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: '领域id',
    align: "center",
    dataIndex: 'rateDomainId'
  },
  {
    title: '评估要素',
    align: "center",
    dataIndex: 'keyitem'
  },
  {
    title: '分值',
    align: "center",
    dataIndex: 'keyitemScore'
  },
  {
    title: '备注说明',
    align: "center",
    dataIndex: 'remark'
  },
  {
    title: '序号',
    align: "center",
    sorter: true,
    dataIndex: 'keyindex'
  },
  {
    title: '附件要求',
    align: "center",
    dataIndex: 'filenum'
  },
  {
    title: '附件名',
    align: "center",
    dataIndex: 'filenamestr'
  },
  {
    title: '附件类型',
    align: "center",
    dataIndex: 'filenamesufstr'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "领域id",
    field: 'rateDomainId',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "评估要素",
    field: 'keyitem',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '领域id',
    field: 'rateDomainId',
    component: 'Input',
  },
  {
    label: '评估要素',
    field: 'keyitem',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入评估要素!'},
             ];
    },
  },
  {
    label: '分值',
    field: 'keyitemScore',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入分值!'},
             ];
    },
  },
  {
    label: '备注说明',
    field: 'remark',
    component: 'InputTextArea',
  },
  {
    label: '序号',
    field: 'keyindex',
    component: 'InputNumber',
  },
  {
    label: '附件要求',
    field: 'filenum',
    component: 'Input',
  },
  {
    label: '附件名',
    field: 'filenamestr',
    component: 'Input',
  },
  {
    label: '附件类型',
    field: 'filenamesufstr',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
