fix: относительные пути CSS, data-kt-region, контракт данных
This commit is contained in:
parent
cd76f81c85
commit
c775ced07e
37
index.html
37
index.html
@ -4,11 +4,10 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Контроль качества сервиса — Дашборд</title>
|
||||
<link rel="stylesheet" href="design-system/kt-ai-fonts.css">
|
||||
<link rel="stylesheet" href="design-system/kt-ai-tokens.css">
|
||||
<link rel="stylesheet" href="design-system/kt-ai-components.css">
|
||||
<link rel="stylesheet" href="design-system/kt-ai-page.css">
|
||||
<link rel="stylesheet" href="design-system/kt-ai-chart.css">
|
||||
<link rel="stylesheet" href="./design-system/kt-ai-fonts.css">
|
||||
<link rel="stylesheet" href="./design-system/kt-ai-tokens.css">
|
||||
<link rel="stylesheet" href="./design-system/kt-ai-components.css">
|
||||
<link rel="stylesheet" href="./design-system/kt-ai-page.css">
|
||||
<style>
|
||||
.kt-ai-app { min-height: 100vh; display: flex; flex-direction: column; }
|
||||
.app-header { display: flex; align-items: center; gap: var(--kt-ai-space-4); }
|
||||
@ -123,7 +122,7 @@
|
||||
<h3 style="margin-bottom: var(--kt-ai-space-4); font-size: var(--kt-ai-text-lg);">Объяснение отклонений</h3>
|
||||
<ul class="explanation-list" id="explanationList"></ul>
|
||||
</div>
|
||||
<div class="insights-card kt-ai-card">
|
||||
<div data-kt-region="recommendations" class="insights-card kt-ai-card">
|
||||
<h3 style="margin-bottom: var(--kt-ai-space-4); font-size: var(--kt-ai-text-lg);">Рекомендации</h3>
|
||||
<div id="recommendationsList"></div>
|
||||
</div>
|
||||
@ -273,7 +272,17 @@ function getViewForState(state) {
|
||||
const kpis = calculateKPIs(rows);
|
||||
const targets = getTargetValues();
|
||||
|
||||
const prevPeriodRows = filterData(state.segment, state.channel, state.period === "7d" ? "14d" : state.period === "14d" ? "30d" : "30d");
|
||||
const prevPeriod = state.period === "7d" ? "14d" : (state.period === "14d" ? "30d" : "30d");
|
||||
const prevPeriodRows = DATA.filter(r => {
|
||||
if (state.segment !== "all" && r.segment !== state.segment) return false;
|
||||
if (state.channel !== "all" && r.channel !== state.channel) return false;
|
||||
const days = getDaysForPeriod(prevPeriod);
|
||||
const endDate = new Date("2025-11-30");
|
||||
const startDate = new Date(endDate);
|
||||
startDate.setDate(startDate.getDate() - days + 1);
|
||||
const d = new Date(r.date);
|
||||
return d >= startDate && d <= endDate;
|
||||
});
|
||||
const prevKPIs = calculateKPIs(prevPeriodRows);
|
||||
|
||||
const series = [];
|
||||
@ -481,8 +490,18 @@ function render(view) {
|
||||
|
||||
document.getElementById("emptyState").classList.add("hidden");
|
||||
|
||||
const prevRows = filterData(currentState.segment, currentState.channel, currentState.period === "7d" ? "14d" : "30d");
|
||||
const prevKPIs = calculateKPIs(prevRows);
|
||||
const prevPeriod = currentState.period === "7d" ? "14d" : (currentState.period === "14d" ? "30d" : "30d");
|
||||
const prevPeriodRows = DATA.filter(r => {
|
||||
if (currentState.segment !== "all" && r.segment !== currentState.segment) return false;
|
||||
if (currentState.channel !== "all" && r.channel !== currentState.channel) return false;
|
||||
const days = getDaysForPeriod(prevPeriod);
|
||||
const endDate = new Date("2025-11-30");
|
||||
const startDate = new Date(endDate);
|
||||
startDate.setDate(startDate.getDate() - days + 1);
|
||||
const d = new Date(r.date);
|
||||
return d >= startDate && d <= endDate;
|
||||
});
|
||||
const prevKPIs = calculateKPIs(prevPeriodRows);
|
||||
|
||||
renderKPIs(view.kpis, prevKPIs);
|
||||
renderChart(view.series);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user