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 @@ + + + + +