a31ee9de by lihua

fix -s

1 parent eb0c6e69
...@@ -3,179 +3,13 @@ ...@@ -3,179 +3,13 @@
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="resultProcess"> 5 <script lang="ts" setup name="resultProcess">
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 } from '@/api/modules/dataAnonymization';
12 import { useValidator } from '@/hooks/useValidator';
13 6
14 const router = useRouter()
15 const { proxy } = getCurrentInstance() as any;
16 const { required } = useValidator();
17
18 const searchItemList = ref([{
19 type: "input",
20 label: "",
21 field: "taskName",
22 default: "",
23 placeholder: "任务名称",
24 clearable: true,
25 }, {
26 type: "select",
27 label: "",
28 field: "dataSource",
29 default: null,
30 options: dataSourceTypeList,
31 placeholder: "数据来源",
32 clearable: true,
33 filterable: true,
34 }])
35
36 /** 分页及搜索传参信息配置。 */
37 const page = ref({
38 ...commonPageConfig,
39 taskName: '',
40 dataSource: null
41 });
42
43 const tableInfo = ref({
44 id: 'data-file-table',
45 fields: [
46 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
47 { label: "任务名称", field: "taskName", width: 160 },
48 {
49 label: "数据来源", field: "dataSource", width: 120, getName: (scope) => {
50 return scope.row.dataSource && dataSourceTypeList.find(f => f.value == scope.row.dataSource)?.label || '--';
51 }
52 },
53 { label: "任务状态", field: "sensitiveIdentifyTaskStatus", width: TableColumnWidth.STATE, align: 'center', type: "tag" },
54 { label: "导出时间", field: "exportTime", width: TableColumnWidth.DATETIME },
55 { label: "修改人", field: "updateUserName", width: TableColumnWidth.USERNAME },
56 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
57 ],
58 data: [],
59 page: {
60 type: "normal",
61 rows: 0,
62 ...page.value,
63 },
64 loading: false,
65 actionInfo: {
66 label: "操作",
67 type: "btn",
68 width: 304,
69 fixed: 'right',
70 btns: (scope) => {
71 return [{
72 label: '敏感数据查看', value: 'view', disabled: scope.row.status != 'Y', click: (scope) => {
73 router.push({
74 name: 'sensitiveIdentifyConfig',
75 query: {
76 guid: scope.row.guid,
77 execGuid: scope.row.execGuid,
78 taskName: scope.row.taskName
79 }
80 });
81 }
82 }, {
83 label: "编辑", value: "edit", disabled: scope.row.status == 'R', click: (scope) => {
84
85 }
86 }, {
87 label: "删除", value: "delete", disabled: scope.row.status == 'R', click: (scope) => {
88 proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
89 let guids = [scope.row.guid];
90 deleteSensitiveDataTask(guids).then((res: any) => {
91 if (res?.code == proxy.$passCode) {
92 getTableData();
93 proxy.$ElMessage({
94 type: "success",
95 message: "删除成功",
96 });
97 } else {
98 proxy.$ElMessage({
99 type: "error",
100 message: res.msg,
101 });
102 }
103 });
104 })
105 }
106 }]
107 }
108 }
109 })
110
111 const toSearch = (val: any, clear: boolean = false) => {
112 if (clear) {
113 searchItemList.value.map((item) => (item.default = ""));
114 page.value.taskName = '';
115 page.value.dataSource = null;
116 } else {
117 page.value.taskName = val.taskName;
118 page.value.dataSource = val.dataSource;
119 }
120 getTableData();
121 };
122
123 const getTableData = () => {
124 tableInfo.value.loading = true
125 getSensitiveDataTaskList({
126 pageIndex: page.value.curr,
127 pageSize: page.value.limit,
128 taskName: page.value.taskName,
129 dataSource: page.value.dataSource
130 }).then((res: any) => {
131 if (res?.code == proxy.$passCode) {
132 const data = res.data || {};
133 tableInfo.value.data = data.records?.map(d => {
134 d.sensitiveIdentifyTaskStatus = d.status;
135 return d;
136 }) || []
137 tableInfo.value.page.limit = data.pageSize
138 tableInfo.value.page.curr = data.pageIndex
139 tableInfo.value.page.rows = data.totalRows
140 } else {
141 proxy.$ElMessage({
142 type: 'error',
143 message: res.msg,
144 })
145 }
146 tableInfo.value.loading = false
147 })
148 };
149
150 const tablePageChange = (info) => {
151 page.value.curr = Number(info.curr);
152 page.value.limit = Number(info.limit);
153 getTableData();
154 };
155
156 const handleCreate = () => {
157
158 }
159
160 onBeforeMount(() => {
161 toSearch({});
162 })
163 7
164 </script> 8 </script>
165 9
166 <template> 10 <template>
167 <div class="container_wrap"> 11 <div class="container_wrap">
168 <div class="table_tool_wrap"> 12 匿名化处理
169 <!-- 头部搜索 -->
170 <TableTools :searchItems="searchItemList" :searchId="'data-label-search'" @search="toSearch" :init="false" />
171 <div class="tools_btns">
172 <el-button type="primary" @click="handleCreate">新建</el-button>
173 </div>
174 </div>
175 <div class="table_panel_wrap">
176 <!-- 右侧标签管理表格 -->
177 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" />
178 </div>
179 </div> 13 </div>
180 </template> 14 </template>
181 15
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!