abc5146e by lxs

分类分级任务联调

1 parent d9e56607
...@@ -277,8 +277,8 @@ export const cgTaskDelete = (data) => request({ ...@@ -277,8 +277,8 @@ export const cgTaskDelete = (data) => request({
277 // 手动执行任务 277 // 手动执行任务
278 export const runExecTask = (data) => request({ 278 export const runExecTask = (data) => request({
279 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/exec-task`, 279 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/exec-task`,
280 method: 'put', 280 method: 'post',
281 data 281 params: data
282 }) 282 })
283 283
284 // 分类分级任务日志 284 // 分类分级任务日志
...@@ -288,6 +288,47 @@ export const getTaskExecPageList = (data) => request({ ...@@ -288,6 +288,47 @@ export const getTaskExecPageList = (data) => request({
288 data 288 data
289 }) 289 })
290 290
291 // 分类分级任务执行树形数据
292 export const getTaskExeTreeList = (data) => request({
293 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec/classify/tree-list`,
294 method: 'get',
295 params: data
296 })
297
298 // 分类分级任务执行字段统计
299 export const getTaskFieldCount = (data) => request({
300 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-field-cnt`,
301 method: 'get',
302 params: data
303 })
304
305 // 分类分级任务执行字段查询
306 export const execTaskFieldList = (data) => request({
307 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-field-list-query`,
308 method: 'post',
309 data
310 })
311 // 分类分级任务执行库表查询
312 export const execTaskSheetList = (data) => request({
313 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-db-list-query`,
314 method: 'post',
315 data
316 })
317
318 // 分类分级任务执行任务确认
319 export const execTaskConfirm = (data) => request({
320 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-task`,
321 method: 'post',
322 data
323 })
324
325 // 分类分级任务执行字段确认
326 export const execFieldConfirm = (data) => request({
327 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec-result/confirm-field`,
328 method: 'post',
329 data
330 })
331
291 // 标签规则-分页 332 // 标签规则-分页
292 export const getCgLabelPageList = (data) => request({ 333 export const getCgLabelPageList = (data) => request({
293 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-label/page-list`, 334 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-label/page-list`,
...@@ -334,6 +375,18 @@ export const filterVal = (val, type) => { ...@@ -334,6 +375,18 @@ export const filterVal = (val, type) => {
334 status = '--'; 375 status = '--';
335 break; 376 break;
336 } 377 }
378 } else if(type == 'isCgChange'){
379 switch (val) {
380 case 'N':
381 status = '待确认';
382 break;
383 case 'Y':
384 status = '已确认';
385 break;
386 default:
387 status = '待确认';
388 break;
389 }
337 } 390 }
338 return status; 391 return status;
339 } 392 }
......
...@@ -3,7 +3,17 @@ import { computed, reactive, ref } from 'vue' ...@@ -3,7 +3,17 @@ import { computed, reactive, ref } from 'vue'
3 import { Search } from '@element-plus/icons-vue' 3 import { Search } from '@element-plus/icons-vue'
4 import type { FormInstance, FormRules } from 'element-plus' 4 import type { FormInstance, FormRules } from 'element-plus'
5 import { debounce } from "@/utils/common" 5 import { debounce } from "@/utils/common"
6 const emits = defineEmits(["tableSearch", "toolFilterChange", "loadMore","remoteMethod","treeSelectLoad","selectChange","treeSelectNodeChange","treeSelectNodeClick"]); 6 const emits = defineEmits([
7 "tableSearch",
8 "toolFilterChange",
9 "loadMore",
10 "remoteMethod",
11 "treeSelectLoad",
12 "selectChange",
13 "treeSelectNodeChange",
14 "treeSelectNodeClick",
15 "cascaderChange",
16 ]);
7 const props = defineProps({ 17 const props = defineProps({
8 itemList: { 18 itemList: {
9 type: Array, 19 type: Array,
...@@ -19,6 +29,7 @@ const props = defineProps({ ...@@ -19,6 +29,7 @@ const props = defineProps({
19 } 29 }
20 }) 30 })
21 const formRef = ref() 31 const formRef = ref()
32 const formCascaderRef = ref();
22 const formInline: any = computed(() => { 33 const formInline: any = computed(() => {
23 let items = setFormFields(props.itemList); 34 let items = setFormFields(props.itemList);
24 return reactive(items); 35 return reactive(items);
...@@ -34,9 +45,16 @@ const resetForm = (formEl: FormInstance | undefined) => { ...@@ -34,9 +45,16 @@ const resetForm = (formEl: FormInstance | undefined) => {
34 emits('tableSearch', form, true) 45 emits('tableSearch', form, true)
35 }) 46 })
36 } 47 }
48 const getCascaderCheckedData = () => {
49 const formCascader = formCascaderRef.value[0] || formCascaderRef.value;
50 const data = formCascader.getCheckedNodes();
51 return data;
52 };
53
37 defineExpose({ 54 defineExpose({
38 formInline, 55 formInline,
39 formRef 56 formRef,
57 getCascaderCheckedData
40 }) 58 })
41 const setFormFields = (list: any) => { 59 const setFormFields = (list: any) => {
42 let obj = {} 60 let obj = {}
...@@ -68,10 +86,13 @@ const selectChange = (val, row) => { ...@@ -68,10 +86,13 @@ const selectChange = (val, row) => {
68 const handleTreeSelectNodeChange = (node, item) => { 86 const handleTreeSelectNodeChange = (node, item) => {
69 emits("treeSelectNodeChange", node, item); 87 emits("treeSelectNodeChange", node, item);
70 } 88 }
71 const handleTreeSelectNodeClick = (node, item)=>{ 89 const handleTreeSelectNodeClick = (node, item) => {
72 emits("treeSelectNodeClick", node, item); 90 emits("treeSelectNodeClick", node, item);
73 } 91 }
74 const inputChange = (val)=>{ 92 const cascaderChange = (val, item) => {
93 emits("cascaderChange", val, item);
94 }
95 const inputChange = (val) => {
75 onSubmit() 96 onSubmit()
76 } 97 }
77 onMounted(() => { 98 onMounted(() => {
...@@ -86,56 +107,47 @@ onMounted(() => { ...@@ -86,56 +107,47 @@ onMounted(() => {
86 :class="{ 'width_auto': item.type == 'radio-button' }" :prop="item.field"> 107 :class="{ 'width_auto': item.type == 'radio-button' }" :prop="item.field">
87 <template v-if="item.type == 'select'"> 108 <template v-if="item.type == 'select'">
88 <el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]" 109 <el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]"
89 :placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable" @change="(val) => selectChange(val, item)"> 110 :placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable"
90 <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" :value="item.props?.value ? opt[item.props.value] : opt.value" /> 111 @change="(val) => selectChange(val, item)">
112 <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label"
113 :value="item.props?.value ? opt[item.props.value] : opt.value" />
91 </el-select> 114 </el-select>
92 </template> 115 </template>
93 <template v-else-if="item.type == 'input-select'"> 116 <template v-else-if="item.type == 'input-select'">
94 <el-input v-model.trim="formInline[item.field]" :placeholder="item.placeholder" class="input-with-select" :maxlength="item.maxlength ?? ''" 117 <el-input v-model.trim="formInline[item.field]" :placeholder="item.placeholder" class="input-with-select"
95 :suffix-icon="Search"> 118 :maxlength="item.maxlength ?? ''" :suffix-icon="Search">
96 <template #prepend> 119 <template #prepend>
97 <span v-for="child in item.children"> 120 <span v-for="child in item.children">
98 <el-select v-model="formItemList[child.field]" :placeholder="child.placeholder" 121 <el-select v-model="formItemList[child.field]" :placeholder="child.placeholder"
99 :clearable="item.clearable" style="vertical-align: inherit;"> 122 :clearable="item.clearable" style="vertical-align: inherit;">
100 <el-option v-for="opts in child.options" :label="child.props?.label ? opts[item.props.label] : opts.label" :value="child.props?.value ? opts[item.props.value] : opts.value" /> 123 <el-option v-for="opts in child.options"
124 :label="child.props?.label ? opts[item.props.label] : opts.label"
125 :value="child.props?.value ? opts[item.props.value] : opts.value" />
101 </el-select> 126 </el-select>
102 </span> 127 </span>
103 </template> 128 </template>
104 </el-input> 129 </el-input>
105 </template> 130 </template>
106 <template v-else-if="item.type=='tree-select'"> 131 <template v-else-if="item.type == 'tree-select'">
107 <div class="select_slots_panel"> 132 <div class="select_slots_panel">
108 <div class="slot-prefix" v-for="child in item.children"> 133 <div class="slot-prefix" v-for="child in item.children">
109 <el-select v-model="formInline[child.field]" :placeholder="child.placeholder" @change="(val) => selectChange(val, child)" > 134 <el-select v-model="formInline[child.field]" :placeholder="child.placeholder"
135 @change="(val) => selectChange(val, child)">
110 <el-option v-for="cpt in child.options" :label="cpt.label" :value="cpt.value" /> 136 <el-option v-for="cpt in child.options" :label="cpt.label" :value="cpt.value" />
111 </el-select> 137 </el-select>
112 </div> 138 </div>
113 </div> 139 </div>
114 <div class="slot-default"> 140 <div class="slot-default">
115 <el-tree-select 141 <el-tree-select v-model="formInline[item.field]" :data="item.options" :placeholder="item.placeholder"
116 v-model="formInline[item.field]" 142 :clearable="item.clearable" :filterable="item.filterable" :disabled="item.disabled"
117 :data="item.options" 143 :lazy="item.lazy ?? true" :check-strictly="item.checkStrictly ?? false" :node-key="item.nodeKey ?? 'guid'"
118 :placeholder="item.placeholder" 144 :load="(node, resolve) => treeSelectLoad(node, resolve, item)" :props="item.props"
119 :clearable="item.clearable" 145 :multiple="item.multiple ?? false" :render-after-expand="true" :teleported="item.teleported ?? true"
120 :filterable="item.filterable" 146 :default-expanded-keys="item.expandKeys" :collapse-tags-tooltip="item.collapseTagsTooltip ?? false"
121 :disabled="item.disabled" 147 :collapse-tags="item.collapseTags ?? false" :max-collapse-tags="item.maxTags ?? 1"
122 :lazy="item.lazy ?? true" 148 :show-checkbox="item.showCheckbox ?? false" @change="(val) => selectChange(val, item)"
123 :check-strictly = "item.checkStrictly ?? false"
124 :node-key="item.nodeKey ?? 'guid'"
125 :load="(node, resolve) => treeSelectLoad(node, resolve, item)"
126 :props="item.props"
127 :multiple="item.multiple ?? false"
128 :render-after-expand="true"
129 :teleported="item.teleported ?? true"
130 :default-expanded-keys="item.expandKeys"
131 :collapse-tags-tooltip="item.collapseTagsTooltip ?? false"
132 :collapse-tags="item.collapseTags ?? false"
133 :max-collapse-tags="item.maxTags ?? 1"
134 :show-checkbox="item.showCheckbox ?? false"
135 @change="(val) => selectChange(val, item)"
136 @current-change="(node) => handleTreeSelectNodeChange(node, item)" 149 @current-change="(node) => handleTreeSelectNodeChange(node, item)"
137 @node-click = "(node)=>handleTreeSelectNodeClick(node, item)" 150 @node-click="(node) => handleTreeSelectNodeClick(node, item)">
138 >
139 151
140 <!-- <template #default="{ node, data }"> 152 <!-- <template #default="{ node, data }">
141 <template v-if="item.getName"> 153 <template v-if="item.getName">
...@@ -153,8 +165,8 @@ onMounted(() => { ...@@ -153,8 +165,8 @@ onMounted(() => {
153 {{ item.getName(data, node) }} 165 {{ item.getName(data, node) }}
154 </div> 166 </div>
155 </template> 167 </template>
156 <span v-else>{{ data[item.props.label] }}</span> 168 <span v-else>{{ data[item.props.label] }}</span>
157 </template> --> 169 </template> -->
158 </el-tree-select> 170 </el-tree-select>
159 </div> 171 </div>
160 172
...@@ -178,13 +190,21 @@ onMounted(() => { ...@@ -178,13 +190,21 @@ onMounted(() => {
178 <div class="slot-default"> 190 <div class="slot-default">
179 <el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]" 191 <el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]"
180 :placeholder="item.placeholder" :multiple="item.multiple" collapse-tags collapse-tags-tooltip 192 :placeholder="item.placeholder" :multiple="item.multiple" collapse-tags collapse-tags-tooltip
181 @change="(val) => selectChange(val, item)" 193 @change="(val) => selectChange(val, item)" :max-collapse-tags="3" :filterable="item.filterable"
182 :max-collapse-tags="3" :filterable="item.filterable" :clearable="item.clearable" v-loadmore="loadMore"> 194 :clearable="item.clearable" v-loadmore="loadMore">
183 <el-option v-for="opt in item.options" :label="opt.label" :value="opt.value" /> 195 <el-option v-for="opt in item.options" :label="opt.label" :value="opt.value" />
184 </el-select> 196 </el-select>
185 </div> 197 </div>
186 </div> 198 </div>
187 </template> 199 </template>
200 <template v-else-if="item.type == 'cascader'">
201 <el-cascader ref="formCascaderRef" :class="[item.col, { is_block: item.block }]"
202 v-model="formInline[item.field]" :options="item.options" :props="item.props" :placeholder="item.placeholder"
203 :show-all-levels="item.showAllLevels ?? true" :clearable="item.clearable"
204 :filterable="item.filterable ?? false" :collapse-tags="item.collapse ?? false"
205 :collapse-tags-tooltip="item.tagsTooltip ?? false" :max-collapse-tags="item.maxTags ?? 1"
206 :disabled="item.disabled ?? false" @change="(val) => cascaderChange(val, item)" />
207 </template>
188 <template v-else> 208 <template v-else>
189 <el-input v-model.trim="formInline[item.field]" :placeholder="item.placeholder" :clearable="item.clearable" 209 <el-input v-model.trim="formInline[item.field]" :placeholder="item.placeholder" :clearable="item.clearable"
190 @clear="inputChange" /> 210 @clear="inputChange" />
......
1 <script lang="ts" setup name="TableTools"> 1 <script lang="ts" setup name="TableTools">
2 import TableSearch from './table_search.vue' 2 import TableSearch from './table_search.vue'
3 const emits = defineEmits(["search", "filterChange","loadMore","remoteMethod","treeSelectLoad","selectChange","treeSelectNodeChange","treeSelectNodeClick"]); 3 const emits = defineEmits(["search", "filterChange","loadMore","remoteMethod","treeSelectLoad","selectChange","treeSelectNodeChange","treeSelectNodeClick","cascaderChange"]);
4 const props = defineProps({ 4 const props = defineProps({
5 searchItems: { 5 searchItems: {
6 type: Array, 6 type: Array,
...@@ -53,6 +53,14 @@ const handleTreeSelectNodeChange = (node, item) => { ...@@ -53,6 +53,14 @@ const handleTreeSelectNodeChange = (node, item) => {
53 const treeSelectNodeClick = (node, item)=>{ 53 const treeSelectNodeClick = (node, item)=>{
54 emits("treeSelectNodeClick", node, item); 54 emits("treeSelectNodeClick", node, item);
55 } 55 }
56 const cascaderChange = (val, item) => {
57 emits("cascaderChange", val, item);
58 }
59
60 const getCascaderCheckedData = ()=>{
61 return toolSearch.value.getCascaderCheckedData();
62 }
63
56 defineExpose({ 64 defineExpose({
57 toolSearch, 65 toolSearch,
58 }) 66 })
...@@ -69,6 +77,7 @@ defineExpose({ ...@@ -69,6 +77,7 @@ defineExpose({
69 @selectChange="selectChange" 77 @selectChange="selectChange"
70 @treeSelectNodeChange="handleTreeSelectNodeChange" 78 @treeSelectNodeChange="handleTreeSelectNodeChange"
71 @treeSelectNodeClick="treeSelectNodeClick" 79 @treeSelectNodeClick="treeSelectNodeClick"
80 @cascaderChange="cascaderChange"
72 /> 81 />
73 </div> 82 </div>
74 <div class="tools_bar" v-if="bars?.length"> 83 <div class="tools_bar" v-if="bars?.length">
......
...@@ -74,15 +74,8 @@ const routes: RouteRecordRaw[] = [ ...@@ -74,15 +74,8 @@ const routes: RouteRecordRaw[] = [
74 sidebar: false, 74 sidebar: false,
75 breadcrumb: false, 75 breadcrumb: false,
76 cache: true, 76 cache: true,
77 reuse: true,
78 editPage: true,
79 activeMenu: '/data-inventory/classify-grade-manage/task-config' 77 activeMenu: '/data-inventory/classify-grade-manage/task-config'
80 }, 78 },
81 beforeEnter: (to, from) => {
82 // if (to.query.name) {
83 // to.meta.title = `编辑-${to.query.name}`;
84 // }
85 }
86 }, 79 },
87 { 80 {
88 path: 'template-config', 81 path: 'template-config',
......
...@@ -33,7 +33,7 @@ const useUserStore = defineStore( ...@@ -33,7 +33,7 @@ const useUserStore = defineStore(
33 function getToken(data, state) { 33 function getToken(data, state) {
34 data.platformGuid = "7f16f697aec111ef8656fa163e60becd"; 34 data.platformGuid = "7f16f697aec111ef8656fa163e60becd";
35 data.userType = 2; 35 data.userType = 2;
36 data.validateUri = location.origin + '/'; 36 data.validateUri = location.origin == 'http://localhost:9000' ? 'http://localhost:9000/' : location.origin + '/';
37 return getTokenPromise.value = getTokenByCode(data).then((res: any) => { 37 return getTokenPromise.value = getTokenByCode(data).then((res: any) => {
38 getTokenPromise.value = null; 38 getTokenPromise.value = null;
39 console.log(res); 39 console.log(res);
......
...@@ -12,14 +12,13 @@ import useDataAssetStore from "@/store/modules/dataAsset"; ...@@ -12,14 +12,13 @@ import useDataAssetStore from "@/store/modules/dataAsset";
12 import { filterVal, getCgTaskPageList, cgTaskDelete, runExecTask } from "@/api/modules/dataInventory"; 12 import { filterVal, getCgTaskPageList, cgTaskDelete, runExecTask } from "@/api/modules/dataInventory";
13 import { TableColumnWidth } from '@/utils/enum'; 13 import { TableColumnWidth } from '@/utils/enum';
14 14
15 import Table from "@/components/Table/index.vue";
16
17 const { proxy } = getCurrentInstance() as any; 15 const { proxy } = getCurrentInstance() as any;
18 const router = useRouter(); 16 const router = useRouter();
19 const userStore = useUserStore(); 17 const userStore = useUserStore();
20 const userData = JSON.parse(userStore.userData); 18 const userData = JSON.parse(userStore.userData);
21 const assetStore = useDataAssetStore(); 19 const assetStore = useDataAssetStore();
22 20
21 const loading = ref(false);
23 const page = ref({ 22 const page = ref({
24 limit: 50, 23 limit: 50,
25 curr: 1, 24 curr: 1,
...@@ -41,8 +40,8 @@ const tableInfo = ref({ ...@@ -41,8 +40,8 @@ const tableInfo = ref({
41 { 40 {
42 label: "目录名称", field: "cgDirName", width: 120, type: "text_btn", columClass: 'text_btn', click: (scope) => { 41 label: "目录名称", field: "cgDirName", width: 120, type: "text_btn", columClass: 'text_btn', click: (scope) => {
43 router.push({ 42 router.push({
44 name: "templateConfig", 43 name: "classifyGradeCatalogue",
45 query: { guid: scope.row.damGuid }, 44 // query: { guid: scope.row.damGuid },
46 }); 45 });
47 } 46 }
48 }, 47 },
...@@ -68,13 +67,8 @@ const tableInfo = ref({ ...@@ -68,13 +67,8 @@ const tableInfo = ref({
68 } 67 }
69 }, 68 },
70 ], 69 ],
71 loading: false,
72 data: [], 70 data: [],
73 page: { 71 showPage: false,
74 type: "normal",
75 rows: 0,
76 ...page.value,
77 },
78 actionInfo: { 72 actionInfo: {
79 label: "操作", 73 label: "操作",
80 type: "btn", 74 type: "btn",
...@@ -97,21 +91,18 @@ const tableInfo = ref({ ...@@ -97,21 +91,18 @@ const tableInfo = ref({
97 }); 91 });
98 92
99 const getTableData = () => { 93 const getTableData = () => {
100 tableInfo.value.loading = true; 94 loading.value = true;
101 getCgTaskPageList( 95 getCgTaskPageList(
102 Object.assign({}, searchItemValue.value, { 96 Object.assign({}, searchItemValue.value, {
103 pageIndex: page.value.curr, 97 pageIndex: page.value.curr,
104 pageSize: page.value.limit, 98 pageSize: -1,
105 }) 99 })
106 ).then((res: any) => { 100 ).then((res: any) => {
107 tableInfo.value.loading = false; 101 loading.value = false;
108 tableInfo.value.data = res.data.records || []; 102 tableInfo.value.data = res.data.records || [];
109 tableInfo.value.page.curr = res.data.pageIndex;
110 tableInfo.value.page.limit = res.data.pageSize;
111 tableInfo.value.page.rows = res.data.totalRows;
112 }) 103 })
113 .catch((res) => { 104 .catch((res) => {
114 tableInfo.value.loading = false; 105 loading.value = false;
115 }); 106 });
116 }; 107 };
117 108
...@@ -122,10 +113,10 @@ const tableBtnClick = (scope, btn) => { ...@@ -122,10 +113,10 @@ const tableBtnClick = (scope, btn) => {
122 if (type == 'confirm' || type == 'modify' || type == 'edit' || type == "log") { 113 if (type == 'confirm' || type == 'modify' || type == 'edit' || type == "log") {
123 toPath(type); 114 toPath(type);
124 } else if (type == 'run') { 115 } else if (type == 'run') {
125 const guids = [currTableData.value.guid]; 116 const params = {guid: currTableData.value.guid};
126 runExecTask(guids).then((res: any) => { 117 runExecTask(params).then((res: any) => {
127 if (res.code == proxy.$passCode) { 118 if (res.code == proxy.$passCode) {
128 getFirstPageData(); 119 getTableData();
129 } else { 120 } else {
130 ElMessage({ 121 ElMessage({
131 type: "error", 122 type: "error",
...@@ -181,14 +172,6 @@ const toPath = (type) => { ...@@ -181,14 +172,6 @@ const toPath = (type) => {
181 } 172 }
182 } 173 }
183 174
184 const tablePageChange = (info) => {
185 page.value.curr = Number(info.curr);
186 page.value.limit = Number(info.limit);
187 tableInfo.value.page.limit = page.value.limit;
188 tableInfo.value.page.curr = page.value.curr;
189 getTableData();
190 };
191
192 const open = (msg, type, isBatch = false) => { 175 const open = (msg, type, isBatch = false) => {
193 ElMessageBox.confirm(msg, "提示", { 176 ElMessageBox.confirm(msg, "提示", {
194 confirmButtonText: "确定", 177 confirmButtonText: "确定",
...@@ -198,7 +181,7 @@ const open = (msg, type, isBatch = false) => { ...@@ -198,7 +181,7 @@ const open = (msg, type, isBatch = false) => {
198 const guids = [currTableData.value.guid]; 181 const guids = [currTableData.value.guid];
199 cgTaskDelete(guids).then((res: any) => { 182 cgTaskDelete(guids).then((res: any) => {
200 if (res.code == proxy.$passCode) { 183 if (res.code == proxy.$passCode) {
201 getFirstPageData(); 184 getTableData();
202 ElMessage({ 185 ElMessage({
203 type: "success", 186 type: "success",
204 message: "删除成功", 187 message: "删除成功",
...@@ -210,41 +193,35 @@ const open = (msg, type, isBatch = false) => { ...@@ -210,41 +193,35 @@ const open = (msg, type, isBatch = false) => {
210 }); 193 });
211 } 194 }
212 }).catch((res) => { 195 }).catch((res) => {
213 tableInfo.value.loading = false; 196
214 }); 197 });
215 }); 198 });
216 }; 199 };
217 200
218 const getFirstPageData = () => {
219 page.value.curr = 1
220 tableInfo.value.page.curr = 1;
221 getTableData();
222 }
223
224 onActivated(() => { 201 onActivated(() => {
225 // if (assetStore.isRefresh) {//如果是首次加载,则不需要调用 202 // if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
226 // getFirstPageData(); 203 // getFirstPageData();
227 // assetStore.set(false); 204 // assetStore.set(false);
228 // } 205 // }
229 getFirstPageData()
230 }) 206 })
231 207
232 onBeforeMount(() => { 208 onBeforeMount(() => {
233 209 getTableData()
234 }) 210 })
235 211
236 </script> 212 </script>
237 213
238 <template> 214 <template>
239 <div class="container_wrap" v-if="tableInfo.data.length"> 215 <div class="container_wrap" v-loading="loading">
240 <div class="table_panel_wrap"> 216 <div class="table_tool_wrap" v-if="tableInfo.data.length">
241 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" /> 217 <div class="table_title">分类分级任务</div>
242 </div> 218 </div>
219 <div class="table_panel_wrap" v-if="tableInfo.data.length">
220 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" />
243 </div> 221 </div>
244 <div class="container_wrap" v-else> 222 <div class="card-noData" v-else>
245 <div class="card-noData">
246 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" /> 223 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
247 <p>暂无日志记录</p> 224 <p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
248 </div> 225 </div>
249 </div> 226 </div>
250 </template> 227 </template>
...@@ -252,7 +229,7 @@ onBeforeMount(() => { ...@@ -252,7 +229,7 @@ onBeforeMount(() => {
252 <style scoped lang="scss"> 229 <style scoped lang="scss">
253 .table_tool_wrap { 230 .table_tool_wrap {
254 width: 100%; 231 width: 100%;
255 height: 40px !important; 232 min-height: unset;
256 padding: 0 8px; 233 padding: 0 8px;
257 234
258 .table_title { 235 .table_title {
...@@ -266,8 +243,8 @@ onBeforeMount(() => { ...@@ -266,8 +243,8 @@ onBeforeMount(() => {
266 243
267 .table_panel_wrap { 244 .table_panel_wrap {
268 width: 100%; 245 width: 100%;
269 height: 100%; 246 height: calc(100% - 40px);
270 padding: 0px 8px 0; 247 padding: 8px 8px 16px;
271 } 248 }
272 249
273 .card-noData { 250 .card-noData {
......
...@@ -152,6 +152,7 @@ const metadataTableInfo = ref({ ...@@ -152,6 +152,7 @@ const metadataTableInfo = ref({
152 152
153 const getTaskDetail = (data) => { 153 const getTaskDetail = (data) => {
154 getCgTaskDetail(data).then((res: any) => { 154 getCgTaskDetail(data).then((res: any) => {
155 if (res.code == proxy.$passCode) {
155 const data = res.data || {}; 156 const data = res.data || {};
156 taskDetail.value = data; 157 taskDetail.value = data;
157 taskFormItems.value.map((item) => { 158 taskFormItems.value.map((item) => {
...@@ -160,6 +161,7 @@ const getTaskDetail = (data) => { ...@@ -160,6 +161,7 @@ const getTaskDetail = (data) => {
160 selectRowData.value = data.metaGuids || []; 161 selectRowData.value = data.metaGuids || [];
161 getPermissionList({}); 162 getPermissionList({});
162 getMetaTableData(); 163 getMetaTableData();
164 }
163 }) 165 })
164 } 166 }
165 167
...@@ -179,22 +181,22 @@ const getTableData = () => { ...@@ -179,22 +181,22 @@ const getTableData = () => {
179 }) 181 })
180 ).then((res: any) => { 182 ).then((res: any) => {
181 tableInfo.value.loading = false; 183 tableInfo.value.loading = false;
184 if (res.code == proxy.$passCode) {
182 tableInfo.value.data = res.data.records || []; 185 tableInfo.value.data = res.data.records || [];
183 tableInfo.value.page.curr = res.data.pageIndex; 186 tableInfo.value.page.curr = res.data.pageIndex;
184 tableInfo.value.page.limit = res.data.pageSize; 187 tableInfo.value.page.limit = res.data.pageSize;
185 tableInfo.value.page.rows = res.data.totalRows; 188 tableInfo.value.page.rows = res.data.totalRows;
189 }
186 }) 190 })
187 .catch((res) => { 191 .catch((res) => {
188 tableInfo.value.loading = false; 192 tableInfo.value.loading = false;
189 }); 193 });
190 }; 194 };
191 195
192 const toPath = (type = null) => { 196 const toPath = () => {
193 router.push({ 197 router.push({
194 name: "taskConfig", 198 name: "taskConfig",
195 query: { 199 query: {},
196 type
197 },
198 }); 200 });
199 } 201 }
200 202
...@@ -218,11 +220,9 @@ const tablePageChange = (info) => { ...@@ -218,11 +220,9 @@ const tablePageChange = (info) => {
218 const getMetaTableData = () => { 220 const getMetaTableData = () => {
219 getMetaTableCollectList({}).then((res: any) => { 221 getMetaTableCollectList({}).then((res: any) => {
220 metadataTableInfo.value.loading = false; 222 metadataTableInfo.value.loading = false;
223 if (res.code == proxy.$passCode) {
221 const data = res.data.records || []; 224 const data = res.data.records || [];
222 metadataTableInfo.value.data = data; 225 metadataTableInfo.value.data = data;
223 // metadataTableInfo.value.page.curr = res.data.pageIndex;
224 // metadataTableInfo.value.page.limit = res.data.pageSize;
225 // metadataTableInfo.value.page.rows = res.data.totalRows;
226 if (route.query.type === 'edit') { 226 if (route.query.type === 'edit') {
227 nextTick(() => { 227 nextTick(() => {
228 data.map((row) => { 228 data.map((row) => {
...@@ -230,6 +230,7 @@ const getMetaTableData = () => { ...@@ -230,6 +230,7 @@ const getMetaTableData = () => {
230 }); 230 });
231 }) 231 })
232 } 232 }
233 }
233 }) 234 })
234 } 235 }
235 236
...@@ -330,7 +331,7 @@ const listClick = (row) => { ...@@ -330,7 +331,7 @@ const listClick = (row) => {
330 }; 331 };
331 332
332 // 获取分类列表 333 // 获取分类列表
333 const getPermissionList = (val, init = false) => { 334 const getPermissionList = (val, init = true) => {
334 let params: any = val ? { ...val } : {} 335 let params: any = val ? { ...val } : {}
335 params.pageIndex = listPage.value.curr; 336 params.pageIndex = listPage.value.curr;
336 params.pageSize = listPage.value.limit; 337 params.pageSize = listPage.value.limit;
...@@ -343,10 +344,6 @@ const getPermissionList = (val, init = false) => { ...@@ -343,10 +344,6 @@ const getPermissionList = (val, init = false) => {
343 permissionList.value = JSON.parse(JSON.stringify(data)) 344 permissionList.value = JSON.parse(JSON.stringify(data))
344 currpermissionList.value = JSON.parse(JSON.stringify(data)) 345 currpermissionList.value = JSON.parse(JSON.stringify(data))
345 listPage.value.totalPages = res.data.totalPages 346 listPage.value.totalPages = res.data.totalPages
346 } else {
347 permissionList.value.push(...JSON.parse(JSON.stringify(data)))
348 querySearch(asideSearchInput.value)
349 }
350 if (data.length) { 347 if (data.length) {
351 if (route.query.type == 'edit') { 348 if (route.query.type == 'edit') {
352 templateInfo.value = data.filter(item => item.guid == taskDetail.value.classifyGuid)[0] 349 templateInfo.value = data.filter(item => item.guid == taskDetail.value.classifyGuid)[0]
...@@ -355,6 +352,10 @@ const getPermissionList = (val, init = false) => { ...@@ -355,6 +352,10 @@ const getPermissionList = (val, init = false) => {
355 } 352 }
356 getClassifyTree() 353 getClassifyTree()
357 } 354 }
355 } else {
356 permissionList.value.push(...JSON.parse(JSON.stringify(data)))
357 querySearch(asideSearchInput.value)
358 }
358 } 359 }
359 listLoading.value = false 360 listLoading.value = false
360 }).catch(() => { 361 }).catch(() => {
...@@ -365,23 +366,32 @@ const getPermissionList = (val, init = false) => { ...@@ -365,23 +366,32 @@ const getPermissionList = (val, init = false) => {
365 // 获取树形列表 366 // 获取树形列表
366 const getClassifyTree = () => { 367 const getClassifyTree = () => {
367 const params = { 368 const params = {
368 guid: templateInfo.value.guid 369 classifyGradeGuid: templateInfo.value.guid
369 } 370 }
370 treeInfo.value.loading = true; 371 treeInfo.value.loading = true;
371 getClassifyTreeList(params).then((res: any) => { 372 getClassifyTreeList(params).then((res: any) => {
373 treeInfo.value.loading = false;
372 if (res.code == proxy.$passCode) { 374 if (res.code == proxy.$passCode) {
373 const data = res.data || []; 375 const data = res.data || [];
374 treeInfo.value.data = data; 376 treeInfo.value.data = data;
375 treeInfoRef.value.setCurrentKey(''); 377 treeInfoRef.value.setCurrentKey('');
376 tableInfo.value.data = []; 378 tableInfo.value.data = [];
377 } 379 }
378 treeInfo.value.loading = false;
379 }).catch(() => { 380 }).catch(() => {
380 treeInfo.value.loading = false; 381 treeInfo.value.loading = false;
381 }) 382 })
382 } 383 }
383 384
384 onActivated(() => { 385 onActivated(() => {
386 // if (route.query.type == 'edit') {
387 // getTaskDetail({ guid: route.query.guid })
388 // } else {
389 // getPermissionList({});
390 // getMetaTableData();
391 // }
392 })
393
394 onBeforeMount(() => {
385 if (route.query.type == 'edit') { 395 if (route.query.type == 'edit') {
386 getTaskDetail({ guid: route.query.guid }) 396 getTaskDetail({ guid: route.query.guid })
387 } else { 397 } else {
...@@ -390,10 +400,6 @@ onActivated(() => { ...@@ -390,10 +400,6 @@ onActivated(() => {
390 } 400 }
391 }) 401 })
392 402
393 onBeforeMount(() => {
394 // getPermissionList({})
395 })
396
397 </script> 403 </script>
398 404
399 <template> 405 <template>
......
...@@ -12,8 +12,6 @@ import useDataAssetStore from "@/store/modules/dataAsset"; ...@@ -12,8 +12,6 @@ import useDataAssetStore from "@/store/modules/dataAsset";
12 import { getTaskExecPageList, filterVal } from "@/api/modules/dataInventory"; 12 import { getTaskExecPageList, filterVal } from "@/api/modules/dataInventory";
13 import { TableColumnWidth } from '@/utils/enum'; 13 import { TableColumnWidth } from '@/utils/enum';
14 14
15 import Table from "@/components/Table/index.vue";
16
17 const { proxy } = getCurrentInstance() as any; 15 const { proxy } = getCurrentInstance() as any;
18 const router = useRouter(); 16 const router = useRouter();
19 const route = useRoute(); 17 const route = useRoute();
...@@ -21,6 +19,7 @@ const userStore = useUserStore(); ...@@ -21,6 +19,7 @@ const userStore = useUserStore();
21 const userData = JSON.parse(userStore.userData); 19 const userData = JSON.parse(userStore.userData);
22 const assetStore = useDataAssetStore(); 20 const assetStore = useDataAssetStore();
23 21
22 const loading = ref(false);
24 const page = ref({ 23 const page = ref({
25 limit: 50, 24 limit: 50,
26 curr: 1, 25 curr: 1,
...@@ -63,7 +62,6 @@ const tableInfo = ref({ ...@@ -63,7 +62,6 @@ const tableInfo = ref({
63 } 62 }
64 }, 63 },
65 ], 64 ],
66 loading: false,
67 data: [], 65 data: [],
68 page: { 66 page: {
69 type: "normal", 67 type: "normal",
...@@ -84,7 +82,7 @@ const tableInfo = ref({ ...@@ -84,7 +82,7 @@ const tableInfo = ref({
84 }); 82 });
85 83
86 const getTableData = () => { 84 const getTableData = () => {
87 tableInfo.value.loading = true; 85 loading.value = true;
88 getTaskExecPageList( 86 getTaskExecPageList(
89 Object.assign({}, searchItemValue.value, { 87 Object.assign({}, searchItemValue.value, {
90 pageIndex: page.value.curr, 88 pageIndex: page.value.curr,
...@@ -92,14 +90,16 @@ const getTableData = () => { ...@@ -92,14 +90,16 @@ const getTableData = () => {
92 taskGuid: route.query.guid 90 taskGuid: route.query.guid
93 }) 91 })
94 ).then((res: any) => { 92 ).then((res: any) => {
95 tableInfo.value.loading = false; 93 loading.value = false;
94 if (res.code == proxy.$passCode) {
96 tableInfo.value.data = res.data.records || []; 95 tableInfo.value.data = res.data.records || [];
97 tableInfo.value.page.curr = res.data.pageIndex; 96 tableInfo.value.page.curr = res.data.pageIndex;
98 tableInfo.value.page.limit = res.data.pageSize; 97 tableInfo.value.page.limit = res.data.pageSize;
99 tableInfo.value.page.rows = res.data.totalRows; 98 tableInfo.value.page.rows = res.data.totalRows;
99 }
100 }) 100 })
101 .catch((res) => { 101 .catch((res) => {
102 tableInfo.value.loading = false; 102 loading.value = false;
103 }); 103 });
104 }; 104 };
105 105
...@@ -109,8 +109,6 @@ const tableBtnClick = (scope, btn) => { ...@@ -109,8 +109,6 @@ const tableBtnClick = (scope, btn) => {
109 currTableData.value = row; 109 currTableData.value = row;
110 if (type == "path") { 110 if (type == "path") {
111 toPath(type); 111 toPath(type);
112 } else if (type === "delete") {
113 open("此操作将永久删除,是否继续?", "warning");
114 } 112 }
115 }; 113 };
116 114
...@@ -133,32 +131,6 @@ const tablePageChange = (info) => { ...@@ -133,32 +131,6 @@ const tablePageChange = (info) => {
133 getTableData(); 131 getTableData();
134 }; 132 };
135 133
136 const open = (msg, type, isBatch = false) => {
137 ElMessageBox.confirm(msg, "提示", {
138 confirmButtonText: "确定",
139 cancelButtonText: "取消",
140 type: type,
141 }).then(() => {
142 const guids = [currTableData.value.guid];
143 listingDelete(guids).then((res: any) => {
144 if (res.code == proxy.$passCode) {
145 getFirstPageData();
146 ElMessage({
147 type: "success",
148 message: "删除成功",
149 });
150 } else {
151 ElMessage({
152 type: "error",
153 message: res.msg,
154 });
155 }
156 }).catch((res) => {
157 tableInfo.value.loading = false;
158 });
159 });
160 };
161
162 const getFirstPageData = () => { 134 const getFirstPageData = () => {
163 page.value.curr = 1 135 page.value.curr = 1
164 tableInfo.value.page.curr = 1; 136 tableInfo.value.page.curr = 1;
...@@ -176,18 +148,13 @@ onBeforeMount(() => { ...@@ -176,18 +148,13 @@ onBeforeMount(() => {
176 </script> 148 </script>
177 149
178 <template> 150 <template>
179 <div class="container_wrap" v-if="tableInfo.data.length"> 151 <div class="container_wrap" v-loading="loading">
180 <div class="table_tool_wrap"> 152 <div class="table_panel_wrap" v-if="tableInfo.data.length">
181 <div class="table_title">分类分级任务</div>
182 </div>
183 <div class="table_panel_wrap">
184 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" /> 153 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
185 </div> 154 </div>
186 </div> 155 <div class="card-noData" v-else>
187 <div class="container_wrap" v-else>
188 <div class="card-noData">
189 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" /> 156 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
190 <p>暂无分类分级任务<span class="text_btn" @click="toPath('add')">去新建</span></p> 157 <p>暂无分类分级任务日志记录</p>
191 </div> 158 </div>
192 </div> 159 </div>
193 </template> 160 </template>
...@@ -209,7 +176,7 @@ onBeforeMount(() => { ...@@ -209,7 +176,7 @@ onBeforeMount(() => {
209 176
210 .table_panel_wrap { 177 .table_panel_wrap {
211 width: 100%; 178 width: 100%;
212 height: calc(100% - 40px); 179 height: 100%;
213 padding: 0px 8px 0; 180 padding: 0px 8px 0;
214 } 181 }
215 182
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!