数据字典集中治理
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user