提交质量修改
Showing
6 changed files
with
168 additions
and
68 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") { |
| ... | @@ -489,6 +492,7 @@ const groupTableBtnClick = (scope, btn) => { | ... | @@ -489,6 +492,7 @@ const groupTableBtnClick = (scope, btn) => { |
| 489 | type: "success", | 492 | type: "success", |
| 490 | message: "删除分组成功", | 493 | message: "删除分组成功", |
| 491 | }); | 494 | }); |
| 495 | getQualityGroupTreeData(); | ||
| 492 | } else { | 496 | } else { |
| 493 | ElMessage({ | 497 | ElMessage({ |
| 494 | type: "error", | 498 | type: "error", |
| ... | @@ -639,7 +643,8 @@ const clickCreateTable = () => { | ... | @@ -639,7 +643,8 @@ const clickCreateTable = () => { |
| 639 | name: 'ruleModel', | 643 | name: 'ruleModel', |
| 640 | query: { | 644 | query: { |
| 641 | groupGuid: page.value.modelGroupGuid, | 645 | groupGuid: page.value.modelGroupGuid, |
| 642 | name: lastSelectNode.value.data.name | 646 | name: lastSelectNode.value.data.name, |
| 647 | dataSource: lastSelectNode.value.data.dataSource | ||
| 643 | } | 648 | } |
| 644 | }); | 649 | }); |
| 645 | } | 650 | } |
| ... | @@ -650,7 +655,8 @@ const clickCreateRule = () => { | ... | @@ -650,7 +655,8 @@ const clickCreateRule = () => { |
| 650 | name: 'ruleTemplate', | 655 | name: 'ruleTemplate', |
| 651 | query: { | 656 | query: { |
| 652 | modelGuid: lastSelectNode.value.data.guid, | 657 | modelGuid: lastSelectNode.value.data.guid, |
| 653 | name: lastSelectNode.value.data.name | 658 | name: lastSelectNode.value.data.name, |
| 659 | dataSource: lastSelectNode.value.parent.data.dataSource | ||
| 654 | } | 660 | } |
| 655 | }); | 661 | }); |
| 656 | } | 662 | } |
| ... | @@ -744,6 +750,7 @@ let editSubmitPromise: any = ref(null); | ... | @@ -744,6 +750,7 @@ let editSubmitPromise: any = ref(null); |
| 744 | /** 新建分组对话框确定。 */ | 750 | /** 新建分组对话框确定。 */ |
| 745 | const dialogBtnClick = (btn, info) => { | 751 | const dialogBtnClick = (btn, info) => { |
| 746 | if (btn.value == 'submit') { | 752 | if (btn.value == 'submit') { |
| 753 | info.dataSource = '5'; | ||
| 747 | if (dialogInfo.value.type == 'add') { | 754 | if (dialogInfo.value.type == 'add') { |
| 748 | if (submitPromise.value) { | 755 | if (submitPromise.value) { |
| 749 | return; | 756 | return; |
| ... | @@ -753,6 +760,7 @@ const dialogBtnClick = (btn, info) => { | ... | @@ -753,6 +760,7 @@ const dialogBtnClick = (btn, info) => { |
| 753 | if (res.code == proxy.$passCode) { | 760 | if (res.code == proxy.$passCode) { |
| 754 | groupPage.value.curr = 1; | 761 | groupPage.value.curr = 1; |
| 755 | getGroupTableData(); | 762 | getGroupTableData(); |
| 763 | getQualityGroupTreeData(); | ||
| 756 | ElMessage({ | 764 | ElMessage({ |
| 757 | type: 'success', | 765 | type: 'success', |
| 758 | message: '新建分组成功' | 766 | message: '新建分组成功' |
| ... | @@ -779,6 +787,7 @@ const dialogBtnClick = (btn, info) => { | ... | @@ -779,6 +787,7 @@ const dialogBtnClick = (btn, info) => { |
| 779 | type: 'success', | 787 | type: 'success', |
| 780 | message: '编辑分组成功' | 788 | message: '编辑分组成功' |
| 781 | }) | 789 | }) |
| 790 | getQualityGroupTreeData(); | ||
| 782 | dialogInfo.value.visible = false; | 791 | dialogInfo.value.visible = false; |
| 783 | } else { | 792 | } else { |
| 784 | ElMessage({ | 793 | ElMessage({ | ... | ... |
| ... | @@ -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[]) => { |
| ... | @@ -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) => { | ||
| 628 | if (res.code == proxy.$passCode) { | ||
| 629 | contrastSubjects.value = res.data?.map(d => { | ||
| 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 | }) || []; | ||
| 646 | } | ||
| 647 | }) | ||
| 648 | } else { | ||
| 649 | return getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => { | ||
| 619 | if (res.code == proxy.$passCode) { | 650 | if (res.code == proxy.$passCode) { |
| 620 | contrastSubjects.value = res.data || []; | 651 | contrastSubjects.value = res.data?.children?.map(d => { |
| 621 | return res.data || []; | 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 | }) || []; | ||
| 622 | } | 663 | } |
| 623 | }) | 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 || []; |
| ... | @@ -1099,7 +1147,7 @@ const listItemClick = (data) => { | ... | @@ -1099,7 +1147,7 @@ const listItemClick = (data) => { |
| 1099 | if (ruleType.value === 'custom_sql') { | 1147 | if (ruleType.value === 'custom_sql') { |
| 1100 | sqlTableFilters.value[dialogSelectSubjectTable.value.enName] = sqlTableFilters.value[dialogSelectSubjectTable.value.enName] || ""; | 1148 | sqlTableFilters.value[dialogSelectSubjectTable.value.enName] = sqlTableFilters.value[dialogSelectSubjectTable.value.enName] || ""; |
| 1101 | sqlTableFieldInfo.value.loading = true; | 1149 | sqlTableFieldInfo.value.loading = true; |
| 1102 | getSubjectFields(data.guid).then((res: any) => { | 1150 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1103 | sqlTableFieldInfo.value.loading = false; | 1151 | sqlTableFieldInfo.value.loading = false; |
| 1104 | if (res.code == proxy.$passCode) { | 1152 | if (res.code == proxy.$passCode) { |
| 1105 | sqlTableFieldInfo.value.data = res.data || []; | 1153 | sqlTableFieldInfo.value.data = res.data || []; |
| ... | @@ -1110,7 +1158,7 @@ const listItemClick = (data) => { | ... | @@ -1110,7 +1158,7 @@ const listItemClick = (data) => { |
| 1110 | } else if (ruleType.value === 'logic_check') { | 1158 | } else if (ruleType.value === 'logic_check') { |
| 1111 | tableFilters.value[dialogSelectSubjectTable.value.enName] = tableFilters.value[dialogSelectSubjectTable.value.enName] || ""; | 1159 | tableFilters.value[dialogSelectSubjectTable.value.enName] = tableFilters.value[dialogSelectSubjectTable.value.enName] || ""; |
| 1112 | tableInfo.value.loading = true; | 1160 | tableInfo.value.loading = true; |
| 1113 | getSubjectFields(data.guid).then((res: any) => { | 1161 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1114 | tableInfo.value.loading = false; | 1162 | tableInfo.value.loading = false; |
| 1115 | if (res.code == proxy.$passCode) { | 1163 | if (res.code == proxy.$passCode) { |
| 1116 | tableInfo.value.data = res.data || []; | 1164 | tableInfo.value.data = res.data || []; |
| ... | @@ -1120,7 +1168,7 @@ const listItemClick = (data) => { | ... | @@ -1120,7 +1168,7 @@ const listItemClick = (data) => { |
| 1120 | }) | 1168 | }) |
| 1121 | } else if (ruleType.value == 'null_value_check' || ruleType.value == 'repeate_data_check') { | 1169 | } else if (ruleType.value == 'null_value_check' || ruleType.value == 'repeate_data_check') { |
| 1122 | nullTableInfo.value.loading = true; | 1170 | nullTableInfo.value.loading = true; |
| 1123 | getSubjectFields(data.guid).then((res: any) => { | 1171 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1124 | nullTableInfo.value.loading = false; | 1172 | nullTableInfo.value.loading = false; |
| 1125 | if (res.code == proxy.$passCode) { | 1173 | if (res.code == proxy.$passCode) { |
| 1126 | nullTableInfo.value.data = res.data || []; | 1174 | nullTableInfo.value.data = res.data || []; |
| ... | @@ -1143,7 +1191,7 @@ const listItemClick = (data) => { | ... | @@ -1143,7 +1191,7 @@ const listItemClick = (data) => { |
| 1143 | } | 1191 | } |
| 1144 | let defaultValue = panelList.value[12].defaultValue; | 1192 | let defaultValue = panelList.value[12].defaultValue; |
| 1145 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; | 1193 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; |
| 1146 | getSubjectFields(data.guid).then((res: any) => { | 1194 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1147 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; | 1195 | valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; |
| 1148 | if (res.code == proxy.$passCode) { | 1196 | if (res.code == proxy.$passCode) { |
| 1149 | let data = res.data || []; | 1197 | let data = res.data || []; |
| ... | @@ -1178,7 +1226,7 @@ const listItemClick = (data) => { | ... | @@ -1178,7 +1226,7 @@ const listItemClick = (data) => { |
| 1178 | } | 1226 | } |
| 1179 | let defaultValue = panelList.value[14].defaultValue; | 1227 | let defaultValue = panelList.value[14].defaultValue; |
| 1180 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; | 1228 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; |
| 1181 | getSubjectFields(data.guid).then((res: any) => { | 1229 | getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1182 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; | 1230 | normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; |
| 1183 | if (res.code == proxy.$passCode) { | 1231 | if (res.code == proxy.$passCode) { |
| 1184 | let data = res.data || []; | 1232 | let data = res.data || []; |
| ... | @@ -1226,7 +1274,7 @@ const tableInfo: any = ref({ | ... | @@ -1226,7 +1274,7 @@ const tableInfo: any = ref({ |
| 1226 | fields: [ | 1274 | fields: [ |
| 1227 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, | 1275 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, |
| 1228 | { label: "注释", field: "chName", width: 120 }, | 1276 | { label: "注释", field: "chName", width: 120 }, |
| 1229 | { label: "数据类型", field: "dataTypeChName", width: 100 }, | 1277 | { label: "数据类型", field: "dataTypeName", width: 100 }, |
| 1230 | ], | 1278 | ], |
| 1231 | data: [], | 1279 | data: [], |
| 1232 | showPage: false, | 1280 | showPage: false, |
| ... | @@ -1440,7 +1488,7 @@ const sqlTableFieldInfo: any = ref({ | ... | @@ -1440,7 +1488,7 @@ const sqlTableFieldInfo: any = ref({ |
| 1440 | fields: [ | 1488 | fields: [ |
| 1441 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, | 1489 | { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, |
| 1442 | { label: "注释", field: "chName", width: 120 }, | 1490 | { label: "注释", field: "chName", width: 120 }, |
| 1443 | { label: "数据类型", field: "dataTypeChName", width: 100 }, | 1491 | { label: "数据类型", field: "dataTypeName", width: 100 }, |
| 1444 | ], | 1492 | ], |
| 1445 | data: [], | 1493 | data: [], |
| 1446 | showPage: false, | 1494 | showPage: false, |
| ... | @@ -1584,7 +1632,7 @@ const nullTableInfo: any = ref({ | ... | @@ -1584,7 +1632,7 @@ const nullTableInfo: any = ref({ |
| 1584 | fields: [ | 1632 | fields: [ |
| 1585 | { label: "字段名", field: "enName", width: 140 }, | 1633 | { label: "字段名", field: "enName", width: 140 }, |
| 1586 | { label: "注释", field: "chName", width: 120 }, | 1634 | { label: "注释", field: "chName", width: 120 }, |
| 1587 | { label: "数据类型", field: "dataTypeChName", width: 100 }, | 1635 | { label: "数据类型", field: "dataTypeName", width: 100 }, |
| 1588 | ], | 1636 | ], |
| 1589 | data: [], | 1637 | data: [], |
| 1590 | showPage: false, | 1638 | showPage: false, |
| ... | @@ -1680,7 +1728,7 @@ const getSubjectTableByDomainData = (guid) => { | ... | @@ -1680,7 +1728,7 @@ const getSubjectTableByDomainData = (guid) => { |
| 1680 | } | 1728 | } |
| 1681 | 1729 | ||
| 1682 | const defaultExpandedKeys = computed(() => { | 1730 | 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] : []; | 1731 | return props.value && contrastSubjects.value?.length ? [props.value.contrastSubjectDomainGuid] : []; |
| 1684 | }) | 1732 | }) |
| 1685 | 1733 | ||
| 1686 | const contrastSubjectInputFilterMethod = (v, data) => { | 1734 | const contrastSubjectInputFilterMethod = (v, data) => { |
| ... | @@ -1788,7 +1836,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表 | ... | @@ -1788,7 +1836,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表 |
| 1788 | /** 主表下拉选择变化 */ | 1836 | /** 主表下拉选择变化 */ |
| 1789 | const tableInteMainSelectChange = (val) => { | 1837 | const tableInteMainSelectChange = (val) => { |
| 1790 | mainTableFields.value[val] = []; | 1838 | mainTableFields.value[val] = []; |
| 1791 | getSubjectFields(val).then((res: any) => { | 1839 | getSubjectFields(val, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1792 | if (res.code == proxy.$passCode) { | 1840 | if (res.code == proxy.$passCode) { |
| 1793 | mainTableFields.value[val] = res.data?.map(d => { | 1841 | mainTableFields.value[val] = res.data?.map(d => { |
| 1794 | return Object.assign({}, d, { | 1842 | return Object.assign({}, d, { |
| ... | @@ -1804,7 +1852,7 @@ const tableInteMainSelectChange = (val) => { | ... | @@ -1804,7 +1852,7 @@ const tableInteMainSelectChange = (val) => { |
| 1804 | /** 对比表下拉选择变化 */ | 1852 | /** 对比表下拉选择变化 */ |
| 1805 | const tableInteCompareSelectChange = (val) => { | 1853 | const tableInteCompareSelectChange = (val) => { |
| 1806 | compareTableFields.value[val] = []; | 1854 | compareTableFields.value[val] = []; |
| 1807 | getSubjectFields(val).then((res: any) => { | 1855 | getSubjectFields(val, props.dataSource || props.value.dataSource).then((res: any) => { |
| 1808 | if (res.code == proxy.$passCode) { | 1856 | if (res.code == proxy.$passCode) { |
| 1809 | compareTableFields.value[val] = res.data?.map(d => { | 1857 | compareTableFields.value[val] = res.data?.map(d => { |
| 1810 | return Object.assign({}, d, { | 1858 | return Object.assign({}, d, { |
| ... | @@ -2165,26 +2213,23 @@ defineExpose({ | ... | @@ -2165,26 +2213,23 @@ defineExpose({ |
| 2165 | </el-table-column> | 2213 | </el-table-column> |
| 2166 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> | 2214 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> |
| 2167 | </el-table-column> | 2215 | </el-table-column> |
| 2168 | <el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip> | 2216 | <el-table-column prop="dataTypeName" label="数据类型" width="100px" show-overflow-tooltip> |
| 2169 | <template #default="scope"> | 2217 | <template #default="scope"> |
| 2170 | <span>{{ scope.row["dataTypeChName"] || '--' }}</span> | 2218 | <span>{{ scope.row["dataTypeName"] || '--' }}</span> |
| 2171 | </template> | 2219 | </template> |
| 2172 | </el-table-column> | 2220 | </el-table-column> |
| 2173 | <el-table-column label="值域" width="280px" align="left" fixed="right"> | 2221 | <el-table-column label="值域" width="280px" align="left" fixed="right"> |
| 2174 | <template #default="scope"> | 2222 | <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 | 2223 | <el-input |
| 2179 | v-show="scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'" | 2224 | 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> | 2225 | 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'"> | 2226 | <!-- <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="至" | 2227 | <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" | 2228 | start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" |
| 2184 | :unlink-panels="false" :disabled="props.readonly" /> | 2229 | :unlink-panels="false" :disabled="props.readonly" /> |
| 2185 | </div> | 2230 | </div> --> |
| 2186 | <div class="range-sum" | 2231 | <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'"> | 2232 | 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> | 2233 | <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> |
| 2189 | </el-input> | 2234 | </el-input> |
| 2190 | <span class="text"> 至 </span> | 2235 | <span class="text"> 至 </span> |
| ... | @@ -2192,7 +2237,6 @@ defineExpose({ | ... | @@ -2192,7 +2237,6 @@ defineExpose({ |
| 2192 | </el-input> | 2237 | </el-input> |
| 2193 | </div> | 2238 | </div> |
| 2194 | </template> | 2239 | </template> |
| 2195 | </template> | ||
| 2196 | </el-table-column> | 2240 | </el-table-column> |
| 2197 | </el-table> | 2241 | </el-table> |
| 2198 | </div> | 2242 | </div> |
| ... | @@ -2236,12 +2280,12 @@ defineExpose({ | ... | @@ -2236,12 +2280,12 @@ defineExpose({ |
| 2236 | <template #default="scope"> | 2280 | <template #default="scope"> |
| 2237 | <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable | 2281 | <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable |
| 2238 | @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid" | 2282 | @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid" |
| 2239 | :data="contrastSubjects" placeholder="请选择" lazy :load="(node, resolve) => treeSelectLoad(node, resolve)" | 2283 | :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] : []" | 2284 | :default-expanded-keys="contrastSubjects?.length ? [scope.row.compareSubjectDomainGuid] : []" |
| 2241 | :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]" | 2285 | :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]" |
| 2242 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ | 2286 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ |
| 2243 | value: 'guid', | 2287 | value: 'guid', |
| 2244 | label: 'name', | 2288 | label: 'label', |
| 2245 | children: 'children', | 2289 | children: 'children', |
| 2246 | isLeaf: 'isLeaf' | 2290 | isLeaf: 'isLeaf' |
| 2247 | }"> | 2291 | }"> |
| ... | @@ -2297,9 +2341,9 @@ defineExpose({ | ... | @@ -2297,9 +2341,9 @@ defineExpose({ |
| 2297 | </el-table-column> | 2341 | </el-table-column> |
| 2298 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> | 2342 | <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> |
| 2299 | </el-table-column> | 2343 | </el-table-column> |
| 2300 | <el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip> | 2344 | <el-table-column prop="dataTypeName" label="数据类型" width="100px" show-overflow-tooltip> |
| 2301 | <template #default="scope"> | 2345 | <template #default="scope"> |
| 2302 | <span>{{ scope.row["dataTypeChName"] || '--' }}</span> | 2346 | <span>{{ scope.row["dataTypeName"] || '--' }}</span> |
| 2303 | </template> | 2347 | </template> |
| 2304 | </el-table-column> | 2348 | </el-table-column> |
| 2305 | <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip> | 2349 | <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip> |
| ... | @@ -2378,8 +2422,7 @@ defineExpose({ | ... | @@ -2378,8 +2422,7 @@ defineExpose({ |
| 2378 | <el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip> | 2422 | <el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip> |
| 2379 | <template #default="scope"> | 2423 | <template #default="scope"> |
| 2380 | <el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable | 2424 | <el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable |
| 2381 | v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" lazy | 2425 | 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]" | 2426 | :auto-expand-parent="true" :default-checked-keys="[props.value.contrastSubjectGuid]" |
| 2384 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ | 2427 | :filter-node-method="contrastSubjectInputFilterMethod" :props="{ |
| 2385 | value: 'guid', | 2428 | 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,6 +422,7 @@ const transformRulesInfo = (info: any) => { | ... | @@ -382,6 +422,7 @@ 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, { |
| 386 | enName: row.mainTableField, | 427 | enName: row.mainTableField, |
| 387 | compareTableGuid: row.compareTableGuid, | 428 | compareTableGuid: row.compareTableGuid, |
| ... | @@ -432,17 +473,17 @@ const save = () => { | ... | @@ -432,17 +473,17 @@ const save = () => { |
| 432 | <div class="panel_title"> | 473 | <div class="panel_title"> |
| 433 | <div class="title_text"> | 474 | <div class="title_text"> |
| 434 | <span>选择表</span> | 475 | <span>选择表</span> |
| 435 | <span class="tips_text">选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!</span> | 476 | <span class="tips_text">{{ route.query.dataSource == '5' ? |
| 477 | '选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!' : '选择需要添加质检规则的表' }}</span> | ||
| 436 | </div> | 478 | </div> |
| 437 | </div> | 479 | </div> |
| 438 | <TreeTransfer mode="transfer" :title="['可选表', '已选表']" pid="parentGuid" | 480 | <TreeTransfer mode="transfer" :title="[route.query.dataSource == '5' ? '可选元数据目录表' : '可选盘点数据库目录表', '已选表']" |
| 439 | :from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true" | 481 | pid="parentGuid" :from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true" |
| 440 | :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" | 482 | :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" |
| 441 | :transferOpenNode="true" width="70%" :defaultProps="{ | 483 | :transferOpenNode="true" width="70%" :defaultProps="{ |
| 442 | label: 'name', | 484 | label: 'label', |
| 443 | value: 'guid' | 485 | value: 'guid' |
| 444 | }" | 486 | }" height="calc(100% - 64px)"> |
| 445 | height="calc(100% - 64px)"> | ||
| 446 | </TreeTransfer> | 487 | </TreeTransfer> |
| 447 | </div> | 488 | </div> |
| 448 | </div> | 489 | </div> |
| ... | @@ -457,7 +498,8 @@ const save = () => { | ... | @@ -457,7 +498,8 @@ const save = () => { |
| 457 | <div class="panel_content"> | 498 | <div class="panel_content"> |
| 458 | <div class="form_panel"> | 499 | <div class="form_panel"> |
| 459 | <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" | 500 | <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" |
| 460 | :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList"></ruleForm> | 501 | :data-source="route.query.dataSource as string" :largeCategoryList="largeCategoryList" |
| 502 | :smallCategoryList="smallCategoryList"></ruleForm> | ||
| 461 | </div> | 503 | </div> |
| 462 | </div> | 504 | </div> |
| 463 | </div> | 505 | </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