|
@@ -3,7 +3,7 @@
|
|
|
<div class="flex direction-column p-t-base p-b-base p-l-large fill-blank">
|
|
|
<div class="flex items-center">
|
|
|
<span class="m-r-base">角色</span>
|
|
|
- <base-select v-model="role" :options="ROLE_OPTION"></base-select>
|
|
|
+ <base-select v-model="roleSelf" :options="ROLE_OPTION"></base-select>
|
|
|
<el-button class="m-l-base" type="primary" :loading="loading" @click="onSubmit">保存</el-button>
|
|
|
</div>
|
|
|
<div class="flex-1 p-base m-t-large fill-lighter full-scroll-y-auto privilege-tree">
|
|
@@ -57,7 +57,7 @@ const props = defineProps<{ role: ROLE }>()
|
|
|
|
|
|
const mainLayoutStore = useMainLayoutStore()
|
|
|
|
|
|
-const role = ref<ROLE>(props.role)
|
|
|
+const roleSelf = ref<ROLE>(props.role)
|
|
|
|
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
|
|
|
@@ -92,9 +92,9 @@ const getTreeList = (oldDataList: any[], sortField = false): any[] => {
|
|
|
}
|
|
|
|
|
|
watch(
|
|
|
- role,
|
|
|
+ roleSelf,
|
|
|
() => {
|
|
|
- role.value && getPrivilege({ role: role.value })
|
|
|
+ roleSelf.value && getPrivilege({ role: roleSelf.value })
|
|
|
},
|
|
|
{ immediate: true }
|
|
|
)
|
|
@@ -246,7 +246,7 @@ const onSubmit = async () => {
|
|
|
.map((d) => d.id)
|
|
|
.filter((id) => id > -1)
|
|
|
|
|
|
- await setPrivilege({ role: role.value, privilegeIds })
|
|
|
+ await setPrivilege({ role: roleSelf.value, privilegeIds })
|
|
|
ElMessage.success('保存成功')
|
|
|
} catch (error) {
|
|
|
console.error(error)
|