提交修改

This commit is contained in:
RenCheng 2025-05-06 23:47:07 +08:00
parent 61cbc7da8e
commit f2ce4bf215
13 changed files with 677 additions and 366 deletions

View File

@ -0,0 +1,19 @@
import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
const createRules = (params)=>postAction("/dataMergingRules/createRules",params);
const updateRules = (params)=>putAction("/dataMergingRules/updateRules",params);
const deleteRules = (params)=>deleteAction("/dataMergingRules/deleteRules",params);
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);
export {
createRules,
updateRules,
deleteRules,
queryPage,
queryById,
querytableColumns,
queryRulesByTableName
}

View File

@ -0,0 +1,20 @@
import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
const createRules = (params)=>postAction("/desensitizationRules/createRules",params);
const updateRules = (params)=>putAction("/desensitizationRules/updateRules",params);
const deleteRules = (params)=>deleteAction("/desensitizationRules/deleteRules",params);
const queryPage = (params)=>getAction("/desensitizationRules/queryPage",params);
const queryById = (params)=>getAction("/desensitizationRules/queryById",params);
const querytableColumns = (params)=>getAction("/desensitizationRules/getTableColumns",params);
const queryRulesByTableName = (params)=>getAction("/desensitizationRules/queryRulesByTableName",params);
export {
createRules,
updateRules,
deleteRules,
queryPage,
queryById,
querytableColumns,
queryRulesByTableName
}

View File

@ -0,0 +1,20 @@
import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
const createRules = (params)=>postAction("/rangeValidatorRules/createRules",params);
const updateRules = (params)=>putAction("/rangeValidatorRules/updateRules",params);
const deleteRules = (params)=>deleteAction("/rangeValidatorRules/deleteRules",params);
const queryPage = (params)=>getAction("/rangeValidatorRules/queryPage",params);
const queryById = (params)=>getAction("/rangeValidatorRules/queryById",params);
const querytableColumns = (params)=>getAction("/rangeValidatorRules/getTableColumns",params);
const queryRulesByTableName = (params)=>getAction("/rangeValidatorRules/queryRulesByTableName",params);
export {
createRules,
updateRules,
deleteRules,
queryPage,
queryById,
querytableColumns,
queryRulesByTableName
}

View File

@ -102,7 +102,6 @@ export default {
this.visible = true;
},
eidt(record, dataType1) {
console.log('sfdsafa',record, dataType1)
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {

View File

@ -121,10 +121,14 @@ export default {
}
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) this.form = res.result
if (res.code == 200) {
this.form = res.result
this.checkedList = this.form.judgmentField.split(',')
}
})
}
this.dataType = dataType
this.getQuerytableColumns(dataType, record.tableName)
this.visible = true;
},

View File

