tangning 1 rok temu
rodzic
commit
d5e4ea38bc
1 zmienionych plików z 9 dodań i 0 usunięć
  1. 9 0
      src/views/staff/list.vue

+ 9 - 0
src/views/staff/list.vue

@@ -28,6 +28,7 @@
             },
             {
               label: t('routes.staff.setpower'),
+              ifShow: isPatchAuth,
               onClick: handlepowerModal.bind(null, record),
             },
           ]"
@@ -45,6 +46,7 @@
   import { uploadApi } from '/@/api/sys/upload';
   import { useModal } from '/@/components/Modal';
   // import { Switch } from 'ant-design-vue';
+  import { RoleEnum } from '/@/enums/roleEnum';
   // import { h } from 'vue';
   import SetpaswordModal from './setpaswordModal.vue';
   import addpowerModal from './addpowerModal.vue';
@@ -53,6 +55,7 @@
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
   // import { Time } from '/@/components/Time';
+  import { useUserStore } from '/@/store/modules/user';
   import { useLocaleStore } from '/@/store/modules/locale';
   const localeStore = useLocaleStore();
 
@@ -65,6 +68,7 @@
       const [registerpower, { openModal: openpowerModal }] = useModal();
       const { createMessage } = useMessage();
       const go = useGo();
+      const userStore = useUserStore();
       const { t } = useI18n();
       const columns: BasicColumn[] = [
         {
@@ -141,7 +145,11 @@
           },
         ],
       };
+      const roleList = userStore.roleList;
 
+      const isPatchAuth = computed(() => {
+        return roleList.includes(RoleEnum.PLAT_ADMIN) || roleList.includes(RoleEnum.SUPER);
+      });
       const [registerTable, { reload }] = useTable({
         title: t('routes.staff.staffList'),
         api: ListApi,
@@ -196,6 +204,7 @@
         register,
         registerpower,
         handlepowerModal,
+        isPatchAuth,
       };
     },
   });