🎨 微改

This commit is contained in:
BTMuli
2023-09-04 17:08:07 +08:00
parent ad11a91f73
commit 477201bfb3
4 changed files with 9 additions and 14 deletions

View File

@@ -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>

View File

@@ -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" />
@@ -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
@@ -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;
@@ -254,6 +257,7 @@ async function searchCard(): Promise<void> {
}
loading.value = false;
}
// 导入 UIAF 数据,进行数据合并、刷新
async function importJson(): Promise<void> {
const selectedFile = await dialog.open({

View File

@@ -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>
@@ -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;
});

View File

@@ -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`;
@@ -45,7 +43,6 @@ export const useAppStore = defineStore(
const dataPath = reactive({
userDataDir,
tempDataDir,
dbDataPath,
});
// 用户数据路径