CEES-manage/src/views/cees/waiTeacher/CeesWaiTeacher.data.ts

443 lines
11 KiB
TypeScript
Raw Normal View History

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';
2025-03-06 14:39:23 +08:00
import { ref, onMounted,reactive } from 'vue';
2025-03-06 17:14:16 +08:00
// 学科过滤方法
const filterMajor = (value, row) => {
console.log(value, row); // 打印过滤值和行数据
return row === value;
};
2025-03-06 14:39:23 +08:00
const groupOptions=ref()
// 创建一个简单的事件总线
export const updateGroupOptions = reactive({
updateGroupOptions(newOptions: any) {
groupOptions.value = newOptions;
},
});
2025-03-03 18:23:57 +08:00
//列表数据
export const columns: BasicColumn[] = [
2025-03-03 19:41:01 +08:00
{
2025-03-04 14:32:56 +08:00
title: '姓名',
align: 'center',
dataIndex: 'userName',
},
{
title: '用户ID',
2025-03-03 19:41:01 +08:00
align: 'center',
dataIndex: 'userId',
},
{
2025-03-04 14:32:56 +08:00
title: '年龄',
2025-03-03 19:41:01 +08:00
align: 'center',
2025-03-04 14:32:56 +08:00
dataIndex: 'age',
2025-03-03 19:41:01 +08:00
},
{
2025-03-04 14:32:56 +08:00
title: '性别',
2025-03-03 19:41:01 +08:00
align: 'center',
2025-03-04 14:32:56 +08:00
dataIndex: 'sex',
2025-03-03 19:41:01 +08:00
},
{
2025-03-04 14:32:56 +08:00
title: '学科',
2025-03-03 19:41:01 +08:00
align: 'center',
2025-03-04 14:32:56 +08:00
dataIndex: 'majorId',
2025-03-06 17:14:16 +08:00
filters: [
{ text: '语文', value: 1 },
{ text: '地理', value: 4 },
{ text: '历史', value: 7 },
{ text: '政治', value: 8 },
],
filterMultiple: false, // 是否支持多选过滤
//value: 用户选择的过滤值(如 1
onFilter: (value, record) => filterMajor(value, record.majorId), // 过滤方法
2025-03-03 19:41:01 +08:00
},
{
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: '职称',
2025-03-03 19:41:01 +08:00
align: 'center',
dataIndex: 'jobTitle',
},
2025-03-04 14:32:56 +08:00
{
title: '职务',
align: 'center',
dataIndex: 'office',
},
{
title: '所属分组',
align: 'center',
2025-03-06 14:39:23 +08:00
//dataIndex: 'groupId',
customRender: ({ text }) => {
const group = groupOptions.value.find(item => item.value === text.groupId);
if (group) {
return group.label;
}
return '未知分组';
},
2025-03-04 14:32:56 +08:00
},
{
title: '住宿信息',
align: 'center',
dataIndex: 'dormitory',
},
2025-03-06 17:14:16 +08:00
//{
// title: '用户专业id',
// align: 'center',
// dataIndex: 'userMajorId',
//},
//{
// title: '银行卡号',
// align: 'center',
// dataIndex: 'pyCard',
//},
//{
// title: '饭卡',
// align: 'center',
// dataIndex: 'mealCard',
//},
2025-03-04 14:32:56 +08:00
2025-03-06 17:14:16 +08:00
//{
// title: '工作名称',
// align: 'center',
// dataIndex: 'workName',
//},
//{
// title: '固定电话',
// align: 'center',
// dataIndex: 'workPhone',
//},
//{
// title: '身份证',
// align: 'center',
// dataIndex: 'identityId',
//},
//{
// title: '车牌号',
// align: 'center',
// dataIndex: 'carNumber',
//},
//{
// title: '车辆是否入校',
// align: 'center',
// dataIndex: 'carStatus',
//},
//{
// title: '是否住宿',
// align: 'center',
// dataIndex: 'dormitoryStatus',
//},
//{
// title: '开户所在地',
// align: 'center',
// dataIndex: 'bankAddress',
//},
//{
// title: '开户行',
// align: 'center',
// dataIndex: 'bankName',
//},
//{
// title: '使用次数',
// align: 'center',
// dataIndex: 'numberuse',
//},
//{
// title: '状态',
// align: 'center',
// dataIndex: 'status',
//},
2025-03-03 18:23:57 +08:00
];
//查询数据
export const searchFormSchema: FormSchema[] = [
2025-03-06 17:14:16 +08:00
//{
// label: '学科',
// field: 'majorId',
// component: 'JRangeNumber',
// //colProps: {span: 6},
//},
2025-03-03 19:41:01 +08:00
{
2025-03-04 14:32:56 +08:00
label: '姓名',
2025-03-03 19:41:01 +08:00
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
2025-03-03 18:23:57 +08:00
];
//表单数据
export const formSchema: FormSchema[] = [
{
2025-03-04 14:32:56 +08:00
label: '用户ID',
2025-03-03 18:23:57 +08:00
field: 'userId',
component: 'Input',
2025-03-03 19:41:01 +08:00
dynamicRules: ({ model, schema }) => {
2025-03-04 14:32:56 +08:00
return [{ required: true, message: '请输入用户ID!' }];
2025-03-03 19:41:01 +08:00
},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '姓名',
field: 'userName',
component: 'Input',
2025-03-03 19:41:01 +08:00
dynamicRules: ({ model, schema }) => {
2025-03-06 17:14:16 +08:00
return [{ required: true, message: '请输入姓名!' }];
2025-03-03 19:41:01 +08:00
},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '身份证',
field: 'identityId',
2025-03-03 18:23:57 +08:00
component: 'Input',
2025-03-03 19:41:01 +08:00
dynamicRules: ({ model, schema }) => {
2025-03-06 17:14:16 +08:00
return [{ required: true, message: '请输入身份证!' }];
2025-03-03 19:41:01 +08:00
},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '年龄',
field: 'age',
component: 'InputNumber',
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '性别',
field: 'sex',
component: 'RadioGroup',
componentProps: {
options: [
{ label: '男', value: 0 },
{ label: '女', value: 1 },
],
2025-03-03 19:41:01 +08:00
},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '学科',
field: 'majorId',
component: 'Select',
componentProps: {
options: [
{ label: '语文', value: 1 },
{ label: '地理', value: 4 },
{ label: '历史', value: 7 },
{ label: '政治', value: 8 },
],
},
2025-03-03 19:41:01 +08:00
dynamicRules: ({ model, schema }) => {
2025-03-06 17:14:16 +08:00
return [{ required: true, message: '请选择学科!' }];
2025-03-03 19:41:01 +08:00
},
2025-03-03 18:23:57 +08:00
},
2025-03-06 17:14:16 +08:00
//{
// label: '用户专业id',
// field: 'userMajorId',
// component: 'Input',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入用户专业id!' }];
// },
//},
2025-03-03 18:23:57 +08:00
{
2025-03-06 17:14:16 +08:00
label: '手机号',
field: 'phone',
2025-03-03 18:23:57 +08:00
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入手机号!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '职称',
field: 'jobTitle',
2025-03-03 18:23:57 +08:00
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入职称!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-04 14:32:56 +08:00
label: '职务',
2025-03-03 18:23:57 +08:00
field: 'office',
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入办公位!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '单位名称',
2025-03-03 18:23:57 +08:00
field: 'workName',
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入单位名称!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '单位电话',
2025-03-03 18:23:57 +08:00
field: 'workPhone',
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入单位电话!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '银行卡号',
field: 'pyCard',
2025-03-03 18:23:57 +08:00
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入银行卡号!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '开户地区',
field: 'bankAddress',
2025-03-03 18:23:57 +08:00
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入开户地区(北京,哈尔滨)' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '开户行',
field: 'bankName',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入开户行!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '车牌号',
field: 'carNumber',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入车牌号!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-06 17:14:16 +08:00
label: '饭卡',
field: 'mealCard',
2025-03-03 18:23:57 +08:00
component: 'Input',
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入饭卡!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
label: '是否住宿',
field: 'dormitoryStatus',
2025-03-03 19:41:01 +08:00
component: 'RadioGroup',
componentProps: {
options: [
{ label: '是', value: 0 },
{ label: '否', value: 1 },
],
},
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入是否住宿!' }];
//},
2025-03-03 18:23:57 +08:00
},
{
2025-03-04 14:32:56 +08:00
label: '所属分组',
2025-03-03 18:23:57 +08:00
field: 'groupId',
2025-03-06 14:39:23 +08:00
component: 'Select',
componentProps: {
2025-03-06 17:14:16 +08:00
options: groupOptions, // 动态设置分组选项
2025-03-06 14:39:23 +08:00
},
2025-03-03 19:41:01 +08:00
dynamicRules: ({ model, schema }) => {
2025-03-06 17:14:16 +08:00
return [{ required: true, message: '请选择分组!' }];
2025-03-03 19:41:01 +08:00
},
2025-03-06 17:14:16 +08:00
},
2025-03-03 18:23:57 +08:00
{
2025-03-06 17:14:16 +08:00
label: '车辆是否入校',
field: 'carStatus',
2025-03-03 19:41:01 +08:00
component: 'RadioGroup',
componentProps: {
options: [
2025-03-06 17:14:16 +08:00
{ label: '是', value: 0 },
{ label: '否', value: 1 },
2025-03-03 19:41:01 +08:00
],
},
2025-03-06 17:14:16 +08:00
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入车辆是否入校!' }];
//},
},
//{
// label: '住宿信息',
// field: 'dormitory',
// component: 'Input',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入宿舍信息!' }];
// },
//},
//{
// label: '所属分组',
// 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: '状态:',
// field: 'status',
// component: 'RadioGroup',
// componentProps: {
// options: [
// { label: '已报到', value: 0 },
// { label: '未报到', value: 1 },
// ],
// },
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请选择状态' }];
// },
//},
//// TODO 主键隐藏字段目前写死为ID
2025-03-03 19:41:01 +08:00
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
2025-03-03 18:23:57 +08:00
];
// 高级查询数据
export const superQuerySchema = {
2025-03-04 14:32:56 +08:00
userId: { title: '用户ID', order: 0, view: 'text', type: 'string' },
majorId: { title: '学科', order: 1, view: 'number', type: 'number' },
2025-03-03 19:41:01 +08:00
userMajorId: { title: '用户专业id', order: 2, view: 'text', type: 'string' },
2025-03-04 14:32:56 +08:00
userName: { title: '姓名', order: 3, view: 'text', type: 'string' },
2025-03-03 19:41:01 +08:00
phone: { title: '手机号', order: 4, view: 'text', type: 'string' },
jobTitle: { title: '职称', order: 5, view: 'text', type: 'string' },
pyCard: { title: '银行卡号', order: 6, view: 'text', type: 'string' },
mealCard: { title: '饭卡', order: 7, view: 'text', type: 'string' },
2025-03-04 14:32:56 +08:00
office: { title: '职务', order: 8, view: 'text', type: 'string' },
2025-03-03 19:41:01 +08:00
workName: { title: '工作名称', order: 9, view: 'text', type: 'string' },
workPhone: { title: '固定电话', order: 10, view: 'text', type: 'string' },
identityId: { title: '身份证', order: 11, view: 'text', type: 'string' },
carNumber: { title: '车牌号', order: 12, view: 'text', type: 'string' },
sex: { title: '性别', order: 13, view: 'text', type: 'string' },
age: { title: '年龄', order: 14, view: 'number', type: 'number' },
carStatus: { title: '车辆是否入校', order: 15, view: 'number', type: 'number' },
2025-03-04 14:32:56 +08:00
dormitory: { title: '住宿信息', order: 16, view: 'text', type: 'string' },
2025-03-03 19:41:01 +08:00
dormitoryStatus: { title: '是否住宿', order: 17, view: 'text', type: 'string' },
bankAddress: { title: '开户所在地', order: 18, view: 'text', type: 'string' },
bankName: { title: '开户行', order: 19, view: 'text', type: 'string' },
2025-03-04 14:32:56 +08:00
groupId: { title: '所属分组', order: 20, view: 'number', type: 'number' },
2025-03-03 19:41:01 +08:00
numberuse: { title: '使用次数', order: 21, view: 'number', type: 'number' },
status: { title: '状态0已报道 1未报到', order: 22, 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
}