import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '问题项',
    align:"left",
    dataIndex: 'problemItem',
    width:150,
   },
   {
    title: '问题示例',
    align:"left",
    dataIndex: 'problemExample',
    width:150,
   },
   {
    title: "活动编号",
    align:"left",
    dataIndex: 'caNo',
    width:100,
  },
   {
    title: "控制活动名称",
    align:"left",
    dataIndex: 'caName',
    width:150,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "控制活动",
      field: 'caName',
      component: 'JInput',
      colProps: {span: 6},
 	},
   {
    label: "问题项",
    field: 'problemItem',
    component: 'JInput',
    colProps: {span: 6},
 },
 {
  label: "所属领域",
  field: 'domainCodeMore',
  component: 'JInput',
  colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '控制活动编号',
    field: 'caNo',
    dynamicDisabled: true,
    component: 'Input',
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '控制活动名称',
    field: 'caName',
    dynamicDisabled: true,
    component: 'Input',
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '问题项',
    field: 'problemItem',
    component: 'InputTextArea',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请输入问题项!'},
      ];
    },
    componentProps: {
      rows: 3
    }
  },
  {
    label: '问题示例',
    field: 'problemExample',
    component: 'InputTextArea',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请输入问题示例!'},
      ];
    },
    componentProps: {
      rows: 5
    }
  },
  {
    label: '',
    field: 'complianeNo',
    component: 'Input',
	  show: false
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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