forked from verdnatura/salix-front
feat(VnCard): use props searchbar
This commit is contained in:
parent
f4a9577cc0
commit
44e3eb779d
|
@ -20,10 +20,7 @@ const props = defineProps({
|
|||
searchUrl: { type: String, default: undefined },
|
||||
searchbarLabel: { type: String, default: '' },
|
||||
searchbarInfo: { type: String, default: '' },
|
||||
searchCustomRouteRedirect: { type: String, default: undefined },
|
||||
searchRedirect: { type: Boolean, default: true },
|
||||
searchMakeFetch: { type: Boolean, default: true },
|
||||
searchUrlQuery: { type: String, default: undefined },
|
||||
searchbar: { type: Object, default: undefined },
|
||||
});
|
||||
|
||||
const stateStore = useStateStore();
|
||||
|
@ -71,9 +68,7 @@ if (props.baseUrl) {
|
|||
:url="props.searchUrl"
|
||||
:label="props.searchbarLabel"
|
||||
:info="props.searchbarInfo"
|
||||
:search-url="props.searchUrlQuery"
|
||||
:custom-route-redirect-name="searchCustomRouteRedirect"
|
||||
:redirect="searchRedirect"
|
||||
v-bind="$attrs['searchbar']"
|
||||
/>
|
||||
</slot>
|
||||
<slot v-else name="searchbar" />
|
||||
|
|
|
@ -25,9 +25,12 @@ const searchBarDataKeys = {
|
|||
base-url="MailAliases"
|
||||
:descriptor="AliasDescriptor"
|
||||
:search-data-key="searchBarDataKeys[routeName]"
|
||||
:search-custom-route-redirect="customRouteRedirectName"
|
||||
:search-redirect="!!customRouteRedirectName"
|
||||
:searchbar-label="t('mailAlias.search')"
|
||||
:searchbar-info="t('mailAlias.searchInfo')"
|
||||
:searchbar="{
|
||||
redirect: !!customRouteRedirectName,
|
||||
customRouteRedirectName,
|
||||
info: t('mailAlias.searchInfo'),
|
||||
label: t('mailAlias.search'),
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -26,9 +26,11 @@ const searchBarDataKeys = {
|
|||
data-key="Account"
|
||||
:descriptor="AccountDescriptor"
|
||||
:search-data-key="searchBarDataKeys[routeName]"
|
||||
:search-custom-route-redirect="customRouteRedirectName"
|
||||
:search-redirect="!!customRouteRedirectName"
|
||||
:searchbar-label="t('account.search')"
|
||||
:searchbar-info="t('account.searchInfo')"
|
||||
:searchbar="{
|
||||
redirect: !!customRouteRedirectName,
|
||||
customRouteRedirectName,
|
||||
label: t('account.search'),
|
||||
info: t('account.searchInfo'),
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -23,9 +23,11 @@ const searchBarDataKeys = {
|
|||
data-key="Role"
|
||||
:descriptor="RoleDescriptor"
|
||||
:search-data-key="searchBarDataKeys[routeName]"
|
||||
:search-custom-route-redirect="customRouteRedirectName"
|
||||
:search-redirect="!!customRouteRedirectName"
|
||||
:searchbar-label="t('role.searchRoles')"
|
||||
:searchbar-info="t('role.searchInfo')"
|
||||
:searchbar="{
|
||||
redirect: !!customRouteRedirectName,
|
||||
customRouteRedirectName,
|
||||
label: t('role.searchRoles'),
|
||||
info: t('role.searchInfo'),
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -11,9 +11,11 @@ import filter from './ClaimFilter.js';
|
|||
:descriptor="ClaimDescriptor"
|
||||
:filter-panel="ClaimFilter"
|
||||
search-data-key="ClaimList"
|
||||
search-url="Claims/filter"
|
||||
searchbar-label="Search claim"
|
||||
searchbar-info="You can search by claim id or customer name"
|
||||
:filter="filter"
|
||||
:searchbar="{
|
||||
url: 'Claims/filter',
|
||||
label: 'Search claim',
|
||||
info: 'You can search by claim id or customer name',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -10,8 +10,10 @@ import CustomerFilter from '../CustomerFilter.vue';
|
|||
:descriptor="CustomerDescriptor"
|
||||
:filter-panel="CustomerFilter"
|
||||
search-data-key="CustomerList"
|
||||
search-url="Clients/extendedListFilter"
|
||||
searchbar-label="Search customer"
|
||||
searchbar-info="You can search by customer id or name"
|
||||
:searchbar="{
|
||||
url: 'Clients/extendedListFilter',
|
||||
label: 'Search customer',
|
||||
info: 'You can search by customer id or name',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -10,8 +10,10 @@ import EntryFilter from '../EntryFilter.vue';
|
|||
:descriptor="EntryDescriptor"
|
||||
:filter-panel="EntryFilter"
|
||||
search-data-key="EntryList"
|
||||
search-url="Entries/filter"
|
||||
searchbar-label="Search entries"
|
||||
searchbar-info="You can search by entry reference"
|
||||
:searchbar="{
|
||||
url: 'Entries/filter',
|
||||
label: 'Search entries',
|
||||
info: 'You can search by entry reference',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -10,8 +10,10 @@ import ItemListFilter from '../ItemListFilter.vue';
|
|||
:descriptor="ItemDescriptor"
|
||||
:filter-panel="ItemListFilter"
|
||||
search-data-key="ItemList"
|
||||
search-url="Items/filter"
|
||||
searchbar-label="searchbar.label"
|
||||
searchbar-info="searchbar.info"
|
||||
:searchbar="{
|
||||
url: 'Items/filter',
|
||||
label: 'searchbar.labelr',
|
||||
info: 'searchbar.info',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -16,8 +16,10 @@ const filter = {
|
|||
:descriptor="ParkingDescriptor"
|
||||
:filter-panel="ParkingFilter"
|
||||
search-data-key="ParkingList"
|
||||
search-url="Parkings"
|
||||
searchbar-label="parking.searchBar.label"
|
||||
searchbar-info="parking.searchBar.info"
|
||||
:searchbar="{
|
||||
url: 'Parkings',
|
||||
label: 'parking.searchBar.label',
|
||||
info: 'parking.searchBar.info',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -8,8 +8,10 @@ import VnCard from 'components/common/VnCard.vue';
|
|||
base-url="Agencies"
|
||||
:descriptor="AgencyDescriptor"
|
||||
search-data-key="AgencyList"
|
||||
search-url="Agencies"
|
||||
searchbar-label="agency.searchBar.label"
|
||||
searchbar-info="agency.searchBar.info"
|
||||
:searchbar="{
|
||||
url: 'Agencies',
|
||||
label: 'agency.searchBar.label',
|
||||
info: 'agency.searchBar.info',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -10,8 +10,10 @@ import RoadmapFilter from 'pages/Route/Roadmap/RoadmapFilter.vue';
|
|||
:descriptor="RoadmapDescriptor"
|
||||
:filter-panel="RoadmapFilter"
|
||||
search-data-key="RoadmapList"
|
||||
search-url="Roadmaps"
|
||||
searchbar-label="Search roadmap"
|
||||
searchbar-info="You can search by roadmap id or customer name"
|
||||
:searchbar="{
|
||||
url: 'Roadmaps',
|
||||
label: 'Search roadmap',
|
||||
info: 'You can search by roadmap id or customer name',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -12,6 +12,8 @@ import SupplierListFilter from '../SupplierListFilter.vue';
|
|||
search-data-key="SupplierList"
|
||||
search-url="Suppliers/filter"
|
||||
searchbar-label="Search suppliers"
|
||||
search-url-query="table"
|
||||
:searchbar="{
|
||||
searchUrl: 'table',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -11,6 +11,7 @@ const { t } = useI18n();
|
|||
const route = useRoute();
|
||||
|
||||
const routeName = computed(() => route.name);
|
||||
const customRouteRedirectName = computed(() => routeName.value);
|
||||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
|
@ -19,8 +20,10 @@ const routeName = computed(() => route.name);
|
|||
:filter-panel="TicketFilter"
|
||||
:descriptor="TicketDescriptor"
|
||||
search-data-key="TicketList"
|
||||
:search-custom-route-redirect="routeName"
|
||||
:searchbar-label="t('card.search')"
|
||||
:searchbar-info="t('card.searchInfo')"
|
||||
:searchbar="{
|
||||
customRouteRedirectName,
|
||||
label: t('card.search'),
|
||||
info: t('card.searchInfo'),
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -35,10 +35,12 @@ const filter = {
|
|||
data-key="Travel"
|
||||
base-url="Travels"
|
||||
search-data-key="TravelList"
|
||||
searchbar-label="Search travel"
|
||||
searchbar-info="You can search by travel id or name"
|
||||
search-url="Travels"
|
||||
:filter="filter"
|
||||
:descriptor="TravelDescriptor"
|
||||
:searchbar="{
|
||||
url: 'Travels',
|
||||
label: 'Search travel',
|
||||
info: 'You can search by travel id or name',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -10,8 +10,10 @@ import WorkerFilter from '../WorkerFilter.vue';
|
|||
:descriptor="WorkerDescriptor"
|
||||
:filter-panel="WorkerFilter"
|
||||
search-data-key="WorkerList"
|
||||
search-url="Workers/filter"
|
||||
searchbar-label="Search worker"
|
||||
searchbar-info="You can search by worker id or name"
|
||||
:searchbar="{
|
||||
url: 'Workers/filter',
|
||||
label: 'Search worker',
|
||||
info: 'You can search by worker id or name',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -28,11 +28,12 @@ const searchBarDataKeys = {
|
|||
data-key="Zone"
|
||||
:descriptor="ZoneDescriptor"
|
||||
:search-data-key="searchBarDataKeys[routeName]"
|
||||
:search-custom-route-redirect="customRouteRedirectName"
|
||||
:search-redirect="!!customRouteRedirectName"
|
||||
:search-make-fetch="searchbarMakeFetch"
|
||||
:searchbar-label="t('list.searchZone')"
|
||||
:searchbar-info="t('list.searchInfo')"
|
||||
:filter-panel="ZoneFilterPanel"
|
||||
:searchbar="{
|
||||
url: 'Zones',
|
||||
label: t('list.searchZone'),
|
||||
info: t('list.searchInfo'),
|
||||
}"
|
||||
>
|
||||
<template #searchbar>
|
||||
<ZoneSearchbar />
|
||||
|
|
Loading…
Reference in New Issue