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

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

parent 27e291f1
...@@ -155,16 +155,11 @@ function handleAddAgentApplications() { ...@@ -155,16 +155,11 @@ function handleAddAgentApplications() {
function handleEnterKeypress(event: KeyboardEvent) { function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) { if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault() event.preventDefault()
handleGetAgentApplicationList(true, true, true) if (searchQuery.value !== '') {
} handleGetAgentApplicationList(true, true, true)
} } else {
handleGetAgentApplicationList(true, true)
function handleSearchGetApplicationList(clear = false) { }
if (clear) {
searchQuery.value = ''
handleGetAgentApplicationList(true, true)
} else {
handleGetAgentApplicationList(true, true, true)
} }
} }
</script> </script>
...@@ -185,11 +180,10 @@ function handleSearchGetApplicationList(clear = false) { ...@@ -185,11 +180,10 @@ function handleSearchGetApplicationList(clear = false) {
:placeholder="t('common_module.search')" :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)]" 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 clearable
:on-clear="() => handleSearchGetApplicationList(true)"
@keyup.enter="handleEnterKeypress" @keyup.enter="handleEnterKeypress"
> >
<template #prefix> <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" /> <img src="@/assets/images/search.png" width="14" height="14" class="mr-[5px] cursor-pointer" />
</div> </div>
</template> </template>
......
...@@ -189,19 +189,14 @@ function handleSelectAddType() { ...@@ -189,19 +189,14 @@ function handleSelectAddType() {
router.push({ name: 'PersonalAppSetting' }) router.push({ name: 'PersonalAppSetting' })
} }
function handleSearchGetApplicationList(clear = false) {
if (clear) {
agentSearchInputValue.value = ''
getApplicationList()
} else {
getApplicationList(false, true)
}
}
function handleEnterKeypress(event: KeyboardEvent) { function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) { if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault() event.preventDefault()
getApplicationList(false, true) if (agentSearchInputValue.value !== '') {
getApplicationList(false, true)
} else {
getApplicationList()
}
} }
} }
...@@ -236,7 +231,6 @@ const handleCardContentScrollDebounce = debounce( ...@@ -236,7 +231,6 @@ const handleCardContentScrollDebounce = debounce(
:placeholder="t('common_module.search')" :placeholder="t('common_module.search')"
class="w-[256px]! h-[32px]!" class="w-[256px]! h-[32px]!"
clearable clearable
:on-clear="() => handleSearchGetApplicationList(true)"
@keypress="handleEnterKeypress" @keypress="handleEnterKeypress"
> >
<template #suffix> <template #suffix>
...@@ -246,7 +240,7 @@ const handleCardContentScrollDebounce = debounce( ...@@ -246,7 +240,7 @@ const handleCardContentScrollDebounce = debounce(
fill="#999" fill="#999"
:stroke-width="3" :stroke-width="3"
class="ml-[10px] cursor-pointer text-base" class="ml-[10px] cursor-pointer text-base"
@click="() => handleSearchGetApplicationList(false)" @click="() => getApplicationList(false, true)"
/> />
</template> </template>
</NInput> </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