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: 'docNo',
    width:120
   },
   {
    title: '标准名称',
    align:"left",
    dataIndex: 'name',
    width:250
   },
   {
    title: '行业领域',
    align:"center",
    dataIndex: 'industry',
    width:120
   },
   {
    title: '生效日期',
    align:"center",
    width:120,
    dataIndex: 'efftDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '备案日期',
    align:"center",
    width:120,
    dataIndex: 'fillingDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '备案号',
    align:"center",
    dataIndex: 'filingNum',
    width:120
   },
   {
    title: '批准日期',
    align:"center",
    dataIndex: 'appvDate',
    width:120,
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
  //  {
  //   title: '创建时间',
  //   align:"center",
  //   dataIndex: 'createdTime',
  //   width:140,
  //   customRender:({text}) =>{
  //     return !text?"":(text.length>10?text.substr(0,10):text)
  //   },
  //  },
  //  {
  //   title: '创建人',
  //   align:"center",
  //   dataIndex: 'createdUser',
  //   width:120
  //  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "标准号",
      field: 'docNo',
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "标准名称",
      field: 'name',
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "备案号",
      field: 'filingNum',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标准号',
    field: 'docNo',
    component: 'Input',
  },
  {
    label: '标准名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '当前状态',
    field: 'curSta',
    component: 'Input',
  },
  {
    label: '行业领域',
    field: 'industry',
    component: 'Input',
  },
  {
    label: '生效日期',
    field: 'efftDate',
    component: 'DatePicker',
  },
  {
    label: '备案日期',
    field: 'fillingDate',
    component: 'DatePicker',
  },
  {
    label: '备案号',
    field: 'filingNum',
    component: 'Input',
  },
  {
    label: '批准日期',
    field: 'appvDate',
    component: 'DatePicker',
  },
  {
    label: '链接地址',
    field: 'linkAddr',
    component: 'Input',
  },
  {
    field: 'linkAddr',
    component: 'JUpload',
    helpMessage: '无限制上传',
    label: '上传文件',
    componentProps: { 
      maxCount: 1
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}