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: 'noticeTypeName'
  },
  {
    title: '公告类型编码',
    align: "center",
    dataIndex: 'noticeTypeCode'
  },
  {
    title: '事务类型名称',
    align: "center",
    dataIndex: 'transactionTypeName'
  },
  {
    title: '事务类型编码',
    align: "center",
    dataIndex: 'transactionTypeCode'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "公告类型名称",
    field: 'noticeTypeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "公告类型编码",
    field: 'noticeTypeCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "事务类型名称",
    field: 'transactionTypeName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "事务类型编码",
    field: 'transactionTypeCode',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '公告类型名称',
    field: 'noticeTypeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入公告类型名称!'},
             ];
    },
  },
  {
    label: '公告类型编码',
    field: 'noticeTypeCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入公告类型编码!'},
             ];
    },
  },
  {
    label: '事务类型名称',
    field: 'transactionTypeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入事务类型名称!'},
             ];
    },
  },
  {
    label: '事务类型编码',
    field: 'transactionTypeCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入事务类型编码!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  noticeTypeName: {title: '公告类型名称',order: 0,view: 'text', type: 'string',},
  noticeTypeCode: {title: '公告类型编码',order: 1,view: 'text', type: 'string',},
  transactionTypeName: {title: '事务类型名称',order: 2,view: 'text', type: 'string',},
  transactionTypeCode: {title: '事务类型编码',order: 3,view: 'text', type: 'string',},
};
