Самый активный критик
This commit is contained in:
1 parent
da5604c2a8
commit
35f5d96d88
4 files changed
+97
-26
No files matched your search
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
|
||||
<pattern-card-feed
|
||||
:title="'Самый активный критик'"
|
||||
|
||||
>
|
||||
|
||||
<template v-slot:filling_feedback>
|
||||
<v-row>
|
||||
<v-col class="pr-0">
|
||||
<list-user :author= "top.author" :from_which="'top_comment'"/>
|
||||
</v-col>
|
||||
<v-col class="align-self-center pl-0">
|
||||
<v-table density="compact" class="pa-0">
|
||||
<thead>
|
||||
<tr >
|
||||
<th class="text-center text-caption font-weight-medium">
|
||||
<v-icon icon="$vuetify"></v-icon>
|
||||
</th>
|
||||
<th class="text-center text-caption font-weight-medium">
|
||||
<v-icon icon="$vuetify"></v-icon>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<tr >
|
||||
<th class="text-center">{{top.score}}</th>
|
||||
<th class="text-center">{{top.comment.textarr.length}}</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
<!-- <my-helper :pretext="top"/> -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
</template>
|
||||
</pattern-card-feed>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
||||
import ListUser from '@/components/UI/fiousercard/listUser.vue'
|
||||
// import CardFeedback from '@/components/UI/aboutportal/card-feedback.vue'
|
||||
export default {
|
||||
components: {
|
||||
PatternCardFeed,
|
||||
ListUser
|
||||
},
|
||||
|
||||
props:
|
||||
{
|
||||
top: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -23,13 +23,17 @@
|
||||
v-for=" x in feedback.data"
|
||||
:key=x
|
||||
>
|
||||
<!-- <my-helper :pretext="x"/> -->
|
||||
<card-feedback :data="x"/>
|
||||
</v-col>
|
||||
<v-col class="d-flex flex-column">
|
||||
<card-top-comment :top=dataTopUser />
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
<my-helper :pretext="feedback"/>
|
||||
<my-helper :pretext="top_comment()"/>
|
||||
<!-- <my-helper :pretext="feedback"/>
|
||||
-->
|
||||
|
||||
</template>
|
||||
</pattern-card>
|
||||
@@ -45,6 +49,7 @@ import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
||||
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
||||
import CardFeedback from '@/components/UI/aboutportal/card-feedback.vue'
|
||||
import CardTopComment from '@/components/UI/aboutportal/card-top-comment.vue'
|
||||
|
||||
export default {
|
||||
|
||||
@@ -53,7 +58,8 @@ export default {
|
||||
CardTotal,
|
||||
TopUser,
|
||||
PatternCard,
|
||||
CardFeedback
|
||||
CardFeedback,
|
||||
CardTopComment
|
||||
},
|
||||
|
||||
props:
|
||||
@@ -65,9 +71,10 @@ export default {
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
const dataTopUser = ref({})
|
||||
const top_comment = () => {
|
||||
|
||||
let l =
|
||||
let topUser =
|
||||
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: ''}}
|
||||
@@ -85,13 +92,24 @@ export default {
|
||||
|
||||
return acc
|
||||
}, {})
|
||||
return l
|
||||
|
||||
const sorted = Object.entries(topUser)
|
||||
.sort(([,a],[,b]) => (b.comment.textarr.length - a.comment.textarr.length))
|
||||
console.log(sorted[0],'-------------');
|
||||
dataTopUser.value = sorted[0][1]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
top_comment()
|
||||
|
||||
return {
|
||||
formaComaTime,
|
||||
top_comment
|
||||
dataTopUser
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,20 +30,17 @@
|
||||
/>
|
||||
{{author.fio}}
|
||||
</v-chip>
|
||||
<!-- <template v-slot:prepend>
|
||||
<v-avatar
|
||||
color="grey-darken-3"
|
||||
:image="checkremote( `${spravURL}${author.login}.jpg`)"
|
||||
/>
|
||||
</template>
|
||||
<v-list-item-title :class="style_item_title()">
|
||||
{{author.fio}}
|
||||
</v-list-item-title>
|
||||
<v-list-item-subtitle :class="style_item_subtitle()">
|
||||
{{author.post}}
|
||||
</v-list-item-subtitle> -->
|
||||
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item v-if="from_which=='top_comment'" class="h-100 text-left pa-2" @click="open=true">
|
||||
<v-img
|
||||
cover
|
||||
min-height="80px"
|
||||
max-height="90px"
|
||||
:src="checkremote(`${spravURL}${author.login}.jpg`)"
|
||||
/>
|
||||
</v-list-item>
|
||||
<!-- <my-helper :pretext="author"/> -->
|
||||
|
||||
<info-user-card
|
||||
:opendialog = open
|
||||
|
||||
@@ -29,16 +29,10 @@
|
||||
<card-total :indicator=x />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<!-- <indicators-info
|
||||
:indicator=dataIndicators
|
||||
/> -->
|
||||
|
||||
<!-- {{dataIndicators}} -->
|
||||
|
||||
</v-col>
|
||||
<v-col lg=4 class="d-flex flex-column">
|
||||
<rating-page :pages_count=pages_count />
|
||||
|
||||
<rating-page :pages_count=pages_count />
|
||||
</v-col>
|
||||
<v-col lg=4 class="d-flex flex-column ">
|
||||
|
||||
|
||||
Reference in new issue
Block a user