fix 基础权限相关分配多次操作未清理缓存导致重复添加

This commit is contained in:
DaxPay
2024-10-10 18:35:33 +08:00
parent a56d2ca71f
commit eee1b79ea1
3 changed files with 6 additions and 5 deletions

View File

@@ -38,11 +38,7 @@
</a-tree>
</a-spin>
<template #footer>
<a-select
style="min-width: 100px"
@change="clientSwitch"
v-model:value="clientCode"
>
<a-select style="min-width: 100px" @change="clientSwitch" v-model:value="clientCode">
<a-select-option v-for="o in clients" :key="o.code">{{ o.name }}</a-select-option>
</a-select>
<a-dropdown style="margin-left: 5px" :trigger="['click']" placement="top">
@@ -125,6 +121,7 @@
loading.value = true
searchName.value = ''
expandedKeys.value = []
treeList.value = []
// 当前角色的菜单
await treeByRoleMenu(currentRole.value.id, clientCode).then((res) => {
treeData.value = treeDataTranslate(res.data, 'id', 'title')

View File

@@ -122,6 +122,7 @@
loading.value = true
searchName.value = ''
expandedKeys.value = []
treeList.value = []
// 当前角色的请求路径
await treeByRolePath(currentRole.value.id, clientCode).then((res) => {
treeData.value = treeDataTranslate(res.data, 'id', 'title')

View File

@@ -101,6 +101,9 @@
modal.visible = true
modal.batch = batch
modal.loading = true
modal.treeList = []
modal.checkedKeys = []
// 初始化角色树
await initRoles()
if (!batch) {