Исправление статистики
This commit is contained in:
@@ -25,6 +25,7 @@ class StatisticController extends Controller
|
||||
$queryEndDate = $request->query('endAt');
|
||||
$dateRange = $this->dateService->getDateRangeFromRequest($request, $user);
|
||||
$isRangeOneDay = $this->dateService->isRangeOneDay($dateRange->startDate, $dateRange->endDate);
|
||||
$queryStartOfDateRange = $dateRange->start()->copy()->startOfYear();
|
||||
|
||||
// Генерируем ключ кэша на основе параметров запроса
|
||||
// $cacheKey = $this->generateCacheKey($user, $startDate, $endDate, $isRangeOneDay);
|
||||
@@ -49,6 +50,7 @@ class StatisticController extends Controller
|
||||
],
|
||||
'isOneDay' => $isRangeOneDay,
|
||||
'recipientPlanOfYear' => $finalData['recipientPlanOfYear'],
|
||||
'startOfYear' => $queryStartOfDateRange->format('d.m.Y')
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import {NFlex, NSpace, NTag, NTooltip} from 'naive-ui'
|
||||
import {NFlex, NSpace, NTag, NTooltip, NEl} from 'naive-ui'
|
||||
import {percentType} from "../../../Utils/numbers.js";
|
||||
import {computed} from "vue";
|
||||
import {computed, ref} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
isTotalRow: {
|
||||
@@ -25,6 +25,9 @@ const props = defineProps({
|
||||
cumulative_percent: 0,
|
||||
is_calculate_debt: false,
|
||||
})
|
||||
},
|
||||
startOfYear: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
|
||||
@@ -49,6 +52,17 @@ const typePlan = computed(() => {
|
||||
if (props.plan.debt_from_year > 10) return 'warning'
|
||||
return 'success'
|
||||
})
|
||||
|
||||
const planTooltipShow = ref(false)
|
||||
|
||||
const valueStyle = computed(() => {
|
||||
if (planTooltipShow.value) {
|
||||
return {
|
||||
fontWeight: '700',
|
||||
color: 'var(--primary-color)'
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -69,12 +83,14 @@ const typePlan = computed(() => {
|
||||
<!-- </template>-->
|
||||
<!-- Требуется выписать в текущем месяце-->
|
||||
<!-- </NTooltip>-->
|
||||
<div>
|
||||
<NEl :style="valueStyle">
|
||||
{{ value }}
|
||||
</div>
|
||||
</NEl>
|
||||
<!-- <div class="absolute inset-x-1/2 inset-y-0 w-[22px] h-[22px] -translate-x-[11px] -translate-y-[2px]" />-->
|
||||
<NTooltip v-if="plan && !isTotalRow"
|
||||
trigger="hover"
|
||||
:arrow="false"
|
||||
@update-show="show => planTooltipShow = show"
|
||||
>
|
||||
<template #trigger>
|
||||
<NTag :type="percentType(periodPercent)"
|
||||
@@ -88,9 +104,9 @@ const typePlan = computed(() => {
|
||||
</template>
|
||||
<NSpace vertical>
|
||||
<NFlex align="center" justify="start" :wrap="false" size="small">
|
||||
<NTag type="info">План: {{ plan.period_plan }}, выполнено: {{ value }}</NTag>
|
||||
<NTag type="info">План: {{ plan.period_plan }}</NTag>
|
||||
</NFlex>
|
||||
<NTag :type="typePlan">Долг с начала года: {{ plan.debt_from_year }}</NTag>
|
||||
<NTag :type="typePlan">Долг с {{ startOfYear }}: {{ plan.debt_from_year }}</NTag>
|
||||
</NSpace>
|
||||
<!-- <br>План:-->
|
||||
<!-- <span class="font-medium">{{ plan.cumulative_plan }}</span>, долг:-->
|
||||
|
||||
@@ -43,6 +43,9 @@ const props = defineProps({
|
||||
recipientPlanOfYear: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
startOfYear: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
|
||||
@@ -183,7 +186,8 @@ const columns = ref([
|
||||
{
|
||||
isTotalRow: row.isTotalRow,
|
||||
value: row.outcome,
|
||||
plan: row.plan
|
||||
plan: row.plan,
|
||||
startOfYear: props.startOfYear
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user