4f833571 by lxs

分类分级任务联调

1 parent 2c8abf69
...@@ -103,7 +103,7 @@ const fieldItemList = ref([ ...@@ -103,7 +103,7 @@ const fieldItemList = ref([
103 { 103 {
104 type: "select", 104 type: "select",
105 label: "", 105 label: "",
106 placeholder: '变更类型', 106 placeholder: '确认状态',
107 field: 'changeStatus', 107 field: 'changeStatus',
108 default: '', 108 default: '',
109 options: [ 109 options: [
...@@ -185,8 +185,6 @@ const fieldItemList = ref([ ...@@ -185,8 +185,6 @@ const fieldItemList = ref([
185 }, 185 },
186 ]); 186 ]);
187 187
188 const checked1 = ref(false);
189
190 const page = ref({ 188 const page = ref({
191 limit: 50, 189 limit: 50,
192 curr: 1, 190 curr: 1,
...@@ -235,7 +233,7 @@ const fieldTableInfo = ref({ ...@@ -235,7 +233,7 @@ const fieldTableInfo = ref({
235 fields: [ 233 fields: [
236 { label: "序号", type: "index", width: 56, align: "center", fixed: "left" }, 234 { label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
237 { 235 {
238 label: "确认状态", field: "changeStatus", width: 140, align: 'center', type: "tag", getName: (scope) => { 236 label: "确认状态", field: "changeStatus", width: 96, align: 'center', type: "tag", getName: (scope) => {
239 return filterVal(scope.row.changeStatus, 'changeStatus'); 237 return filterVal(scope.row.changeStatus, 'changeStatus');
240 }, tagType: (scope) => { 238 }, tagType: (scope) => {
241 return scope.row.changeStatus == 'Y' ? 'success' : 'warning'; 239 return scope.row.changeStatus == 'Y' ? 'success' : 'warning';
...@@ -268,14 +266,6 @@ const fieldTableInfo = ref({ ...@@ -268,14 +266,6 @@ const fieldTableInfo = ref({
268 }, 266 },
269 { 267 {
270 label: "分级", field: "gradeDetailName", width: 120, type: 'select', options: [], props: { label: 'gradeName', value: 'guid' }, 268 label: "分级", field: "gradeDetailName", width: 120, type: 'select', options: [], props: { label: 'gradeName', value: 'guid' },
271 // getName: (scope) => {
272 // if (scope.row['STATE'] === 'Running') {
273 // const classifyNames = scope.row.gradeGuid || '';
274 // return classifyNames;
275 // } else {
276 // return scope.row.gradeDetailName || '--';
277 // }
278 // }
279 }, 269 },
280 { label: "标签", field: "label", width: 96 }, 270 { label: "标签", field: "label", width: 96 },
281 { label: "规则", field: "ruleDetail", width: 200 }, 271 { label: "规则", field: "ruleDetail", width: 200 },
...@@ -401,7 +391,7 @@ const getGradeData = () => { ...@@ -401,7 +391,7 @@ const getGradeData = () => {
401 }) 391 })
402 } 392 }
403 393
404 // 获取字段统计 394 // 获取分类树形数据
405 const getFieldTree = () => { 395 const getFieldTree = () => {
406 treeInfo.value.loading = true; 396 treeInfo.value.loading = true;
407 getTaskExeTreeList({ execGuid: taskDetail.value.execGuid }).then((res: any) => { 397 getTaskExeTreeList({ execGuid: taskDetail.value.execGuid }).then((res: any) => {
...@@ -425,7 +415,7 @@ const getFieldTree = () => { ...@@ -425,7 +415,7 @@ const getFieldTree = () => {
425 } 415 }
426 416
427 // 获取库、表、字段信息 417 // 获取库、表、字段信息
428 const getSheetFieldList = (params, tId) => { 418 const getSheetFieldList = (params, tId = null) => {
429 getDbFieldList({ execGuid: taskDetail.value.execGuid, ...params }).then(res => { 419 getDbFieldList({ execGuid: taskDetail.value.execGuid, ...params }).then(res => {
430 if (res.code == proxy.$passCode) { 420 if (res.code == proxy.$passCode) {
431 const data = res.data || []; 421 const data = res.data || [];
...@@ -437,7 +427,7 @@ const getSheetFieldList = (params, tId) => { ...@@ -437,7 +427,7 @@ const getSheetFieldList = (params, tId) => {
437 sheetItemList.value[1].options = JSON.parse(JSON.stringify(data)); 427 sheetItemList.value[1].options = JSON.parse(JSON.stringify(data));
438 } else { 428 } else {
439 fieldItemList.value[2].options = JSON.parse(JSON.stringify(data)); 429 fieldItemList.value[2].options = JSON.parse(JSON.stringify(data));
440 if(tId){ 430 if (tId) {
441 fieldItemList.value[2].default = tId; 431 fieldItemList.value[2].default = tId;
442 } 432 }
443 } 433 }
...@@ -461,7 +451,10 @@ const nodeClick = (data) => { ...@@ -461,7 +451,10 @@ const nodeClick = (data) => {
461 } else if (data.guid == 'unclassified') { 451 } else if (data.guid == 'unclassified') {
462 getFieldTableData({ isClassify: 'N' }) 452 getFieldTableData({ isClassify: 'N' })
463 } else { 453 } else {
464 getFieldTableData({ isClassify: 'Y' }); 454 getFieldTableData({ isClassify: 'Y', classifyDetail: data.guid });
455 const parentGuids = data.parentGuids || [];
456 parentGuids.push(data.guid)
457 fieldItemList.value[4].default = parentGuids;
465 } 458 }
466 } 459 }
467 460
...@@ -491,7 +484,7 @@ const getSheetTableData = () => { ...@@ -491,7 +484,7 @@ const getSheetTableData = () => {
491 }; 484 };
492 485
493 // 获取字段表格数据 486 // 获取字段表格数据
494 const getFieldTableData = (param = {}) => { 487 const getFieldTableData = (param: any = {}) => {
495 fieldTableInfo.value.loading = true; 488 fieldTableInfo.value.loading = true;
496 let params: any = { 489 let params: any = {
497 ...fieldParams.value, 490 ...fieldParams.value,
...@@ -500,7 +493,6 @@ const getFieldTableData = (param = {}) => { ...@@ -500,7 +493,6 @@ const getFieldTableData = (param = {}) => {
500 pageIndex: fieldTableInfo.value.page.curr, 493 pageIndex: fieldTableInfo.value.page.curr,
501 pageSize: fieldTableInfo.value.page.limit, 494 pageSize: fieldTableInfo.value.page.limit,
502 } 495 }
503 params.classifyDetail = params.classifyName && params.classifyName.length ? params.classifyName.at(-1) : '';
504 delete params.classifyName 496 delete params.classifyName
505 execTaskFieldList(params).then((res: any) => { 497 execTaskFieldList(params).then((res: any) => {
506 fieldTableInfo.value.loading = false; 498 fieldTableInfo.value.loading = false;
...@@ -544,10 +536,13 @@ const tableBtnClick = (scope, btn) => { ...@@ -544,10 +536,13 @@ const tableBtnClick = (scope, btn) => {
544 currTableData.value = row; 536 currTableData.value = row;
545 if (type == 'tab') { 537 if (type == 'tab') {
546 tabsInfo.value.activeName = 'field'; 538 tabsInfo.value.activeName = 'field';
547 getFieldTableData({ databaseGuid: row.databaseGuid, tableGuid: row.tableGuid }); 539 fieldItemList.value.map(item => item.default = '')
548 fieldItemList.value[1].default = row.databaseGuid; 540 fieldItemList.value[1].default = row.databaseGuid;
549 fieldItemList.value[2].disabled = false; 541 fieldItemList.value[2].disabled = false;
542 treeInfo.value.expandedKey = ['all'];
543 treeInfoRef.value.setCurrentKey('all');
550 getSheetFieldList({ type: 2, databaseGuid: row.databaseGuid }, row.tableGuid); 544 getSheetFieldList({ type: 2, databaseGuid: row.databaseGuid }, row.tableGuid);
545 getFieldTableData({ databaseGuid: row.databaseGuid, tableGuid: row.tableGuid });
551 } else if (type == "edit") { 546 } else if (type == "edit") {
552 row.STATE = 'Running'; 547 row.STATE = 'Running';
553 } else if (type == 'save') { 548 } else if (type == 'save') {
...@@ -648,9 +643,9 @@ const searchField = (val: any, clear: boolean = false) => { ...@@ -648,9 +643,9 @@ const searchField = (val: any, clear: boolean = false) => {
648 getFieldTableData(); 643 getFieldTableData();
649 }; 644 };
650 645
651 const checkboxChange = (val) => { 646 const cascaderChange = (val, row) => {
652 getFieldTableData({ isClassify: val ? 'N' : 'Y' }); 647 console.log(val, row);
653 } 648 };
654 649
655 const selectChange = (val, item, scope = null) => { 650 const selectChange = (val, item, scope = null) => {
656 if (scope) { 651 if (scope) {
...@@ -806,17 +801,13 @@ onBeforeMount(() => { ...@@ -806,17 +801,13 @@ onBeforeMount(() => {
806 <div class="box_right"> 801 <div class="box_right">
807 <div class="table_tool_wrap"> 802 <div class="table_tool_wrap">
808 <TableTools :searchItems="fieldItemList" :searchId="'field-search'" :init="false" 803 <TableTools :searchItems="fieldItemList" :searchId="'field-search'" :init="false"
809 @selectChange="selectChange" @search="searchField" /> 804 @selectChange="selectChange" @cascaderChange="cascaderChange" @search="searchField" />
810 <div class="tools_btns"> 805 <div class="tools_btns">
811 <div class="btns"> 806 <div class="btns">
812 <el-button type="primary" plain @click="btnClick({ value: 'batch' })">批量变量分类分级</el-button> 807 <el-button type="primary" plain @click="btnClick({ value: 'batch' })">批量变量分类分级</el-button>
813 <el-button plain @click="btnClick({ value: 'import' })">导入</el-button> 808 <el-button plain @click="btnClick({ value: 'import' })">导入</el-button>
814 <el-button plain @click="btnClick({ value: 'export' })">导出</el-button> 809 <el-button plain @click="btnClick({ value: 'export' })">导出</el-button>
815 </div> 810 </div>
816 <div class="checkboxs">
817 <el-checkbox v-model="checked1" @change="(val) => checkboxChange(val)">仅看未分级分类</el-checkbox>
818 <!-- <el-checkbox v-model="checked2">仅看变更</el-checkbox> -->
819 </div>
820 </div> 811 </div>
821 </div> 812 </div>
822 <div class="table_panel_wrap panel"> 813 <div class="table_panel_wrap panel">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!