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: 'taskdeptId'
   },
   {
    title: '任务 id',
    align:"center",
    dataIndex: 'rateTaskId'
   },
   {
    title: '规则id',
    align:"center",
    dataIndex: 'ruleId'
   },
   {
    title: '子领域id',
    align:"center",
    dataIndex: 'rateDomainId'
   },
   {
    title: '领域',
    align:"center",
    dataIndex: 'ratedomain'
   },
   {
    title: '序号',
    align:"left",
    dataIndex: 'keyindex',
    width :50,
   },*/
   {
    title: '子领域',
    align:"left",
    dataIndex: 'sondomain',
    width :180,
   },
   {
    title: '评估要素',
    align:"left",
    dataIndex: 'keyitem',
    width :180,
   },
   {
    title: '责任部门',
    align:"left",
    dataIndex: 'rateDept_dictText',
    width :120,
   },
   {
    title: '填报人',
    align:"left",
    dataIndex: 'rateUser_dictText',
    width :80,
   },
   /** 
   {
    title: '评估要素id',
    align:"center",
    dataIndex: 'keyitemId'
   },
  
   
   {
    title: '分配人',
    align:"center",
    dataIndex: 'optionUser'
   },
   {
    title: '分配时间',
    align:"center",
    dataIndex: 'optionTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },*/
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '任务 id',
    field: 'rateTaskId',
    component: 'Input',
    colProps: {span: 6},
    show: false
   },
	{
      label: "子领域",
      field: 'sondomain',
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "评估要素",
      field: 'keyitem',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [

  {
    label: '任务部门id',
    field: 'taskdeptId',
    component: 'Input',
    show: false
  },
  /** 
  {
    label: '任务 id',
    field: 'rateTaskId',
    component: 'Input',
  },
  {
    label: '规则id',
    field: 'ruleId',
    component: 'Input',
  },
  {
    label: '子领域id',
    field: 'rateDomainId',
    component: 'Input',
  },
  {
    label: '领域',
    field: 'ratedomain',
    component: 'Input',
  }, 
  {
    label: '子领域',
    field: 'sondomain',
    component: 'Input',
  }, */
  {
    label: '评估要素',
    field: 'keyitem',
    component: 'Input',
    show: false
  },
  
  {
    label: '评估要素id',
    field: 'keyitemId',
    component: 'Input',
    show: false
  },
  {
    label: '填报人',
    field: 'rateUser',
    //component: 'Input',
    component: 'JSelectUserByDept',
    componentProps:{
        labelKey: 'realname',
        rowKey: 'id',
     },
  },
  /**  
  {
    label: '序号',
    field: 'keyindex',
    component: 'InputNumber',
  },
  {
    label: '填报部门',
    field: 'rateDept',
    component: 'Input',
  },
 
  {
    label: '分配人',
    field: 'optionUser',
    component: 'Input',
  },
  {
    label: '分配时间',
    field: 'optionTime',
    component: 'DatePicker',
  },*/
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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