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