瀏覽代碼

no-dupe-keys处理

刘洋 2 年之前
父節點
當前提交
2cf088f98c
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/modules/admin-role/setting/index.vue

+ 5 - 5
src/modules/admin-role/setting/index.vue

@@ -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)