import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '活动编号',
    align: 'left',
    dataIndex: 'caNo',
    width: 100,
  },
  {
    title: '控制活动名称',
    align: 'left',
    dataIndex: 'caName',
    width: 200,
  },
  {
    title: '标签',
    align: 'left',
    dataIndex: 'lableNameList',
    width: 200,
  },
  {
    title: '检查内容',
    align: 'left',
    dataIndex: 'checkContent',
    width: 300,
  },
  //  {
  //   title: '检查方法',
  //   align:"left",
  //   dataIndex: 'checkMethod'
  //  },
];
//查询数据
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '控制活动',
    field: 'caName',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '所属领域',
    field: 'domainCodeMore',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '标签',
    field: 'lableName',
    component: 'Input',
    colProps: { span: 6 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  // {
  //   label: '控制活动编号',
  //   field: 'caNo',
  //   dynamicDisabled: true,
  //   colProps: { lg: 12 },
  //   itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
  //   component: 'Input',
  // },
  // {
  //   label: '控制活动名称',
  //   field: 'caName',
  //   dynamicDisabled: true,
  //   colProps: { lg: 12 },
  //   itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
  //   component: 'Input',
  // },
  {
    label: '检查内容',
    field: 'checkContent',
    component: 'InputTextArea',
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 4 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 20 } } },
    dynamicRules: ({ model, schema }) => {
      return [{ required: true, message: '请输入检查内容!' }];
    },
    componentProps: {
      rows: 4,
    },
  },
  // {
  //   label: '检查方法',
  //   field: 'checkMethod',
  //   component: 'InputTextArea',
  //   itemProps:{labelCol:{xs: {span: 24},sm: {span: 4},},wrapperCol:{xs: {span: 24},sm: {span: 20},}},
  //   dynamicRules: ({model,schema}) => {
  //     return [
  //            { required: true, message: '请输入检查方法!'},
  //     ];
  //   },
  // },
  {
    label: '询问',
    field: 'checkAsk',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
    component: 'JSearchSelect',
    componentProps: {
      dict: 'sys_position,name,code',
    },
    helpMessage: '向适合的人员询问有关控制运作的资料。',
  },
  {
    label: '交叉/确证寻问',
    field: 'checkCross',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
    component: 'JSearchSelect',
    componentProps: {
      dict: 'sys_position,name,code',
    },
    helpMessage: '除实施适当测试手段外，通过询问企业内其他人员，验证控制的执行情况',
  },
  {
    label: '观察',
    field: 'checkObserve',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
    component: 'Input',
    helpMessage: '观察控制运行的实际情况。',
  },
  {
    label: '审阅',
    field: 'checkReview',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
    component: 'JTreeDict',
    componentProps: {
      field: 'code',
      parentCode: 'B05',
      placeholder: '请选择审阅',
    },
    helpMessage: '检查控制生成的记录和文件，作为控制设计和执行情况的证据。',
  },
  {
    label: '重新运行',
    field: 'checkRerun',
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 4 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 20 } } },
    component: 'InputTextArea',
    helpMessage: '重新履行某些控制程序，以证明其运行是正确的。',
    componentProps: {
      rows: 3,
    },
  },
  {
    label: '能力评估',
    field: 'checkAbility',
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 4 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 20 } } },
    component: 'InputTextArea',
    helpMessage: '综合运用询问、文件检查、重新履行等手段，可以测试某个管理人员在某一领域的知识及其实施某项控制程序的胜任能力。',
    componentProps: {
      rows: 3,
    },
  },
  {
    label: '系统验证',
    field: 'checkSysValid',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
    component: 'Input',
    helpMessage: '测试信息系统中的自动化控制是否按设计要求运行。',
  },
  {
    label: '数据验证',
    field: 'checkDataValid',
    colProps: { lg: 12 },
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 } } },
    component: 'Input',
    helpMessage: '直接抽取数据进行完整性与准确性的验证。',
  },
  {
    label: '穿行性测试',
    field: 'checkTrajection',
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 4 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 20 } } },
    component: 'InputTextArea',
    helpMessage: '追踪交易在信息系统/业务流程中的处理过程，以证实所了解的流程与控制。',
    componentProps: {
      rows: 3,
    },
  },
  {
    label: '分析性复核',
    field: 'checkAnReview',
    itemProps: { labelCol: { xs: { span: 24 }, sm: { span: 4 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 20 } } },
    component: 'InputTextArea',
    helpMessage: '分析重要的比率或趋势，调查这些比率或趋势的异常变动及其与预期数额和相关信息的差异。',
    componentProps: {
      rows: 3,
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

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