Оценка сайта

This commit is contained in:
iriska-gri committed 2024-03-14 13:44:11 +03:00
1 parent aa68c50534
commit 800e7f88aa
12 files changed
+170 -117

No files matched your search

@@ -1,11 +1,8 @@
<template>
<pattern-card-feed
<pattern-card-feed
:title="'Самый активный критик'"
>
<template v-slot:filling_feedback>
<template v-slot:filling_feedback>
<v-row no-gutters v-if="top.comment[0].time_create != '1990-01-01'">
@@ -29,13 +26,7 @@
/>
</span>
</template>
<v-card max-width='400' density="compact" class="bg-transparent">
<v-card-text class="pb-0">Оставлено комментариев</v-card-text>
<v-card-subtitle>Последний комментарий оставлен {{formaComaTime(top.comment[0].time_create)}}</v-card-subtitle>
<v-card-title>{{top.comment[0].comment}}</v-card-title>
</v-card>
<card-comment :comment=top.comment[0] />
</v-tooltip>
</th>
<th class="text-center text-caption font-weight-medium">
@@ -88,13 +79,14 @@
import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
import ListUser from '@/components/UI/fiousercard/listUser.vue'
import TooltipText from '@/components/UI/tooltip-text.vue'
import {formaComaTime} from '@/utils/universal_functions'
// import CardFeedback from '@/components/UI/aboutportal/card-feedback.vue'
import CardComment from './card_top_comment/card-comment.vue'
export default {
components: {
PatternCardFeed,
ListUser,
TooltipText
TooltipText,
CardComment
},
props:
@@ -106,12 +98,7 @@ export default {
},
setup(props) {
// console.log(props.top.comment, 'top.comment');
return {
formaComaTime
}
}
}
</script>
@@ -0,0 +1,33 @@
<template>
<v-card max-width='400' density="compact" class="bg-transparent">
<v-card-text class="pb-0">Оставлено комментариев</v-card-text>
<v-card-subtitle>Последний комментарий оставлен {{formaComaTime(comment.time_create)}}</v-card-subtitle>
<v-card-title>{{comment.comment}}</v-card-title>
</v-card>
</template>
<script>
import {formaComaTime} from '@/utils/universal_functions'
export default {
props: {
comment: {
type: Object,
default: () => {}
}
},
setup() {
return {
formaComaTime
}
}
}
</script>
<style>
</style>
@@ -1,30 +1,27 @@
<template>
<pattern-card
:title="'Обратная связь'"
:ico="'mdi-comment-multiple-outline'"
>
<template v-slot:filling>
<v-row no-gutters class="flex-column gap">
<v-col lg=1 class="w100">
<v-card variant="flat" class="text-subtitle-1 font-weight-regular cursor-default">
Последний комментарий оставлен: <br> <span class="text-subtitle-1 font-weight-bold">{{formaComaTime(feedback.last_comment.time_create)}}</span>
</v-card>
</v-col>
<v-col lg=2 class="w100">
<template v-slot:filling>
<v-row no-gutters class="flex-column gap">
<v-col lg=1 class="w100">
<v-card variant="flat" class="text-subtitle-1 font-weight-regular cursor-default">
Последний комментарий оставлен: <br> <span class="text-subtitle-1 font-weight-bold">{{formaComaTime(feedback.last_comment.time_create)}}</span>
</v-card>
</v-col>
<v-col lg=2 class="w100">
<star-like
:criteria=feedback.criteria
:ratings=feedback.criteria
/>
</v-col>
<v-col
lg=2 class="w100"
v-for=" x in feedback.data"
:key=x
>
</v-col>
<v-col
lg=2 class="w100"
v-for=" x in feedback.data"
:key=x
>
<card-feedback :data="x"/>
</v-col>
<v-col class="d-flex flex-column">
@@ -34,10 +31,8 @@
</v-col>
</v-row>
<!--
-->
{{avgcriteria}}
</template>
</pattern-card>
@@ -83,6 +78,8 @@ export default {
let tuser = {comment:[{time_create:'1990-01-01', comment: ''}], score: 0}
props.feedback.feed.forEach((e) => {
if (!ob[e.author.id]) {
ob[e.author.id] = 0
@@ -109,12 +106,21 @@ 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
dataTopUser,
avgcriteria
}
}
}
@@ -159,14 +159,14 @@ export default {
res.datasets.forEach((e) => {
e.data.push(e.func(val,key))
// e.data = [10,20,30]
});
res.labels.push(formatComa(key))
}
// console.log(res.labels,"datat");
}
// res.datasets[1].data=[]
return res
}})
@@ -282,30 +282,6 @@ export default {
// const arrforline=() => {
// console.log(props.dataLineChart);
// for (let [key, val] of Object.entries) {}
// // Object.entries(props.dataLineChart).forEach(e => {
// // const [key, value] = e
// // arrlines.value.datasets[0].data.push(value.count)
// // arrlines.value.datasets[1].data.push(value.unic.length)
// // arrlines.value.datasets[2].data.push(value.crr)
// // arrlines.value.datasets[3].data.push(value.br)
// // arrlines.value.datasets[4].data.push(value.ppv)
// // arrlines.value.labels.push(formatComa(key))
// // arrlines.value.datasets[1].customlabel.push(props.dataLineChart[key].unic)
// // })
// // console.log(props.dataLineChart,'dataYear2 -------------');
// }
// watch(()=>props.dataLineChart,(newValue, oldValue)=>{
// if (linear.value!==null) {
// renderChart(data.value, options)
// }
// linear.value.chart.datasets =data.value.datasets
// },{deep:true})
return {
data,
options,
@@ -2,13 +2,13 @@
<v-card class="h-100 d-flex" variant="flat">
<v-row no-gutters class="flex-column gap">
<v-col lg=1 class="bg-teal-lighten-5 w100">
<v-col class="flex-grow-0 bg-teal-lighten-5 pa-0 w100">
<span class="font-weight-medium text-button text-teal-darken-4 cursor-default">
{{title}}
</span>
</v-col>
<v-col class="d-flex flex-column pt-1">
<v-col class="d-flex flex-column pa-0">
<slot name="filling_feedback"></slot>
</v-col>
</v-row>
@@ -186,7 +186,7 @@ export default {
unic: 1
}]
})
console.log(res, 'ind----------------------')
}
else {
@@ -127,7 +127,7 @@ export default {
function f_generalvacation() {
axiosApiInstance.get('api/general_vacation/generalvacation/')
.then(data => {
console.log(data.data,'----------------------');
for (let x in data.data) {
@@ -165,10 +165,7 @@ export default {
mess = `${d.getDate()} число`
}
// if d.getFullYear() == '1970': {
// console.log(d, 'ddddddddddddddddddddddd');
// }
return mess
}
@@ -0,0 +1,67 @@
<template>
<div>
<v-row
v-for="(x, key) in rating.basecrit"
:key = key
class="align-center"
>
<v-col
class="pl-5"
lg=5
>
<v-icon
size="large"
:color="x.color"
:icon="x.ico"
/>
{{x.name}}
</v-col>
<v-col lg=6 class="pa-0">
<v-rating
v-model="message[key].rating"
:hover="typeof(key) == 'number'"
half-increments
color="yellow"
:density="'comfortable'"
/>
</v-col>
<v-divider/>
</v-row>
</div>
</template>
<script>
import { computed } from 'vue'
export default {
props: {
rating: {
type: Object,
default: () => {}
},
},
setup(props, { emit }) {
const message = computed({
get: () => props.rating.nowrating,
set: (value) => emit('update:ratings', value)
})
return {
message
}
}
}
</script>
<style>
</style>
@@ -40,31 +40,23 @@
<div v-if="criteria.length!=0" class="pt-1">
<v-row
class="align-center flex-column scoreheight"
no-gutters
>
<div class="flex-columnd-flex pa-0"
<div class="flex-column d-flex pa-0"
v-for="(x, key) in criteria"
:key = key
>
<v-col lg=1 class="text-subtitle-1 font-weight-regular cursor-default w100 pa-0"
>
<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"
size="small"
:color="x.color"
:icon="x.ico"
/>
{{x.name}}
</v-col>
<v-col lg=2 class=" w100 pa-1 ">
{{x.name}}
</v-col>
<v-col lg=2 class=" w100 pa-0 ">
<v-rating
v-model="message[key].ratings"
@@ -138,6 +130,8 @@ export default {
set: (value) => emit('update:ratings', value)
})
return {
message
}
@@ -35,16 +35,15 @@
</v-list-item>
<!-- <v-list-item class="h-100 text-left pa-2" @click="open=true"> -->
<v-img
v-if="from_which=='top_comment'"
@click="open=true"
v-if="from_which=='top_comment'"
@click="open=true"
cover
class="cursor-pointer"
class="cursor-pointer"
:src="checkremote(`${spravURL}${author.login}.jpg`)"
/>
<!-- </v-list-item> -->
<info-user-card
:opendialog = open
@@ -79,11 +78,6 @@ export default {
const open = ref(false)
// const countcomment = () => {
// console.log(props.top);
// }
// countcomment()
const style_item_title = () => {
if (props.from_which=="top-user") {
+8 -9
View File
@@ -10,15 +10,12 @@
Оцените сайт
</v-col>
<v-divider/>
<v-divider class="pb-3"/>
</v-row>
<star-like
:criteria=feedbackdata.basecrit
:ratings=feedbackdata.nowrating
how="modal"
<feedstar-like
:rating=feedbackdata
@update:rating="feedbackdata.nowrating = $event"
/>
/>
<v-row class="mt-6">
<v-col class="pa-0 px-3">
<v-textarea
@@ -62,9 +59,10 @@
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 },
components: { starLike, FeedstarLike },
props: {
LikeDialog: {
@@ -84,7 +82,7 @@ export default {
feedbackdata.value = data.data
if (feedbackdata.value.nowrating.length == 0) {
for (let x of feedbackdata.value.basecrit) {
feedbackdata.value.nowrating.push({ratings: x.rating, crit: x.id, id: null})
feedbackdata.value.nowrating.push({rating: x.rating, crit: x.id, id: null})
}
}
if (feedbackdata.value.nowcomment === null) {
@@ -122,6 +120,7 @@ export default {
}
function feedSend() {
axiosApiInstance.post(`api/feedback/feedbackdata/`, {nowrating : feedbackdata.value.nowrating, nowcomment: feedbackdata.value.nowcomment} ).then(data => {})
menusCloses()