数据管理初始化

This commit is contained in:
Qi 2025-06-11 13:31:35 +08:00
parent 0c1c795d68
commit 4f3365999b
6 changed files with 135 additions and 149 deletions

View File

@ -1,103 +1,96 @@
import {BasicColumn} from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
import {FormSchema} from '/@/components/Table'; import { FormSchema } from '/@/components/Table';
import { rules} from '/@/utils/helper/validator'; import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; import { render } from '/@/utils/common/renderUtils';
//列表数据 //列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '教师姓名', title: '教师姓名',
align:"center", align: 'center',
dataIndex: 'graduatesName' dataIndex: 'graduatesName',
}, },
{ {
title: '年龄', title: '年龄',
align:"center", align: 'center',
dataIndex: 'age' dataIndex: 'age',
}, },
{ {
title: '性别', title: '性别',
align:"center", align: 'center',
dataIndex: 'sex' dataIndex: 'sex',
}, },
{ {
title: '校区', title: '校区',
align:"center", align: 'center',
dataIndex: 'campus' dataIndex: 'campus',
}, },
{ // {
title: '照片地址', // title: '照片地址',
align:"center", // align:"center",
dataIndex: 'photoAddress' // dataIndex: 'photoAddress'
}, // },
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [];
];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
label: '教师姓名', label: '教师姓名',
field: 'graduatesName', field: 'graduatesName',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入教师姓名!' }];
{ required: true, message: '请输入教师姓名!'}, },
];
},
}, },
{ {
label: '年龄', label: '年龄',
field: 'age', field: 'age',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入年龄!' }];
{ required: true, message: '请输入年龄!'}, },
];
},
}, },
{ {
label: '性别', label: '性别',
field: 'sex', field: 'sex',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入性别!' }];
{ required: true, message: '请输入性别!'}, },
];
},
}, },
{ {
label: '校区', label: '校区',
field: 'campus', field: 'campus',
component: 'Input', component: 'Input',
}, },
//{
// label: '照片地址',
// field: 'photoAddress',
// component: 'Input',
//},
// TODO 主键隐藏字段目前写死为ID
{ {
label: '照片地址', label: '',
field: 'photoAddress', field: 'id',
component: 'Input', component: 'Input',
show: false,
}, },
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
]; ];
// 高级查询数据 // 高级查询数据
export const superQuerySchema = { export const superQuerySchema = {
graduatesName: {title: '教师姓名',order: 0,view: 'text', type: 'string',}, graduatesName: { title: '教师姓名', order: 0, view: 'text', type: 'string' },
age: {title: '年龄',order: 1,view: 'text', type: 'string',}, age: { title: '年龄', order: 1, view: 'text', type: 'string' },
sex: {title: '性别',order: 2,view: 'text', type: 'string',}, sex: { title: '性别', order: 2, view: 'text', type: 'string' },
campus: {title: '校区',order: 3,view: 'text', type: 'string',}, campus: { title: '校区', order: 3, view: 'text', type: 'string' },
photoAddress: {title: '照片地址',order: 4,view: 'text', type: 'string',}, photoAddress: { title: '照片地址', order: 4, view: 'text', type: 'string' },
}; };
/** /**
* formSchema * formSchema
* @param param * @param param
*/ */
export function getBpmFormSchema(_formData): FormSchema[]{ export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema // 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema; return formSchema;
} }

View File

