From 45d4365de725aecc2a5b0c65937723c5e24a5a6a Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Sat, 5 Oct 2024 17:02:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/views/system/client/data.tsx | 74 ++++++- .../src/views/system/client/index.vue | 181 +++++++++++++++--- 2 files changed, 222 insertions(+), 33 deletions(-) diff --git a/apps/web-antd/src/views/system/client/data.tsx b/apps/web-antd/src/views/system/client/data.tsx index d3ea0978..5bf7233e 100644 --- a/apps/web-antd/src/views/system/client/data.tsx +++ b/apps/web-antd/src/views/system/client/data.tsx @@ -1,9 +1,10 @@ -import type { FormSchemaGetter } from '#/adapter'; +import type { FormSchemaGetter, VxeGridProps } from '#/adapter'; import { DictEnum } from '@vben/constants'; import { getPopupContainer } from '@vben/utils'; -import { getDictOptions } from '#/utils/dict'; +import { getDict, getDictOptions } from '#/utils/dict'; +import { renderDict, renderDictTags } from '#/utils/render'; export const querySchema: FormSchemaGetter = () => [ { @@ -26,6 +27,75 @@ export const querySchema: FormSchemaGetter = () => [ }, ]; +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '客户端ID', + field: 'clientId', + showOverflow: true, + }, + { + title: '客户端key', + field: 'clientKey', + }, + { + title: '客户端密钥', + field: 'clientSecret', + }, + { + title: '授权类型', + field: 'grantTypeList', + slots: { + default: ({ row }) => { + if (!row.grantTypeList) { + return '无'; + } + return renderDictTags( + row.grantTypeList, + getDict(DictEnum.SYS_GRANT_TYPE), + ); + }, + }, + }, + { + title: '设备类型', + field: 'deviceType', + slots: { + default: ({ row }) => { + return renderDict(row.deviceType, DictEnum.SYS_DEVICE_TYPE); + }, + }, + }, + { + title: 'token活跃时间', + field: 'activeTimeout', + formatter({ row }) { + return `${row.activeTimeout}秒`; + }, + }, + { + title: 'token超时时间', + field: 'timeout', + formatter({ row }) { + return `${row.timeout}秒`; + }, + }, + { + title: '状态', + field: 'status', + slots: { + default: 'status', + }, + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + export const drawerSchema: FormSchemaGetter = () => [ { component: 'Input', diff --git a/apps/web-antd/src/views/system/client/index.vue b/apps/web-antd/src/views/system/client/index.vue index e5825f99..a8c555fc 100644 --- a/apps/web-antd/src/views/system/client/index.vue +++ b/apps/web-antd/src/views/system/client/index.vue @@ -1,51 +1,170 @@