Commit 977f53b8 authored by shirlyn.guo's avatar shirlyn.guo 👌🏻

chore: 搜索框空内容加载全部数据

parent 27e291f1
......@@ -155,16 +155,11 @@ function handleAddAgentApplications() {
function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleGetAgentApplicationList(true, true, true)
}
}
function handleSearchGetApplicationList(clear = false) {
if (clear) {
searchQuery.value = ''
handleGetAgentApplicationList(true, true)
} else {
handleGetAgentApplicationList(true, true, true)
if (searchQuery.value !== '') {
handleGetAgentApplicationList(true, true, true)
} else {
handleGetAgentApplicationList(true, true)
}
}
}
</script>
......@@ -185,11 +180,10 @@ function handleSearchGetApplicationList(clear = false) {
:placeholder="t('common_module.search')"
class="search-input rounded-[26px]! text-[16px]! leading-[32px]! border-[#9ea3ff]! border-[1px] py-[6px] shadow-[0_4px_10px_0px_rgba(103,103,103,.1)]"
clearable
:on-clear="() => handleSearchGetApplicationList(true)"
@keyup.enter="handleEnterKeypress"
>
<template #prefix>
<div @click="() => handleSearchGetApplicationList(false)">
<div @click="() => handleGetAgentApplicationList(true, true, true)">
<img src="@/assets/images/search.png" width="14" height="14" class="mr-[5px] cursor-pointer" />
</div>
</template>
......
......@@ -189,19 +189,14 @@ function handleSelectAddType() {
router.push({ name: 'PersonalAppSetting' })
}
function handleSearchGetApplicationList(clear = false) {
if (clear) {
agentSearchInputValue.value = ''
getApplicationList()
} else {
getApplicationList(false, true)
}
}
function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault()
getApplicationList(false, true)
if (agentSearchInputValue.value !== '') {
getApplicationList(false, true)
} else {
getApplicationList()
}
}
}
......@@ -236,7 +231,6 @@ const handleCardContentScrollDebounce = debounce(
:placeholder="t('common_module.search')"
class="w-[256px]! h-[32px]!"
clearable
:on-clear="() => handleSearchGetApplicationList(true)"
@keypress="handleEnterKeypress"
>
<template #suffix>
......@@ -246,7 +240,7 @@ const handleCardContentScrollDebounce = debounce(
fill="#999"
:stroke-width="3"
class="ml-[10px] cursor-pointer text-base"
@click="() => handleSearchGetApplicationList(false)"
@click="() => getApplicationList(false, true)"
/>
</template>
</NInput>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment