信息架构/菜单框架大重构-20260109

This commit is contained in:
Cheng Zhou
2026-01-09 11:19:04 +08:00
parent ba3cf95b8a
commit 9021c7fe2b
188 changed files with 7632 additions and 11658 deletions
-21
View File
@@ -1,21 +0,0 @@
import type { Dict } from "./types";
import { createDict } from "./utils";
const seriousnessItems = [
{ value: "NON_SERIOUS", label: "否", order: 1 },
{ value: "SERIOUS", label: "是", order: 2, color: "danger" },
];
const severityItems = [
{ value: "G1", label: "I级", order: 1 },
{ value: "G2", label: "II级", order: 2 },
{ value: "G3", label: "III级", order: 3 },
{ value: "G4", label: "IV级", order: 4, color: "danger" },
{ value: "G5", label: "V级", order: 5, color: "danger" },
{ value: "MILD", label: "轻度", order: 6 },
{ value: "MODERATE", label: "中度", order: 7 },
{ value: "SEVERE", label: "重度", order: 8, color: "danger" },
];
export const aeSeriousnessDict: Dict = createDict(seriousnessItems);
export const aeSeverityDict: Dict = createDict(severityItems);
-13
View File
@@ -1,13 +0,0 @@
import type { Dict } from "./types";
import { createDict } from "./utils";
import { statusDict } from "./status.dict";
const categoryItems = [
{ value: "SITE_FEE", label: "中心费用", order: 1 },
{ value: "SUBJECT_FEE", label: "受试者费用", order: 2 },
{ value: "TRAVEL_FEE", label: "差旅费用", order: 3 },
{ value: "OTHER", label: "其他", order: 99 },
];
export const financeCategoryDict: Dict = createDict(categoryItems);
export const financeStatusDict = statusDict;
-12
View File
@@ -1,12 +0,0 @@
import type { Dict } from "./types";
import { createDict } from "./utils";
const transactionItems = [
{ value: "RECEIPT", label: "接收", order: 1 },
{ value: "DISPENSE", label: "发药", order: 2 },
{ value: "RETURN", label: "回收", order: 3 },
{ value: "DESTROY", label: "销毁", order: 4 },
{ value: "TRANSFER", label: "转移", order: 5 },
];
export const impTransactionTypeDict: Dict = createDict(transactionItems);
-4
View File
@@ -1,8 +1,4 @@
export * from "./types";
export * from "./utils";
export * from "./status.dict";
export * from "./priority.dict";
export * from "./role.dict";
export * from "./ae.dict";
export * from "./finance.dict";
export * from "./imp.dict";
@@ -1,41 +0,0 @@
import { createDict, getDictColor, getDictLabel } from "./utils";
import type { Dict } from "./types";
export const milestoneTypeDict: Record<string, string> = {
ETHICS_SUBMISSION: "伦理递交",
ETHICS_APPROVAL: "伦理批件",
SITE_INITIATION: "中心启动",
SIV: "启动会",
FPI: "首例入组",
LPI: "末例入组",
DBL: "揭盲",
CSR: "总结报告",
};
const milestoneStatusItems = [
{ value: "NOT_STARTED", label: "未开始", color: "info", order: 1 },
{ value: "IN_PROGRESS", label: "进行中", color: "warning", order: 2 },
{ value: "DONE", label: "已完成", color: "success", order: 3 },
{ value: "COMPLETED", label: "已完成", color: "success", order: 3 },
{ value: "BLOCKED", label: "受阻", color: "danger", order: 4 },
];
export const milestoneStatusDict: Dict = createDict(milestoneStatusItems);
export const milestoneTypeOptions = Object.entries(milestoneTypeDict).map(([value, label]) => ({
value,
label,
}));
export const milestoneStatusOptions = ["NOT_STARTED", "IN_PROGRESS", "DONE", "BLOCKED"].map((value) => ({
value,
label: getDictLabel(milestoneStatusDict, value) || value,
color: getDictColor(milestoneStatusDict, value),
}));
export const getMilestoneTypeLabel = (value?: string | null) => milestoneTypeDict[value || ""] || value || "—";
export const getMilestoneStatusLabel = (value?: string | null) =>
getDictLabel(milestoneStatusDict, value) || value || "—";
export const getMilestoneStatusColor = (value?: string | null) => getDictColor(milestoneStatusDict, value) || "info";
@@ -1,10 +0,0 @@
import type { Dict } from "./types";
import { createDict } from "./utils";
const items = [
{ value: "LOW", label: "低", color: "info", order: 1 },
{ value: "MEDIUM", label: "中", color: "warning", order: 2 },
{ value: "HIGH", label: "高", color: "danger", order: 3 },
];
export const priorityDict: Dict = createDict(items);