修改数据合并
This commit is contained in:
parent
f2ce4bf215
commit
69133f6d97
|
@ -6,7 +6,7 @@ const deleteRules = (params)=>deleteAction("/dataMergingRules/deleteRules",param
|
|||
const queryPage = (params)=>getAction("/dataMergingRules/queryPage",params);
|
||||
const queryById = (params)=>getAction("/dataMergingRules/queryById",params);
|
||||
const querytableColumns = (params)=>getAction("/dataMergingRules/getTableColumns",params);
|
||||
const queryRulesByTableName = (params)=>getAction("/dataMergingRules/queryRulesByTableName",params);
|
||||
const getTables = (params)=>getAction("/dataMergingRules/getTables",params);
|
||||
|
||||
export {
|
||||
createRules,
|
||||
|
@ -15,5 +15,5 @@ export {
|
|||
queryPage,
|
||||
queryById,
|
||||
querytableColumns,
|
||||
queryRulesByTableName
|
||||
getTables
|
||||
}
|
|
@ -27,9 +27,9 @@
|
|||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
|
||||
</a-col>
|
||||
<!-- <a-col :md="6" :sm="24" style="text-align: right;">
|
||||
<a-col :md="6" :sm="24" style="text-align: right;">
|
||||
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
|
||||
</a-col> -->
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
|
|
@ -5,20 +5,14 @@
|
|||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model ref="ruleForm" :model="form" :rules="rules">
|
||||
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
|
||||
<a-input v-model="form.tableName" placeholder="请输入" v-decorator="['tableName',{
|
||||
rules: [
|
||||
{ required: true, message: '表名不能为空' },
|
||||
{ min: 1, max: 60, message: '长度1-60位' },
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
}]"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="判定字段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mergTables">
|
||||
<a-input v-if="form.duplicationType == 1" disabled v-model="allText" placeholder="请输入"></a-input>
|
||||
<a-tree-select v-if="form.duplicationType == 2" v-model="checkedList" style="width: 100%"
|
||||
<a-tree-select v-model="form.tableName" style="width: 100%"
|
||||
:tree-data="treeData" :show-checked-strategy="SHOW_PARENT" search-placeholder="请选项"
|
||||
:dropdownStyle="{ maxHeight: '400px', overflowY: 'auto'}"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="合并表" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mergTables">
|
||||
<a-tree-select v-model="form.mergTables" style="width: 100%"
|
||||
:tree-data="treeData" multiple :show-checked-strategy="SHOW_PARENT" search-placeholder="请选项"
|
||||
:dropdownStyle="{ maxHeight: '400px', overflowY: 'auto'}"/>
|
||||
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
|
@ -28,7 +22,7 @@
|
|||
<script>
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import { createRules, updateRules, queryById, querytableColumns } from '@/api/dataMergingRules'
|
||||
import { createRules, updateRules, queryById, getTables } from '@/api/dataMergingRules'
|
||||
import { TreeSelect } from 'ant-design-vue';
|
||||
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
|
||||
|
||||
|
@ -74,20 +68,31 @@ export default {
|
|||
created() {
|
||||
},
|
||||
methods: {
|
||||
getQuerytableColumns(tableName) {
|
||||
|
||||
getQuerytableColumns(dataType) {
|
||||
getTables({dataType: dataType}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.treeData = []
|
||||
res.result.forEach(element => {
|
||||
this.treeData.push({
|
||||
title: element,
|
||||
value: element,
|
||||
key: element,
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
handleChange(value) {
|
||||
this.getQuerytableColumns(this.form.tableName)
|
||||
this.getQuerytableColumns( this.dataType )
|
||||
},
|
||||
add(dataType) {
|
||||
this.form = {
|
||||
tableName: null,
|
||||
mergTables: null
|
||||
mergTables: []
|
||||
}
|
||||
this.dataType = dataType
|
||||
this.checkedList =[]
|
||||
this.visible = true;
|
||||
this.getQuerytableColumns(dataType)
|
||||
},
|
||||
eidt(record, dataType) {
|
||||
this.form = {
|
||||
|
@ -99,12 +104,11 @@ export default {
|
|||
queryById({ id: record.id }).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.form = res.result
|
||||
this.checkedList = this.form.mergTables.split(',')
|
||||
this.form.mergTables = this.form.mergTables.split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
this.dataType = dataType
|
||||
|
||||
this.getQuerytableColumns(dataType)
|
||||
this.visible = true;
|
||||
},
|
||||
|
@ -115,14 +119,11 @@ export default {
|
|||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.confirmLoading = true;
|
||||
if(this.form.duplicationType == 1){
|
||||
this.form.judgmentField = 'ALL'
|
||||
}else{
|
||||
this.form.judgmentField = this.checkedList.join(',')
|
||||
}
|
||||
let subdata = this.form;
|
||||
subdata.mergTables = this.form.mergTables.join(',')
|
||||
console.log('提交', this.form)
|
||||
if (!this.form.id) {
|
||||
createRules(this.form).then(res => {
|
||||
createRules(subdata).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success({
|
||||
message: '系统提示',
|
||||
|
@ -140,7 +141,7 @@ export default {
|
|||
}
|
||||
})
|
||||
} else {
|
||||
updateRules(this.form).then(res => {
|
||||
updateRules(subdata).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success({
|
||||
message: '系统提示',
|
||||
|
|
Loading…
Reference in New Issue
Block a user