| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- import type { SmartColumn, SmartSearchFormSchema } from '@/components/SmartTable';
- import type { FormSchema } from '@/components/Form';
- import { tableUseYnClass } from '@/components/SmartTable';
- /**
- * 表格列表
- */
- export const getTableColumns = (): SmartColumn[] => {
- return [
- {
- type: 'checkbox',
- width: 60,
- align: 'center',
- fixed: 'left',
- },
- {
- field: 'seq',
- sortable: true,
- title: '{common.table.seq}',
- width: 100,
- },
- {
- field: 'accessKey',
- title: '{system.views.auth.acccessSecret.title.accessKey}',
- width: 120,
- },
- {
- field: 'secretKey',
- title: '{system.views.auth.acccessSecret.title.secretKey}',
- width: 120,
- },
- {
- field: 'expireDate',
- title: '{system.views.auth.acccessSecret.title.expireDate}',
- width: 165,
- },
- {
- field: 'accessIp',
- title: '{system.views.auth.acccessSecret.title.accessIp}',
- width: 120,
- },
- {
- field: 'remark',
- title: '{common.table.remark}',
- width: 200,
- },
- {
- ...tableUseYnClass(),
- },
- {
- field: 'createBy',
- title: '{common.table.createUser}',
- width: 120,
- },
- {
- field: 'createTime',
- title: '{common.table.createTime}',
- width: 165,
- },
- {
- field: 'updateBy',
- title: '{common.table.updateUser}',
- width: 120,
- },
- {
- field: 'updateTime',
- title: '{common.table.updateTime}',
- width: 165,
- },
- {
- title: '{common.table.operation}',
- field: 'operation',
- width: 120,
- fixed: 'right',
- slots: {
- default: 'table-operation',
- },
- },
- ];
- };
- /**
- * 添加修改表单
- */
- export const getFormSchemas = (t: Function): FormSchema[] => {
- return [
- {
- field: 'id',
- show: false,
- label: '',
- component: 'Input',
- componentProps: {},
- },
- {
- field: 'accessKey',
- label: t('system.views.auth.acccessSecret.title.accessKey'),
- component: 'Input',
- componentProps: {},
- dynamicDisabled: true,
- },
- {
- field: 'secretKey',
- label: t('system.views.auth.acccessSecret.title.secretKey'),
- component: 'Input',
- componentProps: {},
- dynamicDisabled: true,
- },
- {
- field: 'expireDate',
- label: t('system.views.auth.acccessSecret.title.expireDate'),
- component: 'DatePicker',
- componentProps: {
- showTime: true,
- style: { width: '100%' },
- },
- },
- {
- field: 'accessIp',
- label: t('system.views.auth.acccessSecret.title.accessIp'),
- component: 'InputTextArea',
- componentProps: {
- placeholder: t('system.views.auth.acccessSecret.validate.accessIp'),
- },
- },
- {
- field: 'remark',
- label: t('common.table.remark'),
- component: 'InputTextArea',
- componentProps: {},
- },
- {
- field: 'useYn',
- label: t('common.table.useYn'),
- component: 'Switch',
- componentProps: {},
- defaultValue: true,
- },
- {
- field: 'seq',
- label: t('common.table.seq'),
- component: 'InputNumber',
- componentProps: {},
- required: true,
- },
- ];
- };
- export const getSearchFormSchemas = (t: Function): SmartSearchFormSchema[] => {
- return [
- {
- field: 'accessKey',
- label: t('system.views.auth.acccessSecret.title.accessKey'),
- component: 'Input',
- searchSymbol: 'like',
- },
- {
- field: 'secretKey',
- label: t('system.views.auth.acccessSecret.title.secretKey'),
- component: 'Input',
- searchSymbol: 'like',
- },
- {
- field: 'useYn',
- label: t('common.table.useYn'),
- component: 'Select',
- searchSymbol: '=',
- defaultValue: 1,
- componentProps: {
- style: {
- width: '120px',
- },
- options: [
- {
- label: t('common.form.use'),
- value: 1,
- },
- {
- label: t('common.form.noUse'),
- value: 0,
- },
- ],
- },
- },
- ];
- };
|