import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; /** 表格列配置 */ export const columns: BasicColumn[] = [ { title: '用户昵称', dataIndex: 'nickName' }, { title: '性别', dataIndex: 'sex', customRender: ({record}) => { return ~~record?.isVibration === 0 ? '男' : '女'; } }, { title: '是否震动', dataIndex: 'isVibration', customRender: ({record}) => { return ~~record?.isVibration === 0 ? '是' : '否'; } }, { title: '是否响铃', dataIndex: 'isSound', customRender: ({record}) => { return ~~record?.isSound === 0 ? '是' : '否'; } }, { title: '自定义响铃', dataIndex: 'customSound', }, { title: '创建人', dataIndex: 'createByName' }, { title: '创建时间', dataIndex: 'createTime', width: 200 } ]; /** 搜索表单配置 */ export const searchFormSchema: FormSchema[] = [ { field: 'nickName', label: '用户昵称', component: 'Input', componentProps: { placeholder: '请输入用户昵称', }, colProps: { span: 6 } } ]; /** 表单配置 */ export const formSchema: FormSchema[] = [ { field: 'id', label: 'ID', component: 'Input', show: false }, { field: 'nickName', label: '用户昵称', component: 'Input', required: true, colProps: { span: 12 } }, { field: 'sex', label: '性别', component: 'Select', required: true, componentProps: { options: [ { label: '男', value: '0' }, { label: '女', value: '1' } ] }, colProps: { span: 12 } }, { field: 'userId', label: '用户ID', component: 'Input', required: true, colProps: { span: 12 } }, { field: 'pushTypeId', label: '推送类型ID', component: 'Input', required: true, colProps: { span: 12 } }, { field: 'isVibration', label: '是否震动', component: 'RadioGroup', defaultValue: '0', componentProps: { options: [ { label: '是', value: '0' }, { label: '否', value: '1' } ] }, colProps: { span: 12 } }, { field: 'isSound', label: '是否响铃', component: 'RadioGroup', defaultValue: '0', componentProps: { options: [ { label: '是', value: '0' }, { label: '否', value: '1' } ] }, colProps: { span: 12 } }, { field: 'customSound', label: '自定义响铃', component: 'Input', required: true, colProps: { span: 24 } }, ];