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:"left",
    dataIndex: 'domainName',
    width:'150'
   },
  //  {
  //   title: '领域编码',
  //   align:"left",
  //   dataIndex: 'domainCode',
  //   width:'150'
  //  },
   {
    title: '调查项名称',
    align:"left",
    dataIndex: 'attrName',
    width:'150'
   },
   {
    title: '数据采集方式',
    align:"left",
    dataIndex: 'collMethod',
    customRender: ({ text }) => {
      return render.renderDict(text, 'colletway');
    },

    width:'150',
   },
   {
    title: '属性编码',
    align:"left",
    dataIndex: 'attrCode',
    width:'150',
    ifShow:false
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '领域名称',
    field: 'domainName',
    component: 'Input',
  }
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '领域编号',
    field: 'domainCode',
    component: 'Input',
    required:true,
    show: false
  },
  {
    label: '领域名称',
    field: 'domainName',
    component: 'Input',
    required:true
  },
  {
    label: '属性编码',
    field: 'attrCode',
    component: 'Input',
	  show: false
  },
  {
    label: '调查项目',
    field: 'attrName',
    component: 'Input',
    required:true
  },
  {
    label: '采集方法',
    field: 'collMethod',
    component: 'JDictSelectTag',
    defaultValue:1,
    required:true,
    componentProps: {
      dictCode: 'colletway',
      stringToNumber: true,
      placeholder: '请选择采集方式',
     }
  },
  {
    label: '风险等级',
    field: 'riskLevel',
    component: 'JDictSelectTag',
    required:false,
    defaultValue:1,
    componentProps: {
      dictCode: 'risk_level',
      stringToNumber: true,
      placeholder: '请选择',
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
  {
	  label: '',
	  field: 'tp',
	  component: 'Input',
	  show: false
	},
];



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