295d1a3f by lxs

分类分级任务bug修改

1 parent 0b36fb0c
...@@ -6,11 +6,13 @@ ...@@ -6,11 +6,13 @@
6 import { ref, onMounted } from "vue"; 6 import { ref, onMounted } from "vue";
7 import { useRouter, useRoute } from "vue-router"; 7 import { useRouter, useRoute } from "vue-router";
8 import { ElMessage, ElMessageBox } from "element-plus"; 8 import { ElMessage, ElMessageBox } from "element-plus";
9 import useDataAssetStore from "@/store/modules/dataAsset";
9 import { filterVal, getCgTaskPageList, cgTaskDelete, runExecTask } from "@/api/modules/dataInventory"; 10 import { filterVal, getCgTaskPageList, cgTaskDelete, runExecTask } from "@/api/modules/dataInventory";
10 import { TableColumnWidth } from '@/utils/enum'; 11 import { TableColumnWidth } from '@/utils/enum';
11 12
12 const { proxy } = getCurrentInstance() as any; 13 const { proxy } = getCurrentInstance() as any;
13 const router = useRouter(); 14 const router = useRouter();
15 const assetStore = useDataAssetStore();
14 16
15 const loading = ref(false); 17 const loading = ref(false);
16 const page = ref({ 18 const page = ref({
...@@ -196,10 +198,10 @@ const open = (msg, type, isBatch = false) => { ...@@ -196,10 +198,10 @@ const open = (msg, type, isBatch = false) => {
196 }; 198 };
197 199
198 onActivated(() => { 200 onActivated(() => {
199 // if (assetStore.isRefresh) {//如果是首次加载,则不需要调用 201 if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
200 // getFirstPageData(); 202 getTableData()
201 // assetStore.set(false); 203 assetStore.set(false);
202 // } 204 }
203 }) 205 })
204 206
205 onBeforeMount(() => { 207 onBeforeMount(() => {
......
...@@ -8,6 +8,8 @@ import { useRouter, useRoute } from "vue-router"; ...@@ -8,6 +8,8 @@ import { useRouter, useRoute } from "vue-router";
8 import { ElMessage, ElMessageBox } from "element-plus"; 8 import { ElMessage, ElMessageBox } from "element-plus";
9 import { Search, Warning, ArrowUp } from "@element-plus/icons-vue"; 9 import { Search, Warning, ArrowUp } from "@element-plus/icons-vue";
10 import { tagMethod, tagType, changeNum } from "@/utils/common"; 10 import { tagMethod, tagType, changeNum } from "@/utils/common";
11 import useUserStore from "@/store/modules/user";
12 import useDataAssetStore from "@/store/modules/dataAsset";
11 import TableTools from '@/components/Tools/table_tools.vue'; 13 import TableTools from '@/components/Tools/table_tools.vue';
12 import { 14 import {
13 getCgTaskDetail, 15 getCgTaskDetail,
...@@ -25,6 +27,9 @@ import { ...@@ -25,6 +27,9 @@ import {
25 const { proxy } = getCurrentInstance() as any; 27 const { proxy } = getCurrentInstance() as any;
26 const router = useRouter(); 28 const router = useRouter();
27 const route = useRoute(); 29 const route = useRoute();
30 const userStore = useUserStore();
31 const fullPath = route.fullPath;
32 const assetStore = useDataAssetStore();
28 33
29 const loading = ref(false); 34 const loading = ref(false);
30 const gradeList = ref([]); 35 const gradeList = ref([]);
...@@ -659,6 +664,8 @@ const saveTask = () => { ...@@ -659,6 +664,8 @@ const saveTask = () => {
659 loading.value = false; 664 loading.value = false;
660 if (res.code == proxy.$passCode) { 665 if (res.code == proxy.$passCode) {
661 ElMessage.success('变更成功'); 666 ElMessage.success('变更成功');
667 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
668 assetStore.set(true);
662 router.push({ 669 router.push({
663 name: "taskConfig", 670 name: "taskConfig",
664 }); 671 });
......
...@@ -7,14 +7,20 @@ import { ref, onMounted } from "vue"; ...@@ -7,14 +7,20 @@ import { ref, onMounted } from "vue";
7 import { useRouter, useRoute } from "vue-router"; 7 import { useRouter, useRoute } from "vue-router";
8 import { ElMessage, ElMessageBox } from "element-plus"; 8 import { ElMessage, ElMessageBox } from "element-plus";
9 import { Search } from "@element-plus/icons-vue"; 9 import { Search } from "@element-plus/icons-vue";
10 import useUserStore from "@/store/modules/user";
11 import useDataAssetStore from "@/store/modules/dataAsset";
10 import { getCgTaskDetail, getClassifyGradList, getClassifyTreeList, getCgLabelPageList, getMetaTableCollectList, cgTaskSave, cgTaskUpdate } from "@/api/modules/dataInventory"; 12 import { getCgTaskDetail, getClassifyGradList, getClassifyTreeList, getCgLabelPageList, getMetaTableCollectList, cgTaskSave, cgTaskUpdate } from "@/api/modules/dataInventory";
11 13
12 const { proxy } = getCurrentInstance() as any; 14 const { proxy } = getCurrentInstance() as any;
13 const router = useRouter(); 15 const router = useRouter();
14 const route = useRoute(); 16 const route = useRoute();
17 const userStore = useUserStore();
18 const fullPath = route.fullPath;
19 const assetStore = useDataAssetStore();
15 20
21 const loading = ref(false);
16 const step = ref(0); 22 const step = ref(0);
17 const selectIndex = ref(0); 23 const selectIndex = ref('');
18 const taskDetail = ref({}); 24 const taskDetail = ref({});
19 const asideSearchInput = ref(""); 25 const asideSearchInput = ref("");
20 const permissionList: any = ref([]) 26 const permissionList: any = ref([])
...@@ -56,6 +62,7 @@ const taskFormItems: any = ref([ ...@@ -56,6 +62,7 @@ const taskFormItems: any = ref([
56 field: 'taskName', 62 field: 'taskName',
57 default: '', 63 default: '',
58 maxlength: 50, 64 maxlength: 50,
65 clearable: true,
59 required: true 66 required: true
60 }, 67 },
61 { 68 {
...@@ -65,6 +72,7 @@ const taskFormItems: any = ref([ ...@@ -65,6 +72,7 @@ const taskFormItems: any = ref([
65 field: 'cgDirName', 72 field: 'cgDirName',
66 default: '', 73 default: '',
67 maxlength: 50, 74 maxlength: 50,
75 clearable: true,
68 required: true 76 required: true
69 }, 77 },
70 ]) 78 ])
...@@ -190,9 +198,10 @@ const getTableData = () => { ...@@ -190,9 +198,10 @@ const getTableData = () => {
190 }; 198 };
191 199
192 const toPath = () => { 200 const toPath = () => {
201 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
202 assetStore.set(true);
193 router.push({ 203 router.push({
194 name: "taskConfig", 204 name: "taskConfig",
195 query: {},
196 }); 205 });
197 } 206 }
198 207
...@@ -222,7 +231,7 @@ const getMetaTableData = () => { ...@@ -222,7 +231,7 @@ const getMetaTableData = () => {
222 if (route.query.type === 'edit') { 231 if (route.query.type === 'edit') {
223 nextTick(() => { 232 nextTick(() => {
224 data.map((row) => { 233 data.map((row) => {
225 taskDetail.value.metaGuids.indexOf(row.guid) > -1 && metadataTableRef.value.tableRef.toggleRowSelection(row, true); 234 taskDetail.value.metaGuids.indexOf(row.databaseGuid) > -1 && metadataTableRef.value.tableRef.toggleRowSelection(row, true);
226 }); 235 });
227 }) 236 })
228 } 237 }
...@@ -258,7 +267,9 @@ const btnClick = async (btn, bType = null) => { ...@@ -258,7 +267,9 @@ const btnClick = async (btn, bType = null) => {
258 const subForm = { ...form }; 267 const subForm = { ...form };
259 submitForm(formEl, subForm); 268 submitForm(formEl, subForm);
260 } else { 269 } else {
261 toPath() 270 router.push({
271 name: "taskConfig",
272 });
262 } 273 }
263 }; 274 };
264 275
...@@ -266,6 +277,7 @@ const submitForm = (formEl, info) => { ...@@ -266,6 +277,7 @@ const submitForm = (formEl, info) => {
266 if (!formEl) return; 277 if (!formEl) return;
267 formEl.validate((valid, fields) => { 278 formEl.validate((valid, fields) => {
268 if (valid) { 279 if (valid) {
280 loading.value = true;
269 const params = { 281 const params = {
270 classifyGuid: templateInfo.value.guid, 282 classifyGuid: templateInfo.value.guid,
271 metaGuids: selectRowData.value, 283 metaGuids: selectRowData.value,
...@@ -275,6 +287,7 @@ const submitForm = (formEl, info) => { ...@@ -275,6 +287,7 @@ const submitForm = (formEl, info) => {
275 params.guid = taskDetail.value.guid; 287 params.guid = taskDetail.value.guid;
276 params.execGuid = taskDetail.value.execGuid; 288 params.execGuid = taskDetail.value.execGuid;
277 cgTaskUpdate(params).then((res: any) => { 289 cgTaskUpdate(params).then((res: any) => {
290 loading.value = false;
278 if (res.code == proxy.$passCode) { 291 if (res.code == proxy.$passCode) {
279 toPath() 292 toPath()
280 } else { 293 } else {
...@@ -288,9 +301,11 @@ const submitForm = (formEl, info) => { ...@@ -288,9 +301,11 @@ const submitForm = (formEl, info) => {
288 type: "error", 301 type: "error",
289 message: '请求失败', 302 message: '请求失败',
290 }); 303 });
304 loading.value = false;
291 }) 305 })
292 } else { 306 } else {
293 cgTaskSave(params).then((res: any) => { 307 cgTaskSave(params).then((res: any) => {
308 loading.value = false;
294 if (res.code == proxy.$passCode) { 309 if (res.code == proxy.$passCode) {
295 toPath() 310 toPath()
296 } else { 311 } else {
...@@ -304,6 +319,7 @@ const submitForm = (formEl, info) => { ...@@ -304,6 +319,7 @@ const submitForm = (formEl, info) => {
304 type: "error", 319 type: "error",
305 message: '请求失败', 320 message: '请求失败',
306 }); 321 });
322 loading.value = false;
307 }) 323 })
308 } 324 }
309 } else { 325 } else {
...@@ -322,6 +338,7 @@ const handleScroll = () => { ...@@ -322,6 +338,7 @@ const handleScroll = () => {
322 338
323 // 点击分类列表 339 // 点击分类列表
324 const listClick = (row) => { 340 const listClick = (row) => {
341 selectIndex.value = row.guid;
325 templateInfo.value = row; 342 templateInfo.value = row;
326 getClassifyTree(); 343 getClassifyTree();
327 searchItemValue.value.classifyGuid = row.guid; 344 searchItemValue.value.classifyGuid = row.guid;
...@@ -409,7 +426,7 @@ onMounted(() => { ...@@ -409,7 +426,7 @@ onMounted(() => {
409 </script> 426 </script>
410 427
411 <template> 428 <template>
412 <div class="container_wrap full flex"> 429 <div class="container_wrap full flex" v-loading="loading">
413 <div class="aside_wrap" v-show="step == 0"> 430 <div class="aside_wrap" v-show="step == 0">
414 <div class="aside_title">选择分类</div> 431 <div class="aside_title">选择分类</div>
415 <!-- <div class="aside_search"> 432 <!-- <div class="aside_search">
...@@ -417,8 +434,8 @@ onMounted(() => { ...@@ -417,8 +434,8 @@ onMounted(() => {
417 @change="querySearch" /> 434 @change="querySearch" />
418 </div> --> 435 </div> -->
419 <div class="aside_list" v-loading="listLoading" v-infinite-scroll="handleScroll"> 436 <div class="aside_list" v-loading="listLoading" v-infinite-scroll="handleScroll">
420 <div class="list_item" v-for="(item, i) in currpermissionList" :class="{ active: selectIndex == i }" 437 <div class="list_item" v-for="(item, i) in currpermissionList" :class="{ active: selectIndex == item.guid }"
421 @click="selectIndex = i; listClick(item);" v-preReClick>{{ item.name }}</div> 438 @click="listClick(item);" v-preReClick>{{ item.name }}</div>
422 </div> 439 </div>
423 </div> 440 </div>
424 <div class="main_wrap" :class="{ full: step == 1 }"> 441 <div class="main_wrap" :class="{ full: step == 1 }">
......
...@@ -131,11 +131,11 @@ const getFirstPageData = () => { ...@@ -131,11 +131,11 @@ const getFirstPageData = () => {
131 } 131 }
132 132
133 onActivated(() => { 133 onActivated(() => {
134 getFirstPageData() 134 // getFirstPageData()
135 }) 135 })
136 136
137 onBeforeMount(() => { 137 onBeforeMount(() => {
138 138 getFirstPageData()
139 }) 139 })
140 140
141 </script> 141 </script>
...@@ -170,7 +170,7 @@ onBeforeMount(() => { ...@@ -170,7 +170,7 @@ onBeforeMount(() => {
170 .table_panel_wrap { 170 .table_panel_wrap {
171 width: 100%; 171 width: 100%;
172 height: 100%; 172 height: 100%;
173 padding: 0px 8px 0; 173 padding: 12px 8px 0;
174 } 174 }
175 175
176 .card-noData { 176 .card-noData {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!