|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<main class="d-flex align-center data-timing-range">
|
|
|
- <div v-if="show" class="d-flex align-center" style="max-height: 100%">
|
|
|
- <span class="pl-2 mr-2 font-weight-bold on-neutral" style="min-width: 150px;">
|
|
|
+ <div class="d-flex align-center" style="max-height: 100%">
|
|
|
+ <span class="label pl-2 mr-2 font-weight-bold on-neutral">
|
|
|
{{ $t('period_choose') }}
|
|
|
</span>
|
|
|
|
|
|
@@ -11,21 +11,6 @@
|
|
|
@update:model-value="updateDateTimeRange"
|
|
|
/>
|
|
|
</div>
|
|
|
-
|
|
|
- <v-btn
|
|
|
- ref="btn"
|
|
|
- class="time-btn ml-1 theme-neutral-soft"
|
|
|
- height="22" min-height="22" max-height="22"
|
|
|
- width="25" min-width="25" max-width="25"
|
|
|
- elevation="0"
|
|
|
- @click="show = !show"
|
|
|
- >
|
|
|
- <v-icon icon="fas fa-history" class="font-weight-normal" style="font-size: 14px;" />
|
|
|
- </v-btn>
|
|
|
-
|
|
|
- <v-tooltip location="bottom" :activator="btn">
|
|
|
- <span>{{ $t('history_help') }}</span>
|
|
|
- </v-tooltip>
|
|
|
</main>
|
|
|
</template>
|
|
|
|
|
|
@@ -33,15 +18,11 @@
|
|
|
import {Ref} from "@vue/reactivity";
|
|
|
import {useAccessProfileStore} from "~/stores/accessProfile";
|
|
|
import {useFormStore} from "~/stores/form";
|
|
|
-import {WatchStopHandle} from "@vue/runtime-core";
|
|
|
import {useEntityManager} from "~/composables/data/useEntityManager";
|
|
|
import Access from "~/models/Access/Access";
|
|
|
import DateUtils from "~/services/utils/dateUtils";
|
|
|
import {usePageStore} from "~/stores/page";
|
|
|
|
|
|
-const btn: Ref = ref(null)
|
|
|
-const show: Ref<boolean> = ref(false)
|
|
|
-
|
|
|
const { setDirty } = useFormStore()
|
|
|
const accessProfileStore = useAccessProfileStore()
|
|
|
const { em } = useEntityManager()
|
|
|
@@ -78,30 +59,10 @@ const updateDateTimeRange = async (dates: Array<Date>): Promise<any> => {
|
|
|
|
|
|
window.location.reload()
|
|
|
}
|
|
|
-
|
|
|
-/**
|
|
|
- * Emit event when component is hidden / shown
|
|
|
- */
|
|
|
-const emit = defineEmits(['showDateTimeRange'])
|
|
|
-
|
|
|
-const unwatch: WatchStopHandle = watch(show, (newValue) => {
|
|
|
- emit('showDateTimeRange', newValue)
|
|
|
-})
|
|
|
-
|
|
|
-onUnmounted(() => {
|
|
|
- unwatch()
|
|
|
-})
|
|
|
-
|
|
|
-// Show by default if a date range is defined in store
|
|
|
-if (accessProfileStore.historical.dateStart || accessProfileStore.historical.dateEnd) {
|
|
|
- show.value = true
|
|
|
- emit('showDateTimeRange', true)
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
-.time-btn {
|
|
|
- border-width: 1px 1px 1px 0;
|
|
|
- border-style: solid;
|
|
|
+.label {
|
|
|
+ min-width: 150px;
|
|
|
}
|
|
|
</style>
|