优化数据管理字段
This commit is contained in:
parent
b181f828dd
commit
9086285b76
|
@ -2,8 +2,14 @@ import { BasicColumn } from '/@/components/Table';
|
|||
import { FormSchema } from '/@/components/Table';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { schemas } from '../../demo/jeecg/jeecgComponents.data';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '校区',
|
||||
align: 'center',
|
||||
dataIndex: 'campus',
|
||||
},
|
||||
{
|
||||
title: '教学楼名',
|
||||
align: 'center',
|
||||
|
@ -14,11 +20,11 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'area',
|
||||
},
|
||||
{
|
||||
title: '楼层号',
|
||||
align: 'center',
|
||||
dataIndex: 'floor',
|
||||
},
|
||||
//{
|
||||
// title: '楼层号',
|
||||
// align: 'center',
|
||||
// dataIndex: 'floor',
|
||||
//},
|
||||
{
|
||||
title: '教室',
|
||||
align: 'center',
|
||||
|
@ -47,6 +53,21 @@ export const formSchema: FormSchema[] = [
|
|||
// return [{ required: true, message: '请输入完整的教室名称(例如:崇师楼B区520、理工一511)' }];
|
||||
// },
|
||||
//},
|
||||
{
|
||||
label: '校区',
|
||||
field: 'campus',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '江北', value: '江北' },
|
||||
{ label: '江南', value: '江南' },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请选择校区!!' }];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
label: '教学楼名称',
|
||||
field: 'building',
|
||||
|
@ -55,16 +76,17 @@ export const formSchema: FormSchema[] = [
|
|||
return [{ required: true, message: '请输入教学楼名称!!' }];
|
||||
},
|
||||
},
|
||||
|
||||
//{
|
||||
// label: '楼层号',
|
||||
// field: 'floor',
|
||||
// component: 'Input',
|
||||
//},
|
||||
{
|
||||
label: '区域',
|
||||
field: 'area',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '楼层号',
|
||||
field: 'floor',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '教室',
|
||||
field: 'roomNumber',
|
||||
|
|
|
@ -2,8 +2,19 @@ import { BasicColumn } from '/@/components/Table';
|
|||
import { FormSchema } from '/@/components/Table';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { values } from 'xe-utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '校区',
|
||||
align: 'center',
|
||||
dataIndex: 'campus',
|
||||
},
|
||||
{
|
||||
title: '学院',
|
||||
align: 'center',
|
||||
dataIndex: 'college',
|
||||
},
|
||||
{
|
||||
title: '教师姓名',
|
||||
align: 'center',
|
||||
|
@ -19,10 +30,11 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'sex',
|
||||
},
|
||||
|
||||
{
|
||||
title: '校区',
|
||||
title: '类型',
|
||||
align: 'center',
|
||||
dataIndex: 'campus',
|
||||
dataIndex: 'type',
|
||||
},
|
||||
//{
|
||||
// title: '照片地址',
|
||||
|
@ -34,6 +46,36 @@ export const columns: BasicColumn[] = [
|
|||
export const searchFormSchema: FormSchema[] = [];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '校区',
|
||||
field: 'campus',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '江北', value: '江北' },
|
||||
{ label: '江南', value: '江南' },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请选择校区!!' }];
|
||||
},
|
||||
defaultValue: '江北',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
field: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '教师', value: '教师' },
|
||||
{ label: '研究生', value: '研究生' },
|
||||
{ label: '非教师', value: '非教师' },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请选择类型!!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '教师姓名',
|
||||
field: 'name',
|
||||
|
@ -65,10 +107,28 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: '校区',
|
||||
field: 'campus',
|
||||
label: '学院',
|
||||
field: 'college',
|
||||
component: 'Input',
|
||||
ifShow: ({ model }) => {
|
||||
return model.type === '教师' || model.type === '研究生';
|
||||
},
|
||||
dynamicRules: ({ model }) => {
|
||||
return model.type === '教师' || model.type === '研究生' ? [{ required: true, message: '请输入教师/研究生对应的学院!' }] : [];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '工号/学号',
|
||||
field: 'code',
|
||||
component: 'Input',
|
||||
ifShow: ({ model }) => {
|
||||
return model.type === '教师' || model.type === '研究生';
|
||||
},
|
||||
dynamicRules: ({ model }) => {
|
||||
return model.type === '教师' || model.type === '研究生' ? [{ required: true, message: '请输入教师工号/学号!' }] : [];
|
||||
},
|
||||
},
|
||||
|
||||
//{
|
||||
// label: '照片地址',
|
||||
// field: 'photoAddress',
|
||||
|
|
Loading…
Reference in New Issue