提交去重和缺失值

This commit is contained in:
wangchengming 2025-04-20 18:06:45 +08:00
parent 79aa645817
commit 7f63280582
4 changed files with 82 additions and 73 deletions

View File

@ -28,9 +28,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>
@ -47,9 +47,9 @@
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record.id)">编辑</a>
<a-divider type="vertical" />
<a @click="handleRemove(record.id)">删除</a>
<a @click="handleEdit(record)">配置</a>
<a-divider type="vertical" v-if="record.id" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
@ -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)

View File

@ -19,9 +19,10 @@
</a-form-model-item>
<a-form-model-item label="判定字段" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-if="form.duplicationType == 1" disabled v-model="allText" placeholder="请输入"></a-input>
<a-tree-select v-if="form.duplicationType == 2" v-model="this.form.judgmentField"
style="width: 100%" :tree-data="treeData" tree-checkable :show-checked-strategy="SHOW_PARENT"
<a-tree-select v-if="form.duplicationType == 2" v-model="checkedList" style="width: 100%"
:tree-data="treeData" multiple :show-checked-strategy="SHOW_PARENT"
search-placeholder="请选项" />
</a-form-model-item>
</a-form-model>
</a-spin>
@ -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
eidt(tableName, dataType) {
this.form.tableName = tableName
this.getQuerytableColumns(dataType, tableName)
this.visible = true;
}
})
},
close() {
this.visible = false;
@ -101,25 +116,9 @@ 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 {
this.form.judgmentField = this.checkedList.join(',')
console.log('提交', this.form)
updateRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
@ -132,13 +131,12 @@ export default {
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
description: res.message
})
this.confirmLoading = false
}
})
}
}
});
},
handleCancel() {
@ -148,4 +146,4 @@ export default {
}
</script>
<style scoped></style>

View File

@ -28,9 +28,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>
@ -47,9 +47,9 @@
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record.id)">编辑</a>
<a-divider type="vertical" />
<a @click="handleRemove(record.id)">删除</a>
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
@ -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)

View File

@ -88,13 +88,23 @@ export default {
}
this.visible = true;
},
eidt(recordId) {
queryById({ id: recordId }).then(res => {
eidt(record) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
this.visible = true;
}
})
} else {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.visible = true;
},
close() {
this.visible = false;