@ -24,11 +24,11 @@ export const columns: BasicColumn[] = [
align: 'center', align: 'center',
dataIndex: 'campus', dataIndex: 'campus',
}, },
{ //{
title: '照片地址', // title: '照片地址',
align: 'center', // align: 'center',
dataIndex: 'photoAddress', // dataIndex: 'photoAddress',
}, //},
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = []; export const searchFormSchema: FormSchema[] = [];
@ -63,11 +63,11 @@ export const formSchema: FormSchema[] = [
field: 'campus', field: 'campus',
component: 'Input', component: 'Input',
}, },
{ //{
label: '照片地址', // label: '照片地址',
field: 'photoAddress', // field: 'photoAddress',
component: 'Input', // component: 'Input',
}, //},
// TODO 主键隐藏字段目前写死为ID // TODO 主键隐藏字段目前写死为ID
{ {
label: '', label: '',

View File

@ -1,103 +1,96 @@
import {BasicColumn} from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
import {FormSchema} from '/@/components/Table'; import { FormSchema } from '/@/components/Table';
import { rules} from '/@/utils/helper/validator'; import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; import { render } from '/@/utils/common/renderUtils';
//列表数据 //列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '教师姓名', title: '教师姓名',
align:"center", align: 'center',
dataIndex: 'name' dataIndex: 'name',
}, },
{ {
title: '年龄', title: '年龄',
align:"center", align: 'center',
dataIndex: 'age' dataIndex: 'age',
}, },
{ {
title: '性别', title: '性别',
align:"center", align: 'center',
dataIndex: 'sex' dataIndex: 'sex',
}, },
{ {
title: '校区', title: '校区',
align:"center", align: 'center',
dataIndex: 'campus' dataIndex: 'campus',
}, },
{ //{
title: '照片地址', // title: '照片地址',
align:"center", // align: 'center',
dataIndex: 'photoAddress' // dataIndex: 'photoAddress',
}, //},
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [];
];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{ {
label: '教师姓名', label: '教师姓名',
field: 'name', field: 'name',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入教师姓名!' }];
{ required: true, message: '请输入教师姓名!'}, },
];
},
}, },
{ {
label: '年龄', label: '年龄',
field: 'age', field: 'age',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入年龄!' }];
{ required: true, message: '请输入年龄!'}, },
];
},
}, },
{ {
label: '性别', label: '性别',
field: 'sex', field: 'sex',
component: 'Input', component: 'Input',
dynamicRules: ({model,schema}) => { dynamicRules: ({ model, schema }) => {
return [ return [{ required: true, message: '请输入性别!' }];
{ required: true, message: '请输入性别!'}, },
];
},
}, },
{ {
label: '校区', label: '校区',
field: 'campus', field: 'campus',
component: 'Input', component: 'Input',
}, },
//{
// label: '照片地址',
// field: 'photoAddress',
// component: 'Input',
//},
// TODO 主键隐藏字段目前写死为ID
{ {
label: '照片地址', label: '',
field: 'photoAddress', field: 'id',
component: 'Input', component: 'Input',
show: false,
}, },
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
]; ];
// 高级查询数据 // 高级查询数据
export const superQuerySchema = { export const superQuerySchema = {
name: {title: '教师姓名',order: 0,view: 'text', type: 'string',}, name: { title: '教师姓名', order: 0, view: 'text', type: 'string' },
age: {title: '年龄',order: 1,view: 'text', type: 'string',}, age: { title: '年龄', order: 1, view: 'text', type: 'string' },
sex: {title: '性别',order: 2,view: 'text', type: 'string',}, sex: { title: '性别', order: 2, view: 'text', type: 'string' },
campus: {title: '校区',order: 3,view: 'text', type: 'string',}, campus: { title: '校区', order: 3, view: 'text', type: 'string' },
photoAddress: {title: '照片地址',order: 4,view: 'text', type: 'string',}, photoAddress: { title: '照片地址', order: 4, view: 'text', type: 'string' },
}; };
/** /**
* formSchema * formSchema
* @param param * @param param
*/ */
export function getBpmFormSchema(_formData): FormSchema[]{ export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema // 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema; return formSchema;
} }

View File

@ -4,13 +4,13 @@ import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage(); const { createConfirm } = useMessage();
enum Api { enum Api {
list = '/teachers/cetTeachers/list', list = '/cet/cetTeachers/list',
save = '/teachers/cetTeachers/add', save = '/cet/cetTeachers/add',
edit = '/teachers/cetTeachers/edit', edit = '/cet/cetTeachers/edit',
deleteOne = '/teachers/cetTeachers/delete', deleteOne = '/cet/cetTeachers/delete',
deleteBatch = '/teachers/cetTeachers/deleteBatch', deleteBatch = '/cet/cetTeachers/deleteBatch',
importExcel = '/teachers/cetTeachers/importExcel', importExcel = '/cet/cetTeachers/importExcel',
exportXls = '/teachers/cetTeachers/exportXls', exportXls = '/cet/cetTeachers/exportXls',
} }
/** /**
* api * api

View File

@ -24,11 +24,11 @@ export const columns: BasicColumn[] = [
align: 'center', align: 'center',
dataIndex: 'campus', dataIndex: 'campus',
}, },
{ //{
title: '照片地址', // title: '照片地址',
align: 'center', // align: 'center',
dataIndex: 'photoAddress', // dataIndex: 'photoAddress',
}, //},
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = []; export const searchFormSchema: FormSchema[] = [];
@ -63,11 +63,11 @@ export const formSchema: FormSchema[] = [
field: 'campus', field: 'campus',
component: 'Input', component: 'Input',
}, },
{ //{
label: '照片地址', // label: '照片地址',
field: 'photoAddress', // field: 'photoAddress',
component: 'Input', // component: 'Input',
}, //},
// TODO 主键隐藏字段目前写死为ID // TODO 主键隐藏字段目前写死为ID
{ {
label: '', label: '',

View File

@ -8,8 +8,8 @@
import { ref, computed, unref } from 'vue'; import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal'; import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../../../../../../../../../../CetTeachers.data'; import { formSchema } from '../CetTeachers.data';
import { saveOrUpdate } from '../../../../../../../../../../CetTeachers.api'; import { saveOrUpdate } from '../CetTeachers.api';
// Emits // Emits
const emit = defineEmits(['register', 'success']); const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true); const isUpdate = ref(true);