解决菜单删除问题
Showing
2 changed files
with
12 additions
and
8 deletions
| ... | @@ -73,15 +73,18 @@ const removeTab = (targetName) => { | ... | @@ -73,15 +73,18 @@ const removeTab = (targetName) => { |
| 73 | tabbarActive.value = activeName; | 73 | tabbarActive.value = activeName; |
| 74 | tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName); | 74 | tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName); |
| 75 | userStore.setTabbar(tabbarList.value); | 75 | userStore.setTabbar(tabbarList.value); |
| 76 | //被删除之后,需要同步清除activeTabbar里的信息。 | ||
| 77 | const oldCombPath = targetName?.split('/')?.[1]; | ||
| 78 | oldCombPath && userStore.setActiveTabbar(oldCombPath, ''); | ||
| 76 | const combPath = activeName.split('/')[1] | 79 | const combPath = activeName.split('/')[1] |
| 77 | userStore.setActiveTabbar(combPath, activeName); | 80 | userStore.setActiveTabbar(combPath, activeName); |
| 78 | let tabIndex = visibleTabs.value.findIndex(v => v === targetName) | 81 | // let tabIndex = visibleTabs.value.findIndex(v => v === targetName) |
| 79 | if (tabIndex > -1) { | 82 | // if (tabIndex > -1) { |
| 80 | visibleTabs.value.splice(tabIndex, 1); | 83 | // visibleTabs.value.splice(tabIndex, 1); |
| 81 | if (activeTab && router.currentRoute.value.fullPath != targetName) { | 84 | // if (activeTab && router.currentRoute.value.fullPath != targetName) { |
| 82 | keepAliveStore.remove(activeTab.meta.reuse ? activeTab.fullPath : activeTab.matched.at(-1)?.components?.default?.name) | 85 | // keepAliveStore.remove(activeTab.meta.reuse ? activeTab.fullPath : activeTab.matched.at(-1)?.components?.default?.name) |
| 83 | } | 86 | // } |
| 84 | } | 87 | // } |
| 85 | nextTick(() => { | 88 | nextTick(() => { |
| 86 | nextTab.name && router.push({ name: nextTab.name, query: nextTab.query }); | 89 | nextTab.name && router.push({ name: nextTab.name, query: nextTab.query }); |
| 87 | // setTabVisible() | 90 | // setTabVisible() | ... | ... |
| ... | @@ -654,7 +654,7 @@ const getCodeRuleData = () => { | ... | @@ -654,7 +654,7 @@ const getCodeRuleData = () => { |
| 654 | getCoderuleList(params).then((res: any) => { | 654 | getCoderuleList(params).then((res: any) => { |
| 655 | if (res.code == proxy.$passCode) { | 655 | if (res.code == proxy.$passCode) { |
| 656 | const data = res.data | 656 | const data = res.data |
| 657 | data.map(item => { | 657 | data?.map(item => { |
| 658 | item.label = item.ruleName | 658 | item.label = item.ruleName |
| 659 | item.value = item.guid | 659 | item.value = item.guid |
| 660 | }) | 660 | }) |
| ... | @@ -1573,6 +1573,7 @@ const drawerBtnClick = (btn, info) => { | ... | @@ -1573,6 +1573,7 @@ const drawerBtnClick = (btn, info) => { |
| 1573 | params.dataDictionarySchemaAddDTOS = dtos | 1573 | params.dataDictionarySchemaAddDTOS = dtos |
| 1574 | if (drawerInfo.value.type == 'add') { | 1574 | if (drawerInfo.value.type == 'add') { |
| 1575 | formTable.value.tableInfo.loading = true | 1575 | formTable.value.tableInfo.loading = true |
| 1576 | params.state = 1; //添加字典时默认启用 | ||
| 1576 | addDictionary(params).then((res: any) => { | 1577 | addDictionary(params).then((res: any) => { |
| 1577 | if (res.code == proxy.$passCode) { | 1578 | if (res.code == proxy.$passCode) { |
| 1578 | ElMessage({ | 1579 | ElMessage({ | ... | ... |
-
Please register or sign in to post a comment