import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getAllList} from '../api/AuditRiskScenario.api';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '风险事件编号',
    align: 'center',
    dataIndex: 'riskEventNo',
    ifShow: false,
  },
  {
    title: '风险场景编号',
    align: 'center',
    dataIndex: 'scenarioNo',
    ifShow: false,
  },
  {
    title: '风险事件类别',
    align: 'center',
    dataIndex: 'riskTp',
  },
  {
    title: '风险事件名称',
    align: 'center',
    dataIndex: 'riskEventName',
  },
  {
    title: '风险事件描述',
    align: 'center',
    dataIndex: 'riskEventDesc',
  },
  {
    title: '创建人',
    align: 'center',
    dataIndex: 'createUser',
    ifShow: false,
  },
  {
    title: '来源文件',
    align: 'center',
    dataIndex: 'fileId',
    ifShow: false,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '风险分类',
    field: 'scid',
    component: 'JTreeSelect',
    componentProps: {
      dict: 'audit_risk_scenario,scenario_name,id',
      pidField: 'pid',
      hasChildField: 'has_child',
    },
  },
  {
    label: '风险事件名称',
    field: 'riskEventName',
    component: 'Input',
    componentProps: {
      showCount: true,
      maxlength: 64,
    },
    required: true,
  },
  {
    label: '风险事件描述',
    field: 'riskEventDesc',
    component: 'InputTextArea',
    componentProps: {
      rows: 5,
      showCount: true,
      maxlength: 1024,
    },
    required: true,
  },
  {
    label: '标签',
    field: 'labels',
    component: 'StSelectLable',
  },

  {
    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;
}
