mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-15 03:53:16 +08:00
🚸 允许搜索清空并进行对应处理
This commit is contained in:
501
src-tauri/Cargo.lock
generated
501
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -86,7 +86,13 @@ function handleSearch(kw: string): void {
|
||||
|
||||
async function searchAchi(): Promise<void> {
|
||||
if (!props.isSearch) return;
|
||||
if (!props.search || props.search === "") {
|
||||
if (!props.search) {
|
||||
achievements.value = await TSUserAchi.getAchievements(props.uid, props.series);
|
||||
showSnackbar.success("已重置");
|
||||
emits("update:isSearch", false);
|
||||
return;
|
||||
}
|
||||
if (props.search === "") {
|
||||
showSnackbar.warn("请输入搜索内容");
|
||||
emits("update:isSearch", false);
|
||||
return;
|
||||
|
||||
@@ -111,7 +111,7 @@ watch(
|
||||
search.value = props.keyword;
|
||||
return;
|
||||
}
|
||||
if (search.value !== props.keyword && props.keyword !== "") {
|
||||
if (search.value !== props.keyword && props.keyword !== "" && props.keyword !== null) {
|
||||
search.value = props.keyword;
|
||||
results.value = [];
|
||||
lastId.value = "";
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
<div class="twm-top-append">
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
:clearable="true"
|
||||
:hide-details="true"
|
||||
:single-line="true"
|
||||
append-inner-icon="mdi-magnify"
|
||||
density="compact"
|
||||
label="搜索"
|
||||
prepend-inner-icon="mdi-magnify"
|
||||
variant="outlined"
|
||||
@keydown.enter="searchMaterial()"
|
||||
@click:prepend-inner="searchMaterial()"
|
||||
@click:append-inner="searchMaterial()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -137,7 +137,7 @@ function switchMaterial(isNext: boolean): void {
|
||||
|
||||
function searchMaterial(): void {
|
||||
let selectData = getSelectMaterials();
|
||||
if (search.value === undefined || search.value === "") {
|
||||
if (search.value === undefined || search.value === "" || search.value === null) {
|
||||
if (sortMaterialsData.value.length === selectData.length) {
|
||||
showSnackbar.warn("请输入搜索内容!");
|
||||
return;
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
</div>
|
||||
<v-select
|
||||
v-model="selectType"
|
||||
:items="namecardTypes"
|
||||
item-title="type"
|
||||
:hide-details="true"
|
||||
:clearable="true"
|
||||
width="250px"
|
||||
label="名片类别"
|
||||
:hide-details="true"
|
||||
:items="namecardTypes"
|
||||
density="compact"
|
||||
item-title="type"
|
||||
label="名片类别"
|
||||
variant="outlined"
|
||||
width="250px"
|
||||
>
|
||||
<template #item="{ props, item }">
|
||||
<v-list-item v-bind="props">
|
||||
@@ -31,33 +31,34 @@
|
||||
<div class="wnc-top-append">
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
density="compact"
|
||||
prepend-inner-icon="mdi-magnify"
|
||||
label="搜索"
|
||||
:clearable="true"
|
||||
:hide-details="true"
|
||||
append-inner-icon="mdi-magnify"
|
||||
density="compact"
|
||||
label="搜索"
|
||||
variant="outlined"
|
||||
@click:prepend-inner="searchNameCard()"
|
||||
@click:append-inner="searchNameCard()"
|
||||
@keyup.enter="searchNameCard()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</v-app-bar>
|
||||
<div class="tw-nc-list">
|
||||
<v-virtual-scroll class="v-scroll" :items="sortNameCardsData" :item-height="80" item-key="id">
|
||||
<v-virtual-scroll :item-height="80" :items="sortNameCardsData" class="v-scroll" item-key="id">
|
||||
<template #default="{ item }">
|
||||
<TopNameCard class="item" :data="item" @selected="showNameCard(item)" />
|
||||
<TopNameCard :data="item" class="item" @selected="showNameCard(item)" />
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
</div>
|
||||
<ToNameCard v-model="visible" :data="curNameCard">
|
||||
<template #left>
|
||||
<div class="card-arrow left" @click="switchCard(false)">
|
||||
<img src="@/assets/icons/arrow-right.svg" alt="right" />
|
||||
<img alt="right" src="@/assets/icons/arrow-right.svg" />
|
||||
</div>
|
||||
</template>
|
||||
<template #right>
|
||||
<div class="card-arrow" @click="switchCard(true)">
|
||||
<img src="@/assets/icons/arrow-right.svg" alt="right" />
|
||||
<img alt="right" src="@/assets/icons/arrow-right.svg" />
|
||||
</div>
|
||||
</template>
|
||||
</ToNameCard>
|
||||
@@ -135,8 +136,9 @@ function switchCard(isNext: boolean): void {
|
||||
}
|
||||
|
||||
function searchNameCard(): void {
|
||||
if (search.value === undefined) {
|
||||
if (search.value === undefined || search.value === null) {
|
||||
sortData(AppNameCardsData);
|
||||
showSnackbar.success("已重置");
|
||||
return;
|
||||
}
|
||||
if (search.value === "") {
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
:hide-details="true"
|
||||
:single-line="true"
|
||||
append-inner-icon="mdi-magnify"
|
||||
@click:append-inner="isSearch = true"
|
||||
variant="outlined"
|
||||
:clearable="true"
|
||||
density="compact"
|
||||
label="搜索"
|
||||
@keydown.enter="isSearch = true"
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
<div class="pbm-nav-search">
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
:clearable="true"
|
||||
:hide-details="true"
|
||||
:single-line="true"
|
||||
append-inner-icon="mdi-magnify"
|
||||
density="compact"
|
||||
label="搜索"
|
||||
prepend-inner-icon="mdi-magnify"
|
||||
variant="outlined"
|
||||
@keydown.enter="searchMaterial()"
|
||||
@click:prepend-inner="searchMaterial()"
|
||||
@click:append-inner="searchMaterial()"
|
||||
/>
|
||||
</div>
|
||||
<v-btn
|
||||
@@ -299,7 +299,7 @@ function getItemInfo(id: number): TGApp.App.Material.WikiItem | false {
|
||||
|
||||
function searchMaterial(): void {
|
||||
let selectData = getSelectMaterials();
|
||||
if (search.value === undefined || search.value === "") {
|
||||
if (search.value === undefined || search.value === "" || search.value === null) {
|
||||
if (materialShow.value.length === selectData.length) {
|
||||
showSnackbar.warn("请输入搜索内容!");
|
||||
return;
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
:hide-details="true"
|
||||
:clearable="true"
|
||||
append-inner-icon="mdi-magnify"
|
||||
class="post-switch-item"
|
||||
label="请输入帖子 ID 或搜索词"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
density="compact"
|
||||
label="请输入帖子 ID 或搜索词"
|
||||
variant="outlined"
|
||||
:clearable="true"
|
||||
@keydown.enter="searchPost()"
|
||||
@click:append-inner="searchPost()"
|
||||
/>
|
||||
@@ -200,6 +201,7 @@ async function searchPost(): Promise<void> {
|
||||
.pn-nav {
|
||||
position: relative;
|
||||
display: flex;
|
||||
overflow: auto hidden;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
@@ -209,7 +211,6 @@ async function searchPost(): Promise<void> {
|
||||
padding-right: 16px;
|
||||
padding-left: 16px;
|
||||
column-gap: 16px;
|
||||
overflow: auto hidden;
|
||||
}
|
||||
|
||||
.pn-nav-tabs {
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
:hide-details="true"
|
||||
:clearable="true"
|
||||
append-inner-icon="mdi-magnify"
|
||||
class="post-switch-item"
|
||||
label="请输入帖子 ID 或搜索词"
|
||||
|
||||
Reference in New Issue
Block a user