Merge branch 'develop' into dev_20241202_xukangle
Showing
6 changed files
with
197 additions
and
87 deletions
| ... | @@ -69,7 +69,7 @@ export const saveMetaReportAnalysis = (params) => request({ | ... | @@ -69,7 +69,7 @@ export const saveMetaReportAnalysis = (params) => request({ |
| 69 | **/ | 69 | **/ |
| 70 | // 树形数据 | 70 | // 树形数据 |
| 71 | export const getMetaTreeData = (params) => request({ | 71 | export const getMetaTreeData = (params) => request({ |
| 72 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list`, | 72 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list?isImportCreate=${params.isImportCreate}`, |
| 73 | method: 'post', | 73 | method: 'post', |
| 74 | data: params | 74 | data: params |
| 75 | }) | 75 | }) | ... | ... |
| ... | @@ -81,6 +81,13 @@ export const getDatabase = (params) => request({ | ... | @@ -81,6 +81,13 @@ export const getDatabase = (params) => request({ |
| 81 | data: params | 81 | data: params |
| 82 | }) | 82 | }) |
| 83 | 83 | ||
| 84 | /** 获取盘点的数据库目录 */ | ||
| 85 | export const getInventoryDsDir = () => request({ | ||
| 86 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/tree-list`, | ||
| 87 | method: 'post', | ||
| 88 | data: {} | ||
| 89 | }) | ||
| 90 | |||
| 84 | /** 新建质检表,获取主题域分层的主题表树结构 */ | 91 | /** 新建质检表,获取主题域分层的主题表树结构 */ |
| 85 | export const getSubjectTableTree = (params) => request({ | 92 | export const getSubjectTableTree = (params) => request({ |
| 86 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-directory/directory-tree-list`, | 93 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-directory/directory-tree-list`, |
| ... | @@ -95,10 +102,10 @@ export const getSubjectTableByDomain = (params) => request({ | ... | @@ -95,10 +102,10 @@ export const getSubjectTableByDomain = (params) => request({ |
| 95 | data: params | 102 | data: params |
| 96 | }) | 103 | }) |
| 97 | 104 | ||
| 98 | /** 获取主题表的字段列表 */ | 105 | /** 获取主题表的字段列表,目前应包括盘点目录和元数据目录的表及字段 */ |
| 99 | export const getSubjectFields = (params) => request({ | 106 | export const getSubjectFields = (tableGuid, dataSource) => request({ |
| 100 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-subject/field/list?subjectGuid=${params}`, | 107 | url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/field/list-by-subject-guid?tableGuid=${tableGuid}&dataSource=${dataSource}`, |
| 101 | method: 'get', | 108 | method: 'post', |
| 102 | }) | 109 | }) |
| 103 | 110 | ||
| 104 | /** 表的逻辑条件和sql检验。 */ | 111 | /** 表的逻辑条件和sql检验。 */ | ... | ... |
| ... | @@ -255,10 +255,12 @@ const groupTableInfo = ref({ | ... | @@ -255,10 +255,12 @@ const groupTableInfo = ref({ |
| 255 | label: "操作", | 255 | label: "操作", |
| 256 | type: "btn", | 256 | type: "btn", |
| 257 | width: 92, | 257 | width: 92, |
| 258 | btns: [ | 258 | btns: (scope) => { |
| 259 | { label: "编辑", value: "edit" }, | 259 | return [ |
| 260 | { label: "删除", value: "delete" }, | 260 | { label: "编辑", value: "edit", disabled: scope.row.dataSource != '5' }, |
| 261 | ], | 261 | { label: "删除", value: "delete", disabled: scope.row.dataSource != '5' }, |
| 262 | ] | ||
| 263 | }, | ||
| 262 | } | 264 | } |
| 263 | }); | 265 | }); |
| 264 | 266 | ||
| ... | @@ -402,7 +404,8 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -402,7 +404,8 @@ const tableBtnClick = (scope, btn) => { |
| 402 | name: 'ruleTemplate', | 404 | name: 'ruleTemplate', |
| 403 | query: { | 405 | query: { |
| 404 | modelGuid: row.guid, | 406 | modelGuid: row.guid, |
| 405 | name: row.name | 407 | name: row.name, |
| 408 | dataSource: row.dataSource | ||
| 406 | } | 409 | } |
| 407 | }); | 410 | }); |
| 408 | } else if (type == "delete") { | 411 | } else if (type == "delete") { |
| ... | @@ -429,9 +432,10 @@ const open = (msg, type, isBatch = false) => { | ... | @@ -429,9 +432,10 @@ const open = (msg, type, isBatch = false) => { |
| 429 | if (res.code == proxy.$passCode) { | 432 | if (res.code == proxy.$passCode) { |
| 430 | page.value.curr = 1; | 433 | page.value.curr = 1; |
| 431 | getTableData(); | 434 | getTableData(); |
| 432 | let node = qualityModelTreeRef.value.treeRef.store.nodesMap[currTableData.value.modelGroupGuid]; | 435 | // let node = qualityModelTreeRef.value.treeRef.store.nodesMap[currTableData.value.modelGroupGuid]; |
| 433 | node.loaded = false; | 436 | // node.loaded = false; |
| 434 | node.expand(); | 437 | // node.expand(); |
| 438 | getQualityGroupTreeData(); | ||
| 435 | ElMessage.success('删除成功'); | 439 | ElMessage.success('删除成功'); |
| 436 | } else { | 440 | } else { |
| 437 | ElMessage.error(res.msg); | 441 | ElMessage.error(res.msg); |
| ... | @@ -489,6 +493,7 @@ const groupTableBtnClick = (scope, btn) => { | ... | @@ -489,6 +493,7 @@ const groupTableBtnClick = (scope, btn) => { |
| 489 | type: "success", | 493 | type: "success", |
| 490 | message: "删除分组成功", | 494 | message: "删除分组成功", |
| 491 | }); | 495 | }); |
| 496 | getQualityGroupTreeData(); | ||
| 492 | } else { | 497 | } else { |
| 493 | ElMessage({ | 498 | ElMessage({ |
| 494 | type: "error", | 499 | type: "error", |
| ... | @@ -608,9 +613,10 @@ const ruleOpen = (msg, type, isBatch = false) => { | ... | @@ -608,9 +613,10 @@ const ruleOpen = (msg, type, isBatch = false) => { |
| 608 | deleteQualityTableRule(guids).then((res: any) => { | 613 | deleteQualityTableRule(guids).then((res: any) => { |
| 609 | if (res.code == proxy.$passCode) { | 614 | if (res.code == proxy.$passCode) { |
| 610 | getRuleTableData(); | 615 | getRuleTableData(); |
| 611 | let node = qualityModelTreeRef.value.treeRef.store.nodesMap[lastSelectNode.value.data.guid]; | 616 | // let node = qualityModelTreeRef.value.treeRef.store.nodesMap[lastSelectNode.value.data.guid]; |
| 612 | node.loaded = false; | 617 | // node.loaded = false; |
| 613 | node.expand(); | 618 | // node.expand(); |
| 619 | getQualityGroupTreeData(); | ||
| 614 | ElMessage.success('删除质检表成功'); | 620 | ElMessage.success('删除质检表成功'); |
| 615 | } else { | 621 | } else { |
| 616 | ElMessage.error(res.msg); | 622 | ElMessage.error(res.msg); |
| ... | @@ -639,7 +645,8 @@ const clickCreateTable = () => { | ... | @@ -639,7 +645,8 @@ const clickCreateTable = () => { |
| 639 | name: 'ruleModel', | 645 | name: 'ruleModel', |
| 640 | query: { | 646 | query: { |
| 641 | groupGuid: page.value.modelGroupGuid, | 647 | groupGuid: page.value.modelGroupGuid, |
| 642 | name: lastSelectNode.value.data.name | 648 | name: lastSelectNode.value.data.name, |
| 649 | dataSource: lastSelectNode.value.data.dataSource | ||
| 643 | } | 650 | } |
| 644 | }); | 651 | }); |
| 645 | } | 652 | } |
| ... | @@ -650,7 +657,8 @@ const clickCreateRule = () => { | ... | @@ -650,7 +657,8 @@ const clickCreateRule = () => { |
| 650 | name: 'ruleTemplate', | 657 | name: 'ruleTemplate', |
| 651 | query: { | 658 | query: { |
| 652 | modelGuid: lastSelectNode.value.data.guid, | 659 | modelGuid: lastSelectNode.value.data.guid, |
| 653 | name: lastSelectNode.value.data.name | 660 | name: lastSelectNode.value.data.name, |
| 661 | dataSource: lastSelectNode.value.parent.data.dataSource | ||
| 654 | } | 662 | } |
| 655 | }); | 663 | }); |
| 656 | } | 664 | } |
| ... | @@ -744,6 +752,7 @@ let editSubmitPromise: any = ref(null); | ... | @@ -744,6 +752,7 @@ let editSubmitPromise: any = ref(null); |
| 744 | /** 新建分组对话框确定。 */ | 752 | /** 新建分组对话框确定。 */ |
| 745 | const dialogBtnClick = (btn, info) => { | 753 | const dialogBtnClick = (btn, info) => { |
| 746 | if (btn.value == 'submit') { | 754 | if (btn.value == 'submit') { |
| 755 | info.dataSource = '5'; | ||
| 747 | if (dialogInfo.value.type == 'add') { | 756 | if (dialogInfo.value.type == 'add') { |
| 748 | if (submitPromise.value) { | 757 | if (submitPromise.value) { |
| 749 | return; | 758 | return; |
| ... | @@ -753,6 +762,7 @@ const dialogBtnClick = (btn, info) => { | ... | @@ -753,6 +762,7 @@ const dialogBtnClick = (btn, info) => { |
| 753 | if (res.code == proxy.$passCode) { | 762 | if (res.code == proxy.$passCode) { |
| 754 | groupPage.value.curr = 1; | 763 | groupPage.value.curr = 1; |
| 755 | getGroupTableData(); | 764 | getGroupTableData(); |
| 765 | getQualityGroupTreeData(); | ||
| 756 | ElMessage({ | 766 | ElMessage({ |
| 757 | type: 'success', | 767 | type: 'success', |
| 758 | message: '新建分组成功' | 768 | message: '新建分组成功' |
| ... | @@ -779,6 +789,7 @@ const dialogBtnClick = (btn, info) => { | ... | @@ -779,6 +789,7 @@ const dialogBtnClick = (btn, info) => { |
| 779 | type: 'success', | 789 | type: 'success', |
| 780 | message: '编辑分组成功' | 790 | message: '编辑分组成功' |
| 781 | }) | 791 | }) |
| 792 | getQualityGroupTreeData(); | ||
| 782 | dialogInfo.value.visible = false; | 793 | dialogInfo.value.visible = false; |
| 783 | } else { | 794 | } else { |
| 784 | ElMessage({ | 795 | ElMessage({ |
| ... | @@ -862,8 +873,9 @@ onActivated(async () => { | ... | @@ -862,8 +873,9 @@ onActivated(async () => { |
| 862 | if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) { | 873 | if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) { |
| 863 | getTableData(); | 874 | getTableData(); |
| 864 | } | 875 | } |
| 865 | let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid]; | 876 | // let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid]; |
| 866 | node?.expand(); | 877 | // node?.expand(); |
| 878 | getQualityGroupTreeData(); | ||
| 867 | dataQualityStore.set(null); | 879 | dataQualityStore.set(null); |
| 868 | }); | 880 | }); |
| 869 | } else { | 881 | } else { |
| ... | @@ -871,8 +883,9 @@ onActivated(async () => { | ... | @@ -871,8 +883,9 @@ onActivated(async () => { |
| 871 | if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) { | 883 | if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) { |
| 872 | getTableData(); | 884 | getTableData(); |
| 873 | } | 885 | } |
| 874 | let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid]; | 886 | // let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid]; |
| 875 | node.expand(); | 887 | // node.expand(); |
| 888 | getQualityGroupTreeData(); | ||
| 876 | dataQualityStore.set(null); | 889 | dataQualityStore.set(null); |
| 877 | } | 890 | } |
| 878 | } | 891 | } | ... | ... |
| ... | @@ -6,8 +6,12 @@ import { | ... | @@ -6,8 +6,12 @@ import { |
| 6 | getSubjectFields, | 6 | getSubjectFields, |
| 7 | getSubjectTableTree, | 7 | getSubjectTableTree, |
| 8 | getSubjectTableByDomain, | 8 | getSubjectTableByDomain, |
| 9 | getCheckRulesList | 9 | getCheckRulesList, |
| 10 | getInventoryDsDir | ||
| 10 | } from '@/api/modules/dataQuality'; | 11 | } from '@/api/modules/dataQuality'; |
| 12 | import { | ||
| 13 | getMetaTreeData | ||
| 14 | } from '@/api/modules/dataMetaService'; | ||
| 11 | import Table from "@/components/Table/index.vue"; | 15 | import Table from "@/components/Table/index.vue"; |
| 12 | import Form from "@/components/Form/index.vue"; | 16 | import Form from "@/components/Form/index.vue"; |
| 13 | import { ElMessage } from "element-plus"; | 17 | import { ElMessage } from "element-plus"; |
| ... | @@ -48,7 +52,11 @@ const props = defineProps({ | ... | @@ -48,7 +52,11 @@ const props = defineProps({ |
| 48 | readonly: { | 52 | readonly: { |
| 49 | type: Boolean, | 53 | type: Boolean, |
| 50 | default: false | 54 | default: false |
| 51 | } | 55 | }, |
| 56 | dataSource: { | ||
| 57 | type: String, | ||
| 58 | default: '' | ||
| 59 | }, | ||
| 52 | }); | 60 | }); |
| 53 | 61 | ||
| 54 | watch(() => props.toSubjectTables, (val: any[]) => { | 62 | watch(() => props.toSubjectTables, (val: any[]) => { |
| ... | @@ -138,15 +146,15 @@ const rulesListByType: any = computed(() => { | ... | @@ -138,15 +146,15 @@ const rulesListByType: any = computed(() => { |
| 138 | char: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), | 146 | char: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), |
| 139 | varchar: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'id_card_rule' || r.value == 'phone_number_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), | 147 | varchar: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'id_card_rule' || r.value == 'phone_number_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), |
| 140 | int: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), | 148 | int: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), |
| 141 | date: checkRulesList.value.filter(r => r.value == 'date_format_rule' || r.value == 'custom_regular_rule'), | 149 | date: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'date_format_rule' || r.value == 'custom_regular_rule'), |
| 142 | datetime: checkRulesList.value.filter(r => r.value == 'date_format_rule' || r.value == 'custom_regular_rule'), | 150 | datetime: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'date_format_rule' || r.value == 'custom_regular_rule'), |
| 143 | timestamp: checkRulesList.value.filter(r => r.value == 'custom_regular_rule' || r.value == 'custom_regular_rule'), | 151 | timestamp: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'custom_regular_rule' || r.value == 'custom_regular_rule'), |
| 144 | // text: checkRulesList.value.filter(r => r.value == ''), | 152 | // text: checkRulesList.value.filter(r => r.value == ''), |
| 145 | decimal: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'precision_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), | 153 | decimal: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'precision_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), |
| 146 | // json: checkRulesList.value.filter(r => r.value == ''), | 154 | // json: checkRulesList.value.filter(r => r.value == ''), |
| 147 | tinyint: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), | 155 | tinyint: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'), |
| 148 | time: checkRulesList.value.filter(r => r.value == 'custom_regular_rule'), | 156 | time: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'custom_regular_rule'), |
| 149 | bit: checkRulesList.value.filter(r => r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'custom_regular_rule'), | 157 | bit: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'custom_regular_rule'), |
| 150 | } | 158 | } |
| 151 | }); | 159 | }); |
| 152 | 160 | ||
| ... | @@ -615,12 +623,52 @@ const submit = () => { | ... | @@ -615,12 +623,52 @@ const submit = () => { |
| 615 | } | 623 | } |
| 616 | 624 | ||
| 617 | const getSubjectTableTreeData = () => { | 625 | const getSubjectTableTreeData = () => { |
| 618 | return getSubjectTableTree({}).then((res: any) => { | 626 | if (props.dataSource == '4' || props.value.dataSource == '4') { |
| 627 | return getInventoryDsDir().then((res: any) => { | ||
| 619 | if (res.code == proxy.$passCode) { | 628 | if (res.code == proxy.$passCode) { |
| 620 | contrastSubjects.value = res.data || []; | 629 | contrastSubjects.value = res.data?.map(d => { |
| 621 | return res.data || []; | 630 | d.parentGuid = 0; |
| 631 | d.guid = d.databaseGuid; | ||
| 632 | d.name = d.databaseChName; | ||
| 633 | d.label = d.databaseChName + `(${d.database})`; | ||
| 634 | d.children = d.children?.map(child => { | ||
| 635 | child.parentGuid = d.guid; | ||
| 636 | child.label = child.tableChName + `(${child.tableName})`; | ||
| 637 | child.guid = child.tableGuid; | ||
| 638 | child.isLeaf = true; | ||
| 639 | child.dataServerName = d.database; | ||
| 640 | child.dataSourceGuid = d.databaseGuid; | ||
| 641 | child.parentGuid = d.databaseGuid; | ||
| 642 | return child; | ||
| 643 | }) | ||
| 644 | return d; | ||
| 645 | }) || []; | ||
| 622 | } | 646 | } |
| 623 | }) | 647 | }) |
| 648 | } else { | ||
| 649 | return getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => { | ||
| 650 | if (res.code == proxy.$passCode) { | ||
| 651 | contrastSubjects.value = res.data?.children?.map(d => { | ||
| 652 | d.parentGuid = 0; | ||
| 653 | d.label = d.name; | ||
| 654 | d.children = d.children?.map(child => { | ||
| 655 | child.label = child.name + `(${child.tableName})`; | ||
| 656 | child.isLeaf = true; | ||
| 657 | child.dataServerName = d.name; | ||
| 658 | child.dataSourceGuid = d.guid; | ||
| 659 | return child; | ||
| 660 | }) | ||
| 661 | return d; | ||
| 662 | }) || []; | ||
| 663 | } | ||
| 664 | }) | ||
| 665 | } | ||
| 666 | // return getSubjectTableTree({}).then((res: any) => { | ||
| 667 | // if (res.code == proxy.$passCode) { | ||
| 668 | // contrastSubjects.value = res.data || []; | ||
| 669 | // return res.data || []; | ||
| 670 | // } | ||
| 671 | // }) | ||
| 624 | } | 672 | } |
| 625 | 673 | ||
| 626 | const formBtnClick = (btn) => { | 674 | const formBtnClick = (btn) => { |
| ... | @@ -633,7 +681,7 @@ const formBtnClick = (btn) => { | ... | @@ -633,7 +681,7 @@ const formBtnClick = (btn) => { |
| 633 | nullSelectFields.value = cloneDeep(panelList.value[index].defaultValue); | 681 | nullSelectFields.value = cloneDeep(panelList.value[index].defaultValue); |
| 634 | if (props.toSubjectTables[0]?.guid) { | 682 | if (props.toSubjectTables[0]?.guid) { |
| 635 | nullTableInfo.value.loading = true; | 683 | nullTableInfo.value.loading = true; |
| 636 | getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { | 684 | getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 637 | nullTableInfo.value.loading = false; | 685 | nullTableInfo.value.loading = false; |
| 638 | if (res.code == proxy.$passCode) { | 686 | if (res.code == proxy.$passCode) { |
| 639 | nullTableInfo.value.data = res.data || []; | 687 | nullTableInfo.value.data = res.data || []; |
| ... | @@ -673,7 +721,7 @@ const formBtnClick = (btn) => { | ... | @@ -673,7 +721,7 @@ const formBtnClick = (btn) => { |
| 673 | tableInfo.value.data = []; | 721 | tableInfo.value.data = []; |
| 674 | if (props.toSubjectTables[0]?.guid) { | 722 | if (props.toSubjectTables[0]?.guid) { |
| 675 | tableInfo.value.loading = true; | 723 | tableInfo.value.loading = true; |
| 676 | getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { | 724 | getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 677 | tableInfo.value.loading = false; | 725 | tableInfo.value.loading = false; |
| 678 | if (res.code == proxy.$passCode) { | 726 | if (res.code == proxy.$passCode) { |
| 679 | tableInfo.value.data = res.data || []; | 727 | tableInfo.value.data = res.data || []; |
| ... | @@ -704,7 +752,7 @@ const formBtnClick = (btn) => { | ... | @@ -704,7 +752,7 @@ const formBtnClick = (btn) => { |
| 704 | sqlTableFieldInfo.value.data = []; | 752 | sqlTableFieldInfo.value.data = []; |
| 705 | if (props.toSubjectTables[0]?.guid) { | 753 | if (props.toSubjectTables[0]?.guid) { |
| 706 | sqlTableFieldInfo.value.loading = true; | 754 | sqlTableFieldInfo.value.loading = true; |
| 707 | getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { | 755 | getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 708 | sqlTableFieldInfo.value.loading = false; | 756 | sqlTableFieldInfo.value.loading = false; |
| 709 | if (res.code == proxy.$passCode) { | 757 | if (res.code == proxy.$passCode) { |
| 710 | sqlTableFieldInfo.value.data = res.data || []; | 758 | sqlTableFieldInfo.value.data = res.data || []; |
| ... | @@ -734,7 +782,7 @@ const formBtnClick = (btn) => { | ... | @@ -734,7 +782,7 @@ const formBtnClick = (btn) => { |
| 734 | valueRangeTableListData.value[dialogSelectSubjectTable.value.enName] = []; | 782 | valueRangeTableListData.value[dialogSelectSubjectTable.value.enName] = []; |
| 735 | if (props.toSubjectTables[0]?.guid) { | 783 | if (props.toSubjectTables[0]?.guid) { |
| 736 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; | 784 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; |
| 737 | getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { | 785 | getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 738 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; | 786 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; |
| 739 | if (res.code == proxy.$passCode) { | 787 | if (res.code == proxy.$passCode) { |
| 740 | let data = res.data || []; | 788 | let data = res.data || []; |
| ... | @@ -792,7 +840,7 @@ const formBtnClick = (btn) => { | ... | @@ -792,7 +840,7 @@ const formBtnClick = (btn) => { |
| 792 | normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = []; | 840 | normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = []; |
| 793 | if (props.toSubjectTables[0]?.guid) { | 841 | if (props.toSubjectTables[0]?.guid) { |
| 794 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; | 842 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; |
| 795 | getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { | 843 | getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 796 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; | 844 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; |
| 797 | if (res.code == proxy.$passCode) { | 845 | if (res.code == proxy.$passCode) { |
| 798 | let data = res.data || []; | 846 | let data = res.data || []; |
| ... | @@ -1017,7 +1065,6 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou | ... | @@ -1017,7 +1065,6 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou |
| 1017 | } | 1065 | } |
| 1018 | }); | 1066 | }); |
| 1019 | formItems.value[0].children = panelList.value; | 1067 | formItems.value[0].children = panelList.value; |
| 1020 | console.log(panelList.value); | ||
| 1021 | } | 1068 | } |
| 1022 | 1069 | ||
| 1023 | const radioGroupChange = (val, inlineValue, init) => { | 1070 | const radioGroupChange = (val, inlineValue, init) => { |
| ... | @@ -1099,7 +1146,7 @@ const listItemClick = (data) => { | ... | @@ -1099,7 +1146,7 @@ const listItemClick = (data) => { |
| 1099 | if (ruleType.value === 'custom_sql') { | 1146 | if (ruleType.value === 'custom_sql') { |
| 1100 | sqlTableFilters.value[dialogSelectSubjectTable.value.enName] = sqlTableFilters.value[dialogSelectSubjectTable.value.enName] || ""; | 1147 | sqlTableFilters.value[dialogSelectSubjectTable.value.enName] = sqlTableFilters.value[dialogSelectSubjectTable.value.enName] || ""; |
| 1101 | sqlTableFieldInfo.value.loading = true; | 1148 | sqlTableFieldInfo.value.loading = true; |
| 1102 | getSubjectFields(data.guid).then((res: any) => { | 1149 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1103 | sqlTableFieldInfo.value.loading = false; | 1150 | sqlTableFieldInfo.value.loading = false; |
| 1104 | if (res.code == proxy.$passCode) { | 1151 | if (res.code == proxy.$passCode) { |
| 1105 | sqlTableFieldInfo.value.data = res.data || []; | 1152 | sqlTableFieldInfo.value.data = res.data || []; |
| ... | @@ -1110,7 +1157,7 @@ const listItemClick = (data) => { | ... | @@ -1110,7 +1157,7 @@ const listItemClick = (data) => { |
| 1110 | } else if (ruleType.value === 'logic_check') { | 1157 | } else if (ruleType.value === 'logic_check') { |
| 1111 | tableFilters.value[dialogSelectSubjectTable.value.enName] = tableFilters.value[dialogSelectSubjectTable.value.enName] || ""; | 1158 | tableFilters.value[dialogSelectSubjectTable.value.enName] = tableFilters.value[dialogSelectSubjectTable.value.enName] || ""; |
| 1112 | tableInfo.value.loading = true; | 1159 | tableInfo.value.loading = true; |
| 1113 | getSubjectFields(data.guid).then((res: any) => { | 1160 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1114 | tableInfo.value.loading = false; | 1161 | tableInfo.value.loading = false; |
| 1115 | if (res.code == proxy.$passCode) { | 1162 | if (res.code == proxy.$passCode) { |
| 1116 | tableInfo.value.data = res.data || []; | 1163 | tableInfo.value.data = res.data || []; |
| ... | @@ -1120,7 +1167,7 @@ const listItemClick = (data) => { | ... | @@ -1120,7 +1167,7 @@ const listItemClick = (data) => { |
| 1120 | }) | 1167 | }) |
| 1121 | } else if (ruleType.value == 'null_value_check' || ruleType.value == 'repeate_data_check') { | 1168 | } else if (ruleType.value == 'null_value_check' || ruleType.value == 'repeate_data_check') { |
| 1122 | nullTableInfo.value.loading = true; | 1169 | nullTableInfo.value.loading = true; |
| 1123 | getSubjectFields(data.guid).then((res: any) => { | 1170 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1124 | nullTableInfo.value.loading = false; | 1171 | nullTableInfo.value.loading = false; |
| 1125 | if (res.code == proxy.$passCode) { | 1172 | if (res.code == proxy.$passCode) { |
| 1126 | nullTableInfo.value.data = res.data || []; | 1173 | nullTableInfo.value.data = res.data || []; |
| ... | @@ -1143,7 +1190,7 @@ const listItemClick = (data) => { | ... | @@ -1143,7 +1190,7 @@ const listItemClick = (data) => { |
| 1143 | } | 1190 | } |
| 1144 | let defaultValue = panelList.value[12].defaultValue; | 1191 | let defaultValue = panelList.value[12].defaultValue; |
| 1145 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; | 1192 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; |
| 1146 | getSubjectFields(data.guid).then((res: any) => { | 1193 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1147 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; | 1194 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; |
| 1148 | if (res.code == proxy.$passCode) { | 1195 | if (res.code == proxy.$passCode) { |
| 1149 | let data = res.data || []; | 1196 | let data = res.data || []; |
| ... | @@ -1178,7 +1225,7 @@ const listItemClick = (data) => { | ... | @@ -1178,7 +1225,7 @@ const listItemClick = (data) => { |
| 1178 | } | 1225 | } |
| 1179 | let defaultValue = panelList.value[14].defaultValue; | 1226 | let defaultValue = panelList.value[14].defaultValue; |
| 1180 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; | 1227 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; |
| 1181 | getSubjectFields(data.guid).then((res: any) => { | 1228 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1182 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; | 1229 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; |
| 1183 | if (res.code == proxy.$passCode) { | 1230 | if (res.code == proxy.$passCode) { |
| 1184 | let data = res.data || []; | 1231 | let data = res.data || []; |
| ... | @@ -1226,7 +1273,7 @@ const tableInfo: any = ref({ | ... | @@ -1226,7 +1273,7 @@ const tableInfo: any = ref({ |
| 1226 | fields: [ | 1273 | fields: [ |
| 1227 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, | 1274 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, |
| 1228 | { label: "注释", field: "chName", width: 120 }, | 1275 | { label: "注释", field: "chName", width: 120 }, |
| 1229 | { label: "数据类型", field: "dataTypeChName", width: 100 }, | 1276 | { label: "数据类型", field: "dataTypeName", width: 100 }, |
| 1230 | ], | 1277 | ], |
| 1231 | data: [], | 1278 | data: [], |
| 1232 | showPage: false, | 1279 | showPage: false, |
| ... | @@ -1440,7 +1487,7 @@ const sqlTableFieldInfo: any = ref({ | ... | @@ -1440,7 +1487,7 @@ const sqlTableFieldInfo: any = ref({ |
| 1440 | fields: [ | 1487 | fields: [ |
| 1441 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, | 1488 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, |
| 1442 | { label: "注释", field: "chName", width: 120 }, | 1489 | { label: "注释", field: "chName", width: 120 }, |
| 1443 | { label: "数据类型", field: "dataTypeChName", width: 100 }, | 1490 | { label: "数据类型", field: "dataTypeName", width: 100 }, |
| 1444 | ], | 1491 | ], |
| 1445 | data: [], | 1492 | data: [], |
| 1446 | showPage: false, | 1493 | showPage: false, |
| ... | @@ -1584,7 +1631,7 @@ const nullTableInfo: any = ref({ | ... | @@ -1584,7 +1631,7 @@ const nullTableInfo: any = ref({ |
| 1584 | fields: [ | 1631 | fields: [ |
| 1585 | { label: "字段名", field: "enName", width: 140 }, | 1632 | { label: "字段名", field: "enName", width: 140 }, |
| 1586 | { label: "注释", field: "chName", width: 120 }, | 1633 | { label: "注释", field: "chName", width: 120 }, |
| 1587 | { label: "数据类型", field: "dataTypeChName", width: 100 }, | 1634 | { label: "数据类型", field: "dataTypeName", width: 100 }, |
| 1588 | ], | 1635 | ], |
| 1589 | data: [], | 1636 | data: [], |
| 1590 | showPage: false, | 1637 | showPage: false, |
| ... | @@ -1680,7 +1727,7 @@ const getSubjectTableByDomainData = (guid) => { | ... | @@ -1680,7 +1727,7 @@ const getSubjectTableByDomainData = (guid) => { |
| 1680 | } | 1727 | } |
| 1681 | 1728 | ||
| 1682 | const defaultExpandedKeys = computed(() => { | 1729 | const defaultExpandedKeys = computed(() => { |
| 1683 | return props.value && contrastSubjects.value?.length ? [contrastSubjects.value.find(c => c.children?.some(cc => cc.guid == props.value.contrastSubjectDomainGuid)).guid, props.value.contrastSubjectDomainGuid] : []; | 1730 | return props.value && contrastSubjects.value?.length ? [props.value.contrastSubjectDomainGuid] : []; |
| 1684 | }) | 1731 | }) |
| 1685 | 1732 | ||
| 1686 | const contrastSubjectInputFilterMethod = (v, data) => { | 1733 | const contrastSubjectInputFilterMethod = (v, data) => { |
| ... | @@ -1731,14 +1778,14 @@ const submitValueRange = () => { | ... | @@ -1731,14 +1778,14 @@ const submitValueRange = () => { |
| 1731 | let valueTableFields = valueRangeTableListData.value[table]; | 1778 | let valueTableFields = valueRangeTableListData.value[table]; |
| 1732 | let ruleFields: any = [] | 1779 | let ruleFields: any = [] |
| 1733 | for (const field of valueTableFields) { | 1780 | for (const field of valueTableFields) { |
| 1734 | if (field.startValue != null && field.endValue == null || (field.endValue != null && field.startValue == null)) { | 1781 | if (field.startValue == null && field.endValue == null) { |
| 1735 | if (dialogSelectSubjectTable.value.enName != table) { | 1782 | if (dialogSelectSubjectTable.value.enName != table) { |
| 1736 | valueCheckFormListRef.value.setSelectList(table, 'enName'); | 1783 | valueCheckFormListRef.value.setSelectList(table, 'enName'); |
| 1737 | } | 1784 | } |
| 1738 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`); | 1785 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`); |
| 1739 | return; | 1786 | return; |
| 1740 | } | 1787 | } |
| 1741 | if (field.startValue) { | 1788 | if (field.startValue != null || field.endValue != null) { |
| 1742 | ruleFields.push(field); | 1789 | ruleFields.push(field); |
| 1743 | } else if (field.dataRange) { | 1790 | } else if (field.dataRange) { |
| 1744 | ruleFields.push(field); | 1791 | ruleFields.push(field); |
| ... | @@ -1788,7 +1835,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表 | ... | @@ -1788,7 +1835,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表 |
| 1788 | /** 主表下拉选择变化 */ | 1835 | /** 主表下拉选择变化 */ |
| 1789 | const tableInteMainSelectChange = (val) => { | 1836 | const tableInteMainSelectChange = (val) => { |
| 1790 | mainTableFields.value[val] = []; | 1837 | mainTableFields.value[val] = []; |
| 1791 | getSubjectFields(val).then((res: any) => { | 1838 | getSubjectFields(val, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1792 | if (res.code == proxy.$passCode) { | 1839 | if (res.code == proxy.$passCode) { |
| 1793 | mainTableFields.value[val] = res.data?.map(d => { | 1840 | mainTableFields.value[val] = res.data?.map(d => { |
| 1794 | return Object.assign({}, d, { | 1841 | return Object.assign({}, d, { |
| ... | @@ -1804,7 +1851,7 @@ const tableInteMainSelectChange = (val) => { | ... | @@ -1804,7 +1851,7 @@ const tableInteMainSelectChange = (val) => { |
| 1804 | /** 对比表下拉选择变化 */ | 1851 | /** 对比表下拉选择变化 */ |
| 1805 | const tableInteCompareSelectChange = (val) => { | 1852 | const tableInteCompareSelectChange = (val) => { |
| 1806 | compareTableFields.value[val] = []; | 1853 | compareTableFields.value[val] = []; |
| 1807 | getSubjectFields(val).then((res: any) => { | 1854 | getSubjectFields(val, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1808 | if (res.code == proxy.$passCode) { | 1855 | if (res.code == proxy.$passCode) { |
| 1809 | compareTableFields.value[val] = res.data?.map(d => { | 1856 | compareTableFields.value[val] = res.data?.map(d => { |
| 1810 | return Object.assign({}, d, { | 1857 | return Object.assign({}, d, { |
| ... | @@ -2165,26 +2212,23 @@ defineExpose({ | ... | @@ -2165,26 +2212,23 @@ defineExpose({ |
| 2165 | </el-table-column> | 2212 | </el-table-column> |
| 2166 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> | 2213 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> |
| 2167 | </el-table-column> | 2214 | </el-table-column> |
| 2168 | <el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip> | 2215 | <el-table-column prop="dataTypeName" label="数据类型" width="100px" show-overflow-tooltip> |
| 2169 | <template #default="scope"> | 2216 | <template #default="scope"> |
| 2170 | <span>{{ scope.row["dataTypeChName"] || '--' }}</span> | 2217 | <span>{{ scope.row["dataTypeName"] || '--' }}</span> |
| 2171 | </template> | 2218 | </template> |
| 2172 | </el-table-column> | 2219 | </el-table-column> |
| 2173 | <el-table-column label="值域" width="280px" align="left" fixed="right"> | 2220 | <el-table-column label="值域" width="280px" align="left" fixed="right"> |
| 2174 | <template #default="scope"> | 2221 | <template #default="scope"> |
| 2175 | <span | ||
| 2176 | v-if="scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'">--</span> | ||
| 2177 | <template v-else> | ||
| 2178 | <el-input | 2222 | <el-input |
| 2179 | v-show="scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'" | 2223 | v-show="!scope.row.dataType || scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || scope.row.dataType == 'numeric'" |
| 2180 | v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> | 2224 | v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> |
| 2181 | <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"> | 2225 | <!-- <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"> |
| 2182 | <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至" | 2226 | <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至" |
| 2183 | start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" | 2227 | start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" |
| 2184 | :unlink-panels="false" :disabled="props.readonly" /> | 2228 | :unlink-panels="false" :disabled="props.readonly" /> |
| 2185 | </div> | 2229 | </div> --> |
| 2186 | <div class="range-sum" | 2230 | <div class="range-sum" |
| 2187 | v-show="scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"> | 2231 | v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date' || scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"> |
| 2188 | <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> | 2232 | <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> |
| 2189 | </el-input> | 2233 | </el-input> |
| 2190 | <span class="text"> 至 </span> | 2234 | <span class="text"> 至 </span> |
| ... | @@ -2192,7 +2236,6 @@ defineExpose({ | ... | @@ -2192,7 +2236,6 @@ defineExpose({ |
| 2192 | </el-input> | 2236 | </el-input> |
| 2193 | </div> | 2237 | </div> |
| 2194 | </template> | 2238 | </template> |
| 2195 | </template> | ||
| 2196 | </el-table-column> | 2239 | </el-table-column> |
| 2197 | </el-table> | 2240 | </el-table> |
| 2198 | </div> | 2241 | </div> |
| ... | @@ -2236,12 +2279,12 @@ defineExpose({ | ... | @@ -2236,12 +2279,12 @@ defineExpose({ |
| 2236 | <template #default="scope"> | 2279 | <template #default="scope"> |
| 2237 | <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable | 2280 | <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable |
| 2238 | @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid" | 2281 | @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid" |
| 2239 | :data="contrastSubjects" placeholder="请选择" lazy :load="(node, resolve) => treeSelectLoad(node, resolve)" | 2282 | :data="contrastSubjects" placeholder="请选择" |
| 2240 | :default-expanded-keys="contrastSubjects?.length ? [contrastSubjects.find(c => c.children?.some(cc => cc.guid == scope.row['compareSubjectDomainGuid'])).guid, scope.row.compareSubjectDomainGuid] : []" | 2283 | :default-expanded-keys="contrastSubjects?.length ? [scope.row.compareSubjectDomainGuid] : []" |
| 2241 | :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]" | 2284 | :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]" |
| 2242 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ | 2285 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ |
| 2243 | value: 'guid', | 2286 | value: 'guid', |
| 2244 | label: 'name', | 2287 | label: 'label', |
| 2245 | children: 'children', | 2288 | children: 'children', |
| 2246 | isLeaf: 'isLeaf' | 2289 | isLeaf: 'isLeaf' |
| 2247 | }"> | 2290 | }"> |
| ... | @@ -2297,16 +2340,16 @@ defineExpose({ | ... | @@ -2297,16 +2340,16 @@ defineExpose({ |
| 2297 | </el-table-column> | 2340 | </el-table-column> |
| 2298 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> | 2341 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> |
| 2299 | </el-table-column> | 2342 | </el-table-column> |
| 2300 | <el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip> | 2343 | <el-table-column prop="dataTypeName" label="数据类型" width="100px" show-overflow-tooltip> |
| 2301 | <template #default="scope"> | 2344 | <template #default="scope"> |
| 2302 | <span>{{ scope.row["dataTypeChName"] || '--' }}</span> | 2345 | <span>{{ scope.row["dataTypeName"] || '--' }}</span> |
| 2303 | </template> | 2346 | </template> |
| 2304 | </el-table-column> | 2347 | </el-table-column> |
| 2305 | <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip> | 2348 | <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip> |
| 2306 | <template #default="scope"> | 2349 | <template #default="scope"> |
| 2307 | <el-select v-if="!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')" | 2350 | <el-select v-if="!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')" |
| 2308 | v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable> | 2351 | v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable> |
| 2309 | <el-option v-for="opt in rulesListByType[scope.row.dataType]" :key="opt['value']" | 2352 | <el-option v-for="opt in (rulesListByType[scope.row.dataType] || checkRulesList)" :key="opt['value']" |
| 2310 | :label="opt['label']" :value="opt['value']" /> | 2353 | :label="opt['label']" :value="opt['value']" /> |
| 2311 | </el-select> | 2354 | </el-select> |
| 2312 | <span v-else>{{ scope.row.checkRuleName ?? '--' }}</span> | 2355 | <span v-else>{{ scope.row.checkRuleName ?? '--' }}</span> |
| ... | @@ -2378,8 +2421,7 @@ defineExpose({ | ... | @@ -2378,8 +2421,7 @@ defineExpose({ |
| 2378 | <el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip> | 2421 | <el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip> |
| 2379 | <template #default="scope"> | 2422 | <template #default="scope"> |
| 2380 | <el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable | 2423 | <el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable |
| 2381 | v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" lazy | 2424 | v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" :default-expanded-keys="defaultExpandedKeys" |
| 2382 | :load="(node, resolve) => treeSelectLoad(node, resolve)" :default-expanded-keys="defaultExpandedKeys" | ||
| 2383 | :auto-expand-parent="true" :default-checked-keys="[props.value.contrastSubjectGuid]" | 2425 | :auto-expand-parent="true" :default-checked-keys="[props.value.contrastSubjectGuid]" |
| 2384 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ | 2426 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ |
| 2385 | value: 'guid', | 2427 | value: 'guid', | ... | ... |
| ... | @@ -9,7 +9,7 @@ import { ElMessage, ElMessageBox } from "element-plus"; | ... | @@ -9,7 +9,7 @@ import { ElMessage, ElMessageBox } from "element-plus"; |
| 9 | import StepBar from "@/components/StepBar/index.vue"; | 9 | import StepBar from "@/components/StepBar/index.vue"; |
| 10 | import TreeTransfer from "@/components/TreeTransfer/index.vue"; | 10 | import TreeTransfer from "@/components/TreeTransfer/index.vue"; |
| 11 | import { | 11 | import { |
| 12 | getSubjectTableTree, | 12 | getInventoryDsDir, |
| 13 | getSubjectTableByDomain, | 13 | getSubjectTableByDomain, |
| 14 | saveQualityTable, | 14 | saveQualityTable, |
| 15 | getRuleTypeList, | 15 | getRuleTypeList, |
| ... | @@ -63,15 +63,46 @@ const toSubjectTables: any = ref([]); | ... | @@ -63,15 +63,46 @@ const toSubjectTables: any = ref([]); |
| 63 | 63 | ||
| 64 | const getSubjectTableTreeData = () => { | 64 | const getSubjectTableTreeData = () => { |
| 65 | dsFromTreeDataLoading.value = true; | 65 | dsFromTreeDataLoading.value = true; |
| 66 | getMetaTreeData({}).then((res: any) => { | 66 | if (route.query.dataSource == '4') { |
| 67 | getInventoryDsDir().then((res: any) => { | ||
| 67 | dsFromTreeDataLoading.value = false; | 68 | dsFromTreeDataLoading.value = false; |
| 68 | if (res.code == proxy.$passCode) { | 69 | if (res.code == proxy.$passCode) { |
| 69 | dsFromTreeData.value = res.data?.map(d => { | 70 | dsFromTreeData.value = res.data?.map(d => { |
| 70 | d.parentGuid = 0; | 71 | d.parentGuid = 0; |
| 72 | d.guid = d.databaseGuid; | ||
| 73 | d.name = d.databaseChName; | ||
| 74 | d.label = d.databaseChName + `(${d.database})`; | ||
| 75 | d.children = d.children?.map(child => { | ||
| 76 | child.parentGuid = d.guid; | ||
| 77 | child.label = child.tableChName + `(${child.tableName})`; | ||
| 78 | child.guid = child.tableGuid; | ||
| 79 | child.dataServerName = d.database; | ||
| 80 | child.dataSourceGuid = d.databaseGuid; | ||
| 81 | child.parentGuid = d.databaseGuid; | ||
| 82 | return child; | ||
| 83 | }) | ||
| 84 | return d; | ||
| 85 | }) || []; | ||
| 86 | } | ||
| 87 | }) | ||
| 88 | } else { | ||
| 89 | getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => { | ||
| 90 | dsFromTreeDataLoading.value = false; | ||
| 91 | if (res.code == proxy.$passCode) { | ||
| 92 | dsFromTreeData.value = res.data?.children?.map(d => { | ||
| 93 | d.parentGuid = 0; | ||
| 94 | d.label = d.name; | ||
| 95 | d.children = d.children?.map(child => { | ||
| 96 | child.label = child.name + `(${child.tableName})`; | ||
| 97 | child.dataServerName = d.name; | ||
| 98 | child.dataSourceGuid = d.guid; | ||
| 99 | return child; | ||
| 100 | }) | ||
| 71 | return d; | 101 | return d; |
| 72 | }) || []; | 102 | }) || []; |
| 73 | } | 103 | } |
| 74 | }) | 104 | }) |
| 105 | } | ||
| 75 | } | 106 | } |
| 76 | 107 | ||
| 77 | const getSubjectTableByDomainData = (guid) => { | 108 | const getSubjectTableByDomainData = (guid) => { |
| ... | @@ -158,12 +189,14 @@ const changeStep = (val, skip = false) => { | ... | @@ -158,12 +189,14 @@ const changeStep = (val, skip = false) => { |
| 158 | } | 189 | } |
| 159 | toSubjectTables.value = []; | 190 | toSubjectTables.value = []; |
| 160 | dsToTreeData.value.forEach(d => { | 191 | dsToTreeData.value.forEach(d => { |
| 161 | d.children.forEach(c => { | 192 | d.children.forEach(child => { |
| 162 | c.children.forEach(child => { | 193 | child.guid = child.tableGuid || child.guid; |
| 163 | child.label = `${child.enName}(${child.chName})`; | 194 | child.enName = child.tableName; |
| 195 | child.chName = child.tableChName || child.name; | ||
| 196 | child.dataSourceGuid = child.parentGuid; | ||
| 197 | child.databaseName = child.databaseName, | ||
| 164 | toSubjectTables.value.push(child); | 198 | toSubjectTables.value.push(child); |
| 165 | }) | 199 | }) |
| 166 | }) | ||
| 167 | }); | 200 | }); |
| 168 | step.value = val - 1; | 201 | step.value = val - 1; |
| 169 | stepsInfo.value.step = val - 1 | 202 | stepsInfo.value.step = val - 1 |
| ... | @@ -211,6 +244,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -211,6 +244,7 @@ const transformRulesInfo = (info: any) => { |
| 211 | subjectGuid: tableInfo.guid, | 244 | subjectGuid: tableInfo.guid, |
| 212 | dataSourceGuid: tableInfo.dataSourceGuid, | 245 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 213 | databaseName: tableInfo.dataServerName, | 246 | databaseName: tableInfo.dataServerName, |
| 247 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 214 | modelRuleConfList: [Object.assign({}, info, { | 248 | modelRuleConfList: [Object.assign({}, info, { |
| 215 | qualityModelGuid: modelGuid | 249 | qualityModelGuid: modelGuid |
| 216 | })] | 250 | })] |
| ... | @@ -229,6 +263,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -229,6 +263,7 @@ const transformRulesInfo = (info: any) => { |
| 229 | subjectGuid: tableInfo.guid, | 263 | subjectGuid: tableInfo.guid, |
| 230 | dataSourceGuid: tableInfo.dataSourceGuid, | 264 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 231 | databaseName: tableInfo.dataServerName, | 265 | databaseName: tableInfo.dataServerName, |
| 266 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 232 | modelRuleConfList: [Object.assign({}, info, { | 267 | modelRuleConfList: [Object.assign({}, info, { |
| 233 | ruleField: fields?.map(f => { | 268 | ruleField: fields?.map(f => { |
| 234 | return { | 269 | return { |
| ... | @@ -252,6 +287,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -252,6 +287,7 @@ const transformRulesInfo = (info: any) => { |
| 252 | subjectGuid: tableInfo.guid, | 287 | subjectGuid: tableInfo.guid, |
| 253 | dataSourceGuid: tableInfo.dataSourceGuid, | 288 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 254 | databaseName: tableInfo.dataServerName, | 289 | databaseName: tableInfo.dataServerName, |
| 290 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 255 | modelRuleConfList: [Object.assign({}, info, { | 291 | modelRuleConfList: [Object.assign({}, info, { |
| 256 | ruleField: [{ | 292 | ruleField: [{ |
| 257 | guid: fields.guid, | 293 | guid: fields.guid, |
| ... | @@ -276,6 +312,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -276,6 +312,7 @@ const transformRulesInfo = (info: any) => { |
| 276 | subjectGuid: tableInfo.guid, | 312 | subjectGuid: tableInfo.guid, |
| 277 | dataSourceGuid: tableInfo.dataSourceGuid, | 313 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 278 | databaseName: tableInfo.dataServerName, | 314 | databaseName: tableInfo.dataServerName, |
| 315 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 279 | modelRuleConfList: [Object.assign({}, info, { | 316 | modelRuleConfList: [Object.assign({}, info, { |
| 280 | ruleField: fields?.map(f => { | 317 | ruleField: fields?.map(f => { |
| 281 | return { | 318 | return { |
| ... | @@ -300,6 +337,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -300,6 +337,7 @@ const transformRulesInfo = (info: any) => { |
| 300 | subjectGuid: tableInfo.guid, | 337 | subjectGuid: tableInfo.guid, |
| 301 | dataSourceGuid: tableInfo.dataSourceGuid, | 338 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 302 | databaseName: tableInfo.dataServerName, | 339 | databaseName: tableInfo.dataServerName, |
| 340 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 303 | modelRuleConfList: [Object.assign({}, info, { | 341 | modelRuleConfList: [Object.assign({}, info, { |
| 304 | differenceRange: row.differenceRange, | 342 | differenceRange: row.differenceRange, |
| 305 | rows: [], | 343 | rows: [], |
| ... | @@ -319,6 +357,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -319,6 +357,7 @@ const transformRulesInfo = (info: any) => { |
| 319 | subjectGuid: tableInfo.guid, | 357 | subjectGuid: tableInfo.guid, |
| 320 | dataSourceGuid: tableInfo.dataSourceGuid, | 358 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 321 | databaseName: tableInfo.dataServerName, | 359 | databaseName: tableInfo.dataServerName, |
| 360 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 322 | modelRuleConfList: [Object.assign({}, info, { | 361 | modelRuleConfList: [Object.assign({}, info, { |
| 323 | ruleField: fields.map(f => { | 362 | ruleField: fields.map(f => { |
| 324 | return { | 363 | return { |
| ... | @@ -347,6 +386,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -347,6 +386,7 @@ const transformRulesInfo = (info: any) => { |
| 347 | subjectGuid: tableInfo.guid, | 386 | subjectGuid: tableInfo.guid, |
| 348 | dataSourceGuid: tableInfo.dataSourceGuid, | 387 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 349 | databaseName: tableInfo.dataServerName, | 388 | databaseName: tableInfo.dataServerName, |
| 389 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 350 | modelRuleConfList: [Object.assign({}, info, { | 390 | modelRuleConfList: [Object.assign({}, info, { |
| 351 | ruleField: fields.map(f => { | 391 | ruleField: fields.map(f => { |
| 352 | return { | 392 | return { |
| ... | @@ -382,11 +422,19 @@ const transformRulesInfo = (info: any) => { | ... | @@ -382,11 +422,19 @@ const transformRulesInfo = (info: any) => { |
| 382 | subjectGuid: tableInfo.guid, | 422 | subjectGuid: tableInfo.guid, |
| 383 | dataSourceGuid: tableInfo.dataSourceGuid, | 423 | dataSourceGuid: tableInfo.dataSourceGuid, |
| 384 | databaseName: tableInfo.dataServerName, | 424 | databaseName: tableInfo.dataServerName, |
| 425 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 385 | modelRuleConfList: [Object.assign({}, info, { | 426 | modelRuleConfList: [Object.assign({}, info, { |
| 427 | ruleField: info.ruleFields.map(row => { | ||
| 428 | return { | ||
| 429 | // guid: row.mainTable, | ||
| 386 | enName: row.mainTableField, | 430 | enName: row.mainTableField, |
| 431 | //chName: row.chName, | ||
| 387 | compareTableGuid: row.compareTableGuid, | 432 | compareTableGuid: row.compareTableGuid, |
| 388 | compareTableName: row.compareTableName, | 433 | compareTableName: row.compareTableName, |
| 389 | compareEnName: row.compareEnName | 434 | compareEnName: row.compareEnName |
| 435 | } | ||
| 436 | }), | ||
| 437 | ruleFields: '' | ||
| 390 | })] | 438 | })] |
| 391 | })); | 439 | })); |
| 392 | } | 440 | } |
| ... | @@ -432,17 +480,17 @@ const save = () => { | ... | @@ -432,17 +480,17 @@ const save = () => { |
| 432 | <div class="panel_title"> | 480 | <div class="panel_title"> |
| 433 | <div class="title_text"> | 481 | <div class="title_text"> |
| 434 | <span>选择表</span> | 482 | <span>选择表</span> |
| 435 | <span class="tips_text">选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!</span> | 483 | <span class="tips_text">{{ route.query.dataSource == '5' ? |
| 484 | '选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!' : '选择需要添加质检规则的表' }}</span> | ||
| 436 | </div> | 485 | </div> |
| 437 | </div> | 486 | </div> |
| 438 | <TreeTransfer mode="transfer" :title="['可选表', '已选表']" pid="parentGuid" | 487 | <TreeTransfer mode="transfer" :title="[route.query.dataSource == '5' ? '可选元数据目录表' : '可选盘点数据库目录表', '已选表']" |
| 439 | :from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true" | 488 | pid="parentGuid" :from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true" |
| 440 | :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" | 489 | :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" |
| 441 | :transferOpenNode="true" width="70%" :defaultProps="{ | 490 | :transferOpenNode="true" width="70%" :defaultProps="{ |
| 442 | label: 'name', | 491 | label: 'label', |
| 443 | value: 'guid' | 492 | value: 'guid' |
| 444 | }" | 493 | }" height="calc(100% - 64px)"> |
| 445 | height="calc(100% - 64px)"> | ||
| 446 | </TreeTransfer> | 494 | </TreeTransfer> |
| 447 | </div> | 495 | </div> |
| 448 | </div> | 496 | </div> |
| ... | @@ -457,7 +505,8 @@ const save = () => { | ... | @@ -457,7 +505,8 @@ const save = () => { |
| 457 | <div class="panel_content"> | 505 | <div class="panel_content"> |
| 458 | <div class="form_panel"> | 506 | <div class="form_panel"> |
| 459 | <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" | 507 | <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" |
| 460 | :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList"></ruleForm> | 508 | :data-source="route.query.dataSource as string" :largeCategoryList="largeCategoryList" |
| 509 | :smallCategoryList="smallCategoryList"></ruleForm> | ||
| 461 | </div> | 510 | </div> |
| 462 | </div> | 511 | </div> |
| 463 | </div> | 512 | </div> | ... | ... |
| ... | @@ -204,15 +204,14 @@ const save = () => { | ... | @@ -204,15 +204,14 @@ const save = () => { |
| 204 | subjectGuid: modelDetailInfo.value.subjectGuid, | 204 | subjectGuid: modelDetailInfo.value.subjectGuid, |
| 205 | subjectName: modelDetailInfo.value.subjectName, | 205 | subjectName: modelDetailInfo.value.subjectName, |
| 206 | dataSourceGuid: modelDetailInfo.value.dataSourceGuid, | 206 | dataSourceGuid: modelDetailInfo.value.dataSourceGuid, |
| 207 | modelRuleConfList: submitInfos | 207 | modelRuleConfList: submitInfos, |
| 208 | dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null, | ||
| 208 | }]).then((res: any) => { | 209 | }]).then((res: any) => { |
| 209 | fullScreenLoading.value = false; | 210 | fullScreenLoading.value = false; |
| 210 | if (res.code == proxy.$passCode) { | 211 | if (res.code == proxy.$passCode) { |
| 211 | ElMessage.success('新建规则保存成功'); | 212 | ElMessage.success('新建规则保存成功'); |
| 212 | router.push({ | ||
| 213 | name: 'qualityRules' | ||
| 214 | }); | ||
| 215 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); | 213 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); |
| 214 | router.go(-1); | ||
| 216 | dataQualityStore.setModelGuid(modelGuid); | 215 | dataQualityStore.setModelGuid(modelGuid); |
| 217 | } else { | 216 | } else { |
| 218 | ElMessage.error(res.msg); | 217 | ElMessage.error(res.msg); |
| ... | @@ -317,7 +316,7 @@ const cancel = () => { | ... | @@ -317,7 +316,7 @@ const cancel = () => { |
| 317 | </div> | 316 | </div> |
| 318 | <div class="panel_content" v-show="item.open"> | 317 | <div class="panel_content" v-show="item.open"> |
| 319 | <div class="form_panel"> | 318 | <div class="form_panel"> |
| 320 | <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" | 319 | <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" :dataSource="route.query.dataSource as string" |
| 321 | :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList" :isSingle="true"> | 320 | :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList" :isSingle="true"> |
| 322 | </ruleForm> | 321 | </ruleForm> |
| 323 | </div> | 322 | </div> | ... | ... |
-
Please register or sign in to post a comment