// 权限项类型 (对应后端 DataPermission 实体)
export interface PermissionItem {
  id: number;
  permissionCode: string;
  permissionName: string;
  moduleCode: string;
  moduleName: string;
  operationType: string;
  description?: string;
  sortOrder: number;
  status: number;
  createTime?: string;
  updateTime?: string;
}

// 权限模块类型
export interface PermissionModule {
  code: string;
  name: string;
  permissions: PermissionItem[];
}

// 角色权限类型
export interface RolePermission {
  roleId: number;
  roleName: string;
  permissionIds: number[];
}

// 权限表单类型(CRUD)
export interface PermissionForm {
  id?: number;
  permissionCode: string;
  permissionName: string;
  moduleCode: string;
  moduleName: string;
  operationType: string;
  description?: string;
  sortOrder: number;
  status: number;
}

// 操作类型选项
export const OPERATION_TYPES = [
  { value: "read", label: "查询" },
  { value: "create", label: "新增" },
  { value: "update", label: "编辑" },
  { value: "delete", label: "删除" },
  { value: "export", label: "导出" },
  { value: "import", label: "导入" },
  { value: "execute", label: "执行" },
  { value: "distribute", label: "发放" },
  { value: "review", label: "审核" },
  { value: "generate", label: "生成" }
];
