158 lines
2.9 KiB
TypeScript
158 lines
2.9 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: 'ntitle'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '类型',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'ntype_dictText'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '状态',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'nstatus_dictText'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '链接',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'nlink'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '发布日期',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'ndate'
|
|||
|
},
|
|||
|
{
|
|||
|
title: '是否置顶',
|
|||
|
align: "center",
|
|||
|
dataIndex: 'ontop_dictText'
|
|||
|
},
|
|||
|
];
|
|||
|
|
|||
|
//查询数据
|
|||
|
export const searchFormSchema: FormSchema[] = [
|
|||
|
{
|
|||
|
label: "标题",
|
|||
|
field: 'ntitle',
|
|||
|
component: 'Input',
|
|||
|
colProps: {span: 6},
|
|||
|
},
|
|||
|
{
|
|||
|
label: "类型",
|
|||
|
field: 'ntype',
|
|||
|
component: 'JDictSelectTag',
|
|||
|
componentProps:{
|
|||
|
dictCode: "ntype"
|
|||
|
},
|
|||
|
colProps: {span: 6},
|
|||
|
},
|
|||
|
{
|
|||
|
label: "状态",
|
|||
|
field: 'nstatus',
|
|||
|
component: 'JDictSelectTag',
|
|||
|
componentProps:{
|
|||
|
dictCode: "nstatus"
|
|||
|
},
|
|||
|
colProps: {span: 6},
|
|||
|
},
|
|||
|
{
|
|||
|
label: "发布日期",
|
|||
|
field: 'ndate',
|
|||
|
component: 'DatePicker',
|
|||
|
componentProps: {
|
|||
|
showTime: true,
|
|||
|
},
|
|||
|
colProps: {span: 6},
|
|||
|
},
|
|||
|
{
|
|||
|
label: "是否置顶",
|
|||
|
field: 'ontop',
|
|||
|
component: 'JDictSelectTag',
|
|||
|
componentProps:{
|
|||
|
dictCode: "ontop"
|
|||
|
},
|
|||
|
colProps: {span: 6},
|
|||
|
},
|
|||
|
];
|
|||
|
|
|||
|
//表单数据
|
|||
|
export const formSchema: FormSchema[] = [
|
|||
|
{
|
|||
|
label: '标题',
|
|||
|
field: 'ntitle',
|
|||
|
component: 'Input',
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入标题!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '类型',
|
|||
|
field: 'ntype',
|
|||
|
component: 'JDictSelectTag',
|
|||
|
componentProps:{
|
|||
|
dictCode: "ntype"
|
|||
|
},
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入类型'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '状态',
|
|||
|
field: 'nstatus',
|
|||
|
component: 'JDictSelectTag',
|
|||
|
componentProps:{
|
|||
|
dictCode: "nstatus"
|
|||
|
},
|
|||
|
dynamicRules: ({model,schema}) => {
|
|||
|
return [
|
|||
|
{ required: true, message: '请输入状态!'},
|
|||
|
];
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '内容',
|
|||
|
field: 'ncontentString',
|
|||
|
component: 'JEditor',
|
|||
|
},
|
|||
|
{
|
|||
|
label: '链接',
|
|||
|
field: 'nlink',
|
|||
|
component: 'Input',
|
|||
|
},
|
|||
|
{
|
|||
|
label: '发布日期',
|
|||
|
field: 'ndate',
|
|||
|
component: 'DatePicker',
|
|||
|
componentProps: {
|
|||
|
showTime: true,
|
|||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|||
|
},
|
|||
|
},
|
|||
|
{
|
|||
|
label: '是否置顶',
|
|||
|
field: 'ontop',
|
|||
|
component: 'JDictSelectTag',
|
|||
|
componentProps:{
|
|||
|
dictCode: "ontop"
|
|||
|
},
|
|||
|
},
|
|||
|
// TODO 主键隐藏字段,目前写死为ID
|
|||
|
{
|
|||
|
label: '',
|
|||
|
field: 'id',
|
|||
|
component: 'Input',
|
|||
|
show: false,
|
|||
|
},
|
|||
|
];
|