️ 输入空时重置

This commit is contained in:
目棃
2024-06-14 22:48:23 +08:00
parent 711d35360f
commit d3b24d52c9

View File

@@ -284,12 +284,31 @@ function switchAchiInfo(next: boolean) {
showAchiData.value = renderSelect.value[curAchiDataIndex.value]; showAchiData.value = renderSelect.value[curAchiDataIndex.value];
} }
async function searchAll(): Promise<void> {
if (selectedAchievement.value.length === achievementsStore.totalAchievements) {
showSnackbar({
color: "warn",
text: "已经是全部成就",
});
return;
}
loading.value = true;
loadingTitle.value = "正在获取全部成就数据";
selectedSeries.value = -1;
selectedAchievement.value = await getAchiData("all");
await nextTick(() => {
loading.value = false;
setTimeout(() => {
showSnackbar({
text: `已获取 ${renderSelect.value.length} 条成就数据`,
});
}, 500);
});
}
async function searchCard(): Promise<void> { async function searchCard(): Promise<void> {
if (search.value === "") { if (search.value === "") {
showSnackbar({ await searchAll();
color: "error",
text: "请输入搜索内容",
});
return; return;
} }
selectedSeries.value = -1; selectedSeries.value = -1;