67 lines
1.4 KiB
TypeScript
67 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: '标题',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'title'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '状态',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'ggStatus_dictText'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '发布时间',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'fbTime',
|
|||
|
customRender:({text}) =>{
|
|||
|
return !text?"":(text.length>10?text.substr(0,10):text);
|
|||
|
},
|
|||
|
},
|
|||
|
];
|
|||
|
|
|||
|
//查询数据
|
|||
|
export const searchFormSchema: FormSchema[] = [
|
|||
|
{
|
|||
|
label: "标题",
|
|||
|
field: 'title',
|
|||
|
component: 'Input',
|
|||
|
colProps: {span: 6},
|
|||
|
},
|
|||
|
];
|
|||
|
|
|||
|
//表单数据
|
|||
|
export const formSchema: FormSchema[] = [
|
|||
|
{
|
|||
|
label: '标题',
|
|||
|
field: 'title',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入标题!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '内容',
|
|||
|
field: 'content',
|
|||
|
component: 'JEditor',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入内容!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
// TODO 主键隐藏字段,目前写死为ID
|
|||
|
{
|
|||
|
label: '',
|
|||
|
field: 'id',
|
|||
|
component: 'Input',
|
|||
|
show: false,
|
|||
|
},
|
|||
|
];
|