Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop
Showing
14 changed files
with
606 additions
and
19 deletions
| ... | @@ -49,6 +49,9 @@ VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service | ... | @@ -49,6 +49,9 @@ VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service |
| 49 | # VITE_APP_CHECK_BASEURL = /mock | 49 | # VITE_APP_CHECK_BASEURL = /mock |
| 50 | VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory | 50 | VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory |
| 51 | 51 | ||
| 52 | #匿名化管理接口 | ||
| 53 | VITE_APP_ANONYMIZATION_BASEURL = ms-daop-anonymization-service | ||
| 54 | |||
| 52 | #数据源接口地址 | 55 | #数据源接口地址 |
| 53 | VITE_APP_DATA_SOURCE_URL = ms-daop-data-source-service | 56 | VITE_APP_DATA_SOURCE_URL = ms-daop-data-source-service |
| 54 | 57 | ... | ... |
| ... | @@ -82,6 +82,9 @@ VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service | ... | @@ -82,6 +82,9 @@ VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service |
| 82 | # VITE_APP_CHECK_BASEURL = /mock | 82 | # VITE_APP_CHECK_BASEURL = /mock |
| 83 | VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory | 83 | VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory |
| 84 | 84 | ||
| 85 | #匿名化管理接口 | ||
| 86 | VITE_APP_ANONYMIZATION_BASEURL = ms-daop-anonymization-service | ||
| 87 | |||
| 85 | # 数据字典接口地址 | 88 | # 数据字典接口地址 |
| 86 | VITE_APP_CONFIG_URL = 'ms-daop-configure-service' | 89 | VITE_APP_CONFIG_URL = 'ms-daop-configure-service' |
| 87 | 90 | ... | ... |
src/api/modules/dataAnonymization.ts
0 → 100644
| 1 | /** | ||
| 2 | * 匿名化管理的接口api文件 | ||
| 3 | */ | ||
| 4 | import request from "@/utils/request"; | ||
| 5 | |||
| 6 | /** 获取标签列表。 */ | ||
| 7 | export const getDataLabelList = (params) => request({ | ||
| 8 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/label/page-list`, | ||
| 9 | method: 'post', | ||
| 10 | data: params | ||
| 11 | }) | ||
| 12 | |||
| 13 | /** 修改标签启用禁用状态 */ | ||
| 14 | export const updateLabelState = (params) => request({ | ||
| 15 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/label/update-state`, | ||
| 16 | method: 'put', | ||
| 17 | params | ||
| 18 | }) | ||
| 19 | |||
| 20 | export const saveLabel = (data) => request({ | ||
| 21 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/label/save`, | ||
| 22 | method: 'post', | ||
| 23 | data | ||
| 24 | }) | ||
| 25 | |||
| 26 | export const deleteLabel = (data) => request({ | ||
| 27 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/label/delete`, | ||
| 28 | method: 'delete', | ||
| 29 | data | ||
| 30 | }) | ||
| 31 | |||
| 32 | export const updateLabel = (data) => request({ | ||
| 33 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/label/update`, | ||
| 34 | method: 'put', | ||
| 35 | data | ||
| 36 | }) | ||
| 37 | |||
| 38 | /** 获取标签详情 */ | ||
| 39 | export const getLabelDetail = (guid) => request({ | ||
| 40 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/label/detail?guid=${guid}`, | ||
| 41 | method: 'get' | ||
| 42 | }) | ||
| 43 | |||
| 44 | /** 获取数据字典配置 */ | ||
| 45 | export const getParamsList = (params) => request({ | ||
| 46 | url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType`, | ||
| 47 | method: 'get', | ||
| 48 | params | ||
| 49 | }) | ||
| 50 | |||
| 51 | /** 字段类型 */ | ||
| 52 | export const fieldTypeList = [{ | ||
| 53 | value: '1', | ||
| 54 | label: '日期' | ||
| 55 | }, { | ||
| 56 | value: '2', | ||
| 57 | label: '字符串' | ||
| 58 | }, { | ||
| 59 | value: '3', | ||
| 60 | label: '数值' | ||
| 61 | }] | ||
| 62 | |||
| 63 | /** 获取泛化文件列表 */ | ||
| 64 | export const getGeneralizeFileList = (params) => request({ | ||
| 65 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/generalize-file/page-list`, | ||
| 66 | method: 'post', | ||
| 67 | data: params | ||
| 68 | }) | ||
| 69 | |||
| 70 | export const saveGeneralizeFile = (data) => request({ | ||
| 71 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/generalize-file/save`, | ||
| 72 | method: 'post', | ||
| 73 | data | ||
| 74 | }) | ||
| 75 | |||
| 76 | /** 删除泛化文件 */ | ||
| 77 | export const deleteGeneralizeFile = (data) => request({ | ||
| 78 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/generalize-file/delete`, | ||
| 79 | method: 'delete', | ||
| 80 | data | ||
| 81 | }) | ||
| 82 | |||
| 83 | /** 获取泛化文件详情 */ | ||
| 84 | export const getGeneralizeFileDetail = (guid) => request({ | ||
| 85 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/generalize-file/detail?guid=${guid}`, | ||
| 86 | method: 'get' | ||
| 87 | }) | ||
| 88 | |||
| 89 | export const updateGeneralizeFile = (data) => request({ | ||
| 90 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/generalize-file/update`, | ||
| 91 | method: 'put', | ||
| 92 | data | ||
| 93 | }) | ||
| 94 | |||
| 95 | |||
| 96 | /** --------- 敏感数据识别接口 ------------------- */ | ||
| 97 | |||
| 98 | /** 获取敏感数据识别任务列表 */ | ||
| 99 | export const getSensitiveDataTaskList = (params) => request({ | ||
| 100 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/page-list`, | ||
| 101 | method: 'post', | ||
| 102 | data: params | ||
| 103 | }) | ||
| 104 | |||
| 105 | /** 新增敏感数据识别任务 */ | ||
| 106 | export const saveSensitiveDataTask = (params) => request({ | ||
| 107 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/save`, | ||
| 108 | method: 'post', | ||
| 109 | data: params | ||
| 110 | }) | ||
| 111 | |||
| 112 | /** 编辑修改敏感数据识别任务 */ | ||
| 113 | export const updateSensitiveDataTask = (params) => request({ | ||
| 114 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/update`, | ||
| 115 | method: 'post', | ||
| 116 | params | ||
| 117 | }) | ||
| 118 | |||
| 119 | /** 删除敏感数据识别任务 */ | ||
| 120 | export const deleteSensitiveDataTask = (data) => request({ | ||
| 121 | url: `${import.meta.env.VITE_APP_ANONYMIZATION_BASEURL}/sensitive-data-task/delete`, | ||
| 122 | method: 'delete', | ||
| 123 | data | ||
| 124 | }) | ||
| 125 | |||
| 126 | /** 数据来源类型 */ | ||
| 127 | //export const | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -11,6 +11,8 @@ import { | ... | @@ -11,6 +11,8 @@ import { |
| 11 | MoreFilled, | 11 | MoreFilled, |
| 12 | QuestionFilled, | 12 | QuestionFilled, |
| 13 | WarningFilled, | 13 | WarningFilled, |
| 14 | CircleCheckFilled, | ||
| 15 | CircleCloseFilled, | ||
| 14 | } from "@element-plus/icons-vue"; | 16 | } from "@element-plus/icons-vue"; |
| 15 | // import Table from "../Table/index.vue"; | 17 | // import Table from "../Table/index.vue"; |
| 16 | import Tabs from "../Tabs/index.vue"; | 18 | import Tabs from "../Tabs/index.vue"; |
| ... | @@ -1504,7 +1506,8 @@ const panelChange = (scope, row) => { | ... | @@ -1504,7 +1506,8 @@ const panelChange = (scope, row) => { |
| 1504 | :autocomplete="item.autocompleteSetting?.autocomplete || item.autocomplete | 1506 | :autocomplete="item.autocompleteSetting?.autocomplete || item.autocomplete |
| 1505 | " :readonly="item.autocompleteSetting?.readonly || item.readonly" @click="handlerIptClick(item)" /> | 1507 | " :readonly="item.autocompleteSetting?.readonly || item.readonly" @click="handlerIptClick(item)" /> |
| 1506 | <div class="input_def" v-else> | 1508 | <div class="input_def" v-else> |
| 1507 | <el-input :class="[item.col, { is_block: item.block }]" v-model.trim="formInline[item.field]" | 1509 | <span v-if="item.beforeMsg" style="color: #212121;">{{ item.beforeMsg }}</span> |
| 1510 | <el-input :class="[item.col, { is_block: item.block }]" v-model.trim="formInline[item.field]" :style="item.width ? { width: item.width } : null" | ||
| 1508 | :placeholder="item.placeholder" :type="item.inputType ?? 'text'" :clearable="item.clearable" | 1511 | :placeholder="item.placeholder" :type="item.inputType ?? 'text'" :clearable="item.clearable" |
| 1509 | :disabled="item.disabled || readonly" :min="item.min" :max="item.max" :maxlength="item.maxlength ?? ''" | 1512 | :disabled="item.disabled || readonly" :min="item.min" :max="item.max" :maxlength="item.maxlength ?? ''" |
| 1510 | :autocomplete="item.autocompleteSetting?.autocomplete || item.autocomplete | 1513 | :autocomplete="item.autocompleteSetting?.autocomplete || item.autocomplete |
| ... | @@ -1520,25 +1523,13 @@ const panelChange = (scope, row) => { | ... | @@ -1520,25 +1523,13 @@ const panelChange = (scope, row) => { |
| 1520 | <QuestionFilled /> | 1523 | <QuestionFilled /> |
| 1521 | </el-icon> | 1524 | </el-icon> |
| 1522 | </el-tooltip> | 1525 | </el-tooltip> |
| 1526 | <!-- 输入框右上角显示验证按钮 --> | ||
| 1527 | <span v-if="item.validateBtn" style="position: absolute;right: 0;top: 0px" class="text_btn" @click="item.validateBtn.click">{{ item.validateBtn.label }}</span> | ||
| 1528 | <div v-if="item.validateMsg?.msg" class="validate-input-after-msg" :style="{ color: item.validateMsg.status == 'success' ? '#4FA55D' : '#E63E33', right: item.validateMsg.status == 'success' ? '-106px' : '-120px' }"><el-icon class="title-icon"><CircleCloseFilled v-if="item.validateMsg.status != 'success'" /> | ||
| 1529 | <CircleCheckFilled v-else /></el-icon><span class="title_text">{{ item.validateMsg?.msg }}</span></div> | ||
| 1530 | <span v-if="item.afterMsg" style="color: #212121">{{ item.afterMsg }}</span> | ||
| 1523 | </div> | 1531 | </div> |
| 1524 | </el-form-item> | 1532 | </el-form-item> |
| 1525 | <!-- <el-form-item v-if="item.type === 'formAndSelect'" class="form-and-select" :prop="item.field" | ||
| 1526 | style="width: 100%;display: flex;"> | ||
| 1527 | <div v-for="(child, index) in item.children" :key="index" style="margin-right: 8px;" | ||
| 1528 | @mouseenter="handleMouseEnter(index, item.children)" @mouseleave="handleMouseLeave(index)"> | ||
| 1529 | <template v-if="child.type === 'select'"> | ||
| 1530 | <el-select v-model="formInline[child.field]" :options="child.options" :props="child.props" | ||
| 1531 | :placeholder="child.placeholder" :filterable="child.filterable" :clearable="child.clearable" | ||
| 1532 | class="main-select" style="width: 255px;" /> | ||
| 1533 | </template> | ||
| 1534 | <template v-if="child.type === 'input'"> | ||
| 1535 | <el-input v-model="formInline[child.field]" :placeholder="child.placeholder" :maxlength="child.maxlength" | ||
| 1536 | :clearable="child.clearable" style="width: 255px;" /> | ||
| 1537 | </template> | ||
| 1538 | <el-button v-if="child.showDeleteButton && extraIcon" class="extra-icon" :icon="extraIcon.icon" | ||
| 1539 | @click="extraIcon.click" circle style="margin-left: 8px;" /> | ||
| 1540 | </div> | ||
| 1541 | </el-form-item> --> | ||
| 1542 | 1533 | ||
| 1543 | </template> | 1534 | </template> |
| 1544 | <!-- 默认插槽内容 --> | 1535 | <!-- 默认插槽内容 --> |
| ... | @@ -2505,4 +2496,21 @@ const panelChange = (scope, row) => { | ... | @@ -2505,4 +2496,21 @@ const panelChange = (scope, row) => { |
| 2505 | flex-wrap: nowrap !important; | 2496 | flex-wrap: nowrap !important; |
| 2506 | } | 2497 | } |
| 2507 | } | 2498 | } |
| 2499 | |||
| 2500 | .validate-input-after-msg { | ||
| 2501 | display: flex; | ||
| 2502 | align-items: center; | ||
| 2503 | position: absolute; | ||
| 2504 | top: 26px; | ||
| 2505 | right: -120px; | ||
| 2506 | |||
| 2507 | :deep(.el-icon) { | ||
| 2508 | width: 16px; | ||
| 2509 | height: 16px; | ||
| 2510 | svg { | ||
| 2511 | width: 16px; | ||
| 2512 | height: 16px; | ||
| 2513 | } | ||
| 2514 | } | ||
| 2515 | } | ||
| 2508 | </style> | 2516 | </style> | ... | ... |
| ... | @@ -148,9 +148,38 @@ export const useValidator = () => { | ... | @@ -148,9 +148,38 @@ export const useValidator = () => { |
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | /** 判断输入的是否是正则表达式的规则 */ | ||
| 152 | const regexpRuleValidate = () => { | ||
| 153 | return { | ||
| 154 | validator: (rule: any, value: any, callback: any) => { | ||
| 155 | function isValidRegex(pattern) { | ||
| 156 | try { | ||
| 157 | new RegExp(pattern); | ||
| 158 | return true; | ||
| 159 | } catch (e) { | ||
| 160 | return false; | ||
| 161 | } | ||
| 162 | } | ||
| 163 | if (!value) { | ||
| 164 | callback(new Error("输入正则表达式")); | ||
| 165 | return; | ||
| 166 | } | ||
| 167 | if (isValidRegex(value)) { | ||
| 168 | callback(); | ||
| 169 | return; | ||
| 170 | } else { | ||
| 171 | callback(new Error("正则表达式语法不正确")); | ||
| 172 | return; | ||
| 173 | } | ||
| 174 | }, | ||
| 175 | trigger: "blur", | ||
| 176 | }; | ||
| 177 | } | ||
| 178 | |||
| 151 | return { | 179 | return { |
| 152 | required, | 180 | required, |
| 153 | regexpValidate, | 181 | regexpValidate, |
| 182 | regexpRuleValidate, | ||
| 154 | orderNum, | 183 | orderNum, |
| 155 | description, | 184 | description, |
| 156 | chOrEnPreffix, | 185 | chOrEnPreffix, | ... | ... |
| ... | @@ -55,7 +55,7 @@ onMounted(() => { | ... | @@ -55,7 +55,7 @@ onMounted(() => { |
| 55 | 55 | ||
| 56 | <div class="v-uerinfo"> | 56 | <div class="v-uerinfo"> |
| 57 | <div class="v-top">{{ userStore.userName }}</div> | 57 | <div class="v-top">{{ userStore.userName }}</div> |
| 58 | <div class="v-top"> {{ JSON.parse(loaclStorageInfo).abbreviation }}</div> | 58 | <div class="v-top"> {{ JSON.parse(loaclStorageInfo)?.abbreviation }}</div> |
| 59 | </div> | 59 | </div> |
| 60 | <el-avatar size="small"> | 60 | <el-avatar size="small"> |
| 61 | <el-icon> | 61 | <el-icon> | ... | ... |
src/router/modules/dataAnonymization.ts
0 → 100644
| 1 | import type { RouteRecordRaw } from 'vue-router' | ||
| 2 | |||
| 3 | function Layout() { | ||
| 4 | return import('@/layouts/index.vue') | ||
| 5 | } | ||
| 6 | |||
| 7 | const routes: RouteRecordRaw[] = [ | ||
| 8 | { | ||
| 9 | path: '/data-anonymization/label-management', | ||
| 10 | component: Layout, | ||
| 11 | meta: { | ||
| 12 | title: '标签管理', | ||
| 13 | icon: 'sidebar-videos', | ||
| 14 | }, | ||
| 15 | children: [ | ||
| 16 | { | ||
| 17 | path: '', | ||
| 18 | name: 'labelManagement', | ||
| 19 | component: () => import('@/views/data_anonymization/labelManagement.vue'), | ||
| 20 | meta: { | ||
| 21 | title: '标签管理', | ||
| 22 | sidebar: false, | ||
| 23 | breadcrumb: false, | ||
| 24 | cache: true | ||
| 25 | }, | ||
| 26 | } | ||
| 27 | ], | ||
| 28 | }, | ||
| 29 | { | ||
| 30 | path: '/data-anonymization/generalize-file', | ||
| 31 | component: Layout, | ||
| 32 | meta: { | ||
| 33 | title: '泛化文件管理', | ||
| 34 | icon: 'sidebar-videos', | ||
| 35 | }, | ||
| 36 | children: [ | ||
| 37 | { | ||
| 38 | path: '', | ||
| 39 | name: 'generalizeFile', | ||
| 40 | component: () => import('@/views/data_anonymization/generalizeFile.vue'), | ||
| 41 | meta: { | ||
| 42 | title: '泛化文件管理', | ||
| 43 | sidebar: false, | ||
| 44 | breadcrumb: false, | ||
| 45 | cache: true | ||
| 46 | }, | ||
| 47 | }, | ||
| 48 | { | ||
| 49 | path: 'generalize-file-edit', | ||
| 50 | name: 'generalizeFileEdit', | ||
| 51 | component: () => import('@/views/data_anonymization/generalizeFileEdit.vue'), | ||
| 52 | meta: { | ||
| 53 | title: '新建泛化文件', | ||
| 54 | sidebar: false, | ||
| 55 | breadcrumb: false, | ||
| 56 | cache: true, | ||
| 57 | reuse: true, | ||
| 58 | editPage: true, | ||
| 59 | activeMenu: '/data-anonymization/generalize-file' | ||
| 60 | }, | ||
| 61 | beforeEnter: (to, from) => { | ||
| 62 | if (to.query.fileName) { | ||
| 63 | to.meta.title = `编辑-${to.query.fileName}`; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | }, | ||
| 67 | ], | ||
| 68 | }, | ||
| 69 | { | ||
| 70 | path: '/data-anonymization/sensitive-identify', | ||
| 71 | component: Layout, | ||
| 72 | meta: { | ||
| 73 | title: '敏感数据识别', | ||
| 74 | icon: 'sidebar-videos', | ||
| 75 | }, | ||
| 76 | children: [ | ||
| 77 | { | ||
| 78 | path: '', | ||
| 79 | name: 'sensitiveIdentify', | ||
| 80 | component: () => import('@/views/data_anonymization/sensitiveIdentify.vue'), | ||
| 81 | meta: { | ||
| 82 | title: '敏感数据识别', | ||
| 83 | sidebar: false, | ||
| 84 | breadcrumb: false, | ||
| 85 | cache: true | ||
| 86 | }, | ||
| 87 | }, | ||
| 88 | ], | ||
| 89 | }, | ||
| 90 | { | ||
| 91 | path: '/data-anonymization/result-process', | ||
| 92 | component: Layout, | ||
| 93 | meta: { | ||
| 94 | title: '匿名化处理', | ||
| 95 | icon: 'sidebar-videos', | ||
| 96 | }, | ||
| 97 | children: [ | ||
| 98 | { | ||
| 99 | path: '', | ||
| 100 | name: 'resultProcess', | ||
| 101 | component: () => import('@/views/data_anonymization/resultProcess.vue'), | ||
| 102 | meta: { | ||
| 103 | title: '匿名化处理', | ||
| 104 | sidebar: false, | ||
| 105 | breadcrumb: false, | ||
| 106 | cache: true | ||
| 107 | }, | ||
| 108 | }, | ||
| 109 | ], | ||
| 110 | }, | ||
| 111 | ] | ||
| 112 | |||
| 113 | export default routes |
| ... | @@ -5,6 +5,7 @@ import DataAssess from './modules/dataAsset'; | ... | @@ -5,6 +5,7 @@ import DataAssess from './modules/dataAsset'; |
| 5 | import DataMeta from './modules/dataMeta'; | 5 | import DataMeta from './modules/dataMeta'; |
| 6 | import DataQuality from './modules/dataQuality'; | 6 | import DataQuality from './modules/dataQuality'; |
| 7 | import DataInventory from './modules/dataInventory'; | 7 | import DataInventory from './modules/dataInventory'; |
| 8 | import DataAnonymization from './modules/dataAnonymization'; | ||
| 8 | import AssetIndex from './modules/assetIndex'; | 9 | import AssetIndex from './modules/assetIndex'; |
| 9 | import DataTrustedSpace from './modules/dataTrustedSpace'; | 10 | import DataTrustedSpace from './modules/dataTrustedSpace'; |
| 10 | import DataAssetRegistry from './modules/dataAssetRegistry'; | 11 | import DataAssetRegistry from './modules/dataAssetRegistry'; |
| ... | @@ -113,6 +114,7 @@ const asyncRoutes: RouteRecordRaw[] = [ | ... | @@ -113,6 +114,7 @@ const asyncRoutes: RouteRecordRaw[] = [ |
| 113 | ...DataMeta, | 114 | ...DataMeta, |
| 114 | ...DataQuality, | 115 | ...DataQuality, |
| 115 | ...DataInventory, | 116 | ...DataInventory, |
| 117 | ...DataAnonymization, | ||
| 116 | ...DataTrustedSpace, | 118 | ...DataTrustedSpace, |
| 117 | ...DataPricing | 119 | ...DataPricing |
| 118 | ] | 120 | ] | ... | ... |
src/store/modules/dataAnonymization.ts
0 → 100644
| 1 | const useDataAnonymizationStore = defineStore( | ||
| 2 | // 资产目录guid | ||
| 3 | "isRefresh", | ||
| 4 | () => { | ||
| 5 | const isRefresh = ref<boolean>(false); | ||
| 6 | function setIsRefresh(v: boolean) { | ||
| 7 | isRefresh.value = v; | ||
| 8 | } | ||
| 9 | |||
| 10 | return { | ||
| 11 | isRefresh, | ||
| 12 | setIsRefresh, | ||
| 13 | }; | ||
| 14 | } | ||
| 15 | ); | ||
| 16 | |||
| 17 | export default useDataAnonymizationStore; |
| 1 | <route lang="yaml"> | ||
| 2 | name: generalizeFile | ||
| 3 | </route> | ||
| 4 | |||
| 5 | <script lang="ts" setup name="generalizeFile"> | ||
| 6 | import TableTools from "@/components/Tools/table_tools.vue"; | ||
| 7 | import { commonPageConfig } from '@/components/PageNav/index'; | ||
| 8 | import { TableColumnWidth } from "@/utils/enum"; | ||
| 9 | import { | ||
| 10 | deleteGeneralizeFile, | ||
| 11 | getGeneralizeFileList, | ||
| 12 | fieldTypeList, | ||
| 13 | } from '@/api/modules/dataAnonymization'; | ||
| 14 | import useDataAnonymizationStore from "@/store/modules/dataAnonymization"; | ||
| 15 | |||
| 16 | const anonymizationStore = useDataAnonymizationStore(); | ||
| 17 | const router = useRouter() | ||
| 18 | const { proxy } = getCurrentInstance() as any; | ||
| 19 | |||
| 20 | const searchItemList = ref([{ | ||
| 21 | type: "input", | ||
| 22 | label: "", | ||
| 23 | field: "generalizeFileName", | ||
| 24 | default: "", | ||
| 25 | placeholder: "泛化文件名称", | ||
| 26 | clearable: true, | ||
| 27 | }, { | ||
| 28 | type: "select", | ||
| 29 | label: "", | ||
| 30 | field: "fieldType", | ||
| 31 | default: null, | ||
| 32 | options: fieldTypeList, | ||
| 33 | placeholder: "字段类型", | ||
| 34 | clearable: true, | ||
| 35 | filterable: true, | ||
| 36 | }]) | ||
| 37 | |||
| 38 | /** 分页及搜索传参信息配置。 */ | ||
| 39 | const page = ref({ | ||
| 40 | ...commonPageConfig, | ||
| 41 | generalizeFileName: '', | ||
| 42 | fieldType: '' | ||
| 43 | }); | ||
| 44 | |||
| 45 | const tableInfo = ref({ | ||
| 46 | id: 'data-file-table', | ||
| 47 | fields: [ | ||
| 48 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, | ||
| 49 | { label: "泛化文件名称", field: "generalizeFileName", width: 160 }, | ||
| 50 | { label: "字段类型", field: "fieldType", width: 120, getName: (scope) => { | ||
| 51 | return scope.row.fieldType && fieldTypeList.find(f => f.value == scope.row.fieldType)?.label || '--'; | ||
| 52 | } }, | ||
| 53 | { label: "泛化层级", field: "generalizeLevel", width: 120, align: 'right', type: 'chnum' }, | ||
| 54 | { label: "修改人", field: "updateUserName", width: TableColumnWidth.USERNAME }, | ||
| 55 | { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, | ||
| 56 | ], | ||
| 57 | data: [], | ||
| 58 | page: { | ||
| 59 | type: "normal", | ||
| 60 | rows: 0, | ||
| 61 | ...page.value, | ||
| 62 | }, | ||
| 63 | loading: false, | ||
| 64 | actionInfo: { | ||
| 65 | label: "操作", | ||
| 66 | type: "btn", | ||
| 67 | width: 120, | ||
| 68 | fixed: 'right', | ||
| 69 | btns: (scope) => { | ||
| 70 | return [{ | ||
| 71 | label: "编辑", value: "edit", click: (scope) => { | ||
| 72 | router.push({ | ||
| 73 | name: 'generalizeFileEdit', | ||
| 74 | query: { | ||
| 75 | guid: scope.row.guid, | ||
| 76 | fileName: scope.row.generalizeFileName | ||
| 77 | } | ||
| 78 | }); | ||
| 79 | } | ||
| 80 | }, { | ||
| 81 | label: "删除", value: "delete", disabled: scope.row.bizState == 'Y', click: (scope) => { | ||
| 82 | proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => { | ||
| 83 | let guids = [scope.row.guid]; | ||
| 84 | deleteGeneralizeFile(guids).then((res: any) => { | ||
| 85 | if (res.code == proxy.$passCode) { | ||
| 86 | getTableData(); | ||
| 87 | proxy.$ElMessage({ | ||
| 88 | type: "success", | ||
| 89 | message: "删除成功", | ||
| 90 | }); | ||
| 91 | } else { | ||
| 92 | proxy.$ElMessage({ | ||
| 93 | type: "error", | ||
| 94 | message: res.msg, | ||
| 95 | }); | ||
| 96 | } | ||
| 97 | }); | ||
| 98 | }) | ||
| 99 | } | ||
| 100 | }] | ||
| 101 | } | ||
| 102 | } | ||
| 103 | }) | ||
| 104 | |||
| 105 | const toSearch = (val: any, clear: boolean = false) => { | ||
| 106 | if (clear) { | ||
| 107 | searchItemList.value.map((item) => (item.default = "")); | ||
| 108 | page.value.generalizeFileName = ''; | ||
| 109 | page.value.fieldType = ''; | ||
| 110 | } else { | ||
| 111 | page.value.generalizeFileName = val.generalizeFileName; | ||
| 112 | page.value.fieldType = val.fieldType; | ||
| 113 | } | ||
| 114 | getTableData(); | ||
| 115 | }; | ||
| 116 | |||
| 117 | const getTableData = () => { | ||
| 118 | tableInfo.value.loading = true | ||
| 119 | getGeneralizeFileList({ | ||
| 120 | pageIndex: page.value.curr, | ||
| 121 | pageSize: page.value.limit, | ||
| 122 | generalizeFileName: page.value.generalizeFileName, | ||
| 123 | fieldType: page.value.fieldType | ||
| 124 | }).then((res: any) => { | ||
| 125 | if (res.code == proxy.$passCode) { | ||
| 126 | const data = res.data || {} | ||
| 127 | tableInfo.value.data = data.records || [] | ||
| 128 | tableInfo.value.page.limit = data.pageSize | ||
| 129 | tableInfo.value.page.curr = data.pageIndex | ||
| 130 | tableInfo.value.page.rows = data.totalRows | ||
| 131 | } else { | ||
| 132 | proxy.$ElMessage({ | ||
| 133 | type: 'error', | ||
| 134 | message: res.msg, | ||
| 135 | }) | ||
| 136 | } | ||
| 137 | tableInfo.value.loading = false | ||
| 138 | }) | ||
| 139 | }; | ||
| 140 | |||
| 141 | const tablePageChange = (info) => { | ||
| 142 | page.value.curr = Number(info.curr); | ||
| 143 | page.value.limit = Number(info.limit); | ||
| 144 | getTableData(); | ||
| 145 | }; | ||
| 146 | |||
| 147 | onBeforeMount(() => { | ||
| 148 | toSearch({}); | ||
| 149 | }) | ||
| 150 | |||
| 151 | onActivated(() => { | ||
| 152 | if (anonymizationStore.isRefresh) {//如果是首次加载,则不需要调用 | ||
| 153 | page.value.curr = 1; | ||
| 154 | getTableData(); | ||
| 155 | anonymizationStore.setIsRefresh(false); | ||
| 156 | } | ||
| 157 | }) | ||
| 158 | |||
| 159 | const handleCreate = () => { | ||
| 160 | router.push({ | ||
| 161 | name: 'generalizeFileEdit' | ||
| 162 | }); | ||
| 163 | } | ||
| 164 | |||
| 165 | </script> | ||
| 166 | |||
| 167 | <template> | ||
| 168 | <div class="container_wrap"> | ||
| 169 | <div class="table_tool_wrap"> | ||
| 170 | <!-- 头部搜索 --> | ||
| 171 | <TableTools :searchItems="searchItemList" :searchId="'data-label-search'" @search="toSearch" :init="false" /> | ||
| 172 | <div class="tools_btns"> | ||
| 173 | <el-button type="primary" @click="handleCreate">新建</el-button> | ||
| 174 | </div> | ||
| 175 | </div> | ||
| 176 | <div class="table_panel_wrap"> | ||
| 177 | <!-- 右侧标签管理表格 --> | ||
| 178 | <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" /> | ||
| 179 | </div> | ||
| 180 | </div> | ||
| 181 | </template> | ||
| 182 | |||
| 183 | <style lang="scss" scoped> | ||
| 184 | .table_tool_wrap { | ||
| 185 | width: 100%; | ||
| 186 | height: 84px !important; | ||
| 187 | padding: 0 8px; | ||
| 188 | |||
| 189 | .tools_btns { | ||
| 190 | padding: 0px 0 0; | ||
| 191 | } | ||
| 192 | } | ||
| 193 | |||
| 194 | .table_panel_wrap { | ||
| 195 | width: 100%; | ||
| 196 | height: calc(100% - 84px); | ||
| 197 | padding: 0px 8px 0; | ||
| 198 | } | ||
| 199 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | <route lang="yaml"> | ||
| 2 | name: sensitiveIdentify | ||
| 3 | </route> | ||
| 4 | |||
| 5 | <script lang="ts" setup name="sensitiveIdentify"> | ||
| 6 | import TableTools from "@/components/Tools/table_tools.vue"; | ||
| 7 | import { commonPageConfig } from '@/components/PageNav/index'; | ||
| 8 | import { TableColumnWidth } from "@/utils/enum"; | ||
| 9 | import { | ||
| 10 | getSensitiveDataTaskList, | ||
| 11 | } from '@/api/modules/dataAnonymization'; | ||
| 12 | |||
| 13 | const router = useRouter() | ||
| 14 | const { proxy } = getCurrentInstance() as any; | ||
| 15 | |||
| 16 | const searchItemList = ref([{ | ||
| 17 | type: "input", | ||
| 18 | label: "", | ||
| 19 | field: "taskName", | ||
| 20 | default: "", | ||
| 21 | placeholder: "任务名称", | ||
| 22 | clearable: true, | ||
| 23 | }, { | ||
| 24 | type: "select", | ||
| 25 | label: "", | ||
| 26 | field: "fieldType", | ||
| 27 | default: null, | ||
| 28 | options: [], | ||
| 29 | placeholder: "数据来源", | ||
| 30 | clearable: true, | ||
| 31 | filterable: true, | ||
| 32 | }]) | ||
| 33 | |||
| 34 | /** 分页及搜索传参信息配置。 */ | ||
| 35 | const page = ref({ | ||
| 36 | ...commonPageConfig, | ||
| 37 | generalizeFileName: '', | ||
| 38 | fieldType: '' | ||
| 39 | }); | ||
| 40 | |||
| 41 | </script> | ||
| 42 | |||
| 43 | <template> | ||
| 44 | <div class="container_wrap"> | ||
| 45 | <div class="table_tool_wrap"> | ||
| 46 | <!-- 头部搜索 --> | ||
| 47 | <!-- <TableTools :searchItems="searchItemList" :searchId="'data-label-search'" @search="toSearch" :init="false" /> | ||
| 48 | <div class="tools_btns"> | ||
| 49 | <el-button type="primary" @click="handleCreate">新建</el-button> | ||
| 50 | </div> --> | ||
| 51 | </div> | ||
| 52 | <div class="table_panel_wrap"> | ||
| 53 | <!-- 右侧标签管理表格 --> | ||
| 54 | <!-- <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" /> --> | ||
| 55 | </div> | ||
| 56 | </div> | ||
| 57 | </template> | ||
| 58 | |||
| 59 | <style lang="scss" scoped> | ||
| 60 | .table_tool_wrap { | ||
| 61 | width: 100%; | ||
| 62 | height: 84px !important; | ||
| 63 | padding: 0 8px; | ||
| 64 | |||
| 65 | .tools_btns { | ||
| 66 | padding: 0px 0 0; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | .table_panel_wrap { | ||
| 71 | width: 100%; | ||
| 72 | height: calc(100% - 84px); | ||
| 73 | padding: 0px 8px 0; | ||
| 74 | } | ||
| 75 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment