feat: 客户端管理

This commit is contained in:
dap
2024-10-05 17:02:25 +08:00
parent c8125b2e7f
commit 45d4365de7
2 changed files with 222 additions and 33 deletions

View File

@@ -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',