diff --git a/src/components/ToolBar.vue b/src/components/ToolBar.vue
index 91d6034..ad86dd6 100644
--- a/src/components/ToolBar.vue
+++ b/src/components/ToolBar.vue
@@ -7,7 +7,7 @@
diff --git a/src/components/analytics/AnalyticsView.vue b/src/components/analytics/AnalyticsView.vue
index 7aae1c8..82c2700 100644
--- a/src/components/analytics/AnalyticsView.vue
+++ b/src/components/analytics/AnalyticsView.vue
@@ -7,6 +7,9 @@ import Column from "primevue/column";
import Chart from "primevue/chart";
import Listbox from "primevue/listbox";
import Select from "primevue/select";
+import InputText from "primevue/inputtext";
+import IconField from "primevue/iconfield"
+import InputIcon from "primevue/inputicon";
import Accordion from "primevue/accordion";
import AccordionPanel from "primevue/accordionpanel";
import AccordionHeader from "primevue/accordionheader";
@@ -27,8 +30,15 @@ const dataTableCategories = ref([]);
const tableColumns = ref([]);
const chartData = ref(null)
const selectedCategory = ref()
-const formatter = ref(new Intl.NumberFormat('ru-RU', {style: 'currency', currency: 'RUB', minimumFractionDigits: 0, maximumFractionDigits:0}))
+const formatter = ref(new Intl.NumberFormat('ru-RU', {
+ style: 'currency',
+ currency: 'RUB',
+ minimumFractionDigits: 0,
+ maximumFractionDigits: 0
+}))
const isChartOpen = ref(false)
+const filterText = ref(null)
+
const closeChart = () => {
setTimeout(() => {
@@ -148,12 +158,12 @@ const prepareTableData = (categories) => {
if (found.difference != 0) {
if (found.difference > 0) {
- row[dateStr] = found ? formatter.value.format(found.total) + "
(+ " + found.difference + "%)
" : 0;
+ row[dateStr] = found ? "
" + formatter.value.format(found.total) + "
(+ " + found.difference + "%)
" : 0;
} else {
- row[dateStr] = found ? formatter.value.format(found.total) + "
(" + found.difference + "%)
" : 0;
+ row[dateStr] = found ? "
" + formatter.value.format(found.total) + "
(" + found.difference + "%)
" : 0;
}
} else {
- row[dateStr] = found ? formatter.value.format(found.total) : 0;
+ row[dateStr] = found ? "
" + formatter.value.format(found.total) + "
" : 0;
}
if (!sums[dateStr]) {
sums[dateStr] = 0
@@ -161,7 +171,7 @@ const prepareTableData = (categories) => {
sums[dateStr] += found.total
categorySum += found.total
});
- row["avg"] = formatter.value.format(categorySum/allDates.length);
+ row["avg"] = "
" + formatter.value.format(categorySum / allDates.length) + "
";
return row;
});
@@ -179,7 +189,7 @@ const prepareTableData = (categories) => {
if (difference > 0) {
color = "text-red-500"
} else color = "text-green-600"
- sums[key] = formatter.value.format(sums[key]) + `
(` + difference.toFixed(0) + "%)
";
+ sums[key] = "
" + formatter.value.format(sums[key]) + `
(` + difference.toFixed(0) + "%)
";
});
@@ -221,32 +231,54 @@ onMounted(async () => {
-
+
+
+
+
+ График
+
-
-
- График
-
+
+
+
+
+
+
+
+
{
justify-content: center;
}
-.p-listbox-list-container {
- max-height: 100% !important;
+.p-listbox {
+ //height: 80% !important;
}
+
+.p-listbox-list-container {
+ //height: 100% !important;
+ //max-height: 90% !important;
+}
+
+.p-chart {
+ //width: 100% !important;
+ overflow: auto;
+}
+
diff --git a/src/services/categoryService.ts b/src/services/categoryService.ts
index 6f60f5c..148963b 100644
--- a/src/services/categoryService.ts
+++ b/src/services/categoryService.ts
@@ -4,8 +4,14 @@ import {Category} from "@/models/Category"; // Импортируете нас
export const getCategories = async (type = null) => {
- type = type ? type : ''
- return await apiClient.get('/categories?type=' + type);
+
+ const params = {};
+ if (type) {
+ params.type = type;
+ }
+ return await apiClient.get('/categories', {
+ params: params
+ });
};
export const getCategoryTypes = async () => {