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: 'id',
    sorter:true,
    width:1,
    ifShow:false
  },
  {
    title: 'taskId',
    align:"center",
    dataIndex: 'taskId',
    sorter:true,
    width:1,
    ifShow:false
  },
  {
    title: '指标编号',
    align:"center",
    dataIndex: 'mtrcNo',
    sorter:true,
    width:80,
    resizable: true,
   },
   {
    title: '指标名称',
    align:"left",
    dataIndex: 'mtrcName',
    width:300,
    sorter: true,
    resizable: true,
  
   },
   {
    title: '监测频率',
    align: 'center',
    dataIndex: 'collFreq',
    sorter: true,
    resizable: true,
    width: 90,
    customRender: ({ text }) => {
      return render.renderDict(text, 'colletrate');
    },
  },
  {
    title: '采集方法',
    align: 'center',
    dataIndex: 'collMethod',
    sorter: true,
    resizable: true,
    width: 80,
    customRender: ({ text }) => {
      return render.renderDict(text, 'colletway');
    },
  },
   {
    title: '填报人',
    align:"center",
    dataIndex: 'realname',
    width:150,
    helpMessage: ['填报人'],
    sorter: true,
    resizable: true,
   },
   {
    title: '填报人',
    align:"center",
    dataIndex: 'reporter',
    width:100,
    ifShow:false
   },
   {
    title: '指标定义',
    align:"left",
    dataIndex: 'des',
    width:200,
    resizable: true,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '指标编码',
    field: 'mtrcNo',
    component: 'Input',
    colProps: { lg: 4, md: 8 },
  },
  {
    label: '指标名称',
    field: 'mtrcName',
    component: 'Input',
    colProps: { lg: 4, md: 8 },
  },
  {
    label: '频率',
    field: 'collFreq',
    component: 'JDictSelectTag',
    colProps: {lg: 4,md:8},
    componentProps: {
      dictCode: 'colletrate',
     }
  }
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '指标编码',
    field: 'mtrcNo',
    component: 'Input',
    dynamicDisabled: true,
  },
  {
    label: '指标名称',
    field: 'mtrcName',
    component: 'Input',
    dynamicDisabled: true,
  },
  // {
  //   label: '填报部门',
  //   field: 'reportDepart',
  //   component: 'JSelectDept',
  // },
  {
    label: '填报人',
    field: 'reporter',
    component: 'JSelectUser',
    componentProps:{
       isRadioSelection:false,
        labelKey: 'realname',
        rowKey: 'id',
     },
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
  {
	  label: '',
	  field: 'taskId',
	  component: 'Input',
	  show: false
	},
];



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