import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '检查点ID',
    align: 'center',
    dataIndex: 'checkid',
  },
  {
    title: '项目ID',
    align: 'center',
    dataIndex: 'pid',
  },
  {
    title: '类别',
    align: 'center',
    dataIndex: 'tp_dictText',
  },
  {
    title: '名称',
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: '说明',
    align: 'center',
    dataIndex: 'des',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  // {
  //     label: "检查点ID",
  //     field: 'checkid',
  //     component: 'Input',
  //     colProps: {span: 6},
  // },
  // {
  //     label: "项目ID",
  //     field: 'pid',
  //     component: 'Input',
  //     colProps: {span: 6},
  // },
  {
    label: '类别',
    field: 'tp',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'check_item_tp',
      // placeholder: '请选择',
    },
    colProps: { span: 6 },
  },
  // {
  //     label: "名称",
  //     field: 'name',
  //     component: 'Input',
  //     colProps: {span: 6},
  // },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '检查点ID',
    field: 'checkid',
    component: 'InputNumber',
  },
  {
    label: '项目ID',
    field: 'pid',
    component: 'InputNumber',
  },
  {
    label: '类别',
    field: 'tp',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'check_item_tp',
    },
  },
  {
    label: '名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '说明',
    field: 'des',
    component: 'InputTextArea',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
//表单数据
export const checkMethodFormSchema: FormSchema[] = [
  {
    label: '检查内容',
    field: 'content',
    component: 'InputTextArea',
    componentProps: {
      rows: 3,
      showCount: true,
      maxlength: 1024,
    },
    required: true,
  },
  {
    label: '类别',
    field: 'tp',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'check_item_tp',
    },
  },
  {
    label: '名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '说明',
    field: 'des',
    component: 'InputTextArea',
  },
  {
    label: '控制项',
    field: 'actIds',
    component: 'JCaSelect',
  },
  // {
  //   label: '标 签',
  //   field: 'labels',
  //   component: 'StSelectLable',
  // },
  // {
  //   label: '备 注',
  //   field: 'des',
  //   component: 'InputTextArea',
  //   componentProps: {
  //     rows: 4,
  //     showCount: true,
  //     maxlength: 1024,
  //   },
  // },
  {
    label: '创建人',
    field: 'createUser',
    component: 'Input',
    show: false,
  },
  {
    label: '来源文件',
    field: 'fileId',
    component: 'InputNumber',
    show: false,
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
