Средняя оценка
This commit is contained in:
1 parent
800e7f88aa
commit
53a1fe6195
6 files changed
+116
-28
No files matched your search
@@ -36,7 +36,7 @@ import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
||||
export default {
|
||||
components: {
|
||||
PatternCardFeed,
|
||||
},
|
||||
},
|
||||
props: {
|
||||
|
||||
data: {
|
||||
|
||||
@@ -11,28 +11,23 @@
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-col lg=2 class="w100">
|
||||
|
||||
<star-like
|
||||
:criteria=feedback.criteria
|
||||
:ratings=feedback.criteria
|
||||
/>
|
||||
<statistik-like :rating=feedback.criteria />
|
||||
|
||||
|
||||
</v-col>
|
||||
<v-col
|
||||
lg=2 class="w100"
|
||||
class="w100 flex-grow-0"
|
||||
v-for=" x in feedback.data"
|
||||
:key=x
|
||||
>
|
||||
<card-feedback :data="x"/>
|
||||
</v-col>
|
||||
<v-col class="d-flex flex-column">
|
||||
|
||||
|
||||
<card-top-comment :top=dataTopUser />
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
{{avgcriteria}}
|
||||
</template>
|
||||
</pattern-card>
|
||||
|
||||
@@ -42,22 +37,25 @@
|
||||
import { ref, watch, computed } from 'vue'
|
||||
import {formaComaTime, splitname} from '@/utils/universal_functions'
|
||||
|
||||
import starLike from '@/components/UI/feedback/star-like.vue'
|
||||
|
||||
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'
|
||||
import FeedstarLike from '@/components/UI/feedback/feedstar-like.vue'
|
||||
import StatistikLike from '@/components/UI/feedback/statistik-like.vue'
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
starLike,
|
||||
CardTotal,
|
||||
TopUser,
|
||||
PatternCard,
|
||||
CardFeedback,
|
||||
CardTopComment
|
||||
CardTopComment,
|
||||
FeedstarLike,
|
||||
StatistikLike
|
||||
},
|
||||
|
||||
props:
|
||||
@@ -107,20 +105,12 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
const avgcriteria = computed({
|
||||
get() {
|
||||
let avgcrit = 0
|
||||
props.feedback.criteria.forEach((e)=> {
|
||||
avgcrit += e.ratings
|
||||
})
|
||||
return parseFloat(avgcrit/props.feedback.criteria.length).toFixed(2)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return {
|
||||
formaComaTime,
|
||||
dataTopUser,
|
||||
avgcriteria
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
|
||||
const message = computed({
|
||||
get: () => props.rating.nowrating,
|
||||
set: (value) => emit('update:ratings', value)
|
||||
set: (value) => emit('update:rating', value)
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -127,10 +127,10 @@ export default {
|
||||
|
||||
const message = computed({
|
||||
get: () => props.ratings,
|
||||
set: (value) => emit('update:ratings', value)
|
||||
set: (value) => emit('update:rating', value)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
message
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<pattern-card-feed
|
||||
:title="'Средняя оценка'"
|
||||
>
|
||||
<template v-slot:filling_feedback>
|
||||
<div v-if="rating.length!=0" class="pt-1">
|
||||
<v-row no-gutters>
|
||||
<v-col class="text-subtitle-1 bg-blue-grey-lighten-5 font-weight-bold">
|
||||
{{avgcriteria}}
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row
|
||||
class="align-center flex-column scoreheight"
|
||||
no-gutters
|
||||
>
|
||||
<div class="flex-column d-flex pa-0"
|
||||
v-for="(x, key) in rating"
|
||||
:key = key
|
||||
>
|
||||
<v-col lg=1 class="text-subtitle-1 font-weight-regular cursor-default w100 pa-0">
|
||||
<v-icon
|
||||
size="small"
|
||||
:color="x.color"
|
||||
:icon="x.ico"
|
||||
/>
|
||||
{{x.name}}
|
||||
</v-col>
|
||||
<v-col lg=2 class=" w100 pa-0 ">
|
||||
<v-rating
|
||||
v-model="x.ratings"
|
||||
:hover="typeof(key) == 'number'"
|
||||
half-increments
|
||||
readonly
|
||||
:size="25"
|
||||
color="yellow"
|
||||
:density="'comfortable'"
|
||||
/>
|
||||
</v-col>
|
||||
</div>
|
||||
</v-row>
|
||||
</div>
|
||||
<div class="d-flex flex-column" v-else>
|
||||
<v-row
|
||||
class="align-center flex-column scoreheight gap mt-n2"
|
||||
no-gutters
|
||||
>
|
||||
<v-col class="text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
За выбранный период оценок нет
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
</pattern-card-feed>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
export default {
|
||||
|
||||
props: {
|
||||
rating: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
|
||||
components: {
|
||||
PatternCardFeed,
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
|
||||
const avgcriteria = computed({
|
||||
get() {
|
||||
let avgcrit = 0
|
||||
props.rating.forEach((e)=> {
|
||||
avgcrit += e.ratings
|
||||
})
|
||||
return parseFloat(avgcrit/props.rating.length).toFixed(2)
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
avgcriteria
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -58,11 +58,11 @@
|
||||
<script>
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
import starLike from '@/components/UI/feedback/star-like.vue'
|
||||
|
||||
import FeedstarLike from '@/components/UI/feedback/feedstar-like.vue'
|
||||
|
||||
export default {
|
||||
components: { starLike, FeedstarLike },
|
||||
components: { FeedstarLike },
|
||||
|
||||
props: {
|
||||
LikeDialog: {
|
||||
|
||||
Reference in new issue
Block a user