bb427c9b by lihua

添加最新代码修改

1 parent d4e71aa1
1 /**
2 * API响应处理工具函数
3 * 统一处理API请求的成功/失败逻辑
4 */
5
6 interface ApiResponse {
7 code: number;
8 data?: any;
9 msg?: string;
10 }
11
12 export interface ApiHandlerOptions {
13 /* 当前实例的proxy对象(用于获取$passCode和$ElMessage)*/
14 proxy: any
15 /** 加载状态ref */
16 loadingRef?: Ref<boolean>;
17 /** 成功回调函数 */
18 onSuccess?: (res: any) => void;
19 /** 失败回调函数 */
20 onError?: (res: any) => void;
21 /** 是否显示错误消息,默认true */
22 showError?: boolean;
23 }
24
25 /**
26 * 统一处理API响应的工具函数
27 * @param apiPromise API请求Promise
28 * @param options 配置选项
29 */
30 export const handleApiResponse = async (
31 apiPromise: Promise<ApiResponse>,
32 options: ApiHandlerOptions,
33 ) => {
34 const {
35 loadingRef,
36 onSuccess,
37 onError,
38 showError = true,
39 proxy
40 } = options;
41
42 try {
43 // 设置加载状态
44 if (loadingRef) {
45 loadingRef.value = true;
46 }
47
48 // 执行API请求
49 const res = await apiPromise;
50
51 // 设置加载状态
52 if (loadingRef) {
53 loadingRef.value = false;
54 }
55
56 // 判断请求是否成功
57 if (res?.code == proxy.$passCode) {
58 // 成功回调
59 onSuccess && onSuccess(res);
60 } else {
61 // 失败处理
62 const errorMsg = res?.msg || '';
63 if (showError) {
64 proxy.$ElMessage.error(errorMsg);
65 }
66 onError && onError(res);
67 }
68 } catch (error: any) {
69 // 异常处理
70 if (loadingRef) {
71 loadingRef.value = false;
72 }
73 }
74 };
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
2 * 匿名化管理的接口api文件 2 * 匿名化管理的接口api文件
3 */ 3 */
4 import request from "@/utils/request"; 4 import request from "@/utils/request";
5 import { handleApiResponse, ApiHandlerOptions } from '../apiHander'; // 导入公共处理方法
5 6
6 /** 获取标签列表。 */ 7 /** 获取标签列表。 */
7 export const getDataLabelList = (params) => request({ 8 export const getDataLabelList = (params) => request({
...@@ -246,6 +247,12 @@ export const updateAnonTask = (params) => request({ ...@@ -246,6 +247,12 @@ export const updateAnonTask = (params) => request({
246 }) 247 })
247 248
248 /** 获取匿名化任务详情 */ 249 /** 获取匿名化任务详情 */
250 // export const getAnonTaskDetail = (guid, defaultOptions: ApiHandlerOptions) => handleApiResponse(request({
251 // url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/detail?guid=${guid}`,
252 // method: 'get'
253 // }), defaultOptions)
254
255 /** 获取匿名化任务详情 */
249 export const getAnonTaskDetail = (guid) => request({ 256 export const getAnonTaskDetail = (guid) => request({
250 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/detail?guid=${guid}`, 257 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/detail?guid=${guid}`,
251 method: 'get' 258 method: 'get'
...@@ -265,12 +272,18 @@ export const anonTaskCheck = (params) => request({ ...@@ -265,12 +272,18 @@ export const anonTaskCheck = (params) => request({
265 }) 272 })
266 273
267 /** 获取匿名化任务分析结果数据 */ 274 /** 获取匿名化任务分析结果数据 */
268 export const getAnonAnalyzeResult = (execGuid) => request({ 275 export const getAnonAnalyzeResult1 = (execGuid) => request({
269 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/get-anon-analyze?taskExecGuid=${execGuid}`, 276 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/get-anon-analyze?taskExecGuid=${execGuid}`,
270 method: 'get' 277 method: 'get'
271 }) 278 })
272 279
273 /** 获取匿名化任务分析结果数据 */ 280 /** 获取匿名化任务分析结果数据 */
281 export const getAnonAnalyzeResult = (execGuid, defaultOptions: ApiHandlerOptions) => handleApiResponse(request({
282 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/get-anon-analyze?taskExecGuid=${execGuid}`,
283 method: 'get'
284 }), defaultOptions)
285
286 /** 获取匿名化任务分析结果数据 */
274 export const getLastAnonAnalyzeResult = (execGuid) => request({ 287 export const getLastAnonAnalyzeResult = (execGuid) => request({
275 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/get-anon-analyze?isResult=true&taskExecGuid=${execGuid}`, 288 url: `${import.meta.env.VITE_API_COMMON_URL}/anon-task/get-anon-analyze?isResult=true&taskExecGuid=${execGuid}`,
276 method: 'get' 289 method: 'get'
......
1 import CommonTable from './src/CommonTable.vue'
2
3 export { CommonTable }
4 export default CommonTable
...\ No newline at end of file ...\ No newline at end of file
1 <script lang="ts" setup name="CommonTable">
2 import { ref, watch, computed } from "vue";
3 import { TableColumnWidth } from "@/utils/enum";
4 import { calcColumnWidth } from "@/utils/index";
5 import Moment from 'moment';
6
7 const props = defineProps({
8 data: {
9 type: Array,
10 default: () => []
11 },
12 fields: {
13 type: Array,
14 default: () => []
15 },
16 loading: {
17 type: Boolean,
18 default: false
19 },
20 height: {
21 type: String,
22 default: '100%'
23 },
24 showIndex: {
25 type: Boolean,
26 default: false
27 },
28 rowKey: {
29 type: String,
30 default: 'guid'
31 },
32 style: {
33 type: Object,
34 default: () => ({})
35 }
36 });
37
38 const originTableFieldColumn = ref({});
39
40 const getTextAlign = (field) => {
41 if (field.dataType === 'decimal' || field.dataType === 'int' || field.dataType == 'bit' || field.dataType == 'tinyint') {
42 return 'right';
43 }
44 return 'left'
45 };
46
47 const formatterPreviewDate = (row, info) => {
48 let enName = info.enName;
49 let v = row[enName];
50 if (v === 0) {
51 return v;
52 }
53 if (!v || v == 'null') {
54 return '--';
55 }
56 if (info.dataType === 'datetime') {
57 return Moment(v).format('YYYY-MM-DD HH:mm:ss');
58 }
59 if (info.dataType === 'date') {
60 if (isNaN(<any>(new Date(v)))) {
61 return Moment(parseInt(v)).format('YYYY-MM-DD');
62 } else {
63 return Moment(v).format('YYYY-MM-DD');
64 }
65 }
66 return v;
67 };
68
69 const calcTableColumnWidth = (data: any[], prop, title, otherWidth = 0) => {
70 let d: any[] = [];
71 data.forEach((dt) => d.push(dt[prop]));
72 return calcColumnWidth(
73 d,
74 title,
75 {
76 fontSize: 14,
77 fontFamily: "SimSun",
78 },
79 {
80 fontSize: 14,
81 fontFamily: "SimSun",
82 },
83 otherWidth
84 );
85 };
86
87 watch(
88 () => props.data,
89 (val: any[], oldVal) => {
90 if (!props.fields?.length) {
91 originTableFieldColumn.value = {};
92 return;
93 }
94 originTableFieldColumn.value = {};
95 props.fields.forEach((field, index) => {
96 originTableFieldColumn.value[field.enName] = calcTableColumnWidth(
97 val?.slice(0, 20) || [],
98 field.enName,
99 field.chName,
100 24
101 );
102 });
103 },
104 {
105 deep: true,
106 }
107 );
108 </script>
109
110 <template>
111 <div class="common-table" v-loading="loading">
112 <el-table
113 :data="data"
114 :highlight-current-row="true"
115 stripe
116 border
117 tooltip-effect="light"
118 :height="height"
119 :row-key="rowKey"
120 :style="style"
121 >
122 <el-table-column
123 v-if="showIndex"
124 label="序号"
125 type="index"
126 width="56px"
127 align="center"
128 show-overflow-tooltip
129 ></el-table-column>
130 <template v-for="(item, index) in (fields || [])" :key="index">
131 <el-table-column
132 :label="item.chName"
133 :width="item.dataType === 'datetime'
134 ? TableColumnWidth.DATETIME
135 : item.dataType === 'date'
136 ? TableColumnWidth.DATE
137 : originTableFieldColumn[item.enName]
138 "
139 :align="getTextAlign(item)"
140 :header-align="getTextAlign(item)"
141 :formatter="(row) => formatterPreviewDate(row, item)"
142 :show-overflow-tooltip="true"
143 >
144 </el-table-column>
145 </template>
146 </el-table>
147 <div v-show="!fields.length" class="empty-content">
148 <img src="@/assets/images/empty-data.png" :style="{ width: '168px', height: '96px' }" />
149 <div class="empty-text">暂无数据</div>
150 </div>
151 </div>
152 </template>
153
154 <style lang="scss" scoped>
155 .common-table {
156 width: 100%;
157 height: 100%;
158
159 .el-table {
160 display: inline-block;
161 }
162
163 .empty-content {
164 display: flex;
165 align-items: center;
166 justify-content: center;
167 height: 100%;
168 width: 100%;
169 flex-direction: column;
170
171 .empty-text {
172 font-size: 14px;
173 color: #b2b2b2;
174 }
175 }
176 }
177 </style>
...\ No newline at end of file ...\ No newline at end of file
...@@ -133,8 +133,8 @@ const routes: RouteRecordRaw[] = [ ...@@ -133,8 +133,8 @@ const routes: RouteRecordRaw[] = [
133 children: [ 133 children: [
134 { 134 {
135 path: '', 135 path: '',
136 name: 'resultProcess', 136 name: 'anonResultProcessManage',
137 component: () => import('@/views/data_anonymization/resultProcess.vue'), 137 component: () => import('@/views/data_anonymization/anonResultProcessManage.vue'),
138 meta: { 138 meta: {
139 title: '匿名化处理', 139 title: '匿名化处理',
140 sidebar: false, 140 sidebar: false,
......
1 <route lang="yaml">
2 name: anonResultProcessManage
3 </route>
4
5 <script lang="ts" setup name="anonResultProcessManage">
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 dataSourceTypeList,
11 getAnonTaskList,
12 deleteAnonTask,
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 /** -------------- 搜索栏输入框配置 ------------------------ */
21 const searchItemList = ref([{
22 type: "input",
23 label: "",
24 field: "taskName",
25 default: "",
26 placeholder: "数据集名称",
27 clearable: true,
28 }, {
29 type: "select",
30 label: "",
31 field: "dataSource",
32 default: null,
33 options: dataSourceTypeList,
34 placeholder: "数据来源",
35 clearable: true,
36 filterable: true,
37 }])
38
39 /** 分页及搜索传参信息配置。 */
40 const page = ref({
41 ...commonPageConfig,
42 taskName: '',
43 dataSource: null
44 });
45
46 /** ----------------- 表格展示配置信息,及查询数据处理 ----------------- */
47 const tableInfo = ref({
48 id: 'data-file-table',
49 fields: [
50 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
51 { label: "数据集名称", field: "taskName", width: 160 },
52 {
53 label: "数据来源", field: "dataSource", width: 100, getName: (scope) => {
54 return scope.row.dataSource == 4 ? '外部数据' : (scope.row.dataSource && dataSourceTypeList.find(f => f.value == scope.row.dataSource)?.label || '--');
55 }
56 },
57 { label: "任务状态", field: "sensitiveIdentifyTaskStatus", width: TableColumnWidth.STATE, align: 'center', type: "tag" },
58 { label: "导出时间", field: "exportTime", width: TableColumnWidth.DATETIME },
59 { label: "修改人", field: "updateUserName", width: TableColumnWidth.USERNAME },
60 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
61 ],
62 data: [],
63 page: {
64 type: "normal",
65 rows: 0,
66 ...page.value,
67 },
68 loading: false,
69 actionInfo: {
70 label: "操作",
71 type: "btn",
72 width: 230,
73 fixed: 'right',
74 btns: (scope) => {
75 return [{ label: "编辑", value: "edit", disabled: scope.row.isConfirm == 'Y' || scope.row.dataSource == 4, click: tableBtnHandles['edit'] }, {
76 label: '查看报告', value: 'report', disabled: scope.row.status != 'Y', click: tableBtnHandles['report']
77 }, {
78 label: '查看数据', value: 'view', disabled: scope.row.status != 'Y' || scope.row.handleType == '02', click: tableBtnHandles['view']
79 }, {
80 label: "删除", value: "delete", click: tableBtnHandles['delete']
81 }]
82 }
83 }
84 })
85
86 /** 搜索栏触发搜索 */
87 const toSearch = (val: any, clear: boolean = false) => {
88 if (clear) {
89 searchItemList.value.map((item) => (item.default = ""));
90 page.value.taskName = '';
91 page.value.dataSource = null;
92 } else {
93 page.value.taskName = val.taskName;
94 page.value.dataSource = val.dataSource;
95 }
96 getTableData();
97 };
98
99 const getTableData = () => {
100 tableInfo.value.loading = true
101 getAnonTaskList({
102 pageIndex: page.value.curr,
103 pageSize: page.value.limit,
104 taskName: page.value.taskName,
105 dataSource: page.value.dataSource
106 }).then((res: any) => {
107 if (res?.code == proxy.$passCode) {
108 const data = res.data || {};
109 tableInfo.value.data = data.records?.map(d => {
110 d.sensitiveIdentifyTaskStatus = d.status;
111 return d;
112 }) || []
113 tableInfo.value.page.limit = data.pageSize
114 tableInfo.value.page.curr = data.pageIndex
115 tableInfo.value.page.rows = data.totalRows
116 } else {
117 proxy.$ElMessage({
118 type: 'error',
119 message: res.msg,
120 })
121 }
122 tableInfo.value.loading = false
123 })
124 };
125
126 const tablePageChange = (info) => {
127 page.value.curr = Number(info.curr);
128 page.value.limit = Number(info.limit);
129 getTableData();
130 };
131
132 const tableBtnHandles = {
133 edit: (scope) => {
134 router.push({
135 name: 'anonTaskCreate',
136 query: {
137 guid: scope.row.guid,
138 taskName: scope.row.taskName
139 }
140 });
141 },
142 report: (scope) => {
143 router.push({
144 name: 'anonResultReportView',
145 query: {
146 guid: scope.row.guid,
147 execGuid: scope.row.lastExecGuid,
148 taskName: scope.row.taskName
149 }
150 });
151 },
152 view: (scope) => {
153 router.push({
154 name: 'anonResultView',
155 query: {
156 guid: scope.row.guid,
157 execGuid: scope.row.lastExecGuid,
158 taskName: scope.row.taskName
159 }
160 });
161 },
162 delete: (scope) => {
163 proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
164 let guids = [scope.row.guid];
165 deleteAnonTask(guids).then((res: any) => {
166 if (res?.code == proxy.$passCode) {
167 page.value.curr = 1;
168 getTableData();
169 proxy.$ElMessage({
170 type: "success",
171 message: "删除成功",
172 });
173 } else {
174 proxy.$ElMessage({
175 type: "error",
176 message: res.msg,
177 });
178 }
179 });
180 })
181 }
182 }
183
184 const handleCreate = () => {
185 router.push({
186 name: 'anonTaskCreate'
187 });
188 }
189
190 onBeforeMount(() => {
191 toSearch({});
192 anonymizationStore?.setIsAnonPageRefresh?.(false);
193 })
194
195 onActivated(() => {
196 if (anonymizationStore.isAnonPageRefresh) {//如果是首次加载,则不需要调用
197 page.value.curr = 1;
198 getTableData();
199 anonymizationStore.setIsAnonPageRefresh(false);
200 }
201 });
202
203 </script>
204
205 <template>
206 <div class="container_wrap">
207 <div class="table_tool_wrap">
208 <!-- 头部搜索 -->
209 <TableTools :searchItems="searchItemList" :searchId="'data-label-search'" @search="toSearch" :init="false" />
210 <div class="tools_btns">
211 <el-button type="primary" @click="handleCreate">新建</el-button>
212 </div>
213 </div>
214 <div class="table_panel_wrap">
215 <!-- 右侧标签管理表格 -->
216 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" />
217 </div>
218 </div>
219 </template>
220
221 <style lang="scss" scoped>
222 .table_tool_wrap {
223 width: 100%;
224 height: 84px !important;
225 padding: 0 8px;
226
227 .tools_btns {
228 padding: 0px 0 0;
229 }
230 }
231
232 .table_panel_wrap {
233 width: 100%;
234 height: calc(100% - 84px);
235 padding: 0px 8px 0;
236 }
237 </style>
...\ No newline at end of file ...\ No newline at end of file
...@@ -228,17 +228,16 @@ onMounted(() => { ...@@ -228,17 +228,16 @@ onMounted(() => {
228 228
229 onBeforeMount(() => { 229 onBeforeMount(() => {
230 resultDataLoading.value = true; 230 resultDataLoading.value = true;
231 getAnonAnalyzeResult(taskExecGuid.value).then((res: any) => { 231 getAnonAnalyzeResult(taskExecGuid.value, {
232 resultDataLoading.value = false; 232 proxy: proxy,
233 if (res?.code == proxy.$passCode) { 233 loadingRef: resultDataLoading,
234 analysisResultInfo.value = res.data || {}; 234 onSuccess: (res: any) => {
235 analysisResultInfo.value = res?.data || {};
235 analysisResultTableFields.value = res.data?.column || []; 236 analysisResultTableFields.value = res.data?.column || [];
236 pageInfo.value.curr = 1; 237 pageInfo.value.curr = 1;
237 getAnalysisResultPageData(true); 238 getAnalysisResultPageData(true);
238 } else {
239 res?.msg && proxy.$ElMessage.error(res.msg);
240 } 239 }
241 }); 240 })
242 getAnonTaskDetail(taskGuid.value).then((res: any) => { 241 getAnonTaskDetail(taskGuid.value).then((res: any) => {
243 if (res?.code == proxy.$passCode) { 242 if (res?.code == proxy.$passCode) {
244 oldAnonTaskValueInfo.value = res.data || {}; 243 oldAnonTaskValueInfo.value = res.data || {};
......
...@@ -9,9 +9,6 @@ import { ...@@ -9,9 +9,6 @@ import {
9 getLastAnonAnalyzeResult, 9 getLastAnonAnalyzeResult,
10 exportAnonExecData, 10 exportAnonExecData,
11 } from "@/api/modules/dataAnonymization"; 11 } from "@/api/modules/dataAnonymization";
12 import { calcColumnWidth } from "@/utils/index";
13 import Moment from 'moment';
14 import { TableColumnWidth } from "@/utils/enum";
15 import { ElMessage } from "element-plus"; 12 import { ElMessage } from "element-plus";
16 import { commonPageConfig } from '@/components/PageNav/index'; 13 import { commonPageConfig } from '@/components/PageNav/index';
17 import { download } from "@/utils/common"; 14 import { download } from "@/utils/common";
...@@ -69,56 +66,7 @@ const getData = () => { ...@@ -69,56 +66,7 @@ const getData = () => {
69 }); 66 });
70 } 67 }
71 68
72 const getTextAlign = (field) => {
73 if (field.dataType === 'decimal' || field.dataType === 'int' || field.dataType == 'bit' || field.dataType == 'tinyint') {
74 return 'right';
75 }
76 return 'left'
77 }
78
79 /** otherWidth表示使用标题宽度时添加标题排序图标等宽度 */
80 const calcTableColumnWidth = (data: any[], prop, title, otherWidth = 0) => {
81 let d: any[] = [];
82 data.forEach((dt) => d.push(dt[prop]));
83 return calcColumnWidth(
84 d,
85 title,
86 {
87 fontSize: 14,
88 fontFamily: "SimSun",
89 },
90 {
91 fontSize: 14,
92 fontFamily: "SimSun",
93 },
94 otherWidth
95 );
96 };
97 69
98 /** 每列字段对应的列宽计算结果。 */
99 const originTableFieldColumn = ref({});
100
101 watch(
102 tableData,
103 (val: any[], oldVal) => {
104 if (!tableFields.value?.length) {
105 originTableFieldColumn.value = {};
106 return;
107 }
108 originTableFieldColumn.value = {};
109 tableFields.value.forEach((field, index) => {
110 originTableFieldColumn.value[field.enName] = calcTableColumnWidth(
111 val?.slice(0, 20) || [],
112 field.enName,
113 field.chName,
114 24
115 );
116 });
117 },
118 {
119 deep: true,
120 }
121 );
122 70
123 watch(() => props.execGuid, (val) => { 71 watch(() => props.execGuid, (val) => {
124 if (!val) { 72 if (!val) {
...@@ -157,27 +105,7 @@ onBeforeMount(() => { ...@@ -157,27 +105,7 @@ onBeforeMount(() => {
157 }); 105 });
158 }); 106 });
159 107
160 const formatterPreviewDate = (row, info) => { 108
161 let enName = info.enName;
162 let v = row[enName];
163 if (v === 0) {
164 return v;
165 }
166 if (!v || v == 'null') {
167 return '--';
168 }
169 if (info.dataType === 'datetime') {
170 return Moment(v).format('YYYY-MM-DD HH:mm:ss');
171 }
172 if (info.dataType === 'date') {
173 if (isNaN(<any>(new Date(v)))) {
174 return Moment(parseInt(v)).format('YYYY-MM-DD');
175 } else {
176 return Moment(v).format('YYYY-MM-DD');
177 }
178 }
179 return v;
180 };
181 109
182 const pageChange = (info) => { 110 const pageChange = (info) => {
183 pageInfo.value.curr = Number(info.curr); 111 pageInfo.value.curr = Number(info.curr);
...@@ -212,19 +140,14 @@ const exportData = () => { ...@@ -212,19 +140,14 @@ const exportData = () => {
212 <div class="table_tool_wrap" v-loading="tableDataLoading"> 140 <div class="table_tool_wrap" v-loading="tableDataLoading">
213 <el-button v-show="props.isPage" style="margin-bottom: 8px;" type="primary" @click="exportData" 141 <el-button v-show="props.isPage" style="margin-bottom: 8px;" type="primary" @click="exportData"
214 v-preReClick>导出数据</el-button> 142 v-preReClick>导出数据</el-button>
215 <el-table ref="tableRef" v-show="tableFields.length" :data="tableData" :highlight-current-row="true" stripe border 143 <CommonTable
216 tooltip-effect="light" height="100%" row-key="guid" :style="{ width: '100%', height: !props.isPage ? 'calc(100% - 34px)' : 'calc(100% - 64px)' }"> 144 v-show="tableFields.length"
217 <template v-for="(item, index) in (tableFields || [])"> 145 :data="tableData"
218 <el-table-column :label="item.chName" :width="item.dataType === 'datetime' 146 :fields="tableFields"
219 ? TableColumnWidth.DATETIME 147 :loading="tableDataLoading"
220 : item.dataType === 'date' 148 :height="'100%'"
221 ? TableColumnWidth.DATE 149 :style="{ width: '100%', height: !props.isPage ? 'calc(100% - 34px)' : 'calc(100% - 64px)' }"
222 : originTableFieldColumn[item.enName] 150 />
223 " :align="getTextAlign(item)" :header-align="getTextAlign(item)"
224 :formatter="(row) => formatterPreviewDate(row, item)" :show-overflow-tooltip="true">
225 </el-table-column>
226 </template>
227 </el-table>
228 <div v-show="!tableFields.length" class="empty-content"> 151 <div v-show="!tableFields.length" class="empty-content">
229 <img src="../../assets/images/empty-data.png" :style="{ width: '168px', height: '96px' }" /> 152 <img src="../../assets/images/empty-data.png" :style="{ width: '168px', height: '96px' }" />
230 <div class="empty-text">暂无数据</div> 153 <div class="empty-text">暂无数据</div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 <template> 5 <template>
6 <div class="container_wrap full" v-loading="fullscreenLoading" ref="containerRef"> 6 <div class="container_wrap full" v-loading="fullscreenLoading" ref="containerRef">
7 <div class="content_main"> 7 <div class="content_main">
8 <!-- 顶部步骤条 --> 8 <!-- 顶部步骤条, 需根据不同的条件显示不同的步骤 -->
9 <div class="top_tool_wrap"> 9 <div class="top_tool_wrap">
10 <StepBar :steps-info="stepsInfo" :style="{ width: stepsInfo.list.length == 2 ? '30%' : '60%' }" /> 10 <StepBar :steps-info="stepsInfo" :style="{ width: stepsInfo.list.length == 2 ? '30%' : '60%' }" />
11 </div> 11 </div>
...@@ -27,33 +27,29 @@ ...@@ -27,33 +27,29 @@
27 <!-- 抽样预览的数据表格设置 --> 27 <!-- 抽样预览的数据表格设置 -->
28 <div class="table-v2-main" v-show="dataSimpleFormRef?.formInline?.enableSamplingRate == 'Y'" 28 <div class="table-v2-main" v-show="dataSimpleFormRef?.formInline?.enableSamplingRate == 'Y'"
29 v-loading="sampleTableDataLoading"> 29 v-loading="sampleTableDataLoading">
30 <el-table ref="tableRef" v-show="sampleTableFields.length" :data="sampleTableData" 30 <CommonTable
31 :highlight-current-row="true" stripe border tooltip-effect="light" height="100%" row-key="guid" 31 v-show="sampleTableFields.length"
32 :style="{ width: '100%', height: '240px' }"> 32 :data="sampleTableData"
33 <el-table-column label="序号" type="index" width="56px" align="center" 33 :fields="sampleTableFields"
34 show-overflow-tooltip></el-table-column> 34 :loading="sampleTableDataLoading"
35 <template v-for="(item, index) in (sampleTableFields || [])"> 35 :height="'100%'"
36 <el-table-column :label="item.chName" :width="item.dataType === 'datetime' 36 :show-index="true"
37 ? TableColumnWidth.DATETIME 37 :style="{ width: '100%', height: '240px' }"
38 : item.dataType === 'date' 38 />
39 ? TableColumnWidth.DATE 39 <!-- 无抽样数据时显示占位图片信息 -->
40 : originTableFieldColumn[item.enName]
41 " :align="getTextAlign(item)" :header-align="getTextAlign(item)"
42 :formatter="(row) => formatterPreviewDate(row, item)" :show-overflow-tooltip="true">
43 </el-table-column>
44 </template>
45 </el-table>
46 <div v-show="!sampleTableFields.length" class="main-placeholder"> 40 <div v-show="!sampleTableFields.length" class="main-placeholder">
47 <img src="../../assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" /> 41 <img src="../../assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
48 <div class="empty-text">暂无抽样数据</div> 42 <div class="empty-text">暂无抽样数据</div>
49 </div> 43 </div>
50 </div> 44 </div>
51 </ContentWrap> 45 </ContentWrap>
46 <!-- 数据来源为文件夹时显示提取文件进度及结果分析 -->
52 <ContentWrap v-show="formRef?.formInline?.dataSource == 3" id="id-folder" title="提取文件" description="" 47 <ContentWrap v-show="formRef?.formInline?.dataSource == 3" id="id-folder" title="提取文件" description=""
53 style="margin-top: 16px;"> 48 style="margin-top: 16px;">
54 <div class="folder-main"> 49 <div class="folder-main">
55 <el-button v-show="!selectCurrPath && !Object.keys(dicomStatisticsData)?.length" :icon="Upload" 50 <el-button v-show="!selectCurrPath && !Object.keys(dicomStatisticsData)?.length" :icon="Upload"
56 class="mr8" @click=uploadFolder>上传文件</el-button> 51 class="mr8" @click=uploadFolder>上传文件</el-button>
52 <!-- 弹框展示服务器文件夹目录,并选择 -->
57 <Dialog ref="dialogRef" :dialog-info="uploadFileDialogInfo" @btnClick="dialogBtnClick"> 53 <Dialog ref="dialogRef" :dialog-info="uploadFileDialogInfo" @btnClick="dialogBtnClick">
58 <template #extra-content> 54 <template #extra-content>
59 <div class="radio-main"> 55 <div class="radio-main">
...@@ -160,6 +156,7 @@ ...@@ -160,6 +156,7 @@
160 <div class="desc">正在进行匿名化处理,请稍候...</div> 156 <div class="desc">正在进行匿名化处理,请稍候...</div>
161 <el-button :icon="RefreshRight" link @click="refreshQueryData" v-preReClick>刷新查看结果</el-button> 157 <el-button :icon="RefreshRight" link @click="refreshQueryData" v-preReClick>刷新查看结果</el-button>
162 </div> 158 </div>
159 <!-- 展示执行失败页面 -->
163 <div class="wait-result-div" v-show="isExecEnd && analysisResultInfo.status == 'E'"> 160 <div class="wait-result-div" v-show="isExecEnd && analysisResultInfo.status == 'E'">
164 <el-icon class="failed"> 161 <el-icon class="failed">
165 <CircleCloseFilled /> 162 <CircleCloseFilled />
...@@ -168,6 +165,7 @@ ...@@ -168,6 +165,7 @@
168 <div v-show="analysisResultInfo.errorMsg" class="error-desc">{{ '【' + analysisResultInfo.errorMsg + '】' }} 165 <div v-show="analysisResultInfo.errorMsg" class="error-desc">{{ '【' + analysisResultInfo.errorMsg + '】' }}
169 </div> 166 </div>
170 </div> 167 </div>
168 <!-- 执行成功的报告结果查看页面 -->
171 <anonResultAnalysis v-show="isExecEnd && analysisResultInfo.status == 'Y'" ref="resultReportRef" 169 <anonResultAnalysis v-show="isExecEnd && analysisResultInfo.status == 'Y'" ref="resultReportRef"
172 v-loading="downloadLoading" :analysis-result-info="analysisResultInfo" :is-word-style="isWordStyle" 170 v-loading="downloadLoading" :analysis-result-info="analysisResultInfo" :is-word-style="isWordStyle"
173 :element-loading-text="loadingText" :analysis-result-loading="analysisResultLoading" 171 :element-loading-text="loadingText" :analysis-result-loading="analysisResultLoading"
...@@ -200,25 +198,26 @@ ...@@ -200,25 +198,26 @@
200 <div class="bottom_tool_wrap"> 198 <div class="bottom_tool_wrap">
201 <template v-if="step == 0"> 199 <template v-if="step == 0">
202 <el-button @click="cancelTask">取消</el-button> 200 <el-button @click="cancelTask">取消</el-button>
201 <!-- 匿名化评测情况下只有2个步骤条,根据传参选择对应的处理函数 -->
203 <el-button type="primary" 202 <el-button type="primary"
204 :disabled="formRef?.formInline?.handleType == '02' && formRef?.formInline?.dataSource == 3 && dicomStatisticsData?.state != 'Y'" 203 :disabled="formRef?.formInline?.handleType == '02' && formRef?.formInline?.dataSource == 3 && dicomStatisticsData?.state != 'Y'"
205 @click="changeStep(formRef?.formInline?.handleType == '02' ? 3 : 2)">下一步</el-button> 204 @click="changeStepHandlers[formRef?.formInline?.handleType == '02' ? 3 : 2]()">下一步</el-button>
206 </template> 205 </template>
207 <template v-else-if="step == 1"> 206 <template v-else-if="step == 1">
208 <el-button @click="changeStep(1)">上一步</el-button> 207 <el-button @click="changeStepHandlers['lastStep'](1)">上一步</el-button>
209 <el-button type="primary" @click="changeStep(3)">下一步</el-button> 208 <el-button type="primary" @click="changeStepHandlers['3']()">下一步</el-button>
210 </template> 209 </template>
211 <template v-else-if="step == 2"> 210 <template v-else-if="step == 2">
212 <el-button @click="changeStep(formRef?.formInline?.handleType == '02' ? 1 : 2)">上一步</el-button> 211 <el-button @click="changeStepHandlers.lastStep(formRef?.formInline?.handleType == '02' ? 1 : 2)">上一步</el-button>
213 <el-button v-show="formRef?.formInline?.handleType != '02'" type="primary" 212 <el-button v-show="formRef?.formInline?.handleType != '02'" type="primary"
214 :disabled="analysisResultInfo.status == 'R' || (isExecEnd && analysisResultInfo.status == 'E')" 213 :disabled="analysisResultInfo.status == 'R' || (isExecEnd && analysisResultInfo.status == 'E')"
215 @click="changeStep(4)">下一步</el-button> 214 @click="changeStepHandlers['4']()">下一步</el-button>
216 <el-button type="primary" v-show="formRef?.formInline?.handleType == '02'" 215 <el-button type="primary" v-show="formRef?.formInline?.handleType == '02'"
217 :disabled="analysisResultInfo.status == 'R' || (isExecEnd && analysisResultInfo.status == 'E')" v-preReClick 216 :disabled="analysisResultInfo.status == 'R' || (isExecEnd && analysisResultInfo.status == 'E')" v-preReClick
218 @click="closeTask">关闭</el-button> 217 @click="closeTask">关闭</el-button>
219 </template> 218 </template>
220 <template v-else> 219 <template v-else>
221 <el-button @click="changeStep(3)">上一步</el-button> 220 <el-button @click="changeStepHandlers.lastStep(3)">上一步</el-button>
222 <el-button type="primary" v-preReClick @click="exportResult">导出</el-button> 221 <el-button type="primary" v-preReClick @click="exportResult">导出</el-button>
223 </template> 222 </template>
224 </div> 223 </div>
...@@ -231,7 +230,7 @@ import { ...@@ -231,7 +230,7 @@ import {
231 getAnonTaskDetail, 230 getAnonTaskDetail,
232 getParamsList, 231 getParamsList,
233 chTransformEn, 232 chTransformEn,
234 getAnonAnalyzeResult, 233 getAnonAnalyzeResult1,
235 getAnonAnalyzePageData, 234 getAnonAnalyzePageData,
236 getDatabase, 235 getDatabase,
237 getDsTableByDs, 236 getDsTableByDs,
...@@ -258,8 +257,6 @@ import { ...@@ -258,8 +257,6 @@ import {
258 import useUserStore from "@/store/modules/user"; 257 import useUserStore from "@/store/modules/user";
259 import { useValidator } from '@/hooks/useValidator'; 258 import { useValidator } from '@/hooks/useValidator';
260 import { TableColumnWidth } from '@/utils/enum'; 259 import { TableColumnWidth } from '@/utils/enum';
261 import { calcColumnWidth } from "@/utils/index";
262 import Moment from 'moment';
263 import anonTaskStepTwo from './anonTaskStepTwo.vue'; 260 import anonTaskStepTwo from './anonTaskStepTwo.vue';
264 import * as XLSX from 'xlsx'; 261 import * as XLSX from 'xlsx';
265 import { ElMessage } from 'element-plus'; 262 import { ElMessage } from 'element-plus';
...@@ -272,6 +269,7 @@ import { commonPageConfig } from '@/components/PageNav'; ...@@ -272,6 +269,7 @@ import { commonPageConfig } from '@/components/PageNav';
272 import { Upload } from "@element-plus/icons-vue"; 269 import { Upload } from "@element-plus/icons-vue";
273 import anonResultAnalysis from './components/anonResultAnalysis.vue'; 270 import anonResultAnalysis from './components/anonResultAnalysis.vue';
274 import html2canvas from 'html2canvas'; 271 import html2canvas from 'html2canvas';
272 import { calcColumnWidth } from '@/utils';
275 273
276 const anonymizationStore = useDataAnonymizationStore(); 274 const anonymizationStore = useDataAnonymizationStore();
277 const { proxy } = getCurrentInstance() as any; 275 const { proxy } = getCurrentInstance() as any;
...@@ -643,11 +641,12 @@ const dataSelectInfoFormRules = ref({ ...@@ -643,11 +641,12 @@ const dataSelectInfoFormRules = ref({
643 }] 641 }]
644 }); 642 });
645 643
646 /** 最新选中的 */ 644 /** 最新选中的数据源 */
647 const currDatasourceSelect: any = ref({}); 645 const currDatasourceSelect: any = ref({});
648 646
649 const handleDataSelectFormSelectChange = async (val, row, formInfo) => { 647 /** 数据基本信息选择表单下拉变化对应的处理函数 */
650 if (row.field == 'dataSource') { 648 const dataSelectFormSelectChangeHandlers = {
649 dataSource: (val, row, formInfo) => {
651 dataSelectInfoItems.value[5].visible = val == 1; 650 dataSelectInfoItems.value[5].visible = val == 1;
652 dataSelectInfoItems.value[6].visible = val == 1; 651 dataSelectInfoItems.value[6].visible = val == 1;
653 dataSelectInfoItems.value[8].visible = val == 2; 652 dataSelectInfoItems.value[8].visible = val == 2;
...@@ -655,7 +654,8 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { ...@@ -655,7 +654,8 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
655 sampleTableFields.value = []; 654 sampleTableFields.value = [];
656 parseFileDataSum.value = []; 655 parseFileDataSum.value = [];
657 sampleTableData.value = []; 656 sampleTableData.value = [];
658 } else if (row.field == 'dataSourceGuid') { 657 },
658 dataSourceGuid: async (val, row, formInfo) => {
659 if (!val) { 659 if (!val) {
660 currDatasourceSelect.value = []; 660 currDatasourceSelect.value = [];
661 sampleTableFields.value = []; 661 sampleTableFields.value = [];
...@@ -687,10 +687,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { ...@@ -687,10 +687,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
687 hadFlag: false 687 hadFlag: false
688 }); 688 });
689 if (res.code == proxy.$passCode) { 689 if (res.code == proxy.$passCode) {
690 dsTableList.value = res.data?.records?.map(d => { 690 dsTableList.value = res.data?.records || [];
691 d.tableComment = d.tableComment || d.tableName;
692 return d;
693 }) || [];
694 setDataSelectFormItems(Object.assign({}, formInfo, { file: !formInfo['file'] ? [] : formInfo['file'], tableName: '', qualifiedIdentifier: [] })) 691 setDataSelectFormItems(Object.assign({}, formInfo, { file: !formInfo['file'] ? [] : formInfo['file'], tableName: '', qualifiedIdentifier: [] }))
695 let item = dataSelectInfoItems.value.find(d => d.field == 'tableName'); 692 let item = dataSelectInfoItems.value.find(d => d.field == 'tableName');
696 item && (item.options = dsTableList.value); 693 item && (item.options = dsTableList.value);
...@@ -700,7 +697,8 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { ...@@ -700,7 +697,8 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
700 sampleTableFields.value = []; 697 sampleTableFields.value = [];
701 parseFileDataSum.value = []; 698 parseFileDataSum.value = [];
702 sampleTableData.value = []; 699 sampleTableData.value = [];
703 } else if (row.field == 'tableName') { 700 },
701 tableName: (val, row, formInfo) => {
704 if (!val) { 702 if (!val) {
705 sampleTableFields.value = []; 703 sampleTableFields.value = [];
706 sampleTableData.value = []; 704 sampleTableData.value = [];
...@@ -727,20 +725,8 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { ...@@ -727,20 +725,8 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
727 ElMessage.error(res.msg); 725 ElMessage.error(res.msg);
728 } 726 }
729 }); 727 });
730 } else if (row.field == 'handleType') { 728 },
731 // 第一种匿名处理类型是不可以选择obs类型的。 729 indexDataSourceGuid: async (val, row, formInfo) => {
732 if (val == '01' && formInfo.dataSourceGuid && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) {
733 formInfo.dataSourceGuid = '';
734 formInfo.tableName = '';
735 formInfo.indexDataSourceGuid = '';
736 formInfo.indexTableName = '';
737 formInfo.indexFieldName = '';
738 currDatasourceSelect.value = {};
739 let item = dataSelectInfoItems.value.find(d => d.field == 'tableName');
740 item && (item.options = []);
741 }
742 setDataSelectFormItems(formInfo);
743 } else if (row.field == 'indexDataSourceGuid') {
744 // 清空索引数据表和索引字段 730 // 清空索引数据表和索引字段
745 setDataSelectFormItems(Object.assign({}, formInfo, { indexTableName: '', indexFieldName: '' })); 731 setDataSelectFormItems(Object.assign({}, formInfo, { indexTableName: '', indexFieldName: '' }));
746 let indexTableItem = dataSelectInfoItems.value.find(d => d.field == 'indexTableName'); 732 let indexTableItem = dataSelectInfoItems.value.find(d => d.field == 'indexTableName');
...@@ -778,15 +764,13 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { ...@@ -778,15 +764,13 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
778 }); 764 });
779 if (res.code == proxy.$passCode) { 765 if (res.code == proxy.$passCode) {
780 if (indexTableItem) { 766 if (indexTableItem) {
781 indexTableItem.options = res.data?.records?.map(d => { 767 indexTableItem.options = res.data?.records || [];
782 d.tableComment = d.tableComment || d.tableName;
783 return d;
784 }) || [];
785 } 768 }
786 } else { 769 } else {
787 proxy.$ElMessage.error(res.msg); 770 proxy.$ElMessage.error(res.msg);
788 } 771 }
789 } else if (row.field == 'indexTableName') { 772 },
773 indexTableName: async (val, row, formInfo) => {
790 // 清空索引字段 774 // 清空索引字段
791 setDataSelectFormItems(Object.assign({}, formInfo, { indexFieldName: '' })); 775 setDataSelectFormItems(Object.assign({}, formInfo, { indexFieldName: '' }));
792 let indexFieldItem = dataSelectInfoItems.value.find(d => d.field == 'indexFieldName'); 776 let indexFieldItem = dataSelectInfoItems.value.find(d => d.field == 'indexFieldName');
...@@ -817,9 +801,27 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { ...@@ -817,9 +801,27 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
817 } else { 801 } else {
818 res?.msg && proxy.$ElMessage.error(res.msg); 802 res?.msg && proxy.$ElMessage.error(res.msg);
819 } 803 }
804 },
805 handleType: (val, row, formInfo) => {
806 // 第一种匿名处理类型是不可以选择obs类型的。
807 if (val == '01' && formInfo.dataSourceGuid && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) {
808 formInfo.dataSourceGuid = '';
809 formInfo.tableName = '';
810 formInfo.indexDataSourceGuid = '';
811 formInfo.indexTableName = '';
812 formInfo.indexFieldName = '';
813 currDatasourceSelect.value = {};
814 let item = dataSelectInfoItems.value.find(d => d.field == 'tableName');
815 item && (item.options = []);
816 }
817 setDataSelectFormItems(formInfo);
820 } 818 }
821 } 819 }
822 820
821 const handleDataSelectFormSelectChange = async (val, row, formInfo) => {
822 dataSelectFormSelectChangeHandlers[row.field]?.(val, row, formInfo);
823 }
824
823 const setDataSelectFormItems = (info, isDetail = false) => { 825 const setDataSelectFormItems = (info, isDetail = false) => {
824 // 获取不包含对象存储的数据源列表 826 // 获取不包含对象存储的数据源列表
825 let dsExcludeObs = dataSourceList.value.filter(d => !d.storageType || d.storageType == '1'); 827 let dsExcludeObs = dataSourceList.value.filter(d => !d.storageType || d.storageType == '1');
...@@ -966,38 +968,6 @@ const calcTableColumnWidth = (data: any[], prop, title, otherWidth = 0) => { ...@@ -966,38 +968,6 @@ const calcTableColumnWidth = (data: any[], prop, title, otherWidth = 0) => {
966 ); 968 );
967 }; 969 };
968 970
969 /** 每列字段对应的列宽计算结果。 */
970 const originTableFieldColumn = ref({});
971
972 const getTextAlign = (field) => {
973 if (field.dataType === 'decimal' || field.dataType === 'int') {
974 return 'right';
975 }
976 return 'left'
977 }
978
979 watch(
980 sampleTableData,
981 (val: any[], oldVal) => {
982 if (!sampleTableFields.value?.length) {
983 originTableFieldColumn.value = {};
984 return;
985 }
986 originTableFieldColumn.value = {};
987 sampleTableFields.value.forEach((field, index) => {
988 originTableFieldColumn.value[field.enName] = calcTableColumnWidth(
989 val?.slice(0, 20) || [],
990 field.enName,
991 field.chName,
992 24
993 );
994 });
995 },
996 {
997 deep: true,
998 }
999 );
1000
1001 watch(() => sampleTableFields.value, (val) => { 971 watch(() => sampleTableFields.value, (val) => {
1002 let formInfo = formRef.value.formInline; 972 let formInfo = formRef.value.formInline;
1003 if (formInfo.dataSource == 3) { 973 if (formInfo.dataSource == 3) {
...@@ -1012,27 +982,7 @@ watch(() => sampleTableFields.value, (val) => { ...@@ -1012,27 +982,7 @@ watch(() => sampleTableFields.value, (val) => {
1012 deep: true 982 deep: true
1013 }) 983 })
1014 984
1015 const formatterPreviewDate = (row, info) => { 985
1016 let enName = info.enName;
1017 let v = row[enName];
1018 if (v === 0) {
1019 return v;
1020 }
1021 if (!v || v == 'null') {
1022 return '--';
1023 }
1024 if (info.dataType === 'datetime') {
1025 return Moment(v).format('YYYY-MM-DD HH:mm:ss');
1026 }
1027 if (info.dataType === 'date') {
1028 if (isNaN(<any>(new Date(v)))) {
1029 return Moment(parseInt(v)).format('YYYY-MM-DD');
1030 } else {
1031 return Moment(v).format('YYYY-MM-DD');
1032 }
1033 }
1034 return v;
1035 };
1036 986
1037 /** 解析的总的表格数据,方便后面修改抽样比例时使用 */ 987 /** 解析的总的表格数据,方便后面修改抽样比例时使用 */
1038 const parseFileDataSum: any = ref([]); 988 const parseFileDataSum: any = ref([]);
...@@ -1557,11 +1507,14 @@ const calculateElapsedTime = (parsingTime, parsingCompletedTime) => { ...@@ -1557,11 +1507,14 @@ const calculateElapsedTime = (parsingTime, parsingCompletedTime) => {
1557 /** 第二步的配置组件引用。 */ 1507 /** 第二步的配置组件引用。 */
1558 const anonTaskStepTwoRef = ref(); 1508 const anonTaskStepTwoRef = ref();
1559 1509
1560 const changeStep = async (val) => { 1510 /** 步骤条对应的不同步骤下一步,上一步的处理函数。 */
1561 if (val <= step.value) { 1511 const changeStepHandlers = {
1512 'lastStep': (val) => {
1562 step.value = val - 1; 1513 step.value = val - 1;
1563 stepsInfo.value.step = val - 1; 1514 stepsInfo.value.step = val - 1;
1564 } else if (val == 2) { 1515 },
1516 '2': () => {
1517 let val = 2;
1565 formRef.value?.ruleFormRef?.validate((valid) => { 1518 formRef.value?.ruleFormRef?.validate((valid) => {
1566 if (valid) { 1519 if (valid) {
1567 let formInline = formRef.value?.formInline; 1520 let formInline = formRef.value?.formInline;
...@@ -1583,7 +1536,9 @@ const changeStep = async (val) => { ...@@ -1583,7 +1536,9 @@ const changeStep = async (val) => {
1583 }); 1536 });
1584 } 1537 }
1585 }); 1538 });
1586 } else if (val == 3) { 1539 },
1540 '3': async () => {
1541 let val = 3;
1587 let exec = (saveParams) => { 1542 let exec = (saveParams) => {
1588 if (saveParams.coverageArea?.length) { 1543 if (saveParams.coverageArea?.length) {
1589 saveParams.coverageArea = [saveParams.coverageArea]; 1544 saveParams.coverageArea = [saveParams.coverageArea];
...@@ -1726,7 +1681,9 @@ const changeStep = async (val) => { ...@@ -1726,7 +1681,9 @@ const changeStep = async (val) => {
1726 } 1681 }
1727 }) 1682 })
1728 } 1683 }
1729 } else if (val == 4) { 1684 },
1685 '4': () => {
1686 let val = 4;
1730 //下一步之后,设置执行结束, 查看结果。 1687 //下一步之后,设置执行结束, 查看结果。
1731 step.value = val - 1; 1688 step.value = val - 1;
1732 stepsInfo.value.step = val - 1; 1689 stepsInfo.value.step = val - 1;
...@@ -1866,10 +1823,7 @@ onBeforeMount(() => { ...@@ -1866,10 +1823,7 @@ onBeforeMount(() => {
1866 hadFlag: false 1823 hadFlag: false
1867 }); 1824 });
1868 if (tableRes?.code == proxy.$passCode) { 1825 if (tableRes?.code == proxy.$passCode) {
1869 dsTableList.value = tableRes.data?.records?.map(d => { 1826 dsTableList.value = tableRes.data?.records || [];
1870 d.tableComment = d.tableComment || d.tableName;
1871 return d;
1872 }) || [];
1873 let item = dataSelectInfoItems.value.find(item => item.field == 'tableName'); 1827 let item = dataSelectInfoItems.value.find(item => item.field == 'tableName');
1874 item && (item.options = dsTableList.value); 1828 item && (item.options = dsTableList.value);
1875 } else { 1829 } else {
...@@ -1910,10 +1864,7 @@ onBeforeMount(() => { ...@@ -1910,10 +1864,7 @@ onBeforeMount(() => {
1910 }); 1864 });
1911 if (tableRes?.code == proxy.$passCode) { 1865 if (tableRes?.code == proxy.$passCode) {
1912 let item = dataSelectInfoItems.value.find(item => item.field == 'indexTableName'); 1866 let item = dataSelectInfoItems.value.find(item => item.field == 'indexTableName');
1913 item && (item.options = tableRes.data?.records?.map(d => { 1867 item && (item.options = tableRes.data?.records || []);
1914 d.tableComment = d.tableComment || d.tableName;
1915 return d;
1916 }) || []);
1917 } else { 1868 } else {
1918 proxy.$ElMessage.error(tableRes.msg); 1869 proxy.$ElMessage.error(tableRes.msg);
1919 } 1870 }
...@@ -2018,7 +1969,7 @@ const cancelTask = () => { ...@@ -2018,7 +1969,7 @@ const cancelTask = () => {
2018 proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => { 1969 proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => {
2019 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 1970 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
2020 router.push({ 1971 router.push({
2021 name: 'resultProcess' 1972 name: 'anonResultProcessManage'
2022 }); 1973 });
2023 }, () => { 1974 }, () => {
2024 proxy.$ElMessage.info("已取消"); 1975 proxy.$ElMessage.info("已取消");
...@@ -2029,7 +1980,7 @@ const cancelTask = () => { ...@@ -2029,7 +1980,7 @@ const cancelTask = () => {
2029 const closeTask = () => { 1980 const closeTask = () => {
2030 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 1981 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
2031 router.push({ 1982 router.push({
2032 name: 'resultProcess' 1983 name: 'anonResultProcessManage'
2033 }); 1984 });
2034 } 1985 }
2035 1986
...@@ -2047,7 +1998,7 @@ const processStepThreeResultView = (isRefresh = false) => { ...@@ -2047,7 +1998,7 @@ const processStepThreeResultView = (isRefresh = false) => {
2047 return; 1998 return;
2048 } 1999 }
2049 let process = (isRefresh) => { 2000 let process = (isRefresh) => {
2050 getResultPromise.value = getAnonAnalyzeResult(taskExecGuid.value).then((res: any) => { 2001 getResultPromise.value = getAnonAnalyzeResult1(taskExecGuid.value).then((res: any) => {
2051 getResultPromise.value = null; 2002 getResultPromise.value = null;
2052 if (res?.code == proxy.$passCode) { 2003 if (res?.code == proxy.$passCode) {
2053 analysisResultInfo.value = res.data || {}; 2004 analysisResultInfo.value = res.data || {};
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
98 </div> 98 </div>
99 </div> 99 </div>
100 <div class="result-title">重标识风险表</div> 100 <div class="result-title">重标识风险表</div>
101 <el-table ref="tableRef" v-show="analysisResultTableFields.length" :data="resultData" 101 <el-table ref="tableRef" v-show="analysisResultTableFields?.length" :data="resultData"
102 v-loading="analysisResultLoading" :highlight-current-row="true" stripe border tooltip-effect="light" 102 v-loading="analysisResultLoading" :highlight-current-row="true" stripe border tooltip-effect="light"
103 height="100%" row-key="guid" :style="{ width: '100%', height: '280px' }"> 103 height="100%" row-key="guid" :style="{ width: '100%', height: '280px' }">
104 <el-table-column label="等价类" type="index" width="68px" align="center" show-overflow-tooltip> 104 <el-table-column label="等价类" type="index" width="68px" align="center" show-overflow-tooltip>
...@@ -127,14 +127,14 @@ ...@@ -127,14 +127,14 @@
127 <el-table-column label="判断重风险是否大于门限阈值" prop="isGtThreshold" width="130" align="left" fixed="right" 127 <el-table-column label="判断重风险是否大于门限阈值" prop="isGtThreshold" width="130" align="left" fixed="right"
128 show-overflow-tooltip></el-table-column> 128 show-overflow-tooltip></el-table-column>
129 </el-table> 129 </el-table>
130 <div v-show="!analysisResultTableFields.length" class="empty-content"> 130 <div v-show="!analysisResultTableFields?.length" class="empty-content">
131 <img src="../../../assets/images/empty-data.png" :style="{ width: '168px', height: '96px' }" /> 131 <img src="../../../assets/images/empty-data.png" :style="{ width: '168px', height: '96px' }" />
132 <div class="empty-text">暂无数据</div> 132 <div class="empty-text">暂无数据</div>
133 </div> 133 </div>
134 <div v-show="analysisResultTableFields.length" class="result-table-desc">门限阈值的取值:完全公开共享数据发布,取值 134 <div v-show="analysisResultTableFields?.length" class="result-table-desc">门限阈值的取值:完全公开共享数据发布,取值
135 1/20;受控公开共享数据发布,取值 135 1/20;受控公开共享数据发布,取值
136 1/5;领地公开共享数据发布,取值 1/3</div> 136 1/5;领地公开共享数据发布,取值 1/3</div>
137 <PageNav v-show="analysisResultTableFields.length" :class="[pageInfo.type]" :pageInfo="pageInfo" 137 <PageNav v-show="analysisResultTableFields?.length" :class="[pageInfo.type]" :pageInfo="pageInfo"
138 @pageChange="pageChange" /> 138 @pageChange="pageChange" />
139 <div class="row-two-main" style="margin-top: 12px;"> 139 <div class="row-two-main" style="margin-top: 12px;">
140 <div class="table-one"> 140 <div class="table-one">
...@@ -199,7 +199,6 @@ ...@@ -199,7 +199,6 @@
199 </div> 199 </div>
200 </div> 200 </div>
201 <div v-show="isWordStyle" class="analysis-result-main report-main" ref="report"> 201 <div v-show="isWordStyle" class="analysis-result-main report-main" ref="report">
202 <!-- TODO,报告里需要添加数据对象,对什么做了什么。 -->
203 <div 202 <div
204 style="font-family: simsun;height: 40px;display: block;line-height: 32px;font-size: 18px;color: #212121;font-weight: 700;text-align: center;margin-top: 10px;margin-bottom: 10px;">匿名化效果评估指标</div> 203 style="font-family: simsun;height: 40px;display: block;line-height: 32px;font-size: 18px;color: #212121;font-weight: 700;text-align: center;margin-top: 10px;margin-bottom: 10px;">匿名化效果评估指标</div>
205 <p style="font-family: simsun;margin: 0px;font-size: 14px;line-height: 21px;white-space: pre-wrap;color: #212121;">{{ ' 依据GB/T 42460-2023《信息安全技术个人信息去标识化效果评估指南》附录D,对去标识化以后的数据集基于K匿名模型进行去标识化效果的评估。' }}</p> 204 <p style="font-family: simsun;margin: 0px;font-size: 14px;line-height: 21px;white-space: pre-wrap;color: #212121;">{{ ' 依据GB/T 42460-2023《信息安全技术个人信息去标识化效果评估指南》附录D,对去标识化以后的数据集基于K匿名模型进行去标识化效果的评估。' }}</p>
...@@ -395,7 +394,7 @@ const props = defineProps({ ...@@ -395,7 +394,7 @@ const props = defineProps({
395 }, 394 },
396 analysisResultTableFields: { 395 analysisResultTableFields: {
397 type: Array, 396 type: Array,
398 default: [], 397 default: <any>[],
399 }, 398 },
400 originResultTableFieldColumn: { 399 originResultTableFieldColumn: {
401 type: Object, 400 type: Object,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!