This commit is contained in:
2026-05-11 14:42:22 +08:00
parent 5344e6660e
commit 4a198101f1
14 changed files with 1687 additions and 80 deletions
+25 -2
View File
@@ -16,8 +16,6 @@ import type { IResultSkillCount } from "@/api/calc/type";
// | '魔法石'
// | '武器',
export interface IConfigEquip {
id: string;
reinforce: number;
@@ -76,6 +74,13 @@ export interface IConfig {
emblems: Record<string, IConfigEmblem>;
}
export interface IChangeSourceLog {
id: number;
source: string;
detail: string;
time: string;
}
const defaultEqusConfig = {
id: "",
reinforce: 0,
@@ -127,6 +132,7 @@ export const useConfigStore = defineStore("configStore", () => {
});
const skillCountConfig = ref<IResultSkillCount[]>([]);
const changeSourceLogs = ref<IChangeSourceLog[]>([]);
const loadConfig = () => {
const infoStore = useInfoStore();
@@ -263,6 +269,20 @@ export const useConfigStore = defineStore("configStore", () => {
}
};
const pushChangeSource = (source: string, detail: string) => {
const next: IChangeSourceLog = {
id: Date.now() + Math.floor(Math.random() * 1000),
source,
detail,
time: new Date().toLocaleTimeString("zh-CN", { hour12: false }),
};
changeSourceLogs.value = [next, ...changeSourceLogs.value].slice(0, 30);
};
const clearChangeSource = () => {
changeSourceLogs.value = [];
};
const result = useAsyncState(
() => {
return calc();
@@ -289,5 +309,8 @@ export const useConfigStore = defineStore("configStore", () => {
defaultAvatarConfig,
defaultOathConfig,
defaultEmblemConfig,
changeSourceLogs,
pushChangeSource,
clearChangeSource,
};
});