dbsd_kczx/src/views/zy/zyCjwt/ZyCjwt.data.ts

72 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,
},
];