From 13dfcc3e0536745212fcf63cc536e947cee0c868 Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Mon, 22 Jun 2026 17:02:36 +0900 Subject: [PATCH] =?UTF-8?q?UI=20=D0=BA=D0=BE=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=B0=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Analytics/Export/AnalyticsExcelExport.php | 40 ++ resources/js/Pages/Analytics/Builder.vue | 370 ++++++++++++++++++ .../Components/CustomMeasureModal.vue | 85 ++++ .../Analytics/Components/EditReportModal.vue | 60 +++ .../Analytics/Components/PickerPanel.vue | 114 ++++++ .../Pages/Analytics/Components/PresetCard.vue | 78 ++++ .../Analytics/Components/ReportChart.vue | 270 +++++++++++++ .../Analytics/Components/ResultTable.vue | 43 ++ .../Analytics/Components/SettingsPanel.vue | 312 +++++++++++++++ .../Components/TemplatePickerModal.vue | 104 +++++ resources/js/Pages/Analytics/Index.vue | 188 +++++++++ 11 files changed, 1664 insertions(+) create mode 100644 app/Services/Analytics/Export/AnalyticsExcelExport.php create mode 100644 resources/js/Pages/Analytics/Builder.vue create mode 100644 resources/js/Pages/Analytics/Components/CustomMeasureModal.vue create mode 100644 resources/js/Pages/Analytics/Components/EditReportModal.vue create mode 100644 resources/js/Pages/Analytics/Components/PickerPanel.vue create mode 100644 resources/js/Pages/Analytics/Components/PresetCard.vue create mode 100644 resources/js/Pages/Analytics/Components/ReportChart.vue create mode 100644 resources/js/Pages/Analytics/Components/ResultTable.vue create mode 100644 resources/js/Pages/Analytics/Components/SettingsPanel.vue create mode 100644 resources/js/Pages/Analytics/Components/TemplatePickerModal.vue create mode 100644 resources/js/Pages/Analytics/Index.vue diff --git a/app/Services/Analytics/Export/AnalyticsExcelExport.php b/app/Services/Analytics/Export/AnalyticsExcelExport.php new file mode 100644 index 0000000..b35ff7a --- /dev/null +++ b/app/Services/Analytics/Export/AnalyticsExcelExport.php @@ -0,0 +1,40 @@ + $c->label, $this->result->columns)]; + + if ($this->result->rows === []) { + $rows[] = ['Нет данных за выбранный период']; + } + + foreach ($this->result->rows as $row) { + $line = []; + foreach ($this->result->columns as $column) { + $line[] = $row[$column->key] ?? ''; + } + $rows[] = $line; + } + + return [new ArraySheetExport($this->sheetTitle(), $rows)]; + } + + private function sheetTitle(): string + { + return mb_substr(preg_replace('/[\\\\\/\?\*\[\]:]/', ' ', $this->title), 0, 31) ?: 'Отчёт'; + } +} diff --git a/resources/js/Pages/Analytics/Builder.vue b/resources/js/Pages/Analytics/Builder.vue new file mode 100644 index 0000000..7f9c811 --- /dev/null +++ b/resources/js/Pages/Analytics/Builder.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/resources/js/Pages/Analytics/Components/CustomMeasureModal.vue b/resources/js/Pages/Analytics/Components/CustomMeasureModal.vue new file mode 100644 index 0000000..3ab19b7 --- /dev/null +++ b/resources/js/Pages/Analytics/Components/CustomMeasureModal.vue @@ -0,0 +1,85 @@ + + + diff --git a/resources/js/Pages/Analytics/Components/EditReportModal.vue b/resources/js/Pages/Analytics/Components/EditReportModal.vue new file mode 100644 index 0000000..8424926 --- /dev/null +++ b/resources/js/Pages/Analytics/Components/EditReportModal.vue @@ -0,0 +1,60 @@ + + + diff --git a/resources/js/Pages/Analytics/Components/PickerPanel.vue b/resources/js/Pages/Analytics/Components/PickerPanel.vue new file mode 100644 index 0000000..299ea5d --- /dev/null +++ b/resources/js/Pages/Analytics/Components/PickerPanel.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/resources/js/Pages/Analytics/Components/PresetCard.vue b/resources/js/Pages/Analytics/Components/PresetCard.vue new file mode 100644 index 0000000..f1d29df --- /dev/null +++ b/resources/js/Pages/Analytics/Components/PresetCard.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/resources/js/Pages/Analytics/Components/ReportChart.vue b/resources/js/Pages/Analytics/Components/ReportChart.vue new file mode 100644 index 0000000..cf9efc4 --- /dev/null +++ b/resources/js/Pages/Analytics/Components/ReportChart.vue @@ -0,0 +1,270 @@ + + + + + diff --git a/resources/js/Pages/Analytics/Components/ResultTable.vue b/resources/js/Pages/Analytics/Components/ResultTable.vue new file mode 100644 index 0000000..2b42597 --- /dev/null +++ b/resources/js/Pages/Analytics/Components/ResultTable.vue @@ -0,0 +1,43 @@ + + + diff --git a/resources/js/Pages/Analytics/Components/SettingsPanel.vue b/resources/js/Pages/Analytics/Components/SettingsPanel.vue new file mode 100644 index 0000000..82b9d82 --- /dev/null +++ b/resources/js/Pages/Analytics/Components/SettingsPanel.vue @@ -0,0 +1,312 @@ + + + + + diff --git a/resources/js/Pages/Analytics/Components/TemplatePickerModal.vue b/resources/js/Pages/Analytics/Components/TemplatePickerModal.vue new file mode 100644 index 0000000..0120d5c --- /dev/null +++ b/resources/js/Pages/Analytics/Components/TemplatePickerModal.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/resources/js/Pages/Analytics/Index.vue b/resources/js/Pages/Analytics/Index.vue new file mode 100644 index 0000000..a2424ca --- /dev/null +++ b/resources/js/Pages/Analytics/Index.vue @@ -0,0 +1,188 @@ + + + + +