|
|
@ -14,12 +14,12 @@
|
|
|
|
:md="6"
|
|
|
|
:md="6"
|
|
|
|
:lg="6"
|
|
|
|
:lg="6"
|
|
|
|
:xl="6">
|
|
|
|
:xl="6">
|
|
|
|
<el-form-item label="数据集名称"
|
|
|
|
<el-form-item label="数据集编码"
|
|
|
|
label-width="120px">
|
|
|
|
label-width="120px">
|
|
|
|
<el-input v-model.trim="query.setName"
|
|
|
|
<el-input v-model.trim="query.setCode"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
placeholder="数据源名称"
|
|
|
|
placeholder="数据集编码"
|
|
|
|
class="filter-item" />
|
|
|
|
class="filter-item" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -28,12 +28,12 @@
|
|
|
|
:md="6"
|
|
|
|
:md="6"
|
|
|
|
:lg="6"
|
|
|
|
:lg="6"
|
|
|
|
:xl="6">
|
|
|
|
:xl="6">
|
|
|
|
<el-form-item label="数据集编码"
|
|
|
|
<el-form-item label="数据集名称"
|
|
|
|
label-width="120px">
|
|
|
|
label-width="120px">
|
|
|
|
<el-input v-model.trim="query.setCode"
|
|
|
|
<el-input v-model.trim="query.setName"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
placeholder="数据集编码"
|
|
|
|
placeholder="数据源名称"
|
|
|
|
class="filter-item" />
|
|
|
|
class="filter-item" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -97,16 +97,25 @@
|
|
|
|
<el-button size="mini"
|
|
|
|
<el-button size="mini"
|
|
|
|
type="text"
|
|
|
|
type="text"
|
|
|
|
@click="addOrEditDataSet(scope.row)">编辑</el-button>
|
|
|
|
@click="addOrEditDataSet(scope.row)">编辑</el-button>
|
|
|
|
<el-popconfirm :title="'确定删除' + scope.row.setName + '吗?'"
|
|
|
|
<!-- <el-popconfirm :title="'确定删除' + scope.row.setName + '吗?'"
|
|
|
|
@onConfirm="delect(scope.row)">
|
|
|
|
@onConfirm="delect(scope.row)"> -->
|
|
|
|
<el-button slot="reference"
|
|
|
|
<el-button slot="reference"
|
|
|
|
type="text">删除</el-button>
|
|
|
|
type="text"
|
|
|
|
</el-popconfirm>
|
|
|
|
@click="delect(scope.row)">删除</el-button>
|
|
|
|
|
|
|
|
<!-- </el-popconfirm> -->
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
<!--分页组件-->
|
|
|
|
<!--分页组件-->
|
|
|
|
<!-- <pagination /> -->
|
|
|
|
<div class="block">
|
|
|
|
|
|
|
|
<el-pagination :total="totalCount"
|
|
|
|
|
|
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
|
|
|
|
|
|
:page-size="params.pageSize"
|
|
|
|
|
|
|
|
:current-page="params.pageNumber"
|
|
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
|
|
@current-change="handleCurrentChange" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!--表单组件-->
|
|
|
|
<!--表单组件-->
|
|
|
|
<el-dialog :visible.sync="dialogFormVisible"
|
|
|
|
<el-dialog :visible.sync="dialogFormVisible"
|
|
|
@ -119,7 +128,7 @@
|
|
|
|
:model="formData"
|
|
|
|
:model="formData"
|
|
|
|
:rules="formRules"
|
|
|
|
:rules="formRules"
|
|
|
|
size="small"
|
|
|
|
size="small"
|
|
|
|
label-width="100px">
|
|
|
|
label-width="130px">
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24"
|
|
|
|
:sm="20"
|
|
|
|
:sm="20"
|
|
|
@ -144,9 +153,9 @@
|
|
|
|
:md="8"
|
|
|
|
:md="8"
|
|
|
|
:lg="8"
|
|
|
|
:lg="8"
|
|
|
|
:xl="8">
|
|
|
|
:xl="8">
|
|
|
|
<el-form-item label="数据集名称"
|
|
|
|
<el-form-item label="数据集编码"
|
|
|
|
prop="setName">
|
|
|
|
prop="setCode">
|
|
|
|
<el-input v-model.trim="formData.setName"
|
|
|
|
<el-input v-model.trim="formData.setCode"
|
|
|
|
size="mini" />
|
|
|
|
size="mini" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -155,9 +164,9 @@
|
|
|
|
:md="8"
|
|
|
|
:md="8"
|
|
|
|
:lg="8"
|
|
|
|
:lg="8"
|
|
|
|
:xl="8">
|
|
|
|
:xl="8">
|
|
|
|
<el-form-item label="数据集编码"
|
|
|
|
<el-form-item label="数据集名称"
|
|
|
|
prop="setCode">
|
|
|
|
prop="setName">
|
|
|
|
<el-input v-model.trim="formData.setCode"
|
|
|
|
<el-input v-model.trim="formData.setName"
|
|
|
|
size="mini" />
|
|
|
|
size="mini" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
@ -178,8 +187,7 @@
|
|
|
|
:lg="22"
|
|
|
|
:lg="22"
|
|
|
|
:xl="22"
|
|
|
|
:xl="22"
|
|
|
|
class="code-mirror-form">
|
|
|
|
class="code-mirror-form">
|
|
|
|
<el-form-item label="查询SQL或请求体"
|
|
|
|
<el-form-item label="查询SQL或请求体">
|
|
|
|
label-width="140px">
|
|
|
|
|
|
|
|
<div class="codemirror">
|
|
|
|
<div class="codemirror">
|
|
|
|
<codemirror v-model.trim="formData.dynSentence"
|
|
|
|
<codemirror v-model.trim="formData.dynSentence"
|
|
|
|
:options="optionsSql"
|
|
|
|
:options="optionsSql"
|
|
|
@ -498,6 +506,8 @@ export default {
|
|
|
|
}`,
|
|
|
|
}`,
|
|
|
|
itemFilterScriptId: '',
|
|
|
|
itemFilterScriptId: '',
|
|
|
|
title: '自定义高级规则',
|
|
|
|
title: '自定义高级规则',
|
|
|
|
|
|
|
|
totalCount: 0,
|
|
|
|
|
|
|
|
totalPage: 0,
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
pageNumber: 1,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
@ -570,24 +580,30 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async queryByPage () {
|
|
|
|
async queryByPage () {
|
|
|
|
let params = {
|
|
|
|
let params = {
|
|
|
|
page: 0,
|
|
|
|
page: this.params.pageNumber,
|
|
|
|
size: 10,
|
|
|
|
size: this.params.pageSize,
|
|
|
|
sort: "update_time",
|
|
|
|
sort: "update_time",
|
|
|
|
order: "DESC",
|
|
|
|
order: "DESC",
|
|
|
|
pageNumber: 1,
|
|
|
|
pageNumber: this.params.pageNumber,
|
|
|
|
pageSize: 10
|
|
|
|
pageSize: this.params.pageSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const res = await dataSetPageList(params)
|
|
|
|
const res = await dataSetPageList(params)
|
|
|
|
if (res.code != '200') return
|
|
|
|
if (res.code != '200') return
|
|
|
|
this.listLoading = true
|
|
|
|
this.listLoading = true
|
|
|
|
this.data = res.data.records
|
|
|
|
this.data = res.data.records
|
|
|
|
|
|
|
|
|
|
|
|
this.totalCount = res.data.total
|
|
|
|
this.totalCount = res.data.total
|
|
|
|
this.totalPage = res.data.pages
|
|
|
|
this.totalPage = res.data.pages
|
|
|
|
this.listLoading = false
|
|
|
|
this.listLoading = false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleSizeChange (val) {
|
|
|
|
|
|
|
|
this.params.pageSize = val
|
|
|
|
|
|
|
|
this.queryByPage()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleCurrentChange (val) {
|
|
|
|
|
|
|
|
this.params.pageNumber = val
|
|
|
|
|
|
|
|
this.queryByPage()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onJsonChange (value) { },
|
|
|
|
onJsonChange (value) { },
|
|
|
|
onJsonSave (value) { },
|
|
|
|
onJsonSave (value) { },
|
|
|
@ -599,10 +615,29 @@ export default {
|
|
|
|
this.caseResultTitle = item.setName
|
|
|
|
this.caseResultTitle = item.setName
|
|
|
|
this.caseResultContent = JSON.parse(item.caseResult)
|
|
|
|
this.caseResultContent = JSON.parse(item.caseResult)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async delect (row) {
|
|
|
|
delect (row) {
|
|
|
|
this.visible = false
|
|
|
|
this.$confirm('确定删除?', '提示', {
|
|
|
|
const { code, data } = await deleteDataSet(row)
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
if (code != '200') return
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(async () => {
|
|
|
|
|
|
|
|
this.$emit('deletelayer')
|
|
|
|
|
|
|
|
this.visible = false
|
|
|
|
|
|
|
|
const { code, data } = await deleteDataSet(row)
|
|
|
|
|
|
|
|
if (code != '200') return
|
|
|
|
|
|
|
|
this.queryByPage()
|
|
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
|
|
message: '删除成功!',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
|
|
type: 'info',
|
|
|
|
|
|
|
|
message: '已取消删除',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 编辑数据集,获取单条数据详情
|
|
|
|
// 编辑数据集,获取单条数据详情
|
|
|
|
addOrEditDataSet (row) {
|
|
|
|
addOrEditDataSet (row) {
|
|
|
@ -886,9 +921,11 @@ export default {
|
|
|
|
if (this.dialogFormVisibleTitle === '新增数据集') {
|
|
|
|
if (this.dialogFormVisibleTitle === '新增数据集') {
|
|
|
|
const { code } = await addDataSet(this.formData)
|
|
|
|
const { code } = await addDataSet(this.formData)
|
|
|
|
if (code != '200') return
|
|
|
|
if (code != '200') return
|
|
|
|
|
|
|
|
this.queryByPage()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const { code } = await editDataSet(this.formData)
|
|
|
|
const { code } = await editDataSet(this.formData)
|
|
|
|
if (code != '200') return
|
|
|
|
if (code != '200') return
|
|
|
|
|
|
|
|
this.queryByPage()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.dialogFormVisible = false
|
|
|
|
this.dialogFormVisible = false
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|