diff --git a/src/components/FormPopup.vue b/src/components/FormPopup.vue index 2da986006..d7f744984 100644 --- a/src/components/FormPopup.vue +++ b/src/components/FormPopup.vue @@ -74,7 +74,7 @@ const closeForm = () => { :disabled="isLoading" :loading="isLoading" /> - + diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index ec00b95a3..b04478070 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -22,6 +22,7 @@ const props = defineProps({ searchbarInfo: { type: String, default: '' }, searchCustomRouteRedirect: { type: String, default: undefined }, searchRedirect: { type: Boolean, default: true }, + searchMakeFetch: { type: Boolean, default: true }, }); const stateStore = useStateStore(); diff --git a/src/components/common/VnWeekdayPicker.vue b/src/components/common/VnWeekdayPicker.vue new file mode 100644 index 000000000..10e6b2c4d --- /dev/null +++ b/src/components/common/VnWeekdayPicker.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/components/ui/QCalendarMonthWrapper.vue b/src/components/ui/QCalendarMonthWrapper.vue index 25491417d..bced893fe 100644 --- a/src/components/ui/QCalendarMonthWrapper.vue +++ b/src/components/ui/QCalendarMonthWrapper.vue @@ -147,7 +147,7 @@ const containerClasses = computed(() => { .q-calendar-month__head--workweek, .q-calendar-month__head--weekday.q-calendar__center.q-calendar__ellipsis { text-transform: capitalize; - color: var(---color-font-secondary); + color: $color-font-secondary; font-weight: bold; font-size: 0.8rem; text-align: center; diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 923ab52f6..3df84f76e 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -67,6 +67,10 @@ const props = defineProps({ type: String, default: '', }, + makeFetch: { + type: Boolean, + default: true, + }, }); let arrayData = useArrayData(props.dataKey, { ...props }); @@ -94,12 +98,14 @@ async function search() { ([key, value]) => value && (props.staticParams || []).includes(key) ); store.skip = 0; - await arrayData.applyFilter({ - params: { - ...Object.fromEntries(staticParams), - search: searchText.value, - }, - }); + + if (props.makeFetch) + await arrayData.applyFilter({ + params: { + ...Object.fromEntries(staticParams), + search: searchText.value, + }, + }); if (!props.redirect) return; diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index e2465f5ba..d9bcb4904 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -6,7 +6,7 @@ import { buildFilter } from 'filters/filterPanel'; const arrayDataStore = useArrayDataStore(); -export function useArrayData(key, userOptions) { +export function useArrayData(key = useRoute().meta.moduleName, userOptions) { if (!key) throw new Error('ArrayData: A key is required to use this composable'); if (!arrayDataStore.get(key)) arrayDataStore.set(key); diff --git a/src/filters/dashOrCurrency.js b/src/filters/dashOrCurrency.js new file mode 100644 index 000000000..00243921c --- /dev/null +++ b/src/filters/dashOrCurrency.js @@ -0,0 +1,6 @@ +import toCurrency from './toCurrency'; + +export default function (value) { + if (value == null || value === '') return () => '-'; + return () => toCurrency(value); +} diff --git a/src/filters/index.js b/src/filters/index.js index 43bfc2d40..940788ed1 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -10,6 +10,7 @@ import toLowerCamel from './toLowerCamel'; import dashIfEmpty from './dashIfEmpty'; import dateRange from './dateRange'; import toHour from './toHour'; +import dashOrCurrency from './dashOrCurrency'; export { toLowerCase, @@ -17,6 +18,7 @@ export { toDate, toHour, toDateString, + dashOrCurrency, toDateHourMin, toDateHourMinSec, toRelativeDate, diff --git a/src/pages/Account/Role/Card/RoleBasicData.vue b/src/pages/Account/Role/Card/RoleBasicData.vue index 4607ef15c..bf9b3307d 100644 --- a/src/pages/Account/Role/Card/RoleBasicData.vue +++ b/src/pages/Account/Role/Card/RoleBasicData.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import VnInputDate from 'components/common/VnInputDate.vue'; const route = useRoute(); const { t } = useI18n(); diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index 02a9de04b..eee2713d3 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -1,7 +1,6 @@