数据字典集中治理

This commit is contained in:
Cheng Zhou
2025-12-17 20:58:42 +08:00
parent c2328594b0
commit b0bffbc75e
16 changed files with 170 additions and 39 deletions
+4 -3
View File
@@ -53,7 +53,8 @@ import { fetchFinanceItem } from "../api/finance";
import { useStudyStore } from "../store/study";
import { useAuthStore } from "../store/auth";
import { usePermission } from "../utils/permission";
import { financeMachine, getAvailableActions, getStateColor, getStateLabel } from "../state-machine";
import { financeMachine, getAvailableActions } from "../state-machine";
import { financeStatusDict, getDictColor, getDictLabel } from "../dictionaries";
const study = useStudyStore();
const auth = useAuthStore();
@@ -83,8 +84,8 @@ const loadItem = async () => {
}
};
const stateLabel = (v?: string | null) => getStateLabel(financeMachine, v);
const stateColor = (v?: string | null) => getStateColor(financeMachine, v) || "info";
const stateLabel = (v?: string | null) => getDictLabel(financeStatusDict, v || "");
const stateColor = (v?: string | null) => getDictColor(financeStatusDict, v || "") || "info";
const formatAmount = (num?: number | string) => {
const n = Number(num);