fix : 分类分级查询
Showing
3 changed files
with
123 additions
and
85 deletions
| ... | @@ -49,11 +49,11 @@ export const checkDeleteDictionaryScheme = (params) => request({ | ... | @@ -49,11 +49,11 @@ export const checkDeleteDictionaryScheme = (params) => request({ |
| 49 | data: params | 49 | data: params |
| 50 | }) | 50 | }) |
| 51 | // 分页查询 | 51 | // 分页查询 |
| 52 | // export const getDictionary = (params) => request({ | 52 | export const getDictionary = (params) => request({ |
| 53 | // url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/page-list`, | 53 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/page-list`, |
| 54 | // method: 'post', | 54 | method: 'post', |
| 55 | // data: params | 55 | data: params |
| 56 | // }) | 56 | }) |
| 57 | // 查询数据字典启用状态的数据 | 57 | // 查询数据字典启用状态的数据 |
| 58 | export const getDictionaryAll = (params) => request({ | 58 | export const getDictionaryAll = (params) => request({ |
| 59 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/list-all`, | 59 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/list-all`, |
| ... | @@ -598,10 +598,10 @@ export const filterVal = (val, type) => { | ... | @@ -598,10 +598,10 @@ export const filterVal = (val, type) => { |
| 598 | /** 获取字典列表 | 598 | /** 获取字典列表 |
| 599 | * VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据 | 599 | * VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据 |
| 600 | */ | 600 | */ |
| 601 | export const getDictionary = (params) => request({ | 601 | // export const getDictionary = (params) => request({ |
| 602 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`, | 602 | // url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`, |
| 603 | method: 'post' | 603 | // method: 'post' |
| 604 | }) | 604 | // }) |
| 605 | 605 | ||
| 606 | 606 | ||
| 607 | 607 | ... | ... |
| ... | @@ -24,18 +24,22 @@ import { | ... | @@ -24,18 +24,22 @@ import { |
| 24 | getDbDirDetail, | 24 | getDbDirDetail, |
| 25 | getDbDirTableSelectList, | 25 | getDbDirTableSelectList, |
| 26 | getDbDirFieldSelectList, | 26 | getDbDirFieldSelectList, |
| 27 | updateDataAsset | 27 | updateDataAsset, |
| 28 | getDictionaryAll | ||
| 28 | } from '@/api/modules/dataInventory'; | 29 | } from '@/api/modules/dataInventory'; |
| 29 | import { TableColumnWidth } from "@/utils/enum"; | 30 | import { TableColumnWidth } from "@/utils/enum"; |
| 30 | import router from "@/router"; | 31 | import router from "@/router"; |
| 31 | import { download } from "@/utils/common"; | 32 | import { download } from "@/utils/common"; |
| 32 | import { getLabelList } from "@/api/modules/dataLabel"; | 33 | import { getLabelList } from "@/api/modules/dataLabel"; |
| 34 | import { da } from "element-plus/es/locale"; | ||
| 33 | 35 | ||
| 34 | const currentPath = ref<string[]>([]); | 36 | const currentPath = ref<string[]>([]); |
| 35 | const { proxy } = getCurrentInstance() as any; | 37 | const { proxy } = getCurrentInstance() as any; |
| 36 | const route = useRoute(); | 38 | const route = useRoute(); |
| 37 | // 分级引用refGradeGuid | 39 | // 分级引用refGradeGuid |
| 38 | const refGradeGuid = ref(''); | 40 | const refGradeGuid = ref(''); |
| 41 | // 初始分类classifyDetailGuid | ||
| 42 | const classifyDetailGuidInfo = ref(''); | ||
| 39 | // 分级分类树形列表 | 43 | // 分级分类树形列表 |
| 40 | const CgDirTreeList = ref(); | 44 | const CgDirTreeList = ref(); |
| 41 | const getCgDirTreeData = async () => { | 45 | const getCgDirTreeData = async () => { |
| ... | @@ -50,6 +54,7 @@ const getCgDirTreeData = async () => { | ... | @@ -50,6 +54,7 @@ const getCgDirTreeData = async () => { |
| 50 | currentPath.value = [res.data[0].classifyName]; | 54 | currentPath.value = [res.data[0].classifyName]; |
| 51 | treeInfo.value.expandedKey.push(res.data[0].classifyDetailGuid); | 55 | treeInfo.value.expandedKey.push(res.data[0].classifyDetailGuid); |
| 52 | treeInfo.value.currentNodeKey = res.data[0].classifyDetailGuid; | 56 | treeInfo.value.currentNodeKey = res.data[0].classifyDetailGuid; |
| 57 | classifyDetailGuidInfo.value = res.data[0].classifyDetailGuid; | ||
| 53 | searchItemList.value[1].options = res.data; | 58 | searchItemList.value[1].options = res.data; |
| 54 | refGradeGuid.value = res.data[0].refGradeGuid; | 59 | refGradeGuid.value = res.data[0].refGradeGuid; |
| 55 | treeInfo.value.loading = false; | 60 | treeInfo.value.loading = false; |
| ... | @@ -66,8 +71,9 @@ const getCgDirFieldPage = async (params = {}) => { | ... | @@ -66,8 +71,9 @@ const getCgDirFieldPage = async (params = {}) => { |
| 66 | pageIndex: 1, | 71 | pageIndex: 1, |
| 67 | pageSize: 50, | 72 | pageSize: 50, |
| 68 | execGuid: '', | 73 | execGuid: '', |
| 69 | classifyDetail: '', | 74 | classifyDetail: '', // 分类guid |
| 70 | gradeDetailGuid: '', | 75 | gradeDetailGuid: '', // 分级guid |
| 76 | labelGuid: '', | ||
| 71 | databaseGuid: '', | 77 | databaseGuid: '', |
| 72 | tableGuid: '', | 78 | tableGuid: '', |
| 73 | fieldGuid: '', | 79 | fieldGuid: '', |
| ... | @@ -87,8 +93,9 @@ const getCgDirFieldPage = async (params = {}) => { | ... | @@ -87,8 +93,9 @@ const getCgDirFieldPage = async (params = {}) => { |
| 87 | }; | 93 | }; |
| 88 | 94 | ||
| 89 | const dictionaryList = ref([]); | 95 | const dictionaryList = ref([]); |
| 96 | |||
| 90 | const getDictionaryList = () => { | 97 | const getDictionaryList = () => { |
| 91 | getDictionary({}).then((res: any) => { | 98 | getDictionaryAll({ state: 1 }).then((res: any) => { |
| 92 | dictionaryList.value = []; | 99 | dictionaryList.value = []; |
| 93 | if (res.code == proxy.$passCode) { | 100 | if (res.code == proxy.$passCode) { |
| 94 | dictionaryList.value = res.data || []; | 101 | dictionaryList.value = res.data || []; |
| ... | @@ -115,7 +122,8 @@ onMounted(async () => { | ... | @@ -115,7 +122,8 @@ onMounted(async () => { |
| 115 | await getExecGuid(); | 122 | await getExecGuid(); |
| 116 | await getCgDirTreeData(); | 123 | await getCgDirTreeData(); |
| 117 | await getCgDirFieldPage({ | 124 | await getCgDirFieldPage({ |
| 118 | execGuid: execGuidInfo.value.execGuid | 125 | execGuid: execGuidInfo.value.execGuid, |
| 126 | classifyDetail: classifyDetailGuidInfo.value | ||
| 119 | }); | 127 | }); |
| 120 | getDictionaryList(); | 128 | getDictionaryList(); |
| 121 | getSearchTableList(); | 129 | getSearchTableList(); |
| ... | @@ -218,7 +226,7 @@ const toSearch = (val: any, clear: boolean = false) => { | ... | @@ -218,7 +226,7 @@ const toSearch = (val: any, clear: boolean = false) => { |
| 218 | pageIndex: 1, | 226 | pageIndex: 1, |
| 219 | pageSize: 50, | 227 | pageSize: 50, |
| 220 | execGuid: execGuidInfo.value.execGuid, | 228 | execGuid: execGuidInfo.value.execGuid, |
| 221 | classifyDetail: val.classifyName, | 229 | classifyDetail: classifyDetailGuidInfo.value, |
| 222 | gradeDetailGuid: val.levelName, | 230 | gradeDetailGuid: val.levelName, |
| 223 | labelGuid: val.labelName, | 231 | labelGuid: val.labelName, |
| 224 | databaseGuid: selectedA.value, | 232 | databaseGuid: selectedA.value, |
| ... | @@ -234,9 +242,9 @@ const toSearch = (val: any, clear: boolean = false) => { | ... | @@ -234,9 +242,9 @@ const toSearch = (val: any, clear: boolean = false) => { |
| 234 | database: selectedA.value || '', | 242 | database: selectedA.value || '', |
| 235 | tableName: selectedB.value || '', | 243 | tableName: selectedB.value || '', |
| 236 | fieldName: selectedC.value || '', | 244 | fieldName: selectedC.value || '', |
| 237 | classifyDetailName: val.classifyName, | 245 | classifyDetailGuid: val.classifyName, |
| 238 | gradeDetailName: val.levelName, | 246 | gradeDetailGuid: val.levelName, |
| 239 | label: val.labelName, | 247 | labelGuid: val.labelName, |
| 240 | }); | 248 | }); |
| 241 | } | 249 | } |
| 242 | if (activeName.value === 'second' && activeTab.value === 'word') { | 250 | if (activeName.value === 'second' && activeTab.value === 'word') { |
| ... | @@ -245,10 +253,10 @@ const toSearch = (val: any, clear: boolean = false) => { | ... | @@ -245,10 +253,10 @@ const toSearch = (val: any, clear: boolean = false) => { |
| 245 | pageSize: 50, | 253 | pageSize: 50, |
| 246 | execGuid: execGuidInfo.value.execGuid, | 254 | execGuid: execGuidInfo.value.execGuid, |
| 247 | database: selectedA.value || '', | 255 | database: selectedA.value || '', |
| 248 | tableName: selectedB.value || '', | 256 | fieldName: selectedB.value || '', |
| 249 | classifyDetailName: val.classifyName, | 257 | classifyDetailGuid: val.classifyName, |
| 250 | gradeDetailName: val.levelName, | 258 | gradeDetailGuid: val.levelName, |
| 251 | label: val.labelName, | 259 | labelGuid: val.labelName, |
| 252 | }); | 260 | }); |
| 253 | } | 261 | } |
| 254 | }; | 262 | }; |
| ... | @@ -257,8 +265,10 @@ const toSearch = (val: any, clear: boolean = false) => { | ... | @@ -257,8 +265,10 @@ const toSearch = (val: any, clear: boolean = false) => { |
| 257 | const nodeClick = async (data: any) => { | 265 | const nodeClick = async (data: any) => { |
| 258 | console.log('nodeClick', data); | 266 | console.log('nodeClick', data); |
| 259 | const { guid, classifyDetailGuid, refGradeGuid } = data | 267 | const { guid, classifyDetailGuid, refGradeGuid } = data |
| 268 | classifyDetailGuidInfo.value = classifyDetailGuid; | ||
| 260 | // getGradeData(refGradeGuid); | 269 | // getGradeData(refGradeGuid); |
| 261 | searchItemList.value[1].default = data.classifyName; | 270 | searchItemList.value[1].default = data.classifyName; |
| 271 | |||
| 262 | await getCgDirFieldPage({ | 272 | await getCgDirFieldPage({ |
| 263 | execGuid: execGuidInfo.value.execGuid, | 273 | execGuid: execGuidInfo.value.execGuid, |
| 264 | classifyDetail: classifyDetailGuid, | 274 | classifyDetail: classifyDetailGuid, |
| ... | @@ -407,11 +417,13 @@ const tableCheckboxAllSelectChange = (select) => { | ... | @@ -407,11 +417,13 @@ const tableCheckboxAllSelectChange = (select) => { |
| 407 | 417 | ||
| 408 | // 批量配置业务规则 | 418 | // 批量配置业务规则 |
| 409 | const batchControlRules = () => { | 419 | const batchControlRules = () => { |
| 420 | console.log('selectedRulesData', selectedRulesData.value); | ||
| 410 | // 判断是否选中数据 | 421 | // 判断是否选中数据 |
| 411 | if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) { | 422 | if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) { |
| 412 | proxy.$ElMessage.warning('请选择数据'); | 423 | proxy.$ElMessage.warning('请选择数据'); |
| 413 | return; | 424 | return; |
| 414 | } | 425 | } |
| 426 | |||
| 415 | drawerInfo.value.visible = true; | 427 | drawerInfo.value.visible = true; |
| 416 | classEditFormItems.value[0].default = selectedRulesData.value.rulesName; | 428 | classEditFormItems.value[0].default = selectedRulesData.value.rulesName; |
| 417 | } | 429 | } |
| ... | @@ -475,7 +487,7 @@ const dataBaseTableInfo = ref({ | ... | @@ -475,7 +487,7 @@ const dataBaseTableInfo = ref({ |
| 475 | return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表'; | 487 | return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表'; |
| 476 | } | 488 | } |
| 477 | }, | 489 | }, |
| 478 | { label: "任务修改人", field: "updateUserName", width: 100 }, | 490 | { label: "任务修改人", field: "taskUpdateUserName", width: 100 }, |
| 479 | { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, | 491 | { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, |
| 480 | { label: "描述", field: "description", width: 120, align: 'center' }, | 492 | { label: "描述", field: "description", width: 120, align: 'center' }, |
| 481 | { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' }, | 493 | { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' }, |
| ... | @@ -782,22 +794,20 @@ const drawerBtnClick = async (btn, info) => { | ... | @@ -782,22 +794,20 @@ const drawerBtnClick = async (btn, info) => { |
| 782 | execGuid: execGuidInfo.value.execGuid | 794 | execGuid: execGuidInfo.value.execGuid |
| 783 | }) | 795 | }) |
| 784 | }); | 796 | }); |
| 785 | // const params = { | ||
| 786 | // fieldPrecision, | ||
| 787 | // dictionaryGuid, | ||
| 788 | // isUnique, | ||
| 789 | // isNotNull, | ||
| 790 | // fieldLengthCondition, | ||
| 791 | // fieldValueRange, | ||
| 792 | // fieldGuid: selectedRulesData.value.guids, | ||
| 793 | // execGuid: execGuidInfo.value.execGuid | ||
| 794 | // } | ||
| 795 | const res: any = await saveBizRuleConfig(params); | 797 | const res: any = await saveBizRuleConfig(params); |
| 796 | if (res.code == proxy.$passCode) { | 798 | if (res.code == proxy.$passCode) { |
| 797 | btn.loading = false; | 799 | btn.loading = false; |
| 798 | proxy.$ElMessage.success('配置成功!'); | 800 | proxy.$ElMessage.success('配置成功!'); |
| 799 | drawerInfo.value.visible = false; | 801 | drawerInfo.value.visible = false; |
| 800 | getCgDirFieldPage(); | 802 | getCgDirFieldPage({ |
| 803 | execGuid: execGuidInfo.value.execGuid, | ||
| 804 | classifyDetail: classifyDetailGuidInfo.value, | ||
| 805 | gradeDetailGuid: levelGuidInfo.value, | ||
| 806 | labelGuid: labelGuidInfo.value, | ||
| 807 | databaseGuid: selectedA.value, | ||
| 808 | tableGuid: selectedB.value, | ||
| 809 | fieldGuid: selectedC.value, | ||
| 810 | }); | ||
| 801 | } else { | 811 | } else { |
| 802 | btn.loading = false; | 812 | btn.loading = false; |
| 803 | proxy.$ElMessage.error(res.msg); | 813 | proxy.$ElMessage.error(res.msg); |
| ... | @@ -821,6 +831,7 @@ const handleClick = (tab: any) => { | ... | @@ -821,6 +831,7 @@ const handleClick = (tab: any) => { |
| 821 | console.log(tab.props.name); | 831 | console.log(tab.props.name); |
| 822 | activeName.value = tab.props.name; | 832 | activeName.value = tab.props.name; |
| 823 | if (tab.props.name === 'second') { | 833 | if (tab.props.name === 'second') { |
| 834 | classifyDetailGuidInfo.value = ''; | ||
| 824 | selectedA.value = null; | 835 | selectedA.value = null; |
| 825 | selectedB.value = null; | 836 | selectedB.value = null; |
| 826 | selectedC.value = null; | 837 | selectedC.value = null; |
| ... | @@ -849,8 +860,7 @@ const getDataBaseTreeData = async () => { | ... | @@ -849,8 +860,7 @@ const getDataBaseTreeData = async () => { |
| 849 | dataBaseTreeInfo.value.loading = true; | 860 | dataBaseTreeInfo.value.loading = true; |
| 850 | const res: any = await getDbDirTreeList({}); | 861 | const res: any = await getDbDirTreeList({}); |
| 851 | if (res.code == proxy.$passCode) { | 862 | if (res.code == proxy.$passCode) { |
| 852 | const dataArray = [res.data]; | 863 | const dataArray = res.data; |
| 853 | console.log('dataArray', dataArray, typeof dataArray); | ||
| 854 | // 遍历并添加 GUIDs | 864 | // 遍历并添加 GUIDs |
| 855 | dataArray.forEach(addGuids); | 865 | dataArray.forEach(addGuids); |
| 856 | // 更新到绑定的响应式数据 | 866 | // 更新到绑定的响应式数据 |
| ... | @@ -869,11 +879,7 @@ const addGuids = (node) => { | ... | @@ -869,11 +879,7 @@ const addGuids = (node) => { |
| 869 | } else if (node.tableGuid) { | 879 | } else if (node.tableGuid) { |
| 870 | node.guid = node.tableGuid; | 880 | node.guid = node.tableGuid; |
| 871 | node.name = node.tableChName; | 881 | node.name = node.tableChName; |
| 872 | } else { | ||
| 873 | node.guid = '1'; | ||
| 874 | node.name = node.cgDirName; | ||
| 875 | } | 882 | } |
| 876 | |||
| 877 | if (node.children && Array.isArray(node.children)) { | 883 | if (node.children && Array.isArray(node.children)) { |
| 878 | node.children.forEach(addGuids); | 884 | node.children.forEach(addGuids); |
| 879 | } | 885 | } |
| ... | @@ -887,14 +893,16 @@ const getDataBaseTableData = async (params = {}) => { | ... | @@ -887,14 +893,16 @@ const getDataBaseTableData = async (params = {}) => { |
| 887 | const dataBaseParams = { | 893 | const dataBaseParams = { |
| 888 | pageIndex: dataBasePage.value.curr, | 894 | pageIndex: dataBasePage.value.curr, |
| 889 | pageSize: dataBasePage.value.limit, | 895 | pageSize: dataBasePage.value.limit, |
| 890 | databaseGuid: "", | 896 | tableGuid: tableGuid.value, |
| 897 | databaseGuid: dataBaseGuid.value, | ||
| 891 | isDataAsset: '', | 898 | isDataAsset: '', |
| 892 | execGuid: execGuidInfo.value.execGuid, | 899 | execGuid: execGuidInfo.value.execGuid, |
| 893 | tableName: "", | 900 | tableName: "", |
| 894 | database: "", | 901 | database: "", |
| 895 | label: "", | 902 | fieldName: "", |
| 896 | classifyDetailName: "", | 903 | labelGuid: "", |
| 897 | gradeDetailName: "" | 904 | classifyDetailGuid: "", |
| 905 | gradeDetailGuid: "" | ||
| 898 | }; | 906 | }; |
| 899 | const finalParams = { ...dataBaseParams, ...params }; | 907 | const finalParams = { ...dataBaseParams, ...params }; |
| 900 | 908 | ||
| ... | @@ -939,10 +947,14 @@ const getDataBaseFieldData = async (params = {}) => { | ... | @@ -939,10 +947,14 @@ const getDataBaseFieldData = async (params = {}) => { |
| 939 | pageIndex: dataFieldPage.value.curr, | 947 | pageIndex: dataFieldPage.value.curr, |
| 940 | pageSize: dataFieldPage.value.limit, | 948 | pageSize: dataFieldPage.value.limit, |
| 941 | tableGuid: "", | 949 | tableGuid: "", |
| 942 | execGuid: execGuidInfo.value.execGuid, | ||
| 943 | databaseGuid: "", | 950 | databaseGuid: "", |
| 944 | fieldName: '', | 951 | execGuid: execGuidInfo.value.execGuid, |
| 945 | gradeDetailName: '', | 952 | tableName: "", |
| 953 | database: "", | ||
| 954 | fieldName: "", | ||
| 955 | labelGuid: "", | ||
| 956 | classifyDetailGuid: "", | ||
| 957 | gradeDetailGuid: "" | ||
| 946 | }; | 958 | }; |
| 947 | const finalParams = { ...dataBaseParams, ...params }; | 959 | const finalParams = { ...dataBaseParams, ...params }; |
| 948 | const res: any = await getDbDirFieldPageList(finalParams); | 960 | const res: any = await getDbDirFieldPageList(finalParams); |
| ... | @@ -1011,12 +1023,6 @@ const dataBaseInfo = ref<any>({}); | ... | @@ -1011,12 +1023,6 @@ const dataBaseInfo = ref<any>({}); |
| 1011 | const dataBasenodeClick = (data: any) => { | 1023 | const dataBasenodeClick = (data: any) => { |
| 1012 | isShowCreateBtn.value = false; | 1024 | isShowCreateBtn.value = false; |
| 1013 | console.log('dataBasenodeClick', data); | 1025 | console.log('dataBasenodeClick', data); |
| 1014 | if (data.cgDirName) { | ||
| 1015 | tableGuid.value = ''; | ||
| 1016 | dataBaseGuid.value = ''; | ||
| 1017 | getDataBaseFieldData(); | ||
| 1018 | getDataBaseTableData(); | ||
| 1019 | } | ||
| 1020 | if (data.databaseGuid) { | 1026 | if (data.databaseGuid) { |
| 1021 | dataBaseInfo.value = data; | 1027 | dataBaseInfo.value = data; |
| 1022 | dataBaseGuid.value = data.databaseGuid; | 1028 | dataBaseGuid.value = data.databaseGuid; |
| ... | @@ -1035,9 +1041,7 @@ const dataBasenodeClick = (data: any) => { | ... | @@ -1035,9 +1041,7 @@ const dataBasenodeClick = (data: any) => { |
| 1035 | getDataBaseFieldData({ | 1041 | getDataBaseFieldData({ |
| 1036 | tableGuid: data.tableGuid | 1042 | tableGuid: data.tableGuid |
| 1037 | }); | 1043 | }); |
| 1038 | // getDataBaseTableData({ | 1044 | |
| 1039 | // tableGuid: data.tableGuid | ||
| 1040 | // }); | ||
| 1041 | } | 1045 | } |
| 1042 | 1046 | ||
| 1043 | if (data.databaseGuid || data.cgDirName) { | 1047 | if (data.databaseGuid || data.cgDirName) { |
| ... | @@ -1122,7 +1126,7 @@ const setActiveTab = (tab) => { | ... | @@ -1122,7 +1126,7 @@ const setActiveTab = (tab) => { |
| 1122 | // 数据库字段搜索联动 getDbDirFieldSelectList | 1126 | // 数据库字段搜索联动 getDbDirFieldSelectList |
| 1123 | const getDbDirFieldSelectData = async (type, params = {}) => { | 1127 | const getDbDirFieldSelectData = async (type, params = {}) => { |
| 1124 | const inParams = { | 1128 | const inParams = { |
| 1125 | condition: "database", | 1129 | condition: "1", |
| 1126 | database: "", | 1130 | database: "", |
| 1127 | tableName: "", | 1131 | tableName: "", |
| 1128 | execGuid: execGuidInfo.value.execGuid, | 1132 | execGuid: execGuidInfo.value.execGuid, |
| ... | @@ -1133,14 +1137,20 @@ const getDbDirFieldSelectData = async (type, params = {}) => { | ... | @@ -1133,14 +1137,20 @@ const getDbDirFieldSelectData = async (type, params = {}) => { |
| 1133 | console.log('getDbDirFieldSelectData', res); | 1137 | console.log('getDbDirFieldSelectData', res); |
| 1134 | if (type == 1) { | 1138 | if (type == 1) { |
| 1135 | optionsA.value = res.data.map((item) => ({ | 1139 | optionsA.value = res.data.map((item) => ({ |
| 1136 | dbGuid: item.database, // 数据库标识 | 1140 | dbGuid: item.databaseGuid, // 数据库标识 |
| 1137 | name: item.database, // 数据库名称 | 1141 | name: item.databaseChName, // 数据库名称 |
| 1138 | })); | 1142 | })); |
| 1139 | } | 1143 | } |
| 1140 | if (type == 2) { | 1144 | if (type == 2) { |
| 1141 | optionsB.value = res.data.map((item) => ({ | 1145 | optionsB.value = res.data.map((item) => ({ |
| 1142 | dbGuid: item.tableName, // 表标识 | 1146 | dbGuid: item.tableGuid, // 表标识 |
| 1143 | name: item.tableName, // 表名称 | 1147 | name: item.tableChName, // 表名称 |
| 1148 | })); | ||
| 1149 | } | ||
| 1150 | if (type == 3) { | ||
| 1151 | optionsC.value = res.data.map((item) => ({ | ||
| 1152 | dbGuid: item.fieldGuid, // 字段标识 | ||
| 1153 | name: item.fieldChName, // 字段名称 | ||
| 1144 | })); | 1154 | })); |
| 1145 | } | 1155 | } |
| 1146 | } else { | 1156 | } else { |
| ... | @@ -1173,10 +1183,11 @@ const getSearchTableList = async (type = 1, dbGuid = '') => { | ... | @@ -1173,10 +1183,11 @@ const getSearchTableList = async (type = 1, dbGuid = '') => { |
| 1173 | const getDbDirTableSelectData = async (type, params = {}) => { | 1183 | const getDbDirTableSelectData = async (type, params = {}) => { |
| 1174 | console.log('getDbDirTableSelectData', params); | 1184 | console.log('getDbDirTableSelectData', params); |
| 1175 | const inParams = { | 1185 | const inParams = { |
| 1176 | condition: "database", | 1186 | condition: "1", |
| 1177 | database: "", | ||
| 1178 | tableName: "", | ||
| 1179 | execGuid: execGuidInfo.value.execGuid, | 1187 | execGuid: execGuidInfo.value.execGuid, |
| 1188 | databaseGuid: "", | ||
| 1189 | tableGuid: "", | ||
| 1190 | |||
| 1180 | }; | 1191 | }; |
| 1181 | const finalParams = { ...inParams, ...params }; | 1192 | const finalParams = { ...inParams, ...params }; |
| 1182 | const res: any = await getDbDirTableSelectList(finalParams); | 1193 | const res: any = await getDbDirTableSelectList(finalParams); |
| ... | @@ -1184,21 +1195,28 @@ const getDbDirTableSelectData = async (type, params = {}) => { | ... | @@ -1184,21 +1195,28 @@ const getDbDirTableSelectData = async (type, params = {}) => { |
| 1184 | 1195 | ||
| 1185 | if (type == 1) { | 1196 | if (type == 1) { |
| 1186 | optionsA.value = res.data.map((item) => ({ | 1197 | optionsA.value = res.data.map((item) => ({ |
| 1187 | dbGuid: item.database, // 数据库标识 | 1198 | dbGuid: item.databaseGuid, // 数据库标识 |
| 1188 | name: item.database, // 数据库名称 | 1199 | name: item.databaseChName, // 数据库名称 |
| 1189 | })); | 1200 | })); |
| 1190 | } | 1201 | } |
| 1191 | if (type == 2) { | 1202 | if (type == 2) { |
| 1192 | console.log('进来了吗', res); | 1203 | if (activeTab.value === 'word') { |
| 1204 | console.log('进来了吗', res.data); | ||
| 1205 | optionsC.value = res.data.map((item) => ({ | ||
| 1206 | dbGuid: item.fieldName, // 字段标识 | ||
| 1207 | name: item.fieldName, // 字段名称 | ||
| 1208 | })); | ||
| 1209 | return; | ||
| 1210 | } | ||
| 1193 | optionsB.value = res.data.map((item) => ({ | 1211 | optionsB.value = res.data.map((item) => ({ |
| 1194 | dbGuid: item.database, // 表标识 | 1212 | dbGuid: item.tableGuid, // 表标识 |
| 1195 | name: item.database, // 表名称 | 1213 | name: item.tableChName, // 表名称 |
| 1196 | })); | 1214 | })); |
| 1197 | } | 1215 | } |
| 1198 | if (type == 3) { | 1216 | if (type == 3) { |
| 1199 | optionsC.value = res.data.map((item) => ({ | 1217 | optionsC.value = res.data.map((item) => ({ |
| 1200 | dbGuid: item.database, // 字段标识 | 1218 | dbGuid: item.fieldGuid, // 字段标识 |
| 1201 | name: item.database, // 字段名称 | 1219 | name: item.fieldChName, // 字段名称 |
| 1202 | })); | 1220 | })); |
| 1203 | } | 1221 | } |
| 1204 | 1222 | ||
| ... | @@ -1228,9 +1246,15 @@ const onAChange = async () => { | ... | @@ -1228,9 +1246,15 @@ const onAChange = async () => { |
| 1228 | } | 1246 | } |
| 1229 | if (activeName.value == 'second') { | 1247 | if (activeName.value == 'second') { |
| 1230 | console.log('onAChange', optionsA.value); | 1248 | console.log('onAChange', optionsA.value); |
| 1231 | await getDbDirTableSelectData(2, { database: selectedA.value }); // 数据库搜索 | 1249 | |
| 1250 | if (activeTab.value === 'word') { | ||
| 1251 | await getDbDirFieldSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); | ||
| 1252 | } else { | ||
| 1253 | await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索 | ||
| 1254 | } | ||
| 1232 | } | 1255 | } |
| 1233 | 1256 | ||
| 1257 | |||
| 1234 | }; | 1258 | }; |
| 1235 | 1259 | ||
| 1236 | // 第二个下拉框值改变时 | 1260 | // 第二个下拉框值改变时 |
| ... | @@ -1243,7 +1267,11 @@ const onBChange = async () => { | ... | @@ -1243,7 +1267,11 @@ const onBChange = async () => { |
| 1243 | await getSearchTableList(3, selectedB.value); // 分类分级搜索 | 1267 | await getSearchTableList(3, selectedB.value); // 分类分级搜索 |
| 1244 | } | 1268 | } |
| 1245 | if (activeName.value == 'second') { | 1269 | if (activeName.value == 'second') { |
| 1246 | await getDbDirTableSelectData(3, { tableName: selectedB.value }); // 数据库搜索 | 1270 | if (activeTab.value === 'word') { |
| 1271 | await getDbDirFieldSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" }); | ||
| 1272 | } else { | ||
| 1273 | await getDbDirTableSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" }); // 数据库搜索 | ||
| 1274 | } | ||
| 1247 | } | 1275 | } |
| 1248 | }; | 1276 | }; |
| 1249 | 1277 | ||
| ... | @@ -1265,10 +1293,19 @@ const exportDB = async () => { | ... | @@ -1265,10 +1293,19 @@ const exportDB = async () => { |
| 1265 | }); | 1293 | }); |
| 1266 | } | 1294 | } |
| 1267 | 1295 | ||
| 1268 | // 分类选择 | 1296 | |
| 1269 | const treeSelectNodeChange = (node, item) => { | 1297 | // 标签guid |
| 1270 | const { refGradeGuid } = node; | 1298 | const labelGuidInfo = ref(''); |
| 1271 | // getGradeData(refGradeGuid); | 1299 | // 分级guid信息 |
| 1300 | const levelGuidInfo = ref(''); | ||
| 1301 | // 标签选择 | ||
| 1302 | const selectChange = (val, row, info) => { | ||
| 1303 | console.log('selectChange', val, row, info); | ||
| 1304 | if (info) { | ||
| 1305 | labelGuidInfo.value = info.labelName; | ||
| 1306 | classifyDetailGuidInfo.value = info.classifyName; | ||
| 1307 | levelGuidInfo.value = info.levelName; | ||
| 1308 | } | ||
| 1272 | } | 1309 | } |
| 1273 | 1310 | ||
| 1274 | // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、 | 1311 | // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、 |
| ... | @@ -1303,11 +1340,11 @@ onActivated(async () => { | ... | @@ -1303,11 +1340,11 @@ onActivated(async () => { |
| 1303 | <el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> | 1340 | <el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> |
| 1304 | </el-select> | 1341 | </el-select> |
| 1305 | <el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px" | 1342 | <el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px" |
| 1306 | :clearable="true" v-if="isShowWordSearch"> | 1343 | :clearable="true"> |
| 1307 | <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> | 1344 | <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> |
| 1308 | </el-select> | 1345 | </el-select> |
| 1309 | <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" | 1346 | <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" |
| 1310 | @treeSelectNodeChange="treeSelectNodeChange" /> | 1347 | @selectChange="selectChange" /> |
| 1311 | </div> | 1348 | </div> |
| 1312 | <div class="container_wrap full flex"> | 1349 | <div class="container_wrap full flex"> |
| 1313 | <div class="aside_wrap"> | 1350 | <div class="aside_wrap"> |
| ... | @@ -1423,13 +1460,11 @@ onActivated(async () => { | ... | @@ -1423,13 +1460,11 @@ onActivated(async () => { |
| 1423 | <el-checkbox v-model="checked" label="仅看规划数据资产表" size="large" @change="changeCheck" /> | 1460 | <el-checkbox v-model="checked" label="仅看规划数据资产表" size="large" @change="changeCheck" /> |
| 1424 | </div> | 1461 | </div> |
| 1425 | </div> | 1462 | </div> |
| 1426 | <div class="table_panel_wrap_database" v-if="!tableGuid && activeTab === 'table'" | 1463 | <div class="table_panel_wrap_database" v-if="!tableGuid && activeTab === 'table'"> |
| 1427 | :style="{ height: '483px', minHeight: '210px' }"> | ||
| 1428 | <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange" | 1464 | <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange" |
| 1429 | @tableSwitchBeforeChange="tableSwitchBeforeChange" /> | 1465 | @tableSwitchBeforeChange="tableSwitchBeforeChange" /> |
| 1430 | </div> | 1466 | </div> |
| 1431 | <div class="table_field" v-if="tableGuid || activeTab === 'word'" | 1467 | <div class="table_field" v-if="tableGuid || activeTab === 'word'"> |
| 1432 | :style="{ height: '523px', minHeight: '210px' }"> | ||
| 1433 | <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" /> | 1468 | <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" /> |
| 1434 | </div> | 1469 | </div> |
| 1435 | </div> | 1470 | </div> |
| ... | @@ -1459,6 +1494,7 @@ onActivated(async () => { | ... | @@ -1459,6 +1494,7 @@ onActivated(async () => { |
| 1459 | padding: 0; | 1494 | padding: 0; |
| 1460 | display: flex; | 1495 | display: flex; |
| 1461 | justify-content: space-between; | 1496 | justify-content: space-between; |
| 1497 | height: calc(100% - 44px); | ||
| 1462 | 1498 | ||
| 1463 | .aside_wrap { | 1499 | .aside_wrap { |
| 1464 | width: 199px; | 1500 | width: 199px; |
| ... | @@ -1567,19 +1603,21 @@ onActivated(async () => { | ... | @@ -1567,19 +1603,21 @@ onActivated(async () => { |
| 1567 | 1603 | ||
| 1568 | .table_panel_wrap { | 1604 | .table_panel_wrap { |
| 1569 | width: 100%; | 1605 | width: 100%; |
| 1570 | height: 520px; | 1606 | height: calc(100% - 130px); |
| 1571 | min-height: 210px; | 1607 | min-height: 210px; |
| 1572 | overflow: visible; | 1608 | overflow: visible; |
| 1573 | } | 1609 | } |
| 1574 | 1610 | ||
| 1575 | .table_panel_wrap_database { | 1611 | .table_panel_wrap_database { |
| 1576 | width: 100%; | 1612 | width: 100%; |
| 1613 | height: calc(100% - 170px); | ||
| 1577 | min-height: 210px; | 1614 | min-height: 210px; |
| 1578 | overflow: visible; | 1615 | overflow: visible; |
| 1579 | } | 1616 | } |
| 1580 | 1617 | ||
| 1581 | .table_field { | 1618 | .table_field { |
| 1582 | width: 100%; | 1619 | width: 100%; |
| 1620 | height: calc(100% - 130px); | ||
| 1583 | min-height: 210px; | 1621 | min-height: 210px; |
| 1584 | overflow: visible; | 1622 | overflow: visible; |
| 1585 | } | 1623 | } | ... | ... |
| ... | @@ -677,7 +677,7 @@ const treePromise = ref(); | ... | @@ -677,7 +677,7 @@ const treePromise = ref(); |
| 677 | // 获取数据字典树形数据 | 677 | // 获取数据字典树形数据 |
| 678 | const getTreeData = (needClick = false, currData = {}) => { | 678 | const getTreeData = (needClick = false, currData = {}) => { |
| 679 | const params = { | 679 | const params = { |
| 680 | paramCode: 'data_structure_code' | 680 | paramCode: '数据字典类型' |
| 681 | } | 681 | } |
| 682 | treeInfo.value.loading = true | 682 | treeInfo.value.loading = true |
| 683 | treePromise.value = getDictionaryTree(params).then((res: any) => { | 683 | treePromise.value = getDictionaryTree(params).then((res: any) => { | ... | ... |
-
Please register or sign in to post a comment