diff --git a/src/front/src/components/UI/date-select.vue b/src/front/src/components/UI/date-select.vue
new file mode 100644
index 000000000..b497ec442
--- /dev/null
+++ b/src/front/src/components/UI/date-select.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/front/src/views/AboutPortalPage.vue b/src/front/src/views/AboutPortalPage.vue
index 09b661050..d13eb5acf 100644
--- a/src/front/src/views/AboutPortalPage.vue
+++ b/src/front/src/views/AboutPortalPage.vue
@@ -89,35 +89,16 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -134,12 +115,14 @@ import moment from 'moment'
import lineGraph from '@/components/graph/line-graph.vue'
import { axiosApiInstance } from '@/utils/axios-api'
import Feedmodul from '@/components/UI/aboutportal/feedmodul.vue'
+import DateSelect from '@/components/UI/date-select.vue'
export default {
components: { lineGraph,
- Feedmodul },
+ Feedmodul,
+ DateSelect },
setup(){
@@ -147,10 +130,8 @@ setup(){
const feedback = ref([])
const countvising = ref({now: 0, week: 0, year: 0})
const crit = ref([])
- const menudate = ref(false)
- const selectedDateStart = ref(null)
const startdate =ref(moment(new Date(new Date().getFullYear(), 0, 1)).format('YYYY-MM-DD'))
-
+ const endate =ref(moment(new Date(new Date().getFullYear(), 11, 31)).format('YYYY-MM-DD'))
const arrlines = {}
@@ -232,10 +213,23 @@ setup(){
}),
),
);
+
+
+ const returnstart = (dates) => {
+ startdate.value = dates
+ visition()
+ }
+
+ const returnend = (dates) => {
+ endate.value = dates
+ visition()
+ }
const visition = () => {
+
// ${startdate.value}
- axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}`).then(result => {
+
+ axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${endate.value}`).then(result => {
visiting.value = result.data.result
feedback.value = result.data.feedback
@@ -359,13 +353,7 @@ setup(){
visition()
- const dateStart = () => {
- startdate.value = moment(selectedDateStart.value).format('YYYY-MM-DD')
- visition()
- let d = new Date(new Date().getFullYear(), 0, 1)
- console.log( moment(new Date(new Date().getFullYear(), 0, 1)).format('YYYY-MM-DD'), '222222222222222222222222222');
- menudate.value=false
- }
+
return {
visiting,
@@ -376,13 +364,11 @@ setup(){
feedback,
countvising,
crit,
- menudate,
- selectedDateStart,
- dateStart
-
-
-
-
+ visition,
+ returnstart,
+ returnend,
+ endate,
+ startdate
}
}
diff --git a/src/watcher/views.py b/src/watcher/views.py
index c3a4d2dd3..6990bcc6f 100644
--- a/src/watcher/views.py
+++ b/src/watcher/views.py
@@ -21,7 +21,7 @@ class Counter(ListAPIView):
def get(self, request):
print(request.GET.get("start"), '-----------------------')
- res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), '2024-12-31']).annotate(Sum('count'))
+ res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), request.GET.get("end")]).annotate(Sum('count'))
result = CountSerializer(res, many=True).data
# Обратная связь