From de79fe48e332921d093403a0421d545f36c2b355 Mon Sep 17 00:00:00 2001 From: arily Date: Fri, 26 Apr 2024 11:51:47 +0800 Subject: [PATCH] use createOption from utils --- src/common/options/roles.ts | 1 - src/pages/admin/users/index.vue | 5 +---- src/pages/me/settings.vue | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/common/options/roles.ts b/src/common/options/roles.ts index 3d5da726..68c0e51d 100644 --- a/src/common/options/roles.ts +++ b/src/common/options/roles.ts @@ -1,4 +1,3 @@ -import { createOptions } from '~/common/utils' import { UserRole } from '~/def/user' export const variant: Record = { diff --git a/src/pages/admin/users/index.vue b/src/pages/admin/users/index.vue index 55ca3ced..e1972ca1 100644 --- a/src/pages/admin/users/index.vue +++ b/src/pages/admin/users/index.vue @@ -44,9 +44,6 @@ const { data: result, refresh, pending } = await useAsyncData(async () => { const pages = computed(() => Math.ceil((result.value?.count || 0) / (result.value?.perPage ?? 10))) -function options, TTr extends (key: keyof T, value: T[keyof T]) => string>(priv: T, translate: TTr = ((a: keyof T, b: T[keyof T]) => a) as TTr) { - return Object.entries(priv).map(([label, value]) => ({ label: translate(label, value as T[keyof T]), value }) as { label: ReturnType; value: T[keyof T] }) -} function rewrite() { const newURL = location.href.replace(location.search, '') const searchParams = new URLSearchParams(search.value as any) @@ -173,7 +170,7 @@ fr-FR:
diff --git a/src/pages/me/settings.vue b/src/pages/me/settings.vue index e7dc0df1..1ab8e542 100755 --- a/src/pages/me/settings.vue +++ b/src/pages/me/settings.vue @@ -47,6 +47,7 @@ const enum ChangePasswordState { Succeed, } +// @ts-expect-error I'll use it later // eslint-disable-next-line antfu/no-const-enum, unused-imports/no-unused-vars const enum ProfileState { Errored,