import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '场景编号',
    align: 'center',
    dataIndex: 'scenarioNo',
    width: 110,
  },
  {
    title: '风险场景',
    align: 'left',
    dataIndex: 'scenarioName',
    width: 120,
  },
  {
    title: '标签',
    align: 'left',
    dataIndex: 'lableNameList',
    width: 180,
  },
  {
    title: '事件分类',
    align: 'left',
    dataIndex: 'eventClassifyName',
    width: 150,
  },
  {
    title: '风险事件',
    align: 'left',
    dataIndex: 'riskEventName',
    width: 250,
  },
  {
    title: '风险事件描述',
    align: 'left',
    dataIndex: 'riskEventDesc',
    width: 300,
  },
  {
    title: '更新时间',
    align: 'center',
    dataIndex: 'updatedTime',
    width: 140,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '风险场景',
    field: 'scenarioName',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '风险事件名称',
    field: 'riskEventName',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '标签',
    field: 'lableName',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '事件分类',
    field: 'eventClassify',
    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 } } },
    dynamicRules: ({ model, schema }) => {
      return [{ required: true, message: '请输入风险事件名称!' }];
    },
  },
  // {
  //   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: 'riskEventDesc',
    component: 'InputTextArea',
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 21 } } },
    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;
}
