Топ комментатор
This commit is contained in:
1 parent
a443ea7805
commit
d2881f1250
11 files changed
+103
-105
No files matched your search
@@ -1,24 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<!-- :title="'Оставлено комментариев'" -->
|
<!-- :title="'Оставлено комментариев'" -->
|
||||||
<pattern-card-feed
|
<pattern-card-feed
|
||||||
:title="title"
|
:title="data.title"
|
||||||
>
|
>
|
||||||
<template v-slot:filling_feedback>
|
<template v-slot:filling_feedback>
|
||||||
<v-row no-gutters class="flex-column gap">
|
<v-row no-gutters class="flex-column gap">
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-table density="compact">
|
<v-table density="compact" class="px-7">
|
||||||
<thead>
|
<thead>
|
||||||
<tr >
|
<tr >
|
||||||
<th class="text-center">
|
<th class="text-center text-caption font-weight-medium">
|
||||||
всего
|
всего
|
||||||
</th>
|
</th>
|
||||||
<th class="text-center">
|
<th class="text-center text-caption font-weight-medium">
|
||||||
за период
|
за период
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody >
|
<tbody >
|
||||||
|
<tr >
|
||||||
|
<th class="text-center">{{data.all}}</th>
|
||||||
|
<th class="text-center">{{data.period}}</th>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</v-table>
|
</v-table>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|||||||
@@ -1,95 +1,51 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="!feedback">hui</div>
|
|
||||||
<pattern-card v-else
|
|
||||||
|
<pattern-card
|
||||||
:title="'Обратная связь'"
|
:title="'Обратная связь'"
|
||||||
:ico="'mdi-comment-multiple-outline'"
|
:ico="'mdi-comment-multiple-outline'"
|
||||||
>
|
>
|
||||||
<template v-slot:filling>
|
<template v-slot:filling>
|
||||||
<v-row no-gutters class="flex-column gap">
|
<v-row no-gutters class="flex-column gap">
|
||||||
|
<v-col lg=1 class="w100">
|
||||||
|
<v-card >
|
||||||
|
Последний комментарий оставлен <span class="font-weight-bold">{{formaComaTime(feedback.last_comment.time_create)}}</span>
|
||||||
|
</v-card>
|
||||||
|
</v-col>
|
||||||
<v-col lg=3 class="w100">
|
<v-col lg=3 class="w100">
|
||||||
<star-like
|
<star-like
|
||||||
:criteria=feedback.criteria
|
:criteria=feedback.criteria
|
||||||
:ratings=feedback.criteria
|
:ratings=feedback.criteria
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col lg=2 class="w100">
|
<v-col
|
||||||
<card-feedback
|
lg=2 class="w100"
|
||||||
:title="'Оставлено комментариев'"
|
v-for=" x in feedback.data"
|
||||||
|
:key=x
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- <card-feedback
|
|
||||||
:title="'Оставлено комментариев'"
|
|
||||||
>
|
>
|
||||||
<template v-slot:tbody_stat>
|
<card-feedback :data="x"/>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{{feedback.data.score.all}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{feedback.data.score.period}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
{{format1(feedback.last_comment.time_create)}}
|
|
||||||
</template>
|
|
||||||
</card-feedback> -->
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<my-helper :pretext="feedback"/>
|
<my-helper :pretext="feedback"/>
|
||||||
|
<my-helper :pretext="top_comment()"/>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</pattern-card>
|
</pattern-card>
|
||||||
<!-- <v-row no-gutters class="h-100">
|
|
||||||
<v-col class="d-flex flex-column gap" >
|
|
||||||
<div>
|
|
||||||
<card-total
|
|
||||||
name="Всего поставлено оценок"
|
|
||||||
:total="total"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="h-100">
|
|
||||||
<v-card class="pa-3 pt-4 pl-7 h-100">
|
|
||||||
|
|
||||||
<star-like
|
|
||||||
v-if="Object.keys(forstar).length>0"
|
|
||||||
:criteria=forstar
|
|
||||||
:rating=forstar
|
|
||||||
/>
|
|
||||||
<v-row v-else class="h-100">
|
|
||||||
<v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
|
|
||||||
Оценок за выбранный период нет
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<card-total
|
|
||||||
name="Всего оставлено комментариев"
|
|
||||||
:total="crit.total"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<top-user
|
|
||||||
name= "Самый активный критик"
|
|
||||||
:users=crit
|
|
||||||
ico="mdi-comment-account-outline"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</v-col>
|
|
||||||
</v-row> -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import {format1} from '@/utils/universal_functions'
|
import {formaComaTime, splitname} from '@/utils/universal_functions'
|
||||||
|
|
||||||
import starLike from '@/components/UI/feedback/star-like.vue'
|
import starLike from '@/components/UI/feedback/star-like.vue'
|
||||||
import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
||||||
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||||
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
||||||
import CardFeedback from '@/components/UI/aboutportal/card-feedback.vue'
|
import CardFeedback from '@/components/UI/aboutportal/card-feedback.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
@@ -108,11 +64,34 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setup() {
|
setup(props) {
|
||||||
|
const top_comment = () => {
|
||||||
|
|
||||||
|
let l =
|
||||||
|
props.feedback.feed.reduce((acc, item)=> {
|
||||||
|
if (!acc[item.author.id]) {
|
||||||
|
acc[item.author.id] ={author: {id: 0, login: "", post: "", fio: ""}, score: 0, comment: {textarr: [], data: '', text: ''}}
|
||||||
|
}
|
||||||
|
acc[item.author.id].author.id = item.author.id
|
||||||
|
acc[item.author.id].author.login = item.author.login
|
||||||
|
acc[item.author.id].author.post = item.author.post
|
||||||
|
acc[item.author.id].author.fio = splitname(item.author)
|
||||||
|
acc[item.author.id].score +=1
|
||||||
|
if (item.comment != "") {
|
||||||
|
acc[item.author.id].comment.textarr.push(item.comment)
|
||||||
|
acc[item.author.id].comment.data = formaComaTime(item.time_create)
|
||||||
|
acc[item.author.id].comment.text = item.comment
|
||||||
|
}
|
||||||
|
|
||||||
|
return acc
|
||||||
|
}, {})
|
||||||
|
return l
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
format1
|
formaComaTime,
|
||||||
|
top_comment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import lineGraph from '@/components/graph/line-graph.vue'
|
import lineGraph from '@/components/graph/line-graph.vue'
|
||||||
import {computed } from 'vue'
|
import {computed } from 'vue'
|
||||||
import {format1, splitname} from '@/utils/universal_functions'
|
import {formatComa, splitname} from '@/utils/universal_functions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -127,7 +127,7 @@ export default {
|
|||||||
const [key, value] = e
|
const [key, value] = e
|
||||||
arrlines.value.datasets[0].data.push(value.count)
|
arrlines.value.datasets[0].data.push(value.count)
|
||||||
arrlines.value.datasets[1].data.push(value.unic.length)
|
arrlines.value.datasets[1].data.push(value.unic.length)
|
||||||
arrlines.value.labels.push(format1(key))
|
arrlines.value.labels.push(formatComa(key))
|
||||||
arrlines.value.datasets[1].customlabel.push(props.dataLineChart[key].unic)
|
arrlines.value.datasets[1].customlabel.push(props.dataLineChart[key].unic)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-card class="h-100 d-flex">
|
<v-card class="h-100 d-flex">
|
||||||
<v-row no-gutters class="flex-column gap">
|
<v-row no-gutters class="flex-column gap">
|
||||||
<v-col lg=1 class=" bg-blue-grey-darken-1 w100">
|
<v-col lg=1 class=" bg-blue-grey-darken-1 text-caption font-weight-medium w100">
|
||||||
{{title}}
|
{{title}}
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-column">
|
<v-col class="d-flex flex-column">
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
:from_which = "'top-user'"
|
:from_which = "'top-user'"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:expanded-row="{ columns, item }">
|
<template v-slot:expanded-row="{ columns, item }">
|
||||||
<tr>
|
<tr>
|
||||||
<td :colspan="columns.length">
|
<td :colspan="columns.length">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="selectedDate"
|
v-model="selectedDate"
|
||||||
:value="format1(datedefault)"
|
:value="formatComa(datedefault)"
|
||||||
no-resize
|
no-resize
|
||||||
class="my-textarea"
|
class="my-textarea"
|
||||||
rows="1"
|
rows="1"
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import {format1} from '@/utils/universal_functions'
|
import {formatComa} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -74,7 +74,7 @@ export default {
|
|||||||
menudate,
|
menudate,
|
||||||
selectedDate,
|
selectedDate,
|
||||||
dateStart,
|
dateStart,
|
||||||
format1
|
formatComa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<span class="text-caption">
|
<span class="text-caption">
|
||||||
Информация о странице: <br/>
|
Информация о странице: <br/>
|
||||||
{{router.currentRoute.value.meta.title}} <br/>
|
{{router.currentRoute.value.meta.title}} <br/>
|
||||||
с {{format1(appStore.countvisitor.visitdate)}}
|
с {{formatComa(appStore.countvisitor.visitdate)}}
|
||||||
</span>
|
</span>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
|
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { format1 } from '@/utils/universal_functions'
|
import { formatComa } from '@/utils/universal_functions'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useAppStore } from '@/store/app'
|
import { useAppStore } from '@/store/app'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
@@ -73,7 +73,7 @@ export default {
|
|||||||
router,
|
router,
|
||||||
appStore,
|
appStore,
|
||||||
showTooltip,
|
showTooltip,
|
||||||
format1
|
formatComa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
{{author.post}}
|
{{author.post}}
|
||||||
</v-list-item-subtitle> -->
|
</v-list-item-subtitle> -->
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<!-- <my-helper :pretext="author"/> -->
|
||||||
|
|
||||||
<info-user-card
|
<info-user-card
|
||||||
:opendialog = open
|
:opendialog = open
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
@update:opendialog="open = $event"
|
@update:opendialog="open = $event"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -8,14 +8,18 @@ import moment from 'moment'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function format1(date) {
|
export function formatComa(date) {
|
||||||
return moment(date).format('DD.MM.YYYY')
|
return moment(date).format('DD.MM.YYYY')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function format2(date) {
|
export function formatDash(date) {
|
||||||
return moment(date).format('YYYY-MM-DD')
|
return moment(date).format('YYYY-MM-DD')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formaComaTime(date) {
|
||||||
|
return moment(date).format('DD.MM.YYYY H:mm')
|
||||||
|
}
|
||||||
|
|
||||||
export function getfromserver(path, reactive){
|
export function getfromserver(path, reactive){
|
||||||
try{
|
try{
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row no-gutters class="flex-column gap ma-1">
|
<v-row v-if="Object.keys(feedback).length==0">
|
||||||
|
<v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
|
||||||
|
<v-progress-circular
|
||||||
|
:size="150"
|
||||||
|
:width="7"
|
||||||
|
color="cyan-darken-3"
|
||||||
|
indeterminate
|
||||||
|
></v-progress-circular>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row no-gutters class="flex-column gap ma-1" v-else>
|
||||||
<toolbar-filter/>
|
<toolbar-filter/>
|
||||||
<v-col lg=3 class="w100">
|
<v-col lg=3 class="w100">
|
||||||
<v-row no-gutters class="h-100 gap">
|
<v-row no-gutters class="h-100 gap">
|
||||||
<v-col lg=3 >
|
<v-col lg=3 >
|
||||||
<portal-traffic :traffic=dataAttendance />
|
<portal-traffic :traffic=dataAttendance />
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<line-chart :dataLineChart="dataLineChart"/>
|
<line-chart :dataLineChart="dataLineChart"/>
|
||||||
@@ -43,7 +52,7 @@
|
|||||||
<feedmodul
|
<feedmodul
|
||||||
:feedback="feedback"
|
:feedback="feedback"
|
||||||
/>
|
/>
|
||||||
<!-- <my-helper :pretext="feedback"/> -->
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -55,7 +64,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
|
|
||||||
import {pagecounter, splitname, format1, format2} from '@/utils/universal_functions'
|
import {pagecounter, splitname, formatComa, formatDash} from '@/utils/universal_functions'
|
||||||
|
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
||||||
@@ -108,7 +117,7 @@ setup(){
|
|||||||
|
|
||||||
const visition = () => {
|
const visition = () => {
|
||||||
|
|
||||||
axiosApiInstance.get(`api/watcher/counter/?start=${format2(filterStore.date_period.startdate)}&end=${format2(filterStore.date_period.enddate)}`).then(result => {
|
axiosApiInstance.get(`api/watcher/counter/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
||||||
for_formulas.value = result.data.for_formulas
|
for_formulas.value = result.data.for_formulas
|
||||||
visiting.value = result.data.result
|
visiting.value = result.data.result
|
||||||
feedback.value = result.data.feedback
|
feedback.value = result.data.feedback
|
||||||
@@ -132,7 +141,7 @@ setup(){
|
|||||||
|
|
||||||
|
|
||||||
const funLineChart = (data, item) => {
|
const funLineChart = (data, item) => {
|
||||||
if (item.visitdate <= format2(filterStore.date_period.enddate)) {
|
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||||
if (!data[item.visitdate]) {
|
if (!data[item.visitdate]) {
|
||||||
data[item.visitdate] = {count: 0, unic: []}
|
data[item.visitdate] = {count: 0, unic: []}
|
||||||
}
|
}
|
||||||
@@ -165,7 +174,7 @@ setup(){
|
|||||||
let user = visiting.value.filter(e => e.author.id == iduser)
|
let user = visiting.value.filter(e => e.author.id == iduser)
|
||||||
|
|
||||||
const groupUser = user.reduce((acc, item) => {
|
const groupUser = user.reduce((acc, item) => {
|
||||||
if (item.visitdate <= format2(filterStore.date_period.enddate)) {
|
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||||
funyearpages(yearpages, item)
|
funyearpages(yearpages, item)
|
||||||
checking_for_entry(pages, item.pages)
|
checking_for_entry(pages, item.pages)
|
||||||
|
|
||||||
@@ -215,7 +224,7 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
const funyearpages = (data, item) => {
|
const funyearpages = (data, item) => {
|
||||||
if (item.visitdate <= format2(filterStore.date_period.enddate)) {
|
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||||
if (!data[item.visitdate]) {
|
if (!data[item.visitdate]) {
|
||||||
data[item.visitdate] = {}
|
data[item.visitdate] = {}
|
||||||
}
|
}
|
||||||
@@ -261,7 +270,7 @@ setup(){
|
|||||||
funLineChart(obj, item)
|
funLineChart(obj, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.visitdate >= format2(filterStore.date_period.startdate) && item.visitdate <= format2(filterStore.date_period.enddate)){
|
if (item.visitdate >= formatDash(filterStore.date_period.startdate) && item.visitdate <= formatDash(filterStore.date_period.enddate)){
|
||||||
checking_for_entry(unicuser.value, item.author.id)
|
checking_for_entry(unicuser.value, item.author.id)
|
||||||
|
|
||||||
checking_for_entry(acc[item.pages].year.unique, splitname(item.author))
|
checking_for_entry(acc[item.pages].year.unique, splitname(item.author))
|
||||||
@@ -270,7 +279,7 @@ setup(){
|
|||||||
checking_for_entry(attendance.period.user, splitname(item.author))
|
checking_for_entry(attendance.period.user, splitname(item.author))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.visitdate == format2(new Date())) {
|
if (item.visitdate == formatDash(new Date())) {
|
||||||
// console.log(item, 'item');
|
// console.log(item, 'item');
|
||||||
|
|
||||||
checking_for_entry(acc[item.pages].now.unique, splitname(item.author))
|
checking_for_entry(acc[item.pages].now.unique, splitname(item.author))
|
||||||
@@ -318,8 +327,8 @@ setup(){
|
|||||||
|
|
||||||
|
|
||||||
const title_period = () => {
|
const title_period = () => {
|
||||||
selected_days.value.year.start = format1(filterStore.date_period.startdate)
|
selected_days.value.year.start = formatComa(filterStore.date_period.startdate)
|
||||||
selected_days.value.year.end = format1(filterStore.date_period.enddate)
|
selected_days.value.year.end = formatComa(filterStore.date_period.enddate)
|
||||||
pages_count.value.title = selected_days.value
|
pages_count.value.title = selected_days.value
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +342,7 @@ setup(){
|
|||||||
visitionreduce,
|
visitionreduce,
|
||||||
dataLineChart,
|
dataLineChart,
|
||||||
dataActivusers,
|
dataActivusers,
|
||||||
format1,
|
formatComa,
|
||||||
selected_days,
|
selected_days,
|
||||||
for_formulas,
|
for_formulas,
|
||||||
dataAttendance,
|
dataAttendance,
|
||||||
@@ -399,7 +408,7 @@ setup(){
|
|||||||
// let last_day = []
|
// let last_day = []
|
||||||
// visiting.value.map((e)=>{
|
// visiting.value.map((e)=>{
|
||||||
|
|
||||||
// if (e.visitdate < format2(enddate.value)) {
|
// if (e.visitdate < formatDash(enddate.value)) {
|
||||||
// last_day.push(e.visitdate)
|
// last_day.push(e.visitdate)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -451,7 +460,7 @@ setup(){
|
|||||||
|
|
||||||
// portal_traffic.year.unique.add(item.author.id)
|
// portal_traffic.year.unique.add(item.author.id)
|
||||||
|
|
||||||
// if (item.visitdate == format2(enddate.value)) {
|
// if (item.visitdate == formatDash(enddate.value)) {
|
||||||
// acc[item.pages].now.unique.add(item.author.id)
|
// acc[item.pages].now.unique.add(item.author.id)
|
||||||
// acc[item.pages].now.countall += item.count
|
// acc[item.pages].now.countall += item.count
|
||||||
|
|
||||||
@@ -459,18 +468,18 @@ setup(){
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// Посещаемость портала для периода 1 день
|
// Посещаемость портала для периода 1 день
|
||||||
// if (item.visitdate ==format2(last_days.value)){
|
// if (item.visitdate ==formatDash(last_days.value)){
|
||||||
// portal_traffic.now.comparison_period.add(item.author.id)
|
// portal_traffic.now.comparison_period.add(item.author.id)
|
||||||
// portal_traffic.now.info = `за ${format1(last_days.value)}`
|
// portal_traffic.now.info = `за ${formatComa(last_days.value)}`
|
||||||
// }
|
// }
|
||||||
// portal_traffic.year.info = `с ${format1(previous_period.value)} по ${format1(startdate.value)} `
|
// portal_traffic.year.info = `с ${formatComa(previous_period.value)} по ${formatComa(startdate.value)} `
|
||||||
// console.log( `${format1(previous_period.value)} >=${format1(item.visitdate)} <= ${format1(startdate.value)}`,'до')
|
// console.log( `${formatComa(previous_period.value)} >=${formatComa(item.visitdate)} <= ${formatComa(startdate.value)}`,'до')
|
||||||
|
|
||||||
|
|
||||||
// Посещаемость портала для периода - выбранный период фильтра
|
// Посещаемость портала для периода - выбранный период фильтра
|
||||||
// if (item.visitdate >= format2(previous_period.value) && item.visitdate < format2(startdate.value)) {
|
// if (item.visitdate >= formatDash(previous_period.value) && item.visitdate < formatDash(startdate.value)) {
|
||||||
// console.log( `${format1(previous_period.value)} >=${format1(item.visitdate)} < ${format1(startdate.value)}`,'после')
|
// console.log( `${formatComa(previous_period.value)} >=${formatComa(item.visitdate)} < ${formatComa(startdate.value)}`,'после')
|
||||||
// console.log(previous_period.value, format2(startdate.value), '-------------------------------')
|
// console.log(previous_period.value, formatDash(startdate.value), '-------------------------------')
|
||||||
// portal_traffic.year.comparison_period.add(item.author.id)
|
// portal_traffic.year.comparison_period.add(item.author.id)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|||||||
@@ -66,17 +66,17 @@ class Counter(ListAPIView):
|
|||||||
'criteria': list(rating.values('crit__name').annotate(ratings=Avg('rating'), name=F('crit__name'), ico=F('crit__ico'), color=F('crit__color')).values('ratings', 'name', 'ico', 'color')),
|
'criteria': list(rating.values('crit__name').annotate(ratings=Avg('rating'), name=F('crit__name'), ico=F('crit__ico'), color=F('crit__color')).values('ratings', 'name', 'ico', 'color')),
|
||||||
'data': {
|
'data': {
|
||||||
'score': {
|
'score': {
|
||||||
'title': 'Оставлено комментариев',
|
'title': 'Поставлено оценок',
|
||||||
'all': feed.values_list('comment', flat=True).count(),
|
'all': feed.values_list('comment', flat=True).count(),
|
||||||
'period': feed.values_list('comment', flat=True).filter(time_create__range=[request.GET.get("start"), request.GET.get("end")]).count()
|
'period': feed.values_list('comment', flat=True).filter(time_create__range=[request.GET.get("start"), request.GET.get("end")]).count()
|
||||||
},
|
},
|
||||||
'comment': {
|
'comment': {
|
||||||
'title': 'Поставлено оценок',
|
'title': 'Оставлено комментариев',
|
||||||
'all': feed.values_list('comment', flat=True).filter(~Q(comment='')).count(),
|
'all': feed.values_list('comment', flat=True).filter(~Q(comment='')).count(),
|
||||||
'period': feed.values_list('comment', flat=True).filter(Q(time_create__range=[request.GET.get("start"), request.GET.get("end")]) & ~Q(comment='')).count()
|
'period': feed.values_list('comment', flat=True).filter(Q(time_create__range=[request.GET.get("start"), request.GET.get("end")]) & ~Q(comment='')).count()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'last_comment': feed.values('time_create').filter(~Q(comment='')).earliest('time_create'),
|
'last_comment': feed.values('time_create').filter(~Q(comment='')).latest('time_create'),
|
||||||
# 'avg_score': round(avgrating['res'], 2)
|
# 'avg_score': round(avgrating['res'], 2)
|
||||||
},
|
},
|
||||||
'for_formulas': {
|
'for_formulas': {
|
||||||
|
|||||||
Reference in new issue
Block a user