import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '场景编号',
    align:"left",
    dataIndex: 'stRiskScenario.scenarioNo',
    width:100,
   },
   {
    title: '风险场景',
    align:"left",
    dataIndex: 'stRiskScenario.scenarioName',
    width:150,
   },
   {
    title: '标签',
    align:"left",
    dataIndex: 'stRiskScenario.lableNameList',
    width:200,
   },
   {
    title: '适用对象',
    align:"left",
    dataIndex: 'stRiskScenario.applicableName',
    width:100,
   },
   {
    title: '风险事件',
    align:"left",
    dataIndex: 'stRiskEvent.riskEventName',
    width:150,
   },
   {
    title: '风险事件描述',
    align:"left",
    dataIndex: 'stRiskEvent.riskEventDesc',
    width:250,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "风险场景",
    field: 'scenarioName',
    component: 'Input',
    colProps: {span: 6},
 },
	{
      label: "风险事件名称",
      field: 'riskEventName',
      component: 'Input',
      colProps: {span: 6},
 	},
   {
    label: "适用对象",
    field: 'applicableCode',
    component: 'Input',
    colProps: {span: 6},
 },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '风险场景编号',
    field: 'scenarioNo',
    component: 'Input',
    dynamicDisabled: true,
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '风险场景',
    field: 'scenarioName',
    component: 'Input',
    dynamicDisabled: true,
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '风险事件编号',
    field: 'riskEventNo',
    component: 'Input',
    dynamicDisabled: true,
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '风险事件名称',
    field: 'riskEventName',
    component: 'Input',
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  // {
  //   label: '事件分类',
  //   field: 'eventClassify',
  //   component: 'JSearchSelect',
  //   componentProps:{
  //     dict: "eventclassify"
  //   },
  //   colProps: {lg: 12},
  //   itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  //   dynamicRules: ({model,schema}) => {
  //     return [
  //            { required: true, message: '请选择事件分类!'},
  //     ];
  //   },
  // },
  // {
  //     label: '标签',
  //     field: 'lableList',
  //     component: 'StSelectLable',//'JSelectUser',//
  //     itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
  //     dynamicRules: ({model,schema}) => {
  //       return [
  //              { required: true, message: '请选择标签!'},
  //       ];
  //     },
  // },
  {
    label: '风险事件描述',
    field: 'riskEventDesc',
    component: 'InputTextArea',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
    componentProps: {
      rows: 5
    }
  },
  {
    label: '风险事件编号',
    field: 'riskIds',
    component: 'Input',
    show: false,
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请选择风险事件!'},
      ];
    },
  },
  {
    label: '合规编号',
    field: 'complianeNo',
    component: 'Input',
	  show: false,
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请选择关联文件编号!'},
      ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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