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