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: 'rateTaskId'
   },
   {
    title: '规则id',
    align:"center",
    dataIndex: 'ruleId'
   },
   {
    title: '子领域id',
    align:"center",
    dataIndex: 'rateDomainId'
   },
   */
   {
    title: '序号',
    align:"left",
    sorter: true,
    dataIndex: 'valindex',
    width :50,
   },
   {
    title: '领域',
    align:"left",
    dataIndex: 'ratedomain',
    width :120,
    customRender: ({ text }) => {
      return render.renderDict(text, 'rate_domain');
    },
   },
   {
    title: '子领域',
    align:"left",
    dataIndex: 'sondomain',
    width :180,
   },
   
   {
    title: '责任部门',
    align:"left",
    dataIndex: 'rateDeptName',
    width :120,
   },
   {
    title: '部门责任人',
    align:"left",
    dataIndex: 'rateUserName',
    width :80,
   },
   /** 
   {
    title: '操作人',
    align:"center",
    dataIndex: 'optionUser'
   },
   {
    title: '操作时间',
    align:"center",
    dataIndex: 'optionTime'
   }, */
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "任务id",
    field: 'rateTaskId',
    component: 'Input',
    colProps: {span: 6},
    show: false
 },
	{
      label: "领域",
      field: 'ratedomain',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"rate_domain"
      },
      colProps: {span: 6},
 	},
	{
      label: "子领域",
      field: 'sondomain',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  
  {
    label: '任务 id',
    field: 'rateTaskId',
    component: 'Input',
	  show: false
  },
  {
    label: '子领域id',
    field: 'rateDomainId',
    component: 'Input',
	  show: false
  },
  /**
  {
    label: '规则id',
    field: 'ruleId',
    component: 'Input',
  },
 
  {
    label: '领域',
    field: 'ratedomain',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"rate_domain"
     },
  },
  {
    label: '子领域',
    field: 'sondomain',
    component: 'Input',
  },
  {
    label: '序号',
    field: 'valindex',
    component: 'InputNumber',
  },
  {
    label: '责任部门',
    field: 'rateDept',
    component: 'Input',
  }, */
  {
    label: '部门责任人',
    field: 'rateUser',
    //component: 'Input',
    component: 'JSelectUserByDept',
    componentProps:{
        labelKey: 'realname',
        rowKey: 'id',
     },
  }, /** 
  {
    label: '操作人',
    field: 'optionUser',
    component: 'Input',
  },
  {
    label: '操作时间',
    field: 'optionTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     }, 
  }, */
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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