72 lines
1.4 KiB
TypeScript
72 lines
1.4 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: 'createTime',
|
||
align: "center",
|
||
dataIndex: 'createTime',
|
||
customRender:({text}) =>{
|
||
return !text?"":(text.length>10?text.substr(0,10):text);
|
||
},
|
||
},
|
||
{
|
||
title: '学期学年',
|
||
align: "center",
|
||
dataIndex: 'xqxn'
|
||
},
|
||
{
|
||
title: '问题',
|
||
align: "center",
|
||
dataIndex: 'question'
|
||
},
|
||
{
|
||
title: '答案',
|
||
align: "center",
|
||
dataIndex: 'answer'
|
||
},
|
||
];
|
||
|
||
//查询数据
|
||
export const searchFormSchema: FormSchema[] = [
|
||
{
|
||
label: "问题",
|
||
field: 'question',
|
||
component: 'Input',
|
||
colProps: {span: 6},
|
||
},
|
||
];
|
||
|
||
//表单数据
|
||
export const formSchema: FormSchema[] = [
|
||
{
|
||
label: '问题',
|
||
field: 'question',
|
||
component: 'InputTextArea',
|
||
dynamicRules: ({model,schema}) => {
|
||
return [
|
||
{ required: true, message: '请输入问题!'},
|
||
];
|
||
},
|
||
},
|
||
{
|
||
label: '答案',
|
||
field: 'answer',
|
||
component: 'InputTextArea',
|
||
dynamicRules: ({model,schema}) => {
|
||
return [
|
||
{ required: true, message: '请输入答案!'},
|
||
];
|
||
},
|
||
},
|
||
// TODO 主键隐藏字段,目前写死为ID
|
||
{
|
||
label: '',
|
||
field: 'id',
|
||
component: 'Input',
|
||
show: false,
|
||
},
|
||
];
|