import { fail } from 'assert';
import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '策略编号',
    align: 'left',
    dataIndex: 'strategyNo',
    width: 100,
  },
  {
    title: '内控策略',
    align: 'left',
    dataIndex: 'innerControlStrategy',
    width: 100,
  },
  {
    title: '内控要求',
    align: 'left',
    dataIndex: 'innerControlClaim',
    width: 100,
  },
  {
    title: '所属领域',
    align: 'left',
    dataIndex: 'domainName',
    width: 100,
  },
  {
    title: '适用对象',
    align: 'left',
    dataIndex: 'applicableName',
    width: 100,
  },
  {
    title: '管理制度',
    align: 'left',
    dataIndex: 'manageOrder',
    width: 100,
  },
  {
    title: '职责分工',
    align: 'left',
    dataIndex: 'divisionDutyName',
    width: 100,
  },
  {
    title: '执行规则',
    align: 'left',
    dataIndex: 'execRule',
    width: 100,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '内控策略',
    field: 'innerControlStrategy',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '所属领域',
    field: 'domainCodeMore',
    component: 'JInput',
    colProps: { span: 6 },
  },
  {
    label: '适用对象',
    field: 'applicableCode',
    component: 'Input',
    colProps: { span: 6 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  // {
  //   label: '策略编号',
  //   field: 'strategyNo',
  //   dynamicDisabled: true,
  //   component: 'Input',
  //   colProps: { lg: 12 },
  //   itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
  // },
  {
    label: '内控策略',
    field: 'innerControlStrategy',
    dynamicDisabled: false,
    component: 'Input',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 18 } } },
  },
  {
    label: '策略详情',
    field: 'innerControlClaim',
    component: 'InputTextArea',
    dynamicDisabled: false,
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 21 } } },
    componentProps: {
      rows: 5,
    },
  },
  // {
  //   label: '适用对象',
  //   field: 'applicableCode',
  //   component: 'JSearchSelect',
  //   componentProps: {
  //     dict: 'applyobj',
  //   },
  //   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: 'manageOrder',
  //   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: 'divisionDuty',
  //   component: 'JSearchSelectDuty',
  //   componentProps: {
  //     dict: 'listDuty',
  //   },
  //   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: 'execRule',
  //   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: '请输入执行规则!' }];
  //   },
  // },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

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