0
0
Fork 0

fix(searchbar): search directly from entity card

This commit is contained in:
Joan Sanchez 2023-03-16 09:40:57 +01:00
parent 692927a3eb
commit a876dc0e0c
7 changed files with 42 additions and 6 deletions

View File

@ -14,14 +14,14 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
url: {
type: String,
default: '',
},
data: { data: {
type: Array, type: Array,
default: null, default: null,
}, },
url: {
type: String,
default: '',
},
filter: { filter: {
type: Object, type: Object,
default: null, default: null,
@ -62,7 +62,7 @@ const arrayData = useArrayData(props.dataKey, {
where: props.where, where: props.where,
limit: props.limit, limit: props.limit,
order: props.order, order: props.order,
userParams: props.userParams userParams: props.userParams,
}); });
const store = arrayData.store; const store = arrayData.store;

View File

@ -23,11 +23,42 @@ const props = defineProps({
required: false, required: false,
default: true, default: true,
}, },
url: {
type: String,
default: '',
},
filter: {
type: Object,
default: null,
},
where: {
type: Object,
default: null,
},
order: {
type: String,
default: '',
},
limit: {
type: Number,
default: 10,
},
userParams: {
type: Object,
default: null,
},
}); });
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const arrayData = useArrayData(props.dataKey); const arrayData = useArrayData(props.dataKey, {
url: props.url,
filter: props.filter,
where: props.where,
limit: props.limit,
order: props.order,
userParams: props.userParams,
});
const store = arrayData.store; const store = arrayData.store;
const searchText = ref(''); const searchText = ref('');

View File

@ -12,6 +12,7 @@ const { t } = useI18n();
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
<VnSearchbar <VnSearchbar
data-key="ClaimList" data-key="ClaimList"
url="Claims/filter"
:label="t('Search claim')" :label="t('Search claim')"
:info="t('You can search by claim id or customer name')" :info="t('You can search by claim id or customer name')"
/> />

View File

@ -12,6 +12,7 @@ const { t } = useI18n();
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
<VnSearchbar <VnSearchbar
data-key="CustomerList" data-key="CustomerList"
url="Clients/filter"
:label="t('Search customer')" :label="t('Search customer')"
:info="t('You can search by customer id or name')" :info="t('You can search by customer id or name')"
/> />

View File

@ -12,6 +12,7 @@ const { t } = useI18n();
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
<VnSearchbar <VnSearchbar
data-key="InvoiceOutList" data-key="InvoiceOutList"
url="InvoiceOuts/filter"
:label="t('Search invoice')" :label="t('Search invoice')"
:info="t('You can search by invoice reference')" :info="t('You can search by invoice reference')"
/> />

View File

@ -12,6 +12,7 @@ const { t } = useI18n();
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
<VnSearchbar <VnSearchbar
data-key="TicketList" data-key="TicketList"
url="Tickets/filter"
:label="t('Search ticket')" :label="t('Search ticket')"
:info="t('You can search by ticket id or alias')" :info="t('You can search by ticket id or alias')"
/> />

View File

@ -12,6 +12,7 @@ const { t } = useI18n();
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
<VnSearchbar <VnSearchbar
data-key="WorkerList" data-key="WorkerList"
url="Workers/filter"
:label="t('Search worker')" :label="t('Search worker')"
:info="t('You can search by worker id or name')" :info="t('You can search by worker id or name')"
/> />