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: 'stdId'
   },
   {
    title: '要素id',
    align:"center",
    dataIndex: 'keyitemId'
   },
   {
    title: '分值',
    align:"center",
    dataIndex: 'score'
   },
   {
    title: '序号',
    align:"center",
    dataIndex: 'valIndex'
   },
   {
    title: '填报人',
    align:"center",
    dataIndex: 'inputuser'
   },
   {
    title: '填报人',
    align:"center",
    dataIndex: 'inputdept'
   },
   {
    title: '任务id',
    align:"center",
    dataIndex: 'taskId'
   },
   {
    title: '现状描述',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '自评分',
    align:"center",
    dataIndex: 'inputscore'
   },
   {
    title: '审核状态',
    align:"center",
    dataIndex: 'approvestatus'
   },
   {
    title: '审核意见',
    align:"center",
    dataIndex: 'approveremark'
   },
   {
    title: '审核人',
    align:"center",
    dataIndex: 'approveuser_dictText'
   },
   {
    title: '审核部门',
    align:"center",
    dataIndex: 'approvedept_dictText'
   },
   {
    title: '审核时间',
    align:"center",
    dataIndex: 'approvetime'
   },
   {
    title: '评分人',
    align:"center",
    dataIndex: 'rateuser_dictText'
   },
   {
    title: '评分部门',
    align:"center",
    dataIndex: 'ratedept_dictText'
   },
   {
    title: '评分时间',
    align:"center",
    dataIndex: 'ratetime'
   },
   {
    title: '评分理由',
    align:"center",
    dataIndex: 'rateremark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '选项id',
    field: 'stdId',
    component: 'Input',
  },
  {
    label: '要素id',
    field: 'keyitemId',
    component: 'Input',
  },
  {
    label: '分值',
    field: 'score',
    component: 'InputNumber',
  },
  {
    label: '序号',
    field: 'valIndex',
    component: 'InputNumber',
  },
  {
    label: '填报人',
    field: 'inputuser',
    component: 'Input',
  },
  {
    label: '填报人',
    field: 'inputdept',
    component: 'Input',
  },
  {
    label: '任务id',
    field: 'taskId',
    component: 'Input',
  },
  {
    label: '现状描述',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '自评分',
    field: 'inputscore',
    component: 'InputNumber',
  },
  {
    label: '审核状态',
    field: 'approvestatus',
    component: 'Input',
  },
  {
    label: '审核意见',
    field: 'approveremark',
    component: 'InputTextArea',
  },
  {
    label: '审核人',
    field: 'approveuser',
    component: 'JSelectUserByDept',
    componentProps:{
        labelKey:'realname',
     },
  },
  {
    label: '审核部门',
    field: 'approvedept',
     component: 'JSelectDept',
  },
  {
    label: '审核时间',
    field: 'approvetime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '评分人',
    field: 'rateuser',
    component: 'JSelectUserByDept',
    componentProps:{
        labelKey:'realname',
     },
  },
  {
    label: '评分部门',
    field: 'ratedept',
     component: 'JSelectDept',
  },
  {
    label: '评分时间',
    field: 'ratetime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '评分理由',
    field: 'rateremark',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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