import { option as baseOption } from '../componentBase';
import { deepClone } from '@/util/util';
import { globalOption } from '@/const/globalOption';

export const permissionConstant = {
  ADMIN: 'admin',
  READ: 'read',
  WRITE: 'write',
};

// 系统模块
export const permissionDic = [
  {
    label: '管理',
    value: 'admin',
  },
  {
    label: '读',
    value: 'read',
  },
  {
    label: '写',
    value: 'write',
  },
];

export const userOption = {
  ...globalOption,
  addBtn: false,
  editBtn: false,
  viewBtn: false,
  header: false,
  delBtn: false,
  height: 200,
  menuWidth: 100,
  column: [
    {
      label: '用户账号',
      prop: 'collaboratorAccount',
    },
    {
      label: '操作权限',
      prop: 'permission',
      slot: true,
      width: '120px',
    },
  ],
};

export const option = deepClone(baseOption);
option.header = false;
option.addBtn = false;
option.column.push({
  label: '权限',
  prop: 'permission',
  type: 'select',
  dicData: permissionDic,
  display: false,
});
