fix
This commit is contained in:
@@ -28,7 +28,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4 flex items-end justify-between gap-3">
|
<div class="mt-4 flex items-end justify-between gap-3">
|
||||||
<div class="text-[38px] leading-none font-semibold tracking-tight text-slate-900">
|
<div
|
||||||
|
class="leading-none font-semibold tracking-tight text-slate-900"
|
||||||
|
:class="[valueFontSize]"
|
||||||
|
>
|
||||||
{{ value }}
|
{{ value }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="$slots.right" class="shrink-0">
|
<div v-if="$slots.right" class="shrink-0">
|
||||||
@@ -52,6 +55,16 @@ const props = defineProps({
|
|||||||
description: { type: String, default: '' }
|
description: { type: String, default: '' }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const valueFontSize = computed(() => {
|
||||||
|
const valStr = String(props.value ?? '');
|
||||||
|
const len = valStr.length;
|
||||||
|
if (len > 20) return 'text-[20px]';
|
||||||
|
if (len > 16) return 'text-[24px]';
|
||||||
|
if (len > 12) return 'text-[28px]';
|
||||||
|
if (len > 10) return 'text-[32px]';
|
||||||
|
return 'text-[38px]';
|
||||||
|
});
|
||||||
|
|
||||||
function hexToRgba(hex, alpha) {
|
function hexToRgba(hex, alpha) {
|
||||||
const h = String(hex || '')
|
const h = String(hex || '')
|
||||||
.replace('#', '')
|
.replace('#', '')
|
||||||
|
|||||||
@@ -651,24 +651,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-span-12">
|
|
||||||
<div class="rounded-2xl bg-white shadow-sm border border-slate-200/60 p-4 h-full">
|
|
||||||
<div class="flex items-center gap-1.5 mb-2">
|
|
||||||
<div class="text-[16px] font-semibold text-slate-800">Эффективность каналов</div>
|
|
||||||
<i
|
|
||||||
class="pi pi-question-circle text-[12px] text-slate-400 cursor-help"
|
|
||||||
v-tooltip.top="'Стоимость привлечения клиента по каждому каналу. Показывает, какие каналы наиболее эффективны с точки зрения стоимости привлечения.'"
|
|
||||||
></i>
|
|
||||||
</div>
|
|
||||||
<div class="h-[280px]">
|
|
||||||
<Chart v-if="channelEfficiencyBarData.labels.length > 0" type="bar" :data="channelEfficiencyBarData" :options="channelEfficiencyBarOptions" :plugins="barPlugins" />
|
|
||||||
<div v-else class="h-full flex items-center justify-center text-slate-500 text-[13px]">
|
|
||||||
Нет данных об эффективности каналов
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-span-12">
|
<div class="col-span-12">
|
||||||
<PptConclusionBox :text="report?.sections?.acquisition_channels?.conclusion" />
|
<PptConclusionBox :text="report?.sections?.acquisition_channels?.conclusion" />
|
||||||
</div>
|
</div>
|
||||||
@@ -1009,9 +991,9 @@
|
|||||||
<div class="h-8 w-8 rounded-lg flex items-center justify-center border border-slate-200/70 bg-slate-50/50 flex-shrink-0">
|
<div class="h-8 w-8 rounded-lg flex items-center justify-center border border-slate-200/70 bg-slate-50/50 flex-shrink-0">
|
||||||
<i class="pi pi-link text-slate-500 text-sm"></i>
|
<i class="pi pi-link text-slate-500 text-sm"></i>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
:href="source"
|
:href="source"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="text-sm text-blue-600 hover:text-blue-800 hover:underline break-all flex-1"
|
class="text-sm text-blue-600 hover:text-blue-800 hover:underline break-all flex-1"
|
||||||
>
|
>
|
||||||
@@ -1032,12 +1014,12 @@
|
|||||||
<section v-if="report && !embedded" class="space-y-3">
|
<section v-if="report && !embedded" class="space-y-3">
|
||||||
<div class="rounded-2xl bg-white shadow-sm border border-slate-200/60 p-4 md:p-6">
|
<div class="rounded-2xl bg-white shadow-sm border border-slate-200/60 p-4 md:p-6">
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<Button
|
<Button
|
||||||
label="Создать стратегию"
|
label="Создать стратегию"
|
||||||
icon="pi pi-magic"
|
icon="pi pi-magic"
|
||||||
severity="success"
|
severity="success"
|
||||||
size="large"
|
size="large"
|
||||||
@click="goToStrategy"
|
@click="goToStrategy"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1156,7 +1138,7 @@ async function loadAnalysisV2() {
|
|||||||
// MarketingService.fetchAnalysisV2 уже извлекает data из обёртки {success, message, data}
|
// MarketingService.fetchAnalysisV2 уже извлекает data из обёртки {success, message, data}
|
||||||
// Но на всякий случай проверяем, может быть еще одна обёртка
|
// Но на всякий случай проверяем, может быть еще одна обёртка
|
||||||
let extractedData = (data?.data || data) || null;
|
let extractedData = (data?.data || data) || null;
|
||||||
|
|
||||||
// Убеждаемся, что sources сохраняются - проверяем все возможные места
|
// Убеждаемся, что sources сохраняются - проверяем все возможные места
|
||||||
if (extractedData && !extractedData.sources) {
|
if (extractedData && !extractedData.sources) {
|
||||||
// Проверяем все возможные места, где могут быть sources
|
// Проверяем все возможные места, где могут быть sources
|
||||||
@@ -1166,7 +1148,7 @@ async function loadAnalysisV2() {
|
|||||||
extractedData.sources = data.sources;
|
extractedData.sources = data.sources;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Создаём новый объект, чтобы гарантировать, что все поля сохранены
|
// Создаём новый объект, чтобы гарантировать, что все поля сохранены
|
||||||
if (extractedData) {
|
if (extractedData) {
|
||||||
localReport.value = {
|
localReport.value = {
|
||||||
|
|||||||
Reference in New Issue
Block a user