* переписал функции прототипов в сервисы
* оптимизация доставки контента до клиента * переписал запросы выборок * убрал из подсчета переведенных * добавил сохранение метрикам для вывода в дашборд
This commit is contained in:
@@ -27,7 +27,7 @@ const dateType = computed(() => {
|
||||
})
|
||||
|
||||
const queryDate = ref([null, null])
|
||||
const modelValue = ref(props.date)
|
||||
const modelValue = defineModel('date')
|
||||
|
||||
const setQueryDate = () => {
|
||||
router.reload({
|
||||
@@ -75,14 +75,21 @@ const formattedValue = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => modelValue.value, (newVal) => {
|
||||
if (isUseDateRange.value) {
|
||||
queryDate.value = newVal
|
||||
} else {
|
||||
queryDate.value = [newVal, newVal]
|
||||
}
|
||||
watch(() => modelValue.value, (newVal, oldVal) => {
|
||||
if (!newVal) return
|
||||
|
||||
setQueryDate()
|
||||
if (Array.isArray(newVal)) {
|
||||
if (newVal.length === 2 &&
|
||||
(!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
|
||||
queryDate.value = newVal
|
||||
setQueryDate()
|
||||
}
|
||||
} else {
|
||||
if (newVal !== oldVal) {
|
||||
queryDate.value = newVal
|
||||
setQueryDate()
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user