@ -12,8 +12,7 @@
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
@ -41,14 +40,18 @@
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 420px)' }" rowKey="id"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<template slot="duplicationType" slot-scope="text">
<span v-if="text == 1" >完全去重</span>
<span v-if="text == 2">关键列去重</span>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a-divider type="vertical" v-if="record.id" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
@ -62,11 +65,12 @@
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { deleteRules, queryPage } from '@/api/dataMergingRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
import {getAction} from '@/api/manage'
export default {
name: "missingvalueRules",
name: "dataMergingRules",
components: {
rulesModel
},
@ -108,38 +112,10 @@ export default {
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
title: '合并表',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
dataIndex: 'mergTables',
},
{
title: '创建时间',
@ -165,17 +141,25 @@ export default {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName
}
this.getQueryPage()
} else {
this.$message.warning(res.message);
}
});
},
handleTypeChange(value) {
this.queryParam.dataType = value
handleTypeChange(key) {
this.queryParam.dataType = key
this.getQueryPage()
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
@ -199,12 +183,12 @@ export default {
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.add(this.queryParam.dataType);
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
this.$refs.modalForm.eidt(record, this.queryParam.dataType);
this.$refs.modalForm.title = "配置";
},
handleRemove(recordId) {
console.log('dfs', recordId)

View File

@ -5,30 +5,20 @@
<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="请输入"></a-input>
<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="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
<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%"
: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>
@ -38,8 +28,9 @@
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
import { createRules, updateRules, queryById, querytableColumns } from '@/api/dataMergingRules'
import { TreeSelect } from 'ant-design-vue';
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
export default {
name: "rulesModal",
@ -49,21 +40,24 @@ export default {
},
data() {
return {
SHOW_PARENT,
title: "操作",
allText: 'ALL',
dataType: null,
visible: false,
model: {},
confirmLoading: false,
datatypequeryParam: {
schemaMass: "",
sourceType: 1
},
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
mergTables: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
mergTables: [{ required: true, message: '请选择合并表', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
@ -73,39 +67,46 @@ export default {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
treeData: [],
checkedList: []
}
},
created() {
},
methods: {
add() {
getQuerytableColumns(tableName) {
},
handleChange(value) {
this.getQuerytableColumns(this.form.tableName)
},
add(dataType) {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
mergTables: null
}
this.dataType = dataType
this.checkedList =[]
this.visible = true;
},
eidt(record) {
eidt(record, dataType) {
this.form = {
id: null,
tableName: record.tableName,
mergTables: null
}
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
this.checkedList = this.form.mergTables.split(',')
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.dataType = dataType
this.getQuerytableColumns(dataType)
this.visible = true;
},
close() {
this.visible = false;
@ -114,6 +115,12 @@ 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(',')
}
console.log('提交', this.form)
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
@ -127,7 +134,7 @@ export default {
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
description: res.message
})
this.confirmLoading = false
}
@ -145,7 +152,7 @@ export default {
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
description: res.message
})
this.confirmLoading = false
}
@ -159,6 +166,4 @@ export default {
},
}
}
</script>
<style scoped></style>
</script>

View File

@ -12,8 +12,7 @@
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
@ -41,34 +40,34 @@
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 420px)' }" rowKey="ROW_ID"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
<!-- <a-divider type="vertical" />
<a @click="handleRemove(record.id)">删除</a> -->
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
<subPage ref="subPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { queryPage } from '@/api/rangeValidatorRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
import {getAction} from '@/api/manage'
import subPage from './subPage.vue'
export default {
name: "missingvalueRules",
name: "desensitizationRules",
components: {
rulesModel
subPage
},
data() {
return {
@ -108,45 +107,6 @@ export default {
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
@ -165,17 +125,25 @@ export default {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName
}
this.getQueryPage()
} else {
this.$message.warning(res.message);
}
});
},
handleTypeChange(value) {
this.queryParam.dataType = value
this.getQueryPage()
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
@ -198,41 +166,18 @@ export default {
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
console.log('编辑', this.queryParam.dataType)
// this.$refs.modalForm.eidt(record, this.queryParam.dataType);
// this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true
this.$refs.subPage.getTableInfo()
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -7,28 +7,24 @@
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
<a-input v-model="form.tableName" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="字符串策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
<a-form-model-item label="判定字段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="field">
<a-tree-select v-model="form.field" style="width: 100%"
:tree-data="treeData" search-placeholder="请选项"
:dropdownStyle="{ maxHeight: '400px', overflowY: 'auto'}"/>
</a-form-model-item>
<a-form-model-item label="策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="strategy">
<a-select v-model="form.strategy">
<a-select-option :value="1">填充0</a-select-option>
<a-select-option :value="2">取均值</a-select-option>
<a-select-option :value="3">复制上条数据</a-select-option>
<a-select-option :value="4">复制下条数据</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
<a-form-model-item label="最大值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maxVal">
<a-input v-model="form.maxVal" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
<a-form-model-item label="最小值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="minVal">
<a-input v-model="form.minVal" placeholder="请输入"></a-input>
</a-form-model-item>
</a-form-model>
</a-spin>
@ -38,7 +34,7 @@
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
import { createRules, updateRules, queryById,querytableColumns } from '@/api/rangeValidatorRules'
export default {
@ -53,17 +49,20 @@ export default {
visible: false,
model: {},
confirmLoading: false,
dataType: null,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
strategy: null,
maxVal: null,
minVal: null,
field:null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
strategy: [{ required: true, message: '策略', trigger: 'change' }],
maxVal: [{ required: true, message: '请选输入最大值', trigger: 'change' }],
minVal: [{ required: true, message: '请选输入最小值', trigger: 'change' }],
field: [{ required: true, message: '请选选择字段', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
@ -73,22 +72,40 @@ export default {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
treeData: [],
checkedList: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
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,
})
});
}
})
},
eidt(record) {
add(tableName, dataType) {
this.form = {
tableName: tableName,
strategy: null,
maxVal: null,
minVal: null,
field:null
},
this.visible = true;
this.dataType = dataType
this.getQuerytableColumns(dataType, tableName)
},
eidt(record, dataType) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
@ -97,13 +114,15 @@ export default {
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
tableName: null,
strategy: null,
maxVal: null,
minVal: null,
field:null,
tableName: record.tableName
}
}
this.getQuerytableColumns(dataType, record.tableName)
this.visible = true;
},

