chore: rename submitSearch
This commit is contained in:
parent
e653391ea9
commit
599a0146f0
2 changed files with 15 additions and 15 deletions
|
|
@ -17,7 +17,7 @@ const optionsOp = [
|
||||||
{ label: 'หรือ', value: 'OR' },
|
{ label: 'หรือ', value: 'OR' },
|
||||||
]
|
]
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
searchSubmit: Function
|
submitSearch: Function
|
||||||
submitSearchData: {
|
submitSearchData: {
|
||||||
AND: {
|
AND: {
|
||||||
field: string
|
field: string
|
||||||
|
|
@ -132,7 +132,7 @@ function clearAdvSearchData() {
|
||||||
outlined
|
outlined
|
||||||
v-model="item.value"
|
v-model="item.value"
|
||||||
placeholder="เอกสาร"
|
placeholder="เอกสาร"
|
||||||
@keydown.enter.prevent="searchSubmit()"
|
@keydown.enter.prevent="submitSearch()"
|
||||||
><template v-slot:append>
|
><template v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
v-if="item.value"
|
v-if="item.value"
|
||||||
|
|
@ -180,7 +180,7 @@ function clearAdvSearchData() {
|
||||||
id="advSearchDes"
|
id="advSearchDes"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
@keydown.enter.prevent="searchSubmit()"
|
@keydown.enter.prevent="submitSearch()"
|
||||||
v-model="advSearchDataField.description"
|
v-model="advSearchDataField.description"
|
||||||
><template v-slot:prepend
|
><template v-slot:prepend
|
||||||
><span class="text-subtitle2">รายละเอียด:</span></template
|
><span class="text-subtitle2">รายละเอียด:</span></template
|
||||||
|
|
@ -203,8 +203,8 @@ function clearAdvSearchData() {
|
||||||
color="primary"
|
color="primary"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
icon="mdi-magnify"
|
icon="mdi-magnify"
|
||||||
@click="() => props.searchSubmit()"
|
@click="() => props.submitSearch()"
|
||||||
id="advSearchSubmit"
|
id="advSubmitSearch"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ import mime from 'mime'
|
||||||
import type { StorageFile } from '@/stores/storage'
|
import type { StorageFile } from '@/stores/storage'
|
||||||
import { useSearchDataStore } from '@/stores/searched-data'
|
import { useSearchDataStore } from '@/stores/searched-data'
|
||||||
import { useLoader } from '@/stores/loader'
|
import { useLoader } from '@/stores/loader'
|
||||||
|
import { useFileInfoStore } from '@/stores/file-info-data'
|
||||||
|
|
||||||
import AdvancedSearch from '@/modules/01_user/components/AdvancedSearch.vue'
|
import AdvancedSearch from '@/modules/01_user/components/AdvancedSearch.vue'
|
||||||
import { useFileInfoStore } from '@/stores/file-info-data'
|
|
||||||
|
|
||||||
const loaderStore = useLoader()
|
const loaderStore = useLoader()
|
||||||
const { isFilePreview } = storeToRefs(useFileInfoStore())
|
const { isFilePreview } = storeToRefs(useFileInfoStore())
|
||||||
|
|
@ -39,7 +39,7 @@ const props = defineProps<{
|
||||||
mode: 'admin' | 'user'
|
mode: 'admin' | 'user'
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
async function searchSubmit() {
|
async function submitSearch() {
|
||||||
isFilePreview.value = false
|
isFilePreview.value = false
|
||||||
if (searchData.value.value.trim() !== '') {
|
if (searchData.value.value.trim() !== '') {
|
||||||
submitSearchData.value = { AND: [], OR: [] }
|
submitSearchData.value = { AND: [], OR: [] }
|
||||||
|
|
@ -110,7 +110,7 @@ watch(
|
||||||
() => isActFoundFile.value,
|
() => isActFoundFile.value,
|
||||||
(edited) => {
|
(edited) => {
|
||||||
if (edited === true) {
|
if (edited === true) {
|
||||||
searchSubmit()
|
submitSearch()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
isActFoundFile.value = false
|
isActFoundFile.value = false
|
||||||
}, 300)
|
}, 300)
|
||||||
|
|
@ -139,13 +139,13 @@ watch(
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
v-model="searchData.value"
|
v-model="searchData.value"
|
||||||
id="inputSearch"
|
id="inputSearch"
|
||||||
@update:model-value="searchSubmit"
|
@update:model-value="submitSearch"
|
||||||
@keydown.enter.prevent="searchSubmit"
|
@keydown.enter.prevent="submitSearch"
|
||||||
data-testid="searchAdmin"
|
data-testid="searchAdmin"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend />
|
<template v-slot:prepend />
|
||||||
<template v-slot:append
|
<template v-slot:append
|
||||||
><q-icon name="search" class="pointer" @click="searchSubmit"
|
><q-icon name="search" class="pointer" @click="submitSearch"
|
||||||
/></template>
|
/></template>
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -173,7 +173,7 @@ watch(
|
||||||
outlined
|
outlined
|
||||||
v-model="searchData.value"
|
v-model="searchData.value"
|
||||||
placeholder="เอกสาร"
|
placeholder="เอกสาร"
|
||||||
@keydown.enter.prevent="searchSubmit"
|
@keydown.enter.prevent="submitSearch"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
@ -192,7 +192,7 @@ watch(
|
||||||
<div class="row items-center justify-between q-gutter-y-md q-pt-sm">
|
<div class="row items-center justify-between q-gutter-y-md q-pt-sm">
|
||||||
<div class="column col-grow">
|
<div class="column col-grow">
|
||||||
<advanced-search
|
<advanced-search
|
||||||
:searchSubmit="searchSubmit"
|
:submitSearch="submitSearch"
|
||||||
:submit-search-data="submitSearchData"
|
:submit-search-data="submitSearchData"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -202,8 +202,8 @@ watch(
|
||||||
color="primary"
|
color="primary"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
icon="mdi-magnify"
|
icon="mdi-magnify"
|
||||||
@click="searchSubmit"
|
@click="submitSearch"
|
||||||
id="searchSubmit"
|
id="submitSearch"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue