Skip to content

Commit

Permalink
🎨 微改
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Sep 4, 2023
1 parent ad11a91 commit 477201b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ async function createDataDir(): Promise<void> {
if (!(await fs.exists("userData", { dir: fs.BaseDirectory.AppLocalData }))) {
await fs.createDir("userData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
}
// todo 弃置 tempData dir
if (!(await fs.exists("tempData", { dir: fs.BaseDirectory.AppLocalData }))) {
await fs.createDir("tempData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
}
console.info("数据文件夹创建完成!");
}
</script>
Expand Down
10 changes: 7 additions & 3 deletions src/pages/common/Achievements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
@keyup.enter="searchCard"
/>
<div class="top-btns">
<v-btn prepend-icon="mdi-import" class="top-btn" @click="importJson"> 导入 </v-btn>
<v-btn prepend-icon="mdi-export" class="top-btn" @click="exportJson"> 导出 </v-btn>
<v-btn prepend-icon="mdi-import" class="top-btn" @click="importJson"> 导入</v-btn>
<v-btn prepend-icon="mdi-export" class="top-btn" @click="exportJson"> 导出</v-btn>
</div>
</div>
<ToLoading v-model="loading" :title="loadingTitle" />
Expand Down Expand Up @@ -107,7 +107,7 @@

<script lang="ts" setup>
// vue
import { onMounted, ref, onBeforeMount, computed } from "vue";
import { computed, onBeforeMount, onMounted, ref } from "vue";
import ToLoading from "../../components/overlay/to-loading.vue";
import showSnackbar from "../../components/func/snackbar";
// tauri
Expand Down Expand Up @@ -166,6 +166,9 @@ onMounted(async () => {
loading.value = true;
loadingTitle.value = "正在获取成就系列数据";
seriesList.value = await TGSqlite.getAchievementSeries();
achievementsStore.lastVersion = seriesList.value.reduce((prev, curr) => {
return prev.version > curr.version ? prev : curr;
}).version;
loadingTitle.value = "正在获取成就数据";
selectedAchievement.value = await TGSqlite.getAchievements();
loading.value = false;
Expand Down Expand Up @@ -254,6 +257,7 @@ async function searchCard(): Promise<void> {
}
loading.value = false;
}
// 导入 UIAF 数据,进行数据合并、刷新
async function importJson(): Promise<void> {
const selectedFile = await dialog.open({
Expand Down
6 changes: 2 additions & 4 deletions src/pages/common/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@
<v-list-item-title>本地数据库路径</v-list-item-title>
<v-list-item-subtitle>{{ appStore.dataPath.dbDataPath }}</v-list-item-subtitle>
</v-list-item>
<v-list-item prepend-icon="mdi-folder">
<v-list-item-title>本地临时数据路径</v-list-item-title>
<v-list-item-subtitle>{{ appStore.dataPath.tempDataDir }}</v-list-item-subtitle>
</v-list-item>
<v-list-item prepend-icon="mdi-folder">
<v-list-item-title>本地用户数据路径</v-list-item-title>
<v-list-item-subtitle>{{ appStore.dataPath.userDataDir }}</v-list-item-subtitle>
Expand Down Expand Up @@ -220,6 +216,8 @@ onMounted(async () => {
osPlatform.value = `${await os.platform()}`;
loadingSub.value = "正在获取系统版本";
osVersion.value = await os.version();
loadingSub.value = "正在获取数据库信息";
dbInfo.value = await TGSqlite.getAppData();
loadingSub.value = "";
loading.value = false;
});
Expand Down
3 changes: 0 additions & 3 deletions src/store/modules/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { path } from "@tauri-apps/api";

// 用于存储用户数据的路径
const userDataDir = `${await path.appLocalDataDir()}userData`;
// 用于各种临时数据的路径
const tempDataDir = `${await path.appLocalDataDir()}tempData`;
// 用于存放数据库的路径
const dbDataPath = `${await path.appConfigDir()}tauri-genshin.db`;

Expand Down Expand Up @@ -45,7 +43,6 @@ export const useAppStore = defineStore(

const dataPath = reactive({
userDataDir,
tempDataDir,
dbDataPath,
});
// 用户数据路径
Expand Down

0 comments on commit 477201b

Please sign in to comment.