diff --git a/src/front/package-lock.json b/src/front/package-lock.json index 0b2b61959..a4039d060 100644 --- a/src/front/package-lock.json +++ b/src/front/package-lock.json @@ -6448,11 +6448,11 @@ } }, "node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", + "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -10789,9 +10789,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", diff --git a/src/front/src/components/UI/aboutportal/feedmodul.vue b/src/front/src/components/UI/aboutportal/feedmodul.vue index 9b9b97a11..8a6b6e4c0 100644 --- a/src/front/src/components/UI/aboutportal/feedmodul.vue +++ b/src/front/src/components/UI/aboutportal/feedmodul.vue @@ -71,7 +71,7 @@ export default { }, 0 )/val.rating.length).toFixed(1) } - console.log(avgfeed, 'key,valkey,val'); + for (let [key,val] of Object.entries(us)) { diff --git a/src/front/src/components/dialog-search.vue b/src/front/src/components/dialog-search.vue index 89e73e97f..c52dcf76a 100644 --- a/src/front/src/components/dialog-search.vue +++ b/src/front/src/components/dialog-search.vue @@ -136,9 +136,6 @@ export default { axiosApiInstance.get(`api/general_vacation/dailyload/?id=${props.idpos}`).then(data => { t_dailyRound.value = data.data.daily - - - }) diff --git a/src/front/src/views/AboutPortalPage.vue b/src/front/src/views/AboutPortalPage.vue index 7fa92c057..09b661050 100644 --- a/src/front/src/views/AboutPortalPage.vue +++ b/src/front/src/views/AboutPortalPage.vue @@ -111,8 +111,8 @@ @@ -149,6 +149,7 @@ setup(){ 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')) @@ -224,7 +225,7 @@ setup(){ const previousWeekStart = moment().subtract(1, 'weeks').startOf('week'); // начало предыдущей недели const previousWeekEnd = moment().subtract(1, 'weeks').endOf('week'); // конец предыдущей недели - const maxDate = new Date( + const maxDate = new Date( Math.max( ...visiting.value.map(e => { return new Date(e.visitdate); @@ -233,7 +234,8 @@ setup(){ ); const visition = () => { - axiosApiInstance.get(`api/watcher/counter/`).then(result => { + // ${startdate.value} + axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}`).then(result => { visiting.value = result.data.result feedback.value = result.data.feedback @@ -356,6 +358,15 @@ 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, countgrupp, @@ -366,7 +377,8 @@ setup(){ countvising, crit, menudate, - selectedDateStart + selectedDateStart, + dateStart diff --git a/src/watcher/views.py b/src/watcher/views.py index 323245a80..c3a4d2dd3 100644 --- a/src/watcher/views.py +++ b/src/watcher/views.py @@ -19,8 +19,9 @@ class Counter(ListAPIView): serializer_class = CountSerializer def get(self, request): + print(request.GET.get("start"), '-----------------------') - res = CountVisitor.objects.filter(visitdate__range=['2024-01-01', '2024-12-31']).annotate(Sum('count')) + res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), '2024-12-31']).annotate(Sum('count')) result = CountSerializer(res, many=True).data # Обратная связь