From f92d7aa6e7f123b5b17c0bb1f92ebae8025995df Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:17:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D1=8C=20=D0=B4=D0=BB=D1=8F=20=D1=84=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D1=82=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/package-lock.json | 12 ++--- .../components/UI/aboutportal/feedmodul.vue | 27 +++++++---- src/front/src/views/AboutPortalPage.vue | 46 ++++++++++++++++++- 3 files changed, 69 insertions(+), 16 deletions(-) diff --git a/src/front/package-lock.json b/src/front/package-lock.json index 56a48875a..0b2b61959 100644 --- a/src/front/package-lock.json +++ b/src/front/package-lock.json @@ -22699,9 +22699,9 @@ } }, "node_modules/vuetify": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.3.10.tgz", - "integrity": "sha512-jV5zA4PMK1ik8j/alPhAR75fzSoAvUgPcoKl+fZ/buDu70vJ3nM6+F3zh78UBs0PMzyLlarwt851QNbYXLbZbQ==", + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.4.10.tgz", + "integrity": "sha512-tObGoumCJxuK26OpS/CLZZIJAgDtN2cnd31vJscVhpuf6jeMD7wh8IsgfZownAOXU1FcKWVQwn1RSDsoXk5cJA==", "engines": { "node": "^12.20 || >=14.13" }, @@ -22711,10 +22711,10 @@ }, "peerDependencies": { "typescript": ">=4.7", - "vite-plugin-vuetify": "^1.0.0-alpha.12", - "vue": "^3.2.0", + "vite-plugin-vuetify": ">=1.0.0-alpha.12", + "vue": "^3.3.0", "vue-i18n": "^9.0.0", - "webpack-plugin-vuetify": "^2.0.0-alpha.11" + "webpack-plugin-vuetify": ">=2.0.0-alpha.11" }, "peerDependenciesMeta": { "typescript": { diff --git a/src/front/src/components/UI/aboutportal/feedmodul.vue b/src/front/src/components/UI/aboutportal/feedmodul.vue index 86af5a630..9b9b97a11 100644 --- a/src/front/src/components/UI/aboutportal/feedmodul.vue +++ b/src/front/src/components/UI/aboutportal/feedmodul.vue @@ -9,6 +9,7 @@ {{total}} {{crit}} +
{{average()}}
@@ -35,17 +36,20 @@ export default { let tot = new Set() let us = {} let t = 0 + const avgfeed = props.feedback .reduce((acc, item) => { - console.log(item, 'item'); + if (!acc[item.namecrit]) { - acc[item.namecrit] = [] + acc[item.namecrit] = {rating: [], ico: ''} } - acc[item.namecrit].push(item.rating) + + + acc[item.namecrit]['rating'].push(item.rating) + acc[item.namecrit]['ico'] = item.ico tot.add(item.usercom) - - if (!us[splitname(item.author)]) { + if (!us[splitname(item.author)]) { us[splitname(item.author)] = {max: new Set(), login: 0} } if (item.comment.length > 0) { @@ -53,7 +57,7 @@ export default { us[splitname(item.author)]['login'] = item.author.login } - + return acc }, {} ) @@ -61,11 +65,13 @@ export default { for (let [key,val] of Object.entries(avgfeed)) { - avgfeed[key] = (val.reduce((a,b)=>{ + + avgfeed[key]['rating'] = (val.rating.reduce((a,b)=>{ return a+b }, 0 - )/val.length).toFixed(1) + )/val.rating.length).toFixed(1) } + console.log(avgfeed, 'key,valkey,val'); for (let [key,val] of Object.entries(us)) { @@ -77,9 +83,12 @@ export default { } } + crit.value.total = t total.value = tot.size - console.log(avgfeed, 'avgfeed'); + + + return avgfeed } diff --git a/src/front/src/views/AboutPortalPage.vue b/src/front/src/views/AboutPortalPage.vue index f8cca8696..f9f4774c9 100644 --- a/src/front/src/views/AboutPortalPage.vue +++ b/src/front/src/views/AboutPortalPage.vue @@ -82,8 +82,43 @@ + + + + + + + + + + + + + + @@ -93,6 +128,7 @@