dbsd_kczx/src/views/zy/zyZyxx/ZyZyxx.data.ts

108 lines
2.0 KiB
TypeScript
Raw Normal View History

2024-09-20 08:34:10 +08:00
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: 'content'
},
{
title: '资源',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileSlot' },
},
{
title: '是否发布',
align: "center",
dataIndex: 'sffb_dictText'
},
];
//列表数据
export const columns2: BasicColumn[] = [
{
title: '标题',
align: "center",
dataIndex: 'title'
},
{
title: '内容',
align: "center",
dataIndex: 'content'
},
{
title: '资源',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileSlot' },
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "标题",
field: 'title',
component: 'Input',
colProps: {span: 6},
},
{
label: "是否发布",
field: 'sffb',
component: 'JDictSelectTag',
componentProps:{
dictCode: "yn"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'title',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入标题!'},
];
},
},
{
label: '内容',
field: 'content',
component: 'InputTextArea',
},
{
label: '附件',
field: 'filePath',
component: 'JUpload',
componentProps:{
},
},
{
label: '是否发布',
field: 'sffb',
component: 'JDictSelectTag',
componentProps:{
dictCode: "yn"
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];