From 7f63280582ee8381d6e1f2fd83a5c4971a984d53 Mon Sep 17 00:00:00 2001 From: wangchengming <15110151257@163.com> Date: Sun, 20 Apr 2025 18:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=8E=BB=E9=87=8D=E5=92=8C?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datawashing/deEmphasisRules/index.vue | 17 +-- .../deEmphasisRules/modules/rulesModel.vue | 100 +++++++++--------- .../datawashing/missingvalueRules/index.vue | 16 +-- .../missingvalueRules/rulesModel.vue | 22 ++-- 4 files changed, 82 insertions(+), 73 deletions(-) diff --git a/src/views/datawashing/deEmphasisRules/index.vue b/src/views/datawashing/deEmphasisRules/index.vue index c068fc5..642d66d 100644 --- a/src/views/datawashing/deEmphasisRules/index.vue +++ b/src/views/datawashing/deEmphasisRules/index.vue @@ -28,9 +28,9 @@ 查询 - + @@ -47,9 +47,9 @@ {{ moment(text).format('YYYY-MM-DD') }} --> - 编辑 - - 删除 + 配置 + + 删除 @@ -178,10 +178,11 @@ export default { handleAdd() { this.$refs.modalForm.add(); this.$refs.modalForm.title = "新增"; + this.$refs.modalForm.dataType = this.queryParam.dataType }, - handleEdit(recordId) { - this.$refs.modalForm.eidt(recordId); - this.$refs.modalForm.title = "编辑"; + handleEdit(record) { + this.$refs.modalForm.eidt(record.tableName, this.queryParam.dataType); + this.$refs.modalForm.title = "配置"; }, handleRemove(recordId) { console.log('dfs', recordId) diff --git a/src/views/datawashing/deEmphasisRules/modules/rulesModel.vue b/src/views/datawashing/deEmphasisRules/modules/rulesModel.vue index 9696b83..5eb258b 100644 --- a/src/views/datawashing/deEmphasisRules/modules/rulesModel.vue +++ b/src/views/datawashing/deEmphasisRules/modules/rulesModel.vue @@ -19,9 +19,10 @@ - + @@ -32,7 +33,8 @@ import JCron from "@/components/jeecg/JCron"; import JSelectMultiple from '@/components/jeecg/JSelectMultiple' import { createRules, updateRules, queryById, querytableColumns } from '@/api/deEmphasisRules' - +import { TreeSelect } from 'ant-design-vue'; +const SHOW_PARENT = TreeSelect.SHOW_PARENT; export default { name: "rulesModal", @@ -42,14 +44,16 @@ export default { }, data() { return { + SHOW_PARENT, title: "操作", allText: 'ALL', + dataType: null, visible: false, model: {}, confirmLoading: false, form: { tableName: null, - duplicationType: null, + duplicationType: 1, judgmentField: null }, rules: { @@ -64,13 +68,27 @@ export default { xs: { span: 24 }, sm: { span: 16 }, }, - treeData: [] + treeData: [], + checkedList: [] } }, created() { - // this.loadData(); }, methods: { + getQuerytableColumns(dataType, tableName) { + querytableColumns({ dataType: dataType, tableName: tableName }).then(res => { + if (res.code == 200) { + this.treeData = [] + res.result.forEach(element => { + this.treeData.push({ + title: element, + value: element, + key: element, + }) + }); + } + }) + }, handleChange(value) { if (value == 1) { this.form.judgmentField = 'ALL' @@ -86,13 +104,10 @@ export default { } this.visible = true; }, - eidt(recordId) { - queryById({ id: recordId }).then(res => { - if (res.code == 200) { - this.form = res.result - this.visible = true; - } - }) + eidt(tableName, dataType) { + this.form.tableName = tableName + this.getQuerytableColumns(dataType, tableName) + this.visible = true; }, close() { this.visible = false; @@ -101,43 +116,26 @@ export default { this.$refs.ruleForm.validate(valid => { if (valid) { this.confirmLoading = true; - if (!this.form.id) { - createRules(this.form).then(res => { - if (res.code === 200) { - this.$notification.success({ - message: '系统提示', - description: res.message - }) - this.confirmLoading = false - this.$emit('fatherMethod') - this.handleCancel() - } else { - this.$notification.error({ - message: '系统提示', - description: '操作失败' - }) - this.confirmLoading = false - } - }) - } else { - updateRules(this.form).then(res => { - if (res.code === 200) { - this.$notification.success({ - message: '系统提示', - description: res.message - }) - this.confirmLoading = false - this.$emit('fatherMethod') - this.handleCancel() - } else { - this.$notification.error({ - message: '系统提示', - description: '操作失败' - }) - this.confirmLoading = false - } - }) - } + this.form.judgmentField = this.checkedList.join(',') + + console.log('提交', this.form) + updateRules(this.form).then(res => { + if (res.code === 200) { + this.$notification.success({ + message: '系统提示', + description: res.message + }) + this.confirmLoading = false + this.$emit('fatherMethod') + this.handleCancel() + } else { + this.$notification.error({ + message: '系统提示', + description: res.message + }) + this.confirmLoading = false + } + }) } }); }, @@ -148,4 +146,4 @@ export default { } - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/datawashing/missingvalueRules/index.vue b/src/views/datawashing/missingvalueRules/index.vue index 312d582..ae45fe6 100644 --- a/src/views/datawashing/missingvalueRules/index.vue +++ b/src/views/datawashing/missingvalueRules/index.vue @@ -28,9 +28,9 @@ 查询 - + @@ -47,9 +47,9 @@ {{ moment(text).format('YYYY-MM-DD') }} --> - 编辑 - - 删除 + 配置 + + 删除 @@ -202,9 +202,9 @@ export default { this.$refs.modalForm.add(); this.$refs.modalForm.title = "新增"; }, - handleEdit(recordId) { - this.$refs.modalForm.eidt(recordId); - this.$refs.modalForm.title = "编辑"; + handleEdit(record) { + this.$refs.modalForm.eidt(record); + this.$refs.modalForm.title = "配置"; }, handleRemove(recordId) { console.log('dfs', recordId) diff --git a/src/views/datawashing/missingvalueRules/rulesModel.vue b/src/views/datawashing/missingvalueRules/rulesModel.vue index 0b180b0..633c67f 100644 --- a/src/views/datawashing/missingvalueRules/rulesModel.vue +++ b/src/views/datawashing/missingvalueRules/rulesModel.vue @@ -88,13 +88,23 @@ export default { } this.visible = true; }, - eidt(recordId) { - queryById({ id: recordId }).then(res => { - if (res.code == 200) { - this.form = res.result - this.visible = true; + eidt(record) { + if (record.id) { + queryById({ id: record.id }).then(res => { + if (res.code == 200) { + this.form = res.result + } + }) + } else { + this.form = { + tableName: null, + stringStrategy: null, + digitStrategy: null, + dateTimeStrategy: null } - }) + } + this.visible = true; + }, close() { this.visible = false;