refactor(projects): remove enum

This commit is contained in:
Soybean
2023-02-23 08:38:03 +08:00
parent 44b544745d
commit 21d5214247
31 changed files with 323 additions and 240 deletions

View File

@@ -34,7 +34,7 @@
<script setup lang="ts">
import { watch } from 'vue';
import type { SelectOption } from 'naive-ui';
import { EnumUserRole } from '@/enum';
import { userRoleOptions } from '@/constants';
import { useAppStore, useAuthStore } from '@/store';
import { usePermission } from '@/composables';
@@ -42,18 +42,7 @@ const app = useAppStore();
const auth = useAuthStore();
const { hasPermission } = usePermission();
interface RoleList {
label: string;
value: keyof typeof EnumUserRole;
}
const roleList: RoleList[] = [
{ label: EnumUserRole.super, value: 'super' },
{ label: EnumUserRole.admin, value: 'admin' },
{ label: EnumUserRole.user, value: 'user' }
];
const options: SelectOption[] = roleList as unknown as SelectOption[];
const options: SelectOption[] = userRoleOptions;
watch(
() => auth.userInfo.userRole,