🚸 一些调整

This commit is contained in:
目棃
2025-03-08 17:01:25 +08:00
parent 9dba531bb2
commit 3a102f31be
3 changed files with 17 additions and 13 deletions

View File

@@ -408,18 +408,9 @@ async function confirmDelCache(): Promise<void> {
showSnackbar.error("不支持的平台!");
return;
}
let cacheBSize: number = 0;
await showLoading.start("正在检测缓存");
for (const dir of CacheDir) {
const size: number = await core.invoke("get_dir_size", { path: dir });
cacheBSize += size;
}
await showLoading.update(`缓存大小:${bytesToSize(cacheBSize)}`);
cacheSize.value = cacheBSize;
await showLoading.end();
const delCheck = await showDialog.check(
"确认清除缓存吗?",
`当前缓存大小为 ${bytesToSize(cacheBSize)}`,
`当前缓存大小为 ${bytesToSize(cacheSize.value)}`,
);
if (!delCheck) {
showSnackbar.cancel("已取消清除缓存");

View File

@@ -101,7 +101,7 @@
@click:append="searchPost"
@keyup.enter="searchPost"
/>
<v-btn :rounded="true" class="post-forum-btn" @click="freshPostData()">
<v-btn :rounded="true" class="post-forum-btn" @click="freshPostData()" :loading="isReq">
<v-icon>mdi-refresh</v-icon>
<span>刷新</span>
</v-btn>

View File

@@ -7,6 +7,7 @@
:key="index"
:value="value"
@click="firstLoad(value)"
:disabled="loading"
>
{{ rawData[value].name }}
</v-tab>
@@ -25,7 +26,12 @@
/>
</template>
<template #append>
<v-btn class="post-news-btn" @click="firstLoad(tab, true)" icon="mdi-refresh" />
<v-btn
class="post-news-btn"
:loading="loading"
@click="firstLoad(tab, true)"
icon="mdi-refresh"
/>
<v-btn class="post-news-btn" @click="showList = true" icon="mdi-view-list" />
<v-btn
class="post-news-btn"
@@ -105,8 +111,13 @@ const tab = computed<NewsType>({
onMounted(async () => await firstLoad(tab.value));
async function firstLoad(key: NewsType, refresh: boolean = false): Promise<void> {
if (loading.value) return;
loading.value = true;
if (rawData[key].lastId !== 0) {
if (!refresh) return;
if (!refresh) {
loading.value = false;
return;
}
postData[key] = [];
rawData[key].lastId = 0;
}
@@ -119,6 +130,7 @@ async function firstLoad(key: NewsType, refresh: boolean = false): Promise<void>
await showLoading.end();
await TGLogger.Info(`[News][${gid}][firstLoad] 获取${rawData[key].name}数据成功`);
showSnackbar.success(`获取${gameName}${rawData[key].name}数据成功,共 ${getData.list.length}`);
loading.value = false;
}
async function switchAnno(): Promise<void> {
@@ -128,6 +140,7 @@ async function switchAnno(): Promise<void> {
// 加载更多
async function loadMore(key: NewsType): Promise<void> {
if (loading.value) return;
loading.value = true;
if (rawData[key].isLast) {
showSnackbar.warn("已经是最后一页了");