3c2a1245 by xukangle

fix: 修改分类分级

1 parent ec743969
...@@ -756,7 +756,13 @@ export const updateDbDirTable = (data) => request({ ...@@ -756,7 +756,13 @@ export const updateDbDirTable = (data) => request({
756 export const createTableSql = (data) => request({ 756 export const createTableSql = (data) => request({
757 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/create-table-sql`, 757 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/create-table-sql`,
758 method: 'post', 758 method: 'post',
759 data 759 data,
760 responseType: 'blob',
761 })
762 /**删除新建表 */
763 export const deleteDbDirTable = (params) => request({
764 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/del?tableGuid=${params.tableGuid}`,
765 method: 'get',
760 }) 766 })
761 767
762 /** 768 /**
......
...@@ -1138,7 +1138,8 @@ const panelChange = (scope, row) => { ...@@ -1138,7 +1138,8 @@ const panelChange = (scope, row) => {
1138 :value="child.props?.value ? opts[child.props.value] : opts.value" :disabled="opts.disabled" /> 1138 :value="child.props?.value ? opts[child.props.value] : opts.value" :disabled="opts.disabled" />
1139 </el-select> 1139 </el-select>
1140 <el-input v-else v-model.trim="formInline[child.field]" :placeholder="child.placeholder" 1140 <el-input v-else v-model.trim="formInline[child.field]" :placeholder="child.placeholder"
1141 :clearable="child.clearable" :maxlength="child.maxlength ?? ''" /> 1141 :clearable="child.clearable" :maxlength="child.maxlength ?? ''"
1142 @change="(val) => inputChange(val, child)" @input="(val) => inputEventChange(val, child)" />
1142 </el-form-item> 1143 </el-form-item>
1143 </template> 1144 </template>
1144 </div> 1145 </div>
......
...@@ -26,12 +26,13 @@ import { ...@@ -26,12 +26,13 @@ import {
26 getDbDirFieldSelectList, 26 getDbDirFieldSelectList,
27 updateDataAsset, 27 updateDataAsset,
28 getDictionaryAll, 28 getDictionaryAll,
29 getNewDataTypeList 29 getNewDataTypeList,
30 deleteDbDirTable
30 } from '@/api/modules/dataInventory'; 31 } from '@/api/modules/dataInventory';
31 import { TableColumnWidth } from "@/utils/enum"; 32 import { TableColumnWidth } from "@/utils/enum";
32 import router from "@/router"; 33 import router from "@/router";
33 import { download } from "@/utils/common"; 34 import { download } from "@/utils/common";
34 import { vi } from "element-plus/es/locale"; 35
35 const currentPath = ref<string[]>([]); 36 const currentPath = ref<string[]>([]);
36 const currentDatabasePath = ref<string[]>([]); 37 const currentDatabasePath = ref<string[]>([]);
37 const { proxy } = getCurrentInstance() as any; 38 const { proxy } = getCurrentInstance() as any;
...@@ -105,7 +106,7 @@ const getDictionaryList = () => { ...@@ -105,7 +106,7 @@ const getDictionaryList = () => {
105 dictionaryList.value = []; 106 dictionaryList.value = [];
106 if (res.code == proxy.$passCode) { 107 if (res.code == proxy.$passCode) {
107 dictionaryList.value = res.data || []; 108 dictionaryList.value = res.data || [];
108 classEditFormItems.value[4].options = res.data || []; 109 classEditFormItems.value[5].options = res.data || [];
109 } else { 110 } else {
110 proxy.$ElMessage.error(res.msg); 111 proxy.$ElMessage.error(res.msg);
111 } 112 }
...@@ -544,11 +545,13 @@ const batchControlRules = () => { ...@@ -544,11 +545,13 @@ const batchControlRules = () => {
544 545
545 // 如果全都是单文本框或者全都是双文本框,则继续后续操作 546 // 如果全都是单文本框或者全都是双文本框,则继续后续操作
546 if (isSingleInputField) { 547 if (isSingleInputField) {
547 classEditFormItems.value[5].visible = true; 548 classEditFormItems.value[4].visible = false;
548 classEditFormItems.value[6].visible = false;
549 } else if (isDoubleInputField) {
550 classEditFormItems.value[5].visible = false;
551 classEditFormItems.value[6].visible = true; 549 classEditFormItems.value[6].visible = true;
550 classEditFormItems.value[7].visible = false;
551 } else if (isDoubleInputField) {
552 classEditFormItems.value[4].visible = true;
553 classEditFormItems.value[6].visible = false;
554 classEditFormItems.value[7].visible = true;
552 } 555 }
553 classEditFormItems.value[0].default = selectedRulesData.value.rulesName; 556 classEditFormItems.value[0].default = selectedRulesData.value.rulesName;
554 drawerInfo.value.visible = true; 557 drawerInfo.value.visible = true;
...@@ -607,7 +610,7 @@ const dataBaseTableInfo = ref({ ...@@ -607,7 +610,7 @@ const dataBaseTableInfo = ref({
607 } 610 }
608 }, 611 },
609 { 612 {
610 label: "状态", field: "state", type: 'tag', width: 120, getName: (scope) => { 613 label: "状态", field: "state", type: 'tag', width: 120, align: "center", getName: (scope) => {
611 let status = scope.row.state; 614 let status = scope.row.state;
612 // 0 草稿中 1 已建表 2 已有默认表 615 // 0 草稿中 1 已建表 2 已有默认表
613 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表'; 616 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
...@@ -615,7 +618,7 @@ const dataBaseTableInfo = ref({ ...@@ -615,7 +618,7 @@ const dataBaseTableInfo = ref({
615 }, 618 },
616 { label: "修改人", field: "taskUpdateUserName", width: 100 }, 619 { label: "修改人", field: "taskUpdateUserName", width: 100 },
617 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, 620 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
618 { label: "描述", field: "description", width: 120, align: 'center' }, 621 { label: "描述", field: "description", width: 120, align: 'left' },
619 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' }, 622 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' },
620 623
621 ], 624 ],
...@@ -628,7 +631,7 @@ const dataBaseTableInfo = ref({ ...@@ -628,7 +631,7 @@ const dataBaseTableInfo = ref({
628 actionInfo: { 631 actionInfo: {
629 label: "操作", 632 label: "操作",
630 type: "btn", 633 type: "btn",
631 width: 200, 634 width: 240,
632 fixed: 'right', 635 fixed: 'right',
633 btns: (scope) => { 636 btns: (scope) => {
634 return [ 637 return [
...@@ -668,6 +671,7 @@ const dataBaseTableInfo = ref({ ...@@ -668,6 +671,7 @@ const dataBaseTableInfo = ref({
668 database: scope.row.database, 671 database: scope.row.database,
669 databaseChName: scope.row.databaseChName, 672 databaseChName: scope.row.databaseChName,
670 databaseGuid: scope.row.databaseGuid, 673 databaseGuid: scope.row.databaseGuid,
674 state: scope.row.state,
671 } 675 }
672 }); 676 });
673 } else { 677 } else {
...@@ -682,11 +686,43 @@ const dataBaseTableInfo = ref({ ...@@ -682,11 +686,43 @@ const dataBaseTableInfo = ref({
682 database: scope.row.database, 686 database: scope.row.database,
683 databaseChName: scope.row.databaseChName, 687 databaseChName: scope.row.databaseChName,
684 databaseGuid: scope.row.databaseGuid, 688 databaseGuid: scope.row.databaseGuid,
689 state: scope.row.state,
685 } 690 }
686 }); 691 });
687 } 692 }
688 }, 693 },
689 disabled: scope.row.state !== 2 ? false : true 694 disabled: scope.row.state !== 2 ? false : true
695 },
696 {
697 //删除
698 label: "删除", value: "delete", click: (scope) => {
699 console.log('删除', scope);
700 proxy.$confirm('此操作将永久删除该表, 是否继续?', '提示', {
701 confirmButtonText: '确定',
702 cancelButtonText: '取消',
703 type: 'warning'
704 }).then(async () => {
705 const res: any = await deleteDbDirTable({ tableGuid: scope.row.tableGuid });
706 if (res.code == proxy.$passCode) {
707 proxy.$ElMessage.success('删除成功');
708 dataBaseTableInfo.value.loading = true;
709 await getDataBaseTableData({
710 pageIndex: dataBasePage.value.curr,
711 pageSize: dataBasePage.value.limit
712 });
713 dataBaseTableInfo.value.loading = false;
714
715 } else {
716 proxy.$ElMessage.error(res.msg);
717 }
718 }).catch(() => {
719 proxy.$ElMessage({
720 type: 'info',
721 message: '已取消删除'
722 });
723 });
724 },
725 disabled: scope.row.state == 2 ? true : false
690 } 726 }
691 ] 727 ]
692 } 728 }
...@@ -770,6 +806,7 @@ const classEditFormItems = ref<any>([{ ...@@ -770,6 +806,7 @@ const classEditFormItems = ref<any>([{
770 placeholder: '请选择', 806 placeholder: '请选择',
771 field: 'orderNumLength', 807 field: 'orderNumLength',
772 options: selectLength.value, 808 options: selectLength.value,
809 default: '',
773 required: false, 810 required: false,
774 clearable: true, 811 clearable: true,
775 }, 812 },
...@@ -783,37 +820,41 @@ const classEditFormItems = ref<any>([{ ...@@ -783,37 +820,41 @@ const classEditFormItems = ref<any>([{
783 required: false, 820 required: false,
784 clearable: true, 821 clearable: true,
785 col: 'numberClass', 822 col: 'numberClass',
786 visable: true, 823 visible: true,
787 }, 824 },
788 // { 825 {
789 // label: '', 826 label: '',
790 // type: 'input-group', 827 type: 'input-group',
791 // placeholder: '请输入', 828 placeholder: '请输入',
792 // field: 'orderNum1', 829 field: 'orderNum1',
793 // default: '', 830 default: '',
794 // children: [ 831 children: [
795 // { 832 {
796 // type: 'input', 833 type: 'input',
797 // placeholder: '请输入', 834 placeholder: '请输入',
798 // field: 'startNumber', 835 field: 'startNumber',
799 // default: '', 836 default: '',
800 // clearable: true, 837 maxlength: 6,
801 // required: false, 838 regexp: /\D/g,
839 clearable: true,
840 required: false,
802 841
803 // }, 842 },
804 // { 843 {
805 // type: 'input', 844 type: 'input',
806 // placeholder: '请输入', 845 placeholder: '请输入',
807 // field: 'endNumber', 846 field: 'endNumber',
808 // default: '', 847 default: '',
809 // clearable: true, 848 maxlength: 6,
810 // required: false, 849 regexp: /\D/g,
811 // }, 850 clearable: true,
812 // ], 851 required: false,
813 // col: 'col2', 852 },
814 // clearable: true, 853 ],
815 // visable: false, 854 col: 'numberClass',
816 // }, 855 clearable: true,
856 visible: false,
857 },
817 { 858 {
818 label: '精度', 859 label: '精度',
819 type: 'input', 860 type: 'input',
...@@ -824,6 +865,7 @@ const classEditFormItems = ref<any>([{ ...@@ -824,6 +865,7 @@ const classEditFormItems = ref<any>([{
824 required: false, 865 required: false,
825 clearable: true, 866 clearable: true,
826 block: true, 867 block: true,
868 visible: true,
827 }, { 869 }, {
828 label: '关联字典', 870 label: '关联字典',
829 field: 'dictionaryGuid', 871 field: 'dictionaryGuid',
...@@ -849,35 +891,34 @@ const classEditFormItems = ref<any>([{ ...@@ -849,35 +891,34 @@ const classEditFormItems = ref<any>([{
849 clearable: true, 891 clearable: true,
850 block: false, 892 block: false,
851 disabled: false, 893 disabled: false,
852 visable: true, 894 visible: false,
853 }, 895 },
854 { 896 {
855 label: '字段取值范围', 897 label: '字段取值范围',
856 type: 'input-group', 898 type: 'input-group',
857 placeholder: '请输入', 899 placeholder: '请输入',
858 field: 'fieldValueRange', 900 field: 'fieldValueRange',
859 default: '',
860 children: [ 901 children: [
861 { 902 {
862 type: 'input', 903 type: 'input',
863 placeholder: '请输入', 904 placeholder: '请输入',
864 field: 'startValue', 905 field: 'startValue',
865 default: '',
866 clearable: true, 906 clearable: true,
867 required: true, 907 required: false,
908 regexp: /\D/g,
868 }, 909 },
869 { 910 {
870 type: 'input', 911 type: 'input',
871 placeholder: '请输入', 912 placeholder: '请输入',
872 field: 'endValue', 913 field: 'endValue',
873 default: '',
874 clearable: true, 914 clearable: true,
875 required: true, 915 required: false,
916 regexp: /\D/g,
876 }, 917 },
877 ], 918 ],
878 col: 'col2', 919 col: 'col2',
879 clearable: true, 920 clearable: true,
880 visable: true, 921 visible: true,
881 }, 922 },
882 // 替换为下拉 923 // 替换为下拉
883 { 924 {
...@@ -885,7 +926,7 @@ const classEditFormItems = ref<any>([{ ...@@ -885,7 +926,7 @@ const classEditFormItems = ref<any>([{
885 type: "select", 926 type: "select",
886 field: "isUnique", 927 field: "isUnique",
887 disabled: false, 928 disabled: false,
888 default: 'N', 929 default: '',
889 options: [ 930 options: [
890 { label: "是", value: "Y", disabled: false }, 931 { label: "是", value: "Y", disabled: false },
891 { label: "否", value: "N", disabled: false }, 932 { label: "否", value: "N", disabled: false },
...@@ -909,7 +950,7 @@ const classEditFormItems = ref<any>([{ ...@@ -909,7 +950,7 @@ const classEditFormItems = ref<any>([{
909 type: "select", 950 type: "select",
910 field: "isNotNull", 951 field: "isNotNull",
911 disabled: false, 952 disabled: false,
912 default: 'N', 953 default: '',
913 options: [ 954 options: [
914 { label: "是", value: "Y", disabled: false }, 955 { label: "是", value: "Y", disabled: false },
915 { label: "否", value: "N", disabled: false }, 956 { label: "否", value: "N", disabled: false },
...@@ -973,8 +1014,18 @@ const drawerBtnClick = async (btn, info) => { ...@@ -973,8 +1014,18 @@ const drawerBtnClick = async (btn, info) => {
973 } else { 1014 } else {
974 btn.loading = true; 1015 btn.loading = true;
975 console.log('drawerBtnClick', info); 1016 console.log('drawerBtnClick', info);
976 const { orderNumLength, orderNum, fieldValueRange, startValue, endValue, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info; 1017 const { orderNumLength, orderNum, startNumber, endNumber, fieldValueRange, startValue, endValue, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info;
977 // 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒 1018 // 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
1019 let fieldLengthCondition: any = '';
1020 if ((orderNumLength === 'between' && !startNumber) || (orderNumLength === 'between' && !endNumber)) {
1021 proxy.$ElMessage.error('请选择长度边界范围');
1022 btn.loading = false;
1023 return;
1024 } else {
1025 fieldLengthCondition = orderNumLength + '#' + startNumber + '#' + endNumber;
1026 }
1027
1028 if (orderNumLength !== 'between') {
978 if (orderNumLength && !orderNum) { 1029 if (orderNumLength && !orderNum) {
979 proxy.$ElMessage.error('请填写长度'); 1030 proxy.$ElMessage.error('请填写长度');
980 btn.loading = false; 1031 btn.loading = false;
...@@ -985,13 +1036,14 @@ const drawerBtnClick = async (btn, info) => { ...@@ -985,13 +1036,14 @@ const drawerBtnClick = async (btn, info) => {
985 btn.loading = false; 1036 btn.loading = false;
986 return; 1037 return;
987 } 1038 }
988 let fieldLengthCondition: any = ''; 1039
989 if (!orderNumLength && !orderNum) { 1040 if (!orderNumLength && !orderNum) {
990 fieldLengthCondition = ''; 1041 fieldLengthCondition = '';
991 } 1042 }
992 if (orderNumLength && orderNum) { 1043 if (orderNumLength && orderNum) {
993 fieldLengthCondition = orderNumLength + '#' + orderNum; 1044 fieldLengthCondition = orderNumLength + '#' + orderNum;
994 } 1045 }
1046 }
995 1047
996 const params: any = []; 1048 const params: any = [];
997 selectedRulesData.value.guids.forEach((item: any) => { 1049 selectedRulesData.value.guids.forEach((item: any) => {
...@@ -1037,8 +1089,6 @@ const drawerBtnClick = async (btn, info) => { ...@@ -1037,8 +1089,6 @@ const drawerBtnClick = async (btn, info) => {
1037 btn.loading = false; 1089 btn.loading = false;
1038 proxy.$ElMessage.error(res.msg); 1090 proxy.$ElMessage.error(res.msg);
1039 } 1091 }
1040
1041
1042 } 1092 }
1043 } 1093 }
1044 1094
...@@ -1047,10 +1097,13 @@ const drawerSelectChange = (val, row, info) => { ...@@ -1047,10 +1097,13 @@ const drawerSelectChange = (val, row, info) => {
1047 if (val === 'between') { 1097 if (val === 'between') {
1048 classEditFormItems.value.forEach(item => { 1098 classEditFormItems.value.forEach(item => {
1049 if (item.field === 'orderNum') { 1099 if (item.field === 'orderNum') {
1050 item.visable = false; 1100 item.visible = false;
1051 } 1101 }
1052 if (item.field === 'orderNum1') { 1102 if (item.field === 'orderNum1') {
1053 item.visable = true; 1103 item.visible = true;
1104 }
1105 if (item.field === 'orderNumLength') {
1106 item.default = val;
1054 } 1107 }
1055 }); 1108 });
1056 } 1109 }
...@@ -1657,18 +1710,9 @@ const selectChange = (val, row, info) => { ...@@ -1657,18 +1710,9 @@ const selectChange = (val, row, info) => {
1657 // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、 1710 // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、
1658 onActivated(async () => { 1711 onActivated(async () => {
1659 if (localStorage.getItem('shouldReloadData') === 'true') { 1712 if (localStorage.getItem('shouldReloadData') === 'true') {
1660 await getExecGuid();
1661 activeName.value = 'second';
1662 await getDataBaseTreeData();
1663 await getDataBaseTableData({ 1713 await getDataBaseTableData({
1664 exexGuid: execGuidInfo.value.execGuid 1714 exexGuid: execGuidInfo.value.execGuid
1665 }); 1715 });
1666 getDataBaseFieldData(
1667 {
1668 exexGuid: execGuidInfo.value.execGuid
1669 }
1670 );
1671 getDbDirTableSelectData(1, {});
1672 localStorage.removeItem('shouldReloadData'); 1716 localStorage.removeItem('shouldReloadData');
1673 } 1717 }
1674 }); 1718 });
......
...@@ -520,8 +520,10 @@ const validatePositiveInteger = (row: any, field: string) => { ...@@ -520,8 +520,10 @@ const validatePositiveInteger = (row: any, field: string) => {
520 520
521 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center"> 521 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
522 <template #default="scope"> 522 <template #default="scope">
523 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{ 523 <!-- 判断是否是浮点型,并且当前行是否可编辑 -->
524 scope.row.fieldPrecision ? scope.row.fieldPrecision : '--' }}</span> 524 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision || scope.row.fieldType !== 'float'">
525 {{ scope.row.fieldPrecision ? scope.row.fieldPrecision : '--' }}
526 </span>
525 <el-input v-else v-model="scope.row.fieldPrecision" placeholder="请输入精度" clearable /> 527 <el-input v-else v-model="scope.row.fieldPrecision" placeholder="请输入精度" clearable />
526 </template> 528 </template>
527 </el-table-column> 529 </el-table-column>
......
...@@ -21,6 +21,7 @@ import { ...@@ -21,6 +21,7 @@ import {
21 } from "@/api/modules/dataInventory"; 21 } from "@/api/modules/dataInventory";
22 import existingTableSelect from "./existingTableSelect.vue"; 22 import existingTableSelect from "./existingTableSelect.vue";
23 import useUserStore from "@/store/modules/user"; 23 import useUserStore from "@/store/modules/user";
24 import { download } from "@/utils/common";
24 25
25 26
26 /** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/ 27 /** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/
...@@ -228,6 +229,7 @@ const selectedDatabaseTableInfo = ref<any>([]); ...@@ -228,6 +229,7 @@ const selectedDatabaseTableInfo = ref<any>([]);
228 const datasourceSelectedRows: Ref<any> = ref([]); 229 const datasourceSelectedRows: Ref<any> = ref([]);
229 // 记录数据库databaseGuid 230 // 记录数据库databaseGuid
230 const handlDsSelectedChange = (v, curr) => { 231 const handlDsSelectedChange = (v, curr) => {
232 tableDataInfo.value[0].description = curr.description || '';
231 selectedDatabaseTableInfo.value = curr || ''; 233 selectedDatabaseTableInfo.value = curr || '';
232 datasourceSelectedRows.value = v || []; 234 datasourceSelectedRows.value = v || [];
233 const params: any = []; 235 const params: any = [];
...@@ -374,7 +376,7 @@ const editableFields = { ...@@ -374,7 +376,7 @@ const editableFields = {
374 classifyDetailGuid: true, // 分类可编辑 376 classifyDetailGuid: true, // 分类可编辑
375 fieldType: true, // 字段类型可编辑 377 fieldType: true, // 字段类型可编辑
376 fieldChName: true, // 字段中文名可编辑 378 fieldChName: true, // 字段中文名可编辑
377 379 sourceFieldChName: true, // 源字段中文名可编辑
378 } 380 }
379 381
380 const tableFieldsLoading = ref(false) 382 const tableFieldsLoading = ref(false)
...@@ -802,6 +804,7 @@ const saveOrUpdate = async (params: any = {}, type) => { ...@@ -802,6 +804,7 @@ const saveOrUpdate = async (params: any = {}, type) => {
802 if (res1.code === proxy.$passCode) { 804 if (res1.code === proxy.$passCode) {
803 proxy.$ElMessage.success('编辑成功!'); 805 proxy.$ElMessage.success('编辑成功!');
804 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 806 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
807 localStorage.setItem('shouldReloadData', 'true');
805 router.push({ name: 'classifyGradeCatalogue' }); 808 router.push({ name: 'classifyGradeCatalogue' });
806 } else { 809 } else {
807 saveBtn.value = false 810 saveBtn.value = false
...@@ -810,12 +813,12 @@ const saveOrUpdate = async (params: any = {}, type) => { ...@@ -810,12 +813,12 @@ const saveOrUpdate = async (params: any = {}, type) => {
810 break; 813 break;
811 case 2: 814 case 2:
812 // 生成建表语句 815 // 生成建表语句
813 const res2: any = await createTableSql(finalParams); 816 createTableSql(finalParams).then((res: any) => {
814 if (res2.code === proxy.$passCode) { 817 download(res, '分类分级目录数据.xlsx', 'excel')
815 proxy.$ElMessage.success('建表sql生成成功!'); 818 });
816 } else { 819
817 proxy.$ElMessage.error(res2.msg); 820
818 } 821
819 break; 822 break;
820 default: 823 default:
821 break; 824 break;
...@@ -975,7 +978,7 @@ onActivated(() => { ...@@ -975,7 +978,7 @@ onActivated(() => {
975 <span style="color:red;margin-left: 2px;">*</span> 978 <span style="color:red;margin-left: 2px;">*</span>
976 </template> 979 </template>
977 <template #default="scope"> 980 <template #default="scope">
978 <el-input v-model="scope.row.tableName" placeholder="请输入表名称" /> 981 <el-input v-model="scope.row.tableName" placeholder="请输入表名称" :disabled="route.query.state === '1'" />
979 </template> 982 </template>
980 </el-table-column> 983 </el-table-column>
981 984
...@@ -1019,7 +1022,9 @@ onActivated(() => { ...@@ -1019,7 +1022,9 @@ onActivated(() => {
1019 <el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip> 1022 <el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip>
1020 <!-- 可以编辑 --> 1023 <!-- 可以编辑 -->
1021 <template #default="scope"> 1024 <template #default="scope">
1022 <span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{ scope.row.fieldChName ? 1025 <span
1026 v-if="!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
1027 scope.row.fieldChName ?
1023 scope.row.fieldChName 1028 scope.row.fieldChName
1024 : '--' }}</span> 1029 : '--' }}</span>
1025 <el-input v-else v-model="scope.row.fieldChName" placeholder="请输入" /> 1030 <el-input v-else v-model="scope.row.fieldChName" placeholder="请输入" />
...@@ -1029,7 +1034,9 @@ onActivated(() => { ...@@ -1029,7 +1034,9 @@ onActivated(() => {
1029 <!-- 字段英文名(可编辑) --> 1034 <!-- 字段英文名(可编辑) -->
1030 <el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip> 1035 <el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip>
1031 <template #default="scope"> 1036 <template #default="scope">
1032 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ? 1037 <span
1038 v-if="!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
1039 scope.row.fieldName ?
1033 scope.row.fieldName 1040 scope.row.fieldName
1034 : '--' }}</span> 1041 : '--' }}</span>
1035 <el-input v-else v-model="scope.row.fieldName" placeholder="必填" 1042 <el-input v-else v-model="scope.row.fieldName" placeholder="必填"
...@@ -1037,25 +1044,29 @@ onActivated(() => { ...@@ -1037,25 +1044,29 @@ onActivated(() => {
1037 </template> 1044 </template>
1038 </el-table-column> 1045 </el-table-column>
1039 <!-- 源数据库 --> 1046 <!-- 源数据库 -->
1040 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip> 1047 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip
1048 v-if="route.query.foundMode == '1'">
1041 <template #default="scope"> 1049 <template #default="scope">
1042 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }} 1050 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
1043 </template> 1051 </template>
1044 </el-table-column> 1052 </el-table-column>
1045 <!-- 源数据表 --> 1053 <!-- 源数据表 -->
1046 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip> 1054 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip
1055 v-if="route.query.foundMode === '1'">
1047 <template #default="scope"> 1056 <template #default="scope">
1048 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }} 1057 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
1049 </template> 1058 </template>
1050 </el-table-column> 1059 </el-table-column>
1051 <!-- 源字段中文 --> 1060 <!-- 源字段中文 -->
1052 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip> 1061 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip
1062 v-if="route.query.foundMode === '1'">
1053 <template #default="scope"> 1063 <template #default="scope">
1054 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} 1064 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
1055 </template> 1065 </template>
1056 </el-table-column> 1066 </el-table-column>
1057 <!-- 源字段英文 --> 1067 <!-- 源字段英文 -->
1058 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip> 1068 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip
1069 v-if="route.query.foundMode === '1'">
1059 <template #default="scope"> 1070 <template #default="scope">
1060 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} --> 1071 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
1061 1072
...@@ -1067,7 +1078,7 @@ onActivated(() => { ...@@ -1067,7 +1078,7 @@ onActivated(() => {
1067 <!-- 源端字段 fieldType fieldTypeProps--> 1078 <!-- 源端字段 fieldType fieldTypeProps-->
1068 <el-table-column prop="fieldType" label="源端字段类型" width="120"> 1079 <el-table-column prop="fieldType" label="源端字段类型" width="120">
1069 <template #default="scope"> 1080 <template #default="scope">
1070 <div v-if="scope.row.isEdit"> 1081 <div v-if="scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1')">
1071 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable 1082 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable
1072 :props="fieldTypeProps"> 1083 :props="fieldTypeProps">
1073 <el-option v-for="(item, index) in fieldData" :key="index" :label="item.label" 1084 <el-option v-for="(item, index) in fieldData" :key="index" :label="item.label"
...@@ -1084,7 +1095,7 @@ onActivated(() => { ...@@ -1084,7 +1095,7 @@ onActivated(() => {
1084 <el-table-column prop="fieldLength" label="长度" width="100" align="left"> 1095 <el-table-column prop="fieldLength" label="长度" width="100" align="left">
1085 <template #default="scope"> 1096 <template #default="scope">
1086 <!-- 非编辑状态 --> 1097 <!-- 非编辑状态 -->
1087 <span v-if="!scope.row.isEdit"> 1098 <span v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">
1088 {{ ['varchar', 'decimal', 'char'].includes(scope.row.fieldType) ? scope.row.fieldLength || '--' : '--' 1099 {{ ['varchar', 'decimal', 'char'].includes(scope.row.fieldType) ? scope.row.fieldLength || '--' : '--'
1089 }} 1100 }}
1090 </span> 1101 </span>
...@@ -1128,9 +1139,9 @@ onActivated(() => { ...@@ -1128,9 +1139,9 @@ onActivated(() => {
1128 <!-- 数据是否唯一(可编辑) --> 1139 <!-- 数据是否唯一(可编辑) -->
1129 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left"> 1140 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left">
1130 <template #default="scope"> 1141 <template #default="scope">
1131 <span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{ scope.row.isPrimary ? 1142 <span
1132 (scope.row.isPrimary === 1143 v-if="!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
1133 'Y' ? '是' : '否') : '--' }}</span> 1144 scope.row.isPrimary || '--' }}</span>
1134 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择"> 1145 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
1135 <el-option label="Y" value="Y" /> 1146 <el-option label="Y" value="Y" />
1136 <el-option label="N" value="N" /> 1147 <el-option label="N" value="N" />
...@@ -1140,8 +1151,8 @@ onActivated(() => { ...@@ -1140,8 +1151,8 @@ onActivated(() => {
1140 <!-- 是否必填(可编辑) --> 1151 <!-- 是否必填(可编辑) -->
1141 <el-table-column prop="notNull" label="是否必填" width="100" align="left"> 1152 <el-table-column prop="notNull" label="是否必填" width="100" align="left">
1142 <template #default="scope"> 1153 <template #default="scope">
1143 <span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull === 1154 <span v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
1144 'Y' ? '是' : '否') : '--' }}</span> 1155 scope.row.notNull || '--' }}</span>
1145 <el-select v-else v-model="scope.row.notNull" placeholder="请选择"> 1156 <el-select v-else v-model="scope.row.notNull" placeholder="请选择">
1146 <el-option label="Y" value="Y" /> 1157 <el-option label="Y" value="Y" />
1147 <el-option label="N" value="N" /> 1158 <el-option label="N" value="N" />
...@@ -1188,8 +1199,8 @@ onActivated(() => { ...@@ -1188,8 +1199,8 @@ onActivated(() => {
1188 <template #default="scope"> 1199 <template #default="scope">
1189 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span> 1200 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
1190 <span class="text_btn" v-else @click="saveRow(scope.row)">保存</span> 1201 <span class="text_btn" v-else @click="saveRow(scope.row)">保存</span>
1191 <el-divider direction="vertical" /> 1202 <el-divider direction="vertical" v-if="scope.row.isPrimary != 'Y'" />
1192 <span class="text_btn" @click="deleteRow(scope.$index)">删除</span> 1203 <span class="text_btn" @click="deleteRow(scope.$index)" v-if="scope.row.isPrimary != 'Y'">删除</span>
1193 </template> 1204 </template>
1194 </el-table-column> 1205 </el-table-column>
1195 </el-table> 1206 </el-table>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!