View File

@ -0,0 +1,171 @@
<template>
<a-modal :title="title" :width="900" :visible="pagevisible" :footer="null"
@cancel="handleCancel" >
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="24" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域 -->
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource"
:pagination="false" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
>
<span slot="strategy" slot-scope="text, record">
<span v-if="text == 1">填充0</span>
<span v-if="text == 2">取均值</span>
<span v-if="text == 3">复制上条数据</span>
<span v-if="text == 4">复制下条数据</span>
</span>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getTableInfo" />
</a-card>
</a-modal>
</template>
<script>
import { deleteRules, queryRulesByTableName } from '@/api/rangeValidatorRules'
import rulesModel from './rulesModel.vue'
export default {
name: "subpage2",
components: {
rulesModel
},
data() {
return {
title: '',
datetypeF: '',
pagevisible: false,
queryParam: {
tableName: null
},
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '判定字段',
align: "center",
dataIndex: 'field',
},
{
title: '最大值',
align: "center",
dataIndex: 'maxVal',
},
{
title: '最小值',
align: "center",
dataIndex: 'minVal',
},
{
title: '策略',
align: "center",
dataIndex: 'strategy',
scopedSlots: { customRender: 'strategy' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() { },
methods: {
getTableInfo() {
queryRulesByTableName(this.queryParam).then(res => {
if (res.code == 200) {
this.dataSource = res.result
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add( this.queryParam.tableName, this.datetypeF);
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF);
this.$refs.modalForm.title = "编辑";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getTableInfo()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
},
handleCancel() {
this.pagevisible = false
},
}
}
</script>

View File

@ -12,8 +12,7 @@
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
@ -41,34 +40,34 @@
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 420px)' }" rowKey="ROW_ID"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
<!-- <a-divider type="vertical" />
<a @click="handleRemove(record.id)">删除</a> -->
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
<subPage ref="subPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { queryPage } from '@/api/desensitizationRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
import {getAction} from '@/api/manage'
import subPage from './subPage.vue'
export default {
name: "missingvalueRules",
name: "desensitizationRules",
components: {
rulesModel
subPage
},
data() {
return {
@ -108,45 +107,6 @@ export default {
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
@ -165,17 +125,25 @@ export default {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
if (res.success) {
this.dataTypeList = res.result.result.DATA_CONN_ORIGINAL
if(res.result.result.DATA_CONN_ORIGINAL.length > 0){
this.queryParam.dataType = res.result.result.DATA_CONN_ORIGINAL[0].enName
}
this.getQueryPage()
} else {
this.$message.warning(res.message);
}
});
},
handleTypeChange(value) {
this.queryParam.dataType = value
this.getQueryPage()
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
@ -198,41 +166,18 @@ export default {
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
console.log('编辑', this.queryParam.dataType)
// this.$refs.modalForm.eidt(record, this.queryParam.dataType);
// this.$refs.modalForm.title = "";
this.$refs.subPage.queryParam.tableName = record.tableName
this.$refs.subPage.datetypeF = this.queryParam.dataType
this.$refs.subPage.title = "配置";
this.$refs.subPage.pagevisible = true
this.$refs.subPage.getTableInfo()
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -5,30 +5,29 @@
<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="请输入"></a-input>
<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="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
<a-form-model-item label="去重类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duplicationType">
<a-select v-model="form.type" @change="handleChange">
<a-select-option :value="1">
替换脱敏
</a-select-option>
<a-select-option :value="2">
加密脱敏
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
<a-form-model-item label="判定字段" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select v-model="checkedList" 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>
@ -38,8 +37,9 @@
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
import { createRules, updateRules, queryById, querytableColumns } from '@/api/desensitizationRules'
import { TreeSelect } from 'ant-design-vue';
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
export default {
name: "rulesModal",
@ -49,21 +49,21 @@ export default {
},
data() {
return {
SHOW_PARENT,
title: "操作",
allText: 'ALL',
dataType: null,
visible: false,
model: {},
confirmLoading: false,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
duplicationType: 1,
judgmentField: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
type: [{ required: true, message: '请选择去重类型', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
@ -73,39 +73,60 @@ export default {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
treeData: [],
checkedList: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
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,
})
});
}
})
},
eidt(record) {
handleChange(value) {
this.getQuerytableColumns(this.dataType, this.form.tableName)
},
add(tableName, dataType) {
this.form = {
id: null,
tableName: tableName,
type: 1,
fields: null
}
this.dataType = dataType
this.checkedList =[]
this.visible = true;
this.getQuerytableColumns(dataType, tableName)
},
eidt(record, dataType) {
this.form = {
id: null,
tableName: record.tableName,
type: 1,
fields: null
}
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
this.checkedList = this.form.fields.split(',')
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.dataType = dataType
this.getQuerytableColumns(dataType, record.tableName)
this.visible = true;
},
close() {
this.visible = false;
@ -114,6 +135,8 @@ export default {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true;
this.form.fields = this.checkedList.join(',')
console.log('提交', this.form)
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
@ -127,7 +150,7 @@ export default {
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
description: res.message
})
this.confirmLoading = false
}
@ -145,7 +168,7 @@ export default {
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
description: res.message
})
this.confirmLoading = false
}
@ -159,6 +182,4 @@ export default {
},
}
}
</script>
<style scoped></style>
</script>

View File

@ -0,0 +1,159 @@
<template>
<a-modal :title="title" :width="900" :visible="pagevisible" :footer="null"
@cancel="handleCancel" >
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="24" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域 -->
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource"
:pagination="false" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
>
<span slot="type" slot-scope="text, record">
<span v-if="text == 1">替换脱敏</span>
<span v-if="text == 2">加密脱敏</span>
</span>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getTableInfo" />
</a-card>
</a-modal>
</template>
<script>
import { deleteRules, queryRulesByTableName } from '@/api/desensitizationRules'
import rulesModel from './rulesModel.vue'
export default {
name: "subpage2",
components: {
rulesModel
},
data() {
return {
title: '',
datetypeF: '',
pagevisible: false,
queryParam: {
tableName: null
},
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '判定字段',
align: "center",
dataIndex: 'fields',
},
{
title: '脱敏类型',
align: "center",
dataIndex: 'type',
scopedSlots: { customRender: 'type' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() { },
methods: {
getTableInfo() {
queryRulesByTableName(this.queryParam).then(res => {
if (res.code == 200) {
this.dataSource = res.result
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add( this.queryParam.tableName, this.datetypeF);
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record, this.datetypeF);
this.$refs.modalForm.title = "编辑";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getTableInfo()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
},
handleCancel() {
this.pagevisible = false
},
}
}
</script>