d8c0a524 by xukangle

Merge branch 'develop' into dev_20241202_xukangle

2 parents 3dc89fb7 f9834367
...@@ -646,7 +646,7 @@ onMounted(() => { ...@@ -646,7 +646,7 @@ onMounted(() => {
646 </span> 646 </span>
647 </template> 647 </template>
648 <span class="operate_btn active"> 648 <span class="operate_btn active">
649 <el-dropdown trigger="hover" :show-timeout="50" > 649 <el-dropdown trigger="hover" :show-timeout="50" >
650 <span class="text_btn">...</span> 650 <span class="text_btn">...</span>
651 <template #dropdown> 651 <template #dropdown>
652 652
......
...@@ -288,8 +288,8 @@ const getMsgCnt = () => { ...@@ -288,8 +288,8 @@ const getMsgCnt = () => {
288 } 288 }
289 289
290 onMounted(() => { 290 onMounted(() => {
291 getMsgCnt(); 291 //getMsgCnt();
292 createServerConnect(); 292 //createServerConnect();
293 }); 293 });
294 294
295 </script> 295 </script>
......
...@@ -24,6 +24,27 @@ const routes: RouteRecordRaw[] = [ ...@@ -24,6 +24,27 @@ const routes: RouteRecordRaw[] = [
24 }, 24 },
25 }, 25 },
26 { 26 {
27 path: 'task-edit',
28 name: 'taskEdit',
29 component: () => import('@/views/data_inventory/taskEdit.vue'),
30 meta: {
31 title: '编辑-',
32 sidebar: false,
33 breadcrumb: false,
34 cache: true,
35 reuse: true,
36 editPage: true,
37 activeMenu: '/data-inventory/classify-grade-manage/template-config'
38 },
39 beforeEnter: (to, from) => {
40 if (to.query.name) {
41 to.meta.title = `编辑-${to.query.name}`;
42 } else {
43 to.meta.title = '分类分级任务-新增';
44 }
45 }
46 },
47 {
27 path: 'template-config', 48 path: 'template-config',
28 name: 'templateConfig', 49 name: 'templateConfig',
29 component: () => import('@/views/data_inventory/templateConfig.vue'), 50 component: () => import('@/views/data_inventory/templateConfig.vue'),
......
...@@ -31,6 +31,7 @@ service.interceptors.request.use( ...@@ -31,6 +31,7 @@ service.interceptors.request.use(
31 * 为每一次请求生成一个cancleToken 31 * 为每一次请求生成一个cancleToken
32 */ 32 */
33 const source = axios.CancelToken.source(); 33 const source = axios.CancelToken.source();
34 config.headers.tenant = '6646dcad76c411eea911fa163e419da9'; //会员guid先写死
34 config.cancelToken = source.token; 35 config.cancelToken = source.token;
35 if (config.method === "postfile") { 36 if (config.method === "postfile") {
36 config.method = "post"; 37 config.method = "post";
......
1 <route lang="yaml"> 1 <route lang="yaml">
2 name: taskConfig //分类分级任务 2 name: taskConfig //分类分级任务
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="taskConfig"> 5 <script lang="ts" setup name="taskConfig">
6 import { ref ,onMounted} from "vue"; 6 import { ref, onMounted } from "vue";
7 import { useRouter, useRoute } from "vue-router";
8 import useUserStore from "@/store/modules/user";
9 import { ElMessage, ElMessageBox } from "element-plus";
10
11 import useDataAssetStore from "@/store/modules/dataAsset";
12 import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
13 import { TableColumnWidth } from '@/utils/enum';
14
15 import Table from "@/components/Table/index.vue";
16
17 const { proxy } = getCurrentInstance() as any;
18 const router = useRouter();
19 const userStore = useUserStore();
20 const userData = JSON.parse(userStore.userData);
21 const assetStore = useDataAssetStore();
22 const page = ref({
23 limit: 50,
24 curr: 1,
25 sizes: [
26 { label: "10", value: 10 },
27 { label: "50", value: 50 },
28 { label: "100", value: 100 },
29 { label: "150", value: 150 },
30 { label: "200", value: 200 },
31 ],
32 });
33 const searchItemValue: any = ref({});
34 const currTableData: any = ref({});
35 const tableInfo = ref({
36 id: "mapping-table",
37 fields: [
38 { label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
39 { label: "任务名称", field: "damCode", width: 96 },
40 { label: "目录名称", field: "damName", width: 120 },
41 { label: "分类分级模板", field: "damTypeName", width: 200 },
42 { label: "元数据", field: "damTypeName", width: 200 },
43 // {
44 // label: "是否公共数据", field: "isPublicData", width: 120, getName: (scope) => {
45 // return scope.row.isPublicData == 'Y' ? '是' : '否';
46 // }
47 // },
48 {
49 label: "执行状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
50 return filterVal(scope.row.approveState, 'approveState');
51 }
52 },
53 { label: "任务修改人", field: "damName", width: 120 },
54 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
55 { label: "确认次数", field: "damName", width: 96, align: 'right' },
56 { label: "结果确认人", field: "damName", width: 120 },
57 { label: "确认时间", field: "updateTime", width: TableColumnWidth.DATETIME },
58 {
59 label: "结果状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
60 return filterVal(scope.row.approveState, 'approveState');
61 }
62 },
63 ],
64 loading: false,
65 data: [],
66 page: {
67 type: "normal",
68 rows: 0,
69 ...page.value,
70 },
71 actionInfo: {
72 label: "操作",
73 type: "btn",
74 width: 200,
75 btns: (scope) => {
76 let row = scope.row, btnArr: any = [];
77 if (row.approveState == 'Y') {
78 if (row.listingStatus == 'Y') {
79 btnArr.splice(0, 0, { label: "详情", value: "detail" });
80 } else {
81 btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
82 }
83 } else {
84 if (row.approveState == 'A') {
85 btnArr.splice(0, 0, { label: "详情", value: "detail" });
86 } else {
87 btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
88 }
89 }
90 return btnArr;
91 },
92 },
93 });
94
95 const getTableData = () => {
96 tableInfo.value.loading = true;
97 getListingList(
98 Object.assign({}, searchItemValue.value, {
99 pageIndex: page.value.curr,
100 pageSize: page.value.limit,
101 })
102 ).then((res: any) => {
103 tableInfo.value.loading = false;
104 tableInfo.value.data = res.data.records || [];
105 tableInfo.value.page.curr = res.data.pageIndex;
106 tableInfo.value.page.limit = res.data.pageSize;
107 tableInfo.value.page.rows = res.data.totalRows;
108 })
109 .catch((res) => {
110 tableInfo.value.loading = false;
111 });
112 };
113
114 const tableBtnClick = (scope, btn) => {
115 const type = btn.value;
116 const row = scope.row;
117 currTableData.value = row;
118 if (type == "detail" || type === "edit") {
119 toPath(type);
120 } else if (type === "delete") {
121 open("此操作将永久删除,是否继续?", "warning");
122 }
123 };
124
125 const toPath = (type) => {
126 if (type == 'add') {
127 router.push({
128 name: "taskEdit",
129 query: {
130 type
131 },
132 });
133 } else {
134 router.push({
135 name: "taskEdit",
136 query: {
137 guid: currTableData.value.guid,
138 name: currTableData.value.damName,
139 type
140 },
141 });
142 }
143 }
144
145 const tablePageChange = (info) => {
146 page.value.curr = Number(info.curr);
147 page.value.limit = Number(info.limit);
148 tableInfo.value.page.limit = page.value.limit;
149 tableInfo.value.page.curr = page.value.curr;
150 getTableData();
151 };
152
153 const open = (msg, type, isBatch = false) => {
154 ElMessageBox.confirm(msg, "提示", {
155 confirmButtonText: "确定",
156 cancelButtonText: "取消",
157 type: type,
158 }).then(() => {
159 const guids = [currTableData.value.guid];
160 listingDelete(guids).then((res: any) => {
161 if (res.code == proxy.$passCode) {
162 getFirstPageData();
163 ElMessage({
164 type: "success",
165 message: "删除成功",
166 });
167 } else {
168 ElMessage({
169 type: "error",
170 message: res.msg,
171 });
172 }
173 }).catch((res) => {
174 tableInfo.value.loading = false;
175 });
176 });
177 };
178
179 const getFirstPageData = () => {
180 page.value.curr = 1
181 tableInfo.value.page.curr = 1;
182 getTableData();
183 }
184
185 onActivated(() => {
186 if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
187 getFirstPageData();
188 assetStore.set(false);
189 }
190 })
191
192 onBeforeMount(() => {
193
194 })
7 195
8 </script> 196 </script>
9 197
10 <template> 198 <template>
11 <div>分类分级任务</div> 199 <div class="container_wrap" v-if="tableInfo.data.length">
200 <div class="table_tool_wrap">
201 <div class="table_title">分类分级任务</div>
202 </div>
203 <div class="table_panel_wrap">
204 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
205 </div>
206 </div>
207 <div class="container_wrap" v-else>
208 <div class="card-noData">
209 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
210 <p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
211 </div>
212 </div>
12 </template> 213 </template>
13 214
14 <style lang="scss" scoped> 215 <style scoped lang="scss">
216 .table_tool_wrap {
217 width: 100%;
218 height: 40px !important;
219 padding: 0 8px;
220
221 .table_title {
222 height: 40px;
223 line-height: 40px;
224 font-weight: 600;
225 font-size: 16px;
226 color: #212121;
227 }
228 }
229
230 .table_panel_wrap {
231 width: 100%;
232 height: calc(100% - 40px);
233 padding: 0px 8px 0;
234 }
15 235
16 </style>
...\ No newline at end of file ...\ No newline at end of file
236 .card-noData {
237 position: absolute;
238 top: 50%;
239 left: 50%;
240 transform: translate(-50%, -50%);
241 display: flex;
242 flex-direction: column;
243 align-items: center;
244 }
245 </style>
......
...@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => { ...@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => {
332 })] 332 })]
333 })); 333 }));
334 } 334 }
335 } else if (info.ruleCode == 'norm_check') {
336 let subjectTables = toSubjectTables.value;
337 for (const ds in info.ruleFields) {
338 let fields = info.ruleFields[ds];
339 let tableInfo = subjectTables.find(t => t.enName === ds);
340 modelRules.push(Object.assign({}, {
341 modelGroupGuid: modelGroupGuid.value,
342 name: tableInfo.chName,
343 subjectName: tableInfo.enName,
344 subjectGuid: tableInfo.guid,
345 dataSourceGuid: tableInfo.dataSourceGuid,
346 databaseName: tableInfo.dataServerName,
347 modelRuleConfList: [Object.assign({}, info, {
348 ruleField: fields.map(f => {
349 return {
350 guid: f.guid,
351 enName: f.enName,
352 chName: f.chName,
353 dataType: f.dataType,
354 checkRule: f.checkRule,
355 configValue: f.configValue
356 }
357 }),
358 ruleFields: ''
359 })]
360 }));
361 }
335 } else if (info.ruleCode == 'ref_integrality') { 362 } else if (info.ruleCode == 'ref_integrality') {
336 let subjectTables = toSubjectTables.value; 363 let subjectTables = toSubjectTables.value;
337 info.ruleFields.forEach(row => { 364 info.ruleFields.forEach(row => {
......
...@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => { ...@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => {
140 }), 140 }),
141 ruleFields: '' 141 ruleFields: ''
142 }); 142 });
143 } else if (info.ruleCode == 'norm_check') {
144 let subjectName = detailInfo.value.subjectName;
145 let fields = info.ruleFields[subjectName];
146 return Object.assign({}, info, {
147 guid: ruleGuid,
148 qualityModelGuid: detailInfo.value.qualityModelGuid,
149 ruleCode: detailInfo.value.ruleCode,
150 ruleField: fields.map(f => {
151 return {
152 guid: f.guid,
153 enName: f.enName,
154 chName: f.chName,
155 dataType: f.dataType,
156 checkRule: f.checkRule,
157 configValue: f.configValue
158 }
159 }),
160 ruleFields: ''
161 });
143 } else if (info.ruleCode == 'ref_integrality') { 162 } else if (info.ruleCode == 'ref_integrality') {
144 return Object.assign({}, info, { 163 return Object.assign({}, info, {
145 guid: ruleGuid, 164 guid: ruleGuid,
......
...@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => { ...@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => {
135 }), 135 }),
136 ruleFields: '' 136 ruleFields: ''
137 }); 137 });
138 } else if (info.ruleCode == 'norm_check') {
139 let subjectName = modelDetailInfo.value.subjectName;
140 let fields = info.ruleFields[subjectName];
141 return Object.assign({}, info, {
142 qualityModelGuid: modelGuid,
143 ruleCode: info.ruleCode,
144 ruleField: fields.map(f => {
145 return {
146 guid: f.guid,
147 enName: f.enName,
148 chName: f.chName,
149 dataType: f.dataType,
150 checkRule: f.checkRule,
151 configValue: f.configValue
152 }
153 }),
154 ruleFields: ''
155 });
138 } else if (info.ruleCode == 'ref_integrality') { 156 } else if (info.ruleCode == 'ref_integrality') {
139 return Object.assign({}, info, { 157 return Object.assign({}, info, {
140 qualityModelGuid: modelGuid, 158 qualityModelGuid: modelGuid,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!