admin-vben5/apps/web-antd/src/views/system/client/data.tsx

125 lines
2.7 KiB
TypeScript
Raw Normal View History

2024-09-12 14:41:28 +08:00
import type { FormSchemaGetter } from '#/adapter';
import { DictEnum } from '@vben/constants';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
2024-09-24 11:23:02 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'clientKey',
label: '客户端key',
},
{
component: 'Input',
fieldName: 'clientSecret',
label: '客户端密钥',
},
{
component: 'Select',
componentProps: {
options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
},
fieldName: 'status',
label: '状态',
},
];
2024-09-12 14:41:28 +08:00
export const drawerSchema: FormSchemaGetter = () => [
{
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
fieldName: 'id',
label: 'id',
},
{
component: 'Input',
componentProps: {
disabled: true,
},
dependencies: {
show: () => false,
triggerFields: [''],
},
fieldName: 'clientId',
label: '客户端ID',
},
{
component: 'Input',
fieldName: 'clientKey',
label: '客户端key',
rules: 'required',
},
{
component: 'Input',
fieldName: 'clientSecret',
label: '客户端密钥',
rules: 'required',
},
{
component: 'Select',
componentProps: {
class: 'w-full',
getPopupContainer,
mode: 'multiple',
optionFilterProp: 'label',
options: getDictOptions(DictEnum.SYS_GRANT_TYPE),
},
fieldName: 'grantTypeList',
label: '授权类型',
rules: 'selectRequired',
2024-09-12 14:41:28 +08:00
},
{
component: 'Select',
componentProps: {
allowClear: false,
class: 'w-full',
getPopupContainer,
options: getDictOptions(DictEnum.SYS_DEVICE_TYPE),
},
fieldName: 'deviceType',
label: '设备类型',
rules: 'selectRequired',
2024-09-12 14:41:28 +08:00
},
{
component: 'InputNumber',
componentProps: {
addonAfter: '秒',
placeholder: '请输入',
},
defaultValue: 1800,
fieldName: 'activeTimeout',
2024-09-12 21:06:10 +08:00
formItemClass: 'col-span-2 lg:col-span-1',
2024-09-12 14:44:19 +08:00
help: '指定时间无操作则过期(单位:秒), 默认30分钟(1800秒)',
2024-09-12 14:41:28 +08:00
label: 'Token活跃超时时间',
rules: 'required',
},
{
component: 'InputNumber',
componentProps: {
addonAfter: '秒',
},
defaultValue: 604_800,
fieldName: 'timeout',
2024-09-12 21:06:10 +08:00
formItemClass: 'col-span-2 lg:col-span-1 ',
2024-09-12 14:44:19 +08:00
help: '指定时间必定过期(单位:秒),默认七天(604800秒)',
2024-09-12 14:41:28 +08:00
label: 'Token固定超时时间',
rules: 'required',
},
{
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
optionType: 'button',
},
defaultValue: '0',
fieldName: 'status',
label: '状态',
},
];