mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-05-10 00:44:04 +08:00
refactor(achievements): merge 已经可以退役了
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
*/
|
||||
|
||||
import { defineStore } from "pinia";
|
||||
import TGMap from "../../utils/TGMap";
|
||||
import { SeriesMap } from "../../interface/Achievements";
|
||||
|
||||
const useAchievementsStore = defineStore({
|
||||
id: "achievements",
|
||||
@@ -25,13 +23,7 @@ const useAchievementsStore = defineStore({
|
||||
this.total_achievements = 899;
|
||||
this.fin_achievements = 0;
|
||||
},
|
||||
flushData(seriesMap: TGMap<SeriesMap>) {
|
||||
let total = 0;
|
||||
let fin = 0;
|
||||
seriesMap.forEach(series => {
|
||||
total += series.total_count;
|
||||
fin += series.completed_count;
|
||||
});
|
||||
flushData(total: number, fin: number) {
|
||||
this.total_achievements = total;
|
||||
this.fin_achievements = fin;
|
||||
},
|
||||
|
||||
@@ -12,8 +12,6 @@ import { path } from "@tauri-apps/api";
|
||||
const appDataDir = `${await path.appLocalDataDir()}appData`;
|
||||
// 用于存储用户数据的路径
|
||||
const userDataDir = `${await path.appLocalDataDir()}userData`;
|
||||
// 用于存储合并数据的路径-列表渲染时使用,减少重复计算
|
||||
const mergeDataDir = `${await path.appLocalDataDir()}mergeData`;
|
||||
// 用于各种临时数据的路径
|
||||
const tempDataDir = `${await path.appLocalDataDir()}tempData`;
|
||||
// 用于开发者模式的路径
|
||||
@@ -33,7 +31,6 @@ const useAppStore = defineStore({
|
||||
dataPath: {
|
||||
app: appDataDir,
|
||||
user: userDataDir,
|
||||
merge: mergeDataDir,
|
||||
dev: devDataDir,
|
||||
temp: tempDataDir,
|
||||
},
|
||||
@@ -47,11 +44,6 @@ const useAppStore = defineStore({
|
||||
userPath: {
|
||||
achievements: `${userDataDir}\\achievements.json`,
|
||||
},
|
||||
// 合并数据路径
|
||||
mergePath: {
|
||||
achievements: `${mergeDataDir}\\achievements.json`,
|
||||
achievementSeries: `${mergeDataDir}\\achievementSeries.json`,
|
||||
},
|
||||
// 开发者模式
|
||||
devPath: {
|
||||
app: `${devDataDir}\\app`,
|
||||
@@ -70,11 +62,6 @@ const useAppStore = defineStore({
|
||||
this.userPath = {
|
||||
achievements: `${userDataDir}\\achievements.json`,
|
||||
};
|
||||
// 初始化合并数据路径
|
||||
this.mergePath = {
|
||||
achievements: `${mergeDataDir}\\achievements.json`,
|
||||
achievementSeries: `${mergeDataDir}\\achievementSeries.json`,
|
||||
};
|
||||
// 初始化开发者模式
|
||||
this.devPath = {
|
||||
app: `${devDataDir}\\app`,
|
||||
|
||||
Reference in New Issue
Block a user