import type { OperationModule, OperationStatus, OperationType } from './data';

// 操作类型选项
export const OPERATION_TYPE_OPTIONS: { label: string; value: OperationType }[] =
  [
    { label: '创建', value: 'CREATE' },
    { label: '更新', value: 'UPDATE' },
    { label: '删除', value: 'DELETE' },
    { label: '查询', value: 'QUERY' },
    { label: '登录', value: 'LOGIN' },
    { label: '登出', value: 'LOGOUT' },
    { label: '导出', value: 'EXPORT' },
    { label: '导入', value: 'IMPORT' },
    { label: '启用', value: 'ENABLE' },
    { label: '禁用', value: 'DISABLE' },
    { label: '其他', value: 'OTHER' },
  ];

// 操作模块选项
export const OPERATION_MODULE_OPTIONS: {
  label: string;
  value: OperationModule;
}[] = [
  { label: '用户管理', value: 'USER' },
  { label: '产品管理', value: 'PRODUCT' },
  { label: '订单管理', value: 'ORDER' },
  { label: '文章管理', value: 'ARTICLE' },
  { label: '系统设置', value: 'SYSTEM' },
  { label: '权限管理', value: 'AUTH' },
  { label: '其他', value: 'OTHER' },
];

// 操作结果选项
export const STATUS_OPTIONS: { label: string; value: OperationStatus }[] = [
  { label: '成功', value: 'success' },
  { label: '失败', value: 'failure' },
];

// 操作类型标签颜色映射
export const OPERATION_TYPE_COLORS: Record<OperationType, string> = {
  CREATE: 'green',
  UPDATE: 'blue',
  DELETE: 'red',
  QUERY: 'cyan',
  LOGIN: 'purple',
  LOGOUT: 'orange',
  EXPORT: 'geekblue',
  IMPORT: 'gold',
  ENABLE: 'success',
  DISABLE: 'warning',
  OTHER: 'default',
};

// 操作模块标签颜色映射
export const OPERATION_MODULE_COLORS: Record<OperationModule, string> = {
  USER: 'blue',
  PRODUCT: 'green',
  ORDER: 'orange',
  ARTICLE: 'purple',
  SYSTEM: 'cyan',
  AUTH: 'magenta',
  OTHER: 'default',
};

// 操作类型显示文本映射
export const OPERATION_TYPE_LABELS: Record<OperationType, string> = {
  CREATE: '创建',
  UPDATE: '更新',
  DELETE: '删除',
  QUERY: '查询',
  LOGIN: '登录',
  LOGOUT: '登出',
  EXPORT: '导出',
  IMPORT: '导入',
  ENABLE: '启用',
  DISABLE: '禁用',
  OTHER: '其他',
};

// 操作模块显示文本映射
export const OPERATION_MODULE_LABELS: Record<OperationModule, string> = {
  USER: '用户管理',
  PRODUCT: '产品管理',
  ORDER: '订单管理',
  ARTICLE: '文章管理',
  SYSTEM: '系统设置',
  AUTH: '权限管理',
  OTHER: '其他',
};
