3df7ae45 by lihua

敏感数据识别

1 parent 788395ef
......@@ -112,8 +112,8 @@ export const saveSensitiveDataTask = (params) => request({
/** 编辑修改敏感数据识别任务 */
export const updateSensitiveDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/update`,
method: 'post',
params
method: 'put',
data: params
})
/** 删除敏感数据识别任务 */
......@@ -123,5 +123,72 @@ export const deleteSensitiveDataTask = (data) => request({
data
})
/** 手动执行敏感任务 */
export const execSensitiveDataTask = (guid) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/exec-task?taskGuid=${guid}`,
method: 'get'
})
/** 数据来源类型 */
//export const
\ No newline at end of file
export const dataSourceTypeList = [{
value: 1,
label: '数据源'
}, {
value: 2,
label: '文件导入'
}];
/** 获取数据库选择列表 */
export const getDatabase = (params) => request({
url: `${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-source/get-source-list`,
method: 'post',
data: params
})
/** 获取敏感数据任务执行的数据表列表 */
export const getExecSensitiveTable = (execGuid) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/get-exec-sensitive-table?execGuid=${execGuid}`,
method: 'get'
})
/** 根据数据源或表获取敏感数据任务执行的字段列表 */
export const getExecSensitiveFieldTable = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/get-exec-sensitive-field`,
method: 'post',
data: params
})
/** 获取当前数据表下的执行字段 */
export const getExecSensitiveFieldLabel = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/get-exec-sensitive-label`,
method: 'post',
data: params
})
/** 获取敏感数据识别任务执行后的统计结果 */
export const getStatisticsNum = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/statistics-num`,
method: 'get',
params
})
/** 修改敏感数据识别字段标签 */
export const updateSensitiveDataTaskFieldLabel = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/batch-update-label`,
method: 'put',
data: params
})
/** 批量修改确认状态 */
export const batchUpdateSensitiveDataTaskFieldStatus = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/batch-change-status`,
method: 'post',
data: params
})
/** 获取敏感数据识别任务执行日志 */
export const getSensitiveDataTaskExecLog = (params) => request({
url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/get-exec-sensitive-exec-log`,
method: 'post',
data: params
})
\ No newline at end of file
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755825941248" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1233" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M102.784 179.648A32 32 0 0 1 128.064 128H768a32 32 0 0 1 25.28 51.648L576 458.944v468.992a32 32 0 0 1-49.728 26.624l-192-128a32 32 0 0 1-14.24-26.592V458.944L102.784 179.648z m274.528 248.672A32 32 0 0 1 384 448v334.848l128 85.344V448a32 32 0 0 1 6.72-19.68L702.624 192H193.472l183.84 236.32zM735.968 512h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z m0 128h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z m0 128h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z" fill="#4fa1a4" p-id="1234"></path></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" class="icon" viewBox="0 0 1024 1024"><path d="M102.784 179.648A32 32 0 0 1 128.064 128H768a32 32 0 0 1 25.28 51.648L576 458.944v468.992a32 32 0 0 1-49.728 26.624l-192-128a32 32 0 0 1-14.24-26.592V458.944L102.784 179.648z m274.528 248.672A32 32 0 0 1 384 448v334.848l128 85.344V448a32 32 0 0 1 6.72-19.68L702.624 192H193.472l183.84 236.32zM735.968 512h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z m0 128h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z m0 128h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z" fill="#999999" p-id="1519"></path></svg>
\ No newline at end of file
<svg t="1755766425695" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1233" width="200" height="200"><path d="M102.784 179.648A32 32 0 0 1 128.064 128H768a32 32 0 0 1 25.28 51.648L576 458.944v468.992a32 32 0 0 1-49.728 26.624l-192-128a32 32 0 0 1-14.24-26.592V458.944L102.784 179.648z m274.528 248.672A32 32 0 0 1 384 448v334.848l128 85.344V448a32 32 0 0 1 6.72-19.68L702.624 192H193.472l183.84 236.32zM735.968 512h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z m0 128h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z m0 128h128a32 32 0 1 1 0 64h-128a32 32 0 1 1 0-64z" fill="#999999" p-id="1234"></path></svg>
\ No newline at end of file
......
......@@ -43,18 +43,23 @@ const btn = computed(() => {
return props.popoverInfo.btn ?? {};
});
const dataProps = computed(() => {
return <any>(props.popoverInfo.props || {});
});
const initAttr = () => {
const data = props.popoverInfo.data ?? []
const check = props.popoverInfo.checked ?? []
checkedVal.value = check
isIndeterminate.value = data.length > 0 && data.length == check.length
checkAll.value = data.length > 0 && data.length == check.length;
isIndeterminate.value = check.length > 0 && data.length > check.length
authorities.value = data
}
const filterPopover = (val) => {
let data = props.popoverInfo.data ?? []
if (val) {
authorities.value = data.filter(item => item.dataPermissionName.indexOf(val) > -1)
authorities.value = data.filter(item => item[dataProps.value.label || 'dataPermissionName'].indexOf(val) > -1)
} else {
authorities.value = data
}
......@@ -70,7 +75,8 @@ const handleCheckedCitiesChange = (val) => {
isIndeterminate.value = checkedCount > 0 && checkedCount < authorities.value.length;
};
const showPopver = () => {
inputValue.value = ''
inputValue.value = '';
initAttr();
emits('showPopver', props.popoverInfo.scope, btn.value)
}
const btnClick = () => {
......@@ -98,10 +104,10 @@ watch(() => props.popoverInfo, async (val) => {
</template>
<template v-else-if="type == 'checkbox-list-btns'">
<div class="content_body">
<el-input v-model.trim="inputValue" placeholder="请输入权限名称" :prefix-icon="Search" clearable
@change="filterPopover" />
<el-input v-model.trim="inputValue" v-show="popoverInfo.data?.length > 5" :placeholder="props.popoverInfo.placeholder ?? '请输入权限名称'" :prefix-icon="Search" clearable
@input="filterPopover" />
<el-checkbox-group v-model="checkedVal" @change="handleCheckedCitiesChange">
<el-checkbox v-for="auth in authorities" :key="auth.guid" :label="auth.guid">{{ auth.dataPermissionName
<el-checkbox v-for="auth in authorities" :key="auth.guid" :value="auth.guid">{{ auth[dataProps.label || 'dataPermissionName']
}}</el-checkbox>
</el-checkbox-group>
</div>
......@@ -118,6 +124,9 @@ watch(() => props.popoverInfo, async (val) => {
</div>
<template #reference>
<span v-if="btn.value == 'authority'" @click="showPopver" v-preReClick>{{ btn.label }}</span>
<el-icon class="filter-icon" v-else-if="btn.value == 'filter'" @click="showPopver">
<svg-icon :name="checkedVal.length ? 'filter-mobile-select' : 'filter-mobile'" />
</el-icon>
<el-icon v-else-if="btn.value == 'QuestionFilled'">
<QuestionFilled />
</el-icon>
......@@ -138,8 +147,8 @@ watch(() => props.popoverInfo, async (val) => {
}
.el-checkbox-group {
margin: 8px -8px 0;
max-height: 276px;
margin: 0px -8px 0;
max-height: 256px;
overflow: hidden auto;
.el-checkbox {
......
......@@ -328,7 +328,7 @@ onMounted(() => {
<span v-if="item.unit">{{ item.unit }}</span>
</template>
<template #default="scope" v-else-if="item.type == 'switch'">
<el-switch v-model="scope.row[item.field]" inline-prompt :key="scope.row.guid"
<el-switch v-model="scope.row[item.field]" inline-prompt :key="scope.row[rowKey || 'guid']"
:disabled="!item.isDisabled ? false : item.isDisabled(scope)" :active-value="item.activeValue"
:inactive-value="item.inactiveValue" :width="item.switchWidth" :active-text="item.activeText"
:inactive-text="item.inactiveText" :before-change="() => beforeChange(scope, item)"
......
......@@ -85,6 +85,42 @@ const routes: RouteRecordRaw[] = [
cache: true
},
},
{
path: 'sensitive-identify-config',
name: 'sensitiveIdentifyConfig',
component: () => import('@/views/data_anonymization/sensitiveIdentifyConfig.vue'),
meta: {
title: '敏感数据识别查看',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true,
editPage: false,
activeMenu: '/data-anonymization/sensitive-identify'
},
beforeEnter: (to, from) => {
if (to.query.taskName) {
to.meta.title = `敏感数据识别查看-${to.query.taskName}`;
}
}
},
{
path: 'sensitive-identify-task-exec-log',
name: 'sensitiveIdentifyTaskExecLog',
component: () => import('@/views/data_anonymization/sensitiveIdentifyTaskExecLog.vue'),
meta: {
title: '执行日志',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.guid) {
to.meta.title = `日志-${to.query.name}`;
}
}
}
],
},
{
......
......@@ -495,6 +495,16 @@ export const tagType = (row, type) => {
} else {
state = 'info';
}
} else if (type == 'sensitiveIdentifyTaskStatus') {
if (row[type] == 'Y') {
state = 'success'
} else if (row[type] == 'N') {
state = 'info';
} else if (row[type] == 'E') {
state = 'danger';
} else if (row[type] == 'R') {
state = 'warning';
}
} else if (type == 'state' || type == 'documentState') {
switch (row[type]) {
case 'N':
......@@ -805,6 +815,16 @@ export const tagMethod = (row, type) => {
}else if (row[type] == 'R') { //部分通过
tag = '执行中';
}
} else if (type == 'sensitiveIdentifyTaskStatus') {
if (row[type] == 'Y') {
tag = '成功'
} else if (row[type] == 'N') {
tag = '未执行';
} else if (row[type] == 'E') { //部分通过
tag = '失败';
}else if (row[type] == 'R') { //部分通过
tag = '执行中';
}
} else if (type == 'execState') {
if (row[type] == 0 || row[type] == null) {
tag = '未执行'
......
......@@ -82,7 +82,7 @@ const tableInfo = ref({
proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
let guids = [scope.row.guid];
deleteGeneralizeFile(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
getTableData();
proxy.$ElMessage({
type: "success",
......@@ -122,7 +122,7 @@ const getTableData = () => {
generalizeFileName: page.value.generalizeFileName,
fieldType: page.value.fieldType
}).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
const data = res.data || {}
tableInfo.value.data = data.records || []
tableInfo.value.page.limit = data.pageSize
......
......@@ -268,7 +268,7 @@ const saveUpdate = async () => {
if (!guid.value) {
saveLoading.value = true;
saveGeneralizeFile(params).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('泛化文件新建成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
anonymizationStore.setIsRefresh(true);
......@@ -285,7 +285,7 @@ const saveUpdate = async () => {
params.guid = guid.value;
saveLoading.value = true;
updateGeneralizeFile(params).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('泛化文件编辑成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
anonymizationStore.setIsRefresh(true);
......@@ -310,7 +310,7 @@ onBeforeMount(() => {
if (guid.value) {
fullscreenLoading.value = true;
getGeneralizeFileDetail(guid.value).then(async (res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
let detail = res.data || {};
baseInfoItems.value.forEach(item => {
item.default = detail[item.field];
......
......@@ -73,7 +73,7 @@ const tableInfo = ref({
label: "编辑", value: "edit", click: (scope) => {
currTableData.value = scope.row;
getLabelDetail(scope.row.guid).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
const detail = res.data || {};
currTableData.value = Object.assign({}, currTableData.value, detail);
newCreateLabelFormItems.value.forEach(item => {
......@@ -120,7 +120,7 @@ const tableInfo = ref({
proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
let guids = [scope.row.guid];
deleteLabel(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
getTableData();
proxy.$ElMessage({
type: "success",
......@@ -159,7 +159,7 @@ const getTableData = () => {
pageSize: page.value.limit,
labelName: page.value.labelName
}).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
const data = res.data || {}
tableInfo.value.data = data.records || []
tableInfo.value.page.limit = data.pageSize
......@@ -193,7 +193,7 @@ const tableSwitchChange = (val, scope, field) => {
bizState: val
}
updateLabelState(params).then((res: any) => {
if (res.code == proxy.$passCode && res.data) {
if (res?.code == proxy.$passCode && res.data) {
getTableData();
proxy.$ElMessage({
type: "success",
......@@ -331,7 +331,7 @@ const newCreateLabelDialogInfo = ref({
newCreateLabelDialogInfo.value.submitBtnLoading = true;
if (newCreateLabelDialogInfo.value.type == 'add') {
saveLabel(params).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('标签新建成功');
newCreateLabelDialogInfo.value.visible = false;
newCreateLabelDialogInfo.value.submitBtnLoading = false;
......@@ -350,7 +350,7 @@ const newCreateLabelDialogInfo = ref({
params.labelRuleContent.guid = currTableData.value.labelRuleContent?.guid;
params.labelRuleField.guid = currTableData.value.labelRuleField?.guid;
updateLabel(params).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('标签编辑成功');
newCreateLabelDialogInfo.value.visible = false;
newCreateLabelDialogInfo.value.submitBtnLoading = false;
......@@ -654,7 +654,7 @@ onBeforeMount(() => {
getParamsList({
dictType: "标签类型",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
labelTypeList.value = res.data || [];
let item = newCreateLabelFormItems.value.find(item => item.field == 'labelgroup');
item && (item.children[0].options = labelTypeList.value);
......@@ -665,7 +665,7 @@ onBeforeMount(() => {
getParamsList({
dictType: "内置规则",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
if (res?.code == proxy.$passCode) {
builtInRuleList.value = res.data || [];
ruleContentFormItems.value[1].options = builtInRuleList.value;
} else {
......
<route lang="yaml">
name: sensitiveIdentifyTaskExecLog
</route>
<script lang="ts" setup name="sensitiveIdentifyTaskExecLog">
import { ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import Table from "@/components/Table/index.vue";
import { ElMessage } from "element-plus";
import { commonPageConfig } from '@/components/PageNav/index';
import {
getSensitiveDataTaskExecLog,
} from '@/api/modules/dataAnonymization';
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
const guid = route.query.guid;
const wordName = route.query.name
const page = ref({
...commonPageConfig
});
const tableInfo = ref({
id: "word-log-table",
loading: false,
fields: [
{ label: "报告名称", field: "analysisReportName", width: 230 },
{
label: "方案类型", field: "analysisReportType", width: 100, getName: (scope) => {
let planType = scope.row.analysisReportType;
return planType == 1 ? '表' : (planType == 2 ? '数据库' : (planType == 4 ? '数据同步' : '分组'));
}
},
{ label: "报告对象", field: "qualityModelName", width: 180, },
{ label: "质量评分", field: "qualityScore", width: 100, align: "right" },
{ label: "最后执行时间", field: "execTime", width: 180, },
{ label: "执行状态", field: "execResult", type: "tag", width: 120, align: "center" },
],
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 100,
fixed: 'right',
btns: (scope) => {
return [{ label: "查看报告", value: "reportView", disabled: scope.row['execResult'] != 'Y' }];
}
}
});
const getTableData = () => {
tableInfo.value.loading = true;
getSensitiveDataTaskExecLog({ pageIndex: page.value.curr, pageSize: page.value.limit, taskGuid: guid }).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
const data = res.data || {}
tableInfo.value.data = data.records || []
tableInfo.value.page.limit = data.pageSize
tableInfo.value.page.curr = data.pageIndex
tableInfo.value.page.rows = data.totalRows
} else {
ElMessage.error(res.msg);
}
})
};
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
if (type == 'reportView') {
router.push({
name: 'analysisReport',
query: {
planGuid: row.planGuid,
reportExecGuid: row.guid,
name: wordName
}
});
}
};
onBeforeMount(() => {
getTableData();
});
</script>
<template>
<div class="container_wrap">
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" />
</div>
</div>
</template>
<style lang="scss" scoped>
.container_wrap {
padding: 0;
.table_panel_wrap {
height: 100%;
padding: 16px 16px 0;
}
}
</style>
\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!