1129f998 by lihua

解决编辑目录分类上级选择问题

1 parent 2ba738e7
...@@ -432,7 +432,7 @@ const dictFormItems: any = ref([ ...@@ -432,7 +432,7 @@ const dictFormItems: any = ref([
432 label: "dicName", 432 label: "dicName",
433 value: "guid", 433 value: "guid",
434 children: 'childList', 434 children: 'childList',
435 disabled: 'disabled', 435 disabled: 'editDisabled',
436 checkStrictly: true, 436 checkStrictly: true,
437 emitPath: false 437 emitPath: false
438 }, 438 },
...@@ -734,7 +734,21 @@ const toEdit = async (data) => { ...@@ -734,7 +734,21 @@ const toEdit = async (data) => {
734 if (!row.classGuid) return 734 if (!row.classGuid) return
735 currEditTableRow.value = row; 735 currEditTableRow.value = row;
736 classList.value = tableInfo.value.data || []; 736 classList.value = tableInfo.value.data || [];
737 dictFormItems.value[1].options = classList.value 737 dictFormItems.value[1].options = classList.value;
738 let transferValue = (list, disabled = false) => {
739 if (list.guid == row.guid) {
740 disabled = true;
741 }
742 list.editDisabled = disabled;
743 if (list?.childList?.length) {
744 list.childList?.forEach(d => {
745 transferValue(d, disabled);
746 })
747 }
748 }
749 classList.value?.forEach(cd => {
750 transferValue(cd, false)
751 })
738 // dictApi.getDictTable({ 752 // dictApi.getDictTable({
739 // classGuid: row.classGuid 753 // classGuid: row.classGuid
740 // }).then((res: any) => { 754 // }).then((res: any) => {
...@@ -794,6 +808,22 @@ const handleDrawSelectChange = (val, row, info) => { ...@@ -794,6 +808,22 @@ const handleDrawSelectChange = (val, row, info) => {
794 dictFormItems.value.forEach(d => { 808 dictFormItems.value.forEach(d => {
795 d.default = info[d.field] || ''; 809 d.default = info[d.field] || '';
796 }) 810 })
811 if (drawerInfo.value.type == 'edit') {
812 let transferValue = (list, disabled = false) => {
813 if (list.guid == currEditTableRow.value.guid) {
814 disabled = true;
815 }
816 list.editDisabled = disabled;
817 if (list?.childList?.length) {
818 list.childList?.forEach(d => {
819 transferValue(d, disabled);
820 })
821 }
822 }
823 classList.value?.forEach(cd => {
824 transferValue(cd, false)
825 })
826 }
797 } else { 827 } else {
798 ElMessage({ 828 ElMessage({
799 type: "error", 829 type: "error",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!