Правка процент-бейджа
This commit is contained in:
@@ -43,6 +43,13 @@ const typePlan = computed(() => {
|
||||
if (props.plan.debt_from_year > 10) return 'warning'
|
||||
return 'success'
|
||||
})
|
||||
|
||||
// % выполнения плана именно за выбранный период (не с начала года)
|
||||
const periodPercent = computed(() => {
|
||||
const planForPeriod = Number(props.plan?.period_plan ?? 0)
|
||||
if (!planForPeriod) return 0
|
||||
return Math.round((Number(props.value) * 100) / planForPeriod)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -71,13 +78,13 @@ const typePlan = computed(() => {
|
||||
:arrow="false"
|
||||
>
|
||||
<template #trigger>
|
||||
<NTag :type="percentType(plan.cumulative_percent)"
|
||||
<NTag :type="percentType(periodPercent)"
|
||||
round
|
||||
:bordered="false"
|
||||
size="tiny"
|
||||
class="absolute! -right-1.5 bottom-2.5 text-xs"
|
||||
>
|
||||
{{ plan.cumulative_percent }}%
|
||||
{{ periodPercent }}%
|
||||
</NTag>
|
||||
</template>
|
||||
<NSpace vertical>
|
||||
|
||||
Reference in New Issue
Block a user