import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { RoleEnum } from '/@/enums/roleEnum';
// import { serviceTags,checkStatus } from '../sysDic'

export const checkStatus = [
  { label: '未提交', value: 1 },
  { label: '审核中', value: 2 },
  { label: '审核不通过', value: 3 },
  { label: '被驳回', value: 4 },
  { label: '审核通过', value: 5 },
]

export enum KeysTypeEnum {
  DISABLED = 'disabled',
  ENABLED = 'enabled',
}

export const RoleMenuDictEnum: Recordable<{ key: string; keyType: KeysTypeEnum }> = {
  [RoleEnum.PLATFORM_ADMIN]: { key: 'enabled_platform_admin_auth', keyType: KeysTypeEnum.ENABLED },
  [RoleEnum.SYS_ADMIN]: { key: 'enabled_sysadmin_auth', keyType: KeysTypeEnum.ENABLED },
  [RoleEnum.TENANT_ADMIN]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
  [RoleEnum.CUSTOMER_USER]: { key: 'disabled_tenant_auth', keyType: KeysTypeEnum.DISABLED },
};

/**
 * 查询条件
*/
export const searchFormSchema: FormSchema[] = [
  {
    field: 'resName',
    label: '关键字',
    component: 'Input',
    colProps: { span: 5 },
    componentProps: {
      placeholder: '请输入名称查询',
      maxLength: 255,
    },
  },
  {
    field: 'resTag',
    label: '资源类型',
    component: 'Select',
    defaultValue: 'MR',
    componentProps: {
      options:
        [
          { label: '地图资源', value: 1 },
          { label: '组件资源', value: 2 },
          { label: '场景资源', value: 3 },
          { label: '接口资源', value: 4 },
        ],
    },
    colProps: { span: 4 },
  },
  {
    field: 'checkStatus',
    label: '审核状态',
    component: 'Select',
    componentProps: {
      options: checkStatus,
    },
    colProps: { span: 4 },
  },
  {
    field: 'resTag',
    label: '应用系统',
    component: 'Select',
    componentProps: {
      options:
        [
          { label: '标签1', value: 1 },
          { label: '标签2', value: 2 },
          { label: '标签3', value: 3 },
        ],
    },
    colProps: { span: 5 },
  },
];

/**
 * 列表显示信息
*/
export const columns: BasicColumn[] = [
  {
    title: '资源编号',
    dataIndex: 'SERVICEID',
    width: 160,
  },
  {
    title: '资源名称',
    dataIndex: 'SERVICENAME',
    width: 160,
  },
  {
    title: '业务名称',
    dataIndex: 'BUSSNAME',
    // width: 120,
    align: 'center',
  },
  // {
  //   title: '业务状态',
  //   dataIndex: 'BLZT',
  //   align: 'center',
  //   width: 80,
  //   // slots: { customRender: 'BLZT' },
  // },
  {
    title: '申请人',
    dataIndex: 'SQR',
    align: 'center',
  },
  {
    title: '申请时间',
    dataIndex: 'SQSJ',
    align: 'center',
    width: 180,
  },
  {
    title: '当前环节',
    dataIndex: 'NODENAME',
    align: 'center',
    width: 80,
  },
  {
    title: '审核结果',
    dataIndex: 'ISPASS',
    align: 'center',
    width: 80,
    slots: { customRender: 'ISPASS' },
  },
  {
    title: '审核意见',
    dataIndex: 'CHECKINFO',
    align: 'center',
    width: 80,
  },
  {
    title: '接收时间',
    dataIndex: 'JSSJ',
    align: 'center',
    width: 180,
    // slots: { customRender: 'pdate' },
  }
];



/**
 * 表单
*/
export const formSchema: FormSchema[] = [
  {
    field: 'groupName',
    label: '角色名称',
    required: true,
    component: 'Input',
    componentProps: {
      maxLength: 255,
      placeholder: '请输入角色名称',
    },
  },
  {
    label: '排序',
    field: 'sort',
    component: 'Input',
    componentProps: {
      maxLength: 255,
      placeholder: '请输入排序',
    },
  }
];
