183 lines
4.5 KiB
TypeScript
183 lines
4.5 KiB
TypeScript
|
import {BasicColumn} from '/@/components/Table';
|
|||
|
import {FormSchema} from '/@/components/Table';
|
|||
|
import { rules} from '/@/utils/helper/validator';
|
|||
|
import { render } from '/@/utils/common/renderUtils';
|
|||
|
//列表数据
|
|||
|
export const columns: BasicColumn[] = [
|
|||
|
{
|
|||
|
title: '用户id',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'userId'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '用户名',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'userName'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '专业id,0表示未选择',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'majorId'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '用户专业id',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'userMajorId'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '用户专业id',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'teacherId'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '手机号',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'phone'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '组id',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'groupId'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '使用次数',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'numberuse'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '状态:0正常 1禁用',
|
|||
|
align:"center",
|
|||
|
dataIndex: 'status'
|
|||
|
},
|
|||
|
];
|
|||
|
//查询数据
|
|||
|
export const searchFormSchema: FormSchema[] = [
|
|||
|
{
|
|||
|
label: "用户名",
|
|||
|
field: 'userName',
|
|||
|
component: 'Input',
|
|||
|
//colProps: {span: 6},
|
|||
|
},
|
|||
|
];
|
|||
|
//表单数据
|
|||
|
export const formSchema: FormSchema[] = [
|
|||
|
{
|
|||
|
label: '用户id',
|
|||
|
field: 'userId',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入用户id!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '用户名',
|
|||
|
field: 'userName',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入用户名!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '专业id,0表示未选择',
|
|||
|
field: 'majorId',
|
|||
|
component: 'InputNumber',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入专业id,0表示未选择!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '用户专业id',
|
|||
|
field: 'userMajorId',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入用户专业id!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '用户专业id',
|
|||
|
field: 'teacherId',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入用户专业id!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '手机号',
|
|||
|
field: 'phone',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入手机号!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '组id',
|
|||
|
field: 'groupId',
|
|||
|
component: 'InputNumber',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入组id!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '使用次数',
|
|||
|
field: 'numberuse',
|
|||
|
component: 'InputNumber',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入使用次数!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '状态:0正常 1禁用',
|
|||
|
field: 'status',
|
|||
|
component: 'InputNumber',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入状态:0正常 1禁用!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
// TODO 主键隐藏字段,目前写死为ID
|
|||
|
{
|
|||
|
label: '',
|
|||
|
field: 'id',
|
|||
|
component: 'Input',
|
|||
|
show: false
|
|||
|
},
|
|||
|
];
|
|||
|
|
|||
|
// 高级查询数据
|
|||
|
export const superQuerySchema = {
|
|||
|
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
|
|||
|
userName: {title: '用户名',order: 1,view: 'text', type: 'string',},
|
|||
|
majorId: {title: '专业id,0表示未选择',order: 2,view: 'number', type: 'number',},
|
|||
|
userMajorId: {title: '用户专业id',order: 3,view: 'text', type: 'string',},
|
|||
|
teacherId: {title: '用户专业id',order: 4,view: 'text', type: 'string',},
|
|||
|
phone: {title: '手机号',order: 5,view: 'text', type: 'string',},
|
|||
|
groupId: {title: '组id',order: 6,view: 'number', type: 'number',},
|
|||
|
numberuse: {title: '使用次数',order: 7,view: 'number', type: 'number',},
|
|||
|
status: {title: '状态:0正常 1禁用',order: 8,view: 'number', type: 'number',},
|
|||
|
};
|
|||
|
|
|||
|
/**
|
|||
|
* 流程表单调用这个方法获取formSchema
|
|||
|
* @param param
|
|||
|
*/
|
|||
|
export function getBpmFormSchema(_formData): FormSchema[]{
|
|||
|
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|||
|
return formSchema;
|
|||
|
}
|