a4b59d52 by xukangle

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents 9a3281b5 1312546d
...@@ -189,6 +189,8 @@ const fieldItemList = ref([ ...@@ -189,6 +189,8 @@ const fieldItemList = ref([
189 clearable: true, 189 clearable: true,
190 }, 190 },
191 ]); 191 ]);
192
193 const checked1 = ref(false);
192 const tableToolRef = ref(); 194 const tableToolRef = ref();
193 const toolH = ref(49); 195 const toolH = ref(49);
194 const page = ref({ 196 const page = ref({
...@@ -389,6 +391,7 @@ const getTaskDetail = (param) => { ...@@ -389,6 +391,7 @@ const getTaskDetail = (param) => {
389 }) 391 })
390 } else { 392 } else {
391 ElMessage.error(res.msg); 393 ElMessage.error(res.msg);
394 loading.value = false;
392 } 395 }
393 }).catch(() => { 396 }).catch(() => {
394 loading.value = false; 397 loading.value = false;
...@@ -403,7 +406,10 @@ const getFieldCount = () => { ...@@ -403,7 +406,10 @@ const getFieldCount = () => {
403 fieldCounts.value = data; 406 fieldCounts.value = data;
404 } else { 407 } else {
405 ElMessage.error(res.msg); 408 ElMessage.error(res.msg);
409 loading.value = false;
406 } 410 }
411 }).catch(() => {
412 loading.value = false;
407 }) 413 })
408 } 414 }
409 415
...@@ -419,15 +425,17 @@ const getGradeData = () => { ...@@ -419,15 +425,17 @@ const getGradeData = () => {
419 fieldTableInfo.value.fields[5].options = JSON.parse(JSON.stringify(data)); 425 fieldTableInfo.value.fields[5].options = JSON.parse(JSON.stringify(data));
420 } else { 426 } else {
421 ElMessage.error(res.msg); 427 ElMessage.error(res.msg);
428 loading.value = false;
422 } 429 }
430 }).catch(() => {
431 loading.value = false;
423 }) 432 })
424 } 433 }
425 434
426 // 获取分类树形数据 435 // 获取分类树形数据
427 const getFieldTree = () => { 436 const getFieldTree = () => {
428 treeInfo.value.loading = true;
429 getTaskExeTreeList({ execGuid: taskDetail.value.execGuid }).then((res: any) => { 437 getTaskExeTreeList({ execGuid: taskDetail.value.execGuid }).then((res: any) => {
430 treeInfo.value.loading = false; 438 // treeInfo.value.loading = false;
431 if (res.code == proxy.$passCode) { 439 if (res.code == proxy.$passCode) {
432 const data = res.data || []; 440 const data = res.data || [];
433 const children: any = [ 441 const children: any = [
...@@ -443,15 +451,16 @@ const getFieldTree = () => { ...@@ -443,15 +451,16 @@ const getFieldTree = () => {
443 fieldTableInfo.value.fields[4].options = JSON.parse(JSON.stringify(data)); 451 fieldTableInfo.value.fields[4].options = JSON.parse(JSON.stringify(data));
444 } else { 452 } else {
445 ElMessage.error(res.msg); 453 ElMessage.error(res.msg);
454 loading.value = false;
446 } 455 }
447 }).catch(() => { 456 }).catch(() => {
448 treeInfo.value.loading = false; 457 loading.value = false;
449 }) 458 })
450 } 459 }
451 460
452 // 获取库、表、字段信息 461 // 获取库、表、字段信息
453 const getSheetFieldList = (params, tId = null) => { 462 const getSheetFieldList = (params, tId = null) => {
454 getDbFieldList({ execGuid: taskDetail.value.execGuid, ...params }).then(res => { 463 getDbFieldList({ execGuid: taskDetail.value.execGuid, ...params }).then((res: any) => {
455 if (res.code == proxy.$passCode) { 464 if (res.code == proxy.$passCode) {
456 const data = res.data || []; 465 const data = res.data || [];
457 if (params.type == 1) { 466 if (params.type == 1) {
...@@ -473,7 +482,10 @@ const getSheetFieldList = (params, tId = null) => { ...@@ -473,7 +482,10 @@ const getSheetFieldList = (params, tId = null) => {
473 } 482 }
474 } else { 483 } else {
475 ElMessage.error(res.msg); 484 ElMessage.error(res.msg);
485 loading.value = false;
476 } 486 }
487 }).catch(() => {
488 loading.value = false;
477 }) 489 })
478 } 490 }
479 491
...@@ -497,7 +509,7 @@ const nodeClick = (data, node) => { ...@@ -497,7 +509,7 @@ const nodeClick = (data, node) => {
497 509
498 // 获取库表数据 510 // 获取库表数据
499 const getSheetTableData = () => { 511 const getSheetTableData = () => {
500 sheetTableInfo.value.loading = true; 512 loading.value = true;
501 const sheetParams = sheetSearchRef.value.toolSearch.formInline || {}; 513 const sheetParams = sheetSearchRef.value.toolSearch.formInline || {};
502 execTaskSheetList( 514 execTaskSheetList(
503 Object.assign({}, { ...sheetParams }, { 515 Object.assign({}, { ...sheetParams }, {
...@@ -506,7 +518,7 @@ const getSheetTableData = () => { ...@@ -506,7 +518,7 @@ const getSheetTableData = () => {
506 pageSize: sheetTableInfo.value.page.limit, 518 pageSize: sheetTableInfo.value.page.limit,
507 }) 519 })
508 ).then((res: any) => { 520 ).then((res: any) => {
509 sheetTableInfo.value.loading = false; 521 loading.value = false;
510 if (res.code == proxy.$passCode) { 522 if (res.code == proxy.$passCode) {
511 sheetTableInfo.value.data = res.data.records || []; 523 sheetTableInfo.value.data = res.data.records || [];
512 sheetTableInfo.value.page.curr = res.data.pageIndex; 524 sheetTableInfo.value.page.curr = res.data.pageIndex;
...@@ -517,19 +529,20 @@ const getSheetTableData = () => { ...@@ -517,19 +529,20 @@ const getSheetTableData = () => {
517 } 529 }
518 }) 530 })
519 .catch((res) => { 531 .catch((res) => {
520 fieldTableInfo.value.loading = false; 532 loading.value = false;
521 }); 533 });
522 }; 534 };
523 535
524 // 获取字段表格数据 536 // 获取字段表格数据
525 const getFieldTableData = () => { 537 const getFieldTableData = () => {
526 fieldTableInfo.value.loading = true; 538 loading.value = true;
527 const fieldParams = fieldSearchRef.value.toolSearch.formInline || {}; 539 const fieldParams = fieldSearchRef.value.toolSearch.formInline || {};
528 let params: any = { 540 let params: any = {
529 ...fieldParams, 541 ...fieldParams,
530 execGuid: taskDetail.value.execGuid, 542 execGuid: taskDetail.value.execGuid,
531 pageIndex: fieldTableInfo.value.page.curr, 543 pageIndex: fieldTableInfo.value.page.curr,
532 pageSize: fieldTableInfo.value.page.limit, 544 pageSize: fieldTableInfo.value.page.limit,
545 isMergeClassify: checked1.value ? 'Y' : 'N'
533 } 546 }
534 const classifyName = params.classifyName?.at(-1) || undefined; 547 const classifyName = params.classifyName?.at(-1) || undefined;
535 params.isClassify = classifyName === undefined ? '' : classifyName == 'unclassified' ? 'N' : 'Y'; 548 params.isClassify = classifyName === undefined ? '' : classifyName == 'unclassified' ? 'N' : 'Y';
...@@ -538,7 +551,7 @@ const getFieldTableData = () => { ...@@ -538,7 +551,7 @@ const getFieldTableData = () => {
538 } 551 }
539 delete params.classifyName 552 delete params.classifyName
540 execTaskFieldList(params).then((res: any) => { 553 execTaskFieldList(params).then((res: any) => {
541 fieldTableInfo.value.loading = false; 554 loading.value = false;
542 if (res.code == proxy.$passCode) { 555 if (res.code == proxy.$passCode) {
543 let data = res.data.records || []; 556 let data = res.data.records || [];
544 data.map(item => item.STATE = ''); 557 data.map(item => item.STATE = '');
...@@ -551,7 +564,7 @@ const getFieldTableData = () => { ...@@ -551,7 +564,7 @@ const getFieldTableData = () => {
551 } 564 }
552 }) 565 })
553 .catch((res) => { 566 .catch((res) => {
554 fieldTableInfo.value.loading = false; 567 loading.value = false;
555 }); 568 });
556 }; 569 };
557 570
...@@ -630,6 +643,7 @@ const btnClick = async (btn, bType = null) => { ...@@ -630,6 +643,7 @@ const btnClick = async (btn, bType = null) => {
630 ElMessage.warning('请选择需要操作的数据'); 643 ElMessage.warning('请选择需要操作的数据');
631 return 644 return
632 } 645 }
646 formItems.value.map(f => f.default = f.field == 'gradeGuid' ? '' : []);
633 dialogInfo.value.visible = true; 647 dialogInfo.value.visible = true;
634 } else if (type == 'cancel') { 648 } else if (type == 'cancel') {
635 router.push({ 649 router.push({
...@@ -637,24 +651,24 @@ const btnClick = async (btn, bType = null) => { ...@@ -637,24 +651,24 @@ const btnClick = async (btn, bType = null) => {
637 }); 651 });
638 } else if (type == 'confirm') { 652 } else if (type == 'confirm') {
639 saveTask(); 653 saveTask();
640 } else if(type == 'status'){ 654 } else if (type == 'status') {
641 if (selectRowData.value.length == 0) { 655 if (selectRowData.value.length == 0) {
642 ElMessage.warning('请选择需要操作的数据'); 656 ElMessage.warning('请选择需要操作的数据');
643 } else { 657 } else {
644 let toChange = true, params:any = []; 658 let toChange = true, params: any = [];
645 selectRowData.value.map((item: any) => { 659 selectRowData.value.map((item: any) => {
646 if(!item.classifyDetailGuid || !item.gradeDetailGuid){ 660 if (!item.classifyDetailGuid || !item.gradeDetailGuid) {
647 toChange=false 661 toChange = false
648 } 662 }
649 params.push(item.guid) 663 params.push(item.guid)
650 }) 664 })
651 if(!toChange){ 665 if (!toChange) {
652 ElMessage.warning('所选数据分类分级均不能为空'); 666 ElMessage.warning('所选数据分类分级均不能为空');
653 return 667 return
654 } 668 }
655 saveStatus(params); 669 saveStatus(params);
656 } 670 }
657 } else if(type == 'export'){ 671 } else if (type == 'export') {
658 672
659 } 673 }
660 }; 674 };
...@@ -666,7 +680,7 @@ const saveFields = (params, isBatch = false) => { ...@@ -666,7 +680,7 @@ const saveFields = (params, isBatch = false) => {
666 loading.value = false; 680 loading.value = false;
667 if (res.code == proxy.$passCode) { 681 if (res.code == proxy.$passCode) {
668 ElMessage.success('保存成功'); 682 ElMessage.success('保存成功');
669 if(isBatch){ 683 if (isBatch) {
670 getFieldTableData(); 684 getFieldTableData();
671 } else { 685 } else {
672 currTableData.value.changeStatus = 'Y'; 686 currTableData.value.changeStatus = 'Y';
...@@ -723,6 +737,8 @@ const searchSheet = (val: any, clear: boolean = false) => { ...@@ -723,6 +737,8 @@ const searchSheet = (val: any, clear: boolean = false) => {
723 const searchField = (val: any, clear: boolean = false) => { 737 const searchField = (val: any, clear: boolean = false) => {
724 if (clear) { 738 if (clear) {
725 fieldItemList.value.map(item => item.default = '') 739 fieldItemList.value.map(item => item.default = '')
740 treeInfo.value.expandedKey = ['all'];
741 treeInfoRef.value.setCurrentKey('all');
726 } 742 }
727 fieldParams.value = Object.assign({}, { ...fieldParams.value }, { ...val }); 743 fieldParams.value = Object.assign({}, { ...fieldParams.value }, { ...val });
728 getFieldTableData(); 744 getFieldTableData();
...@@ -935,6 +951,9 @@ onMounted(() => { ...@@ -935,6 +951,9 @@ onMounted(() => {
935 <el-button type="primary" plain @click="btnClick({ value: 'status' })">批量确认</el-button> 951 <el-button type="primary" plain @click="btnClick({ value: 'status' })">批量确认</el-button>
936 <el-button plain @click="btnClick({ value: 'export' })">导出</el-button> 952 <el-button plain @click="btnClick({ value: 'export' })">导出</el-button>
937 </div> 953 </div>
954 <div class="checkboxs">
955 <el-checkbox v-model="checked1" @change="getFieldTableData()">仅看多分级分类</el-checkbox>
956 </div>
938 </div> 957 </div>
939 </div> 958 </div>
940 <div class="table_panel_wrap panel" :style="{ height: 'calc(100% - ' + toolH + 'px)' }"> 959 <div class="table_panel_wrap panel" :style="{ height: 'calc(100% - ' + toolH + 'px)' }">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!