Феедбак

This commit is contained in:
iriska-gri committed 2024-03-05 14:38:27 +03:00
1 parent e3ab5c42c0
commit f1dd6bd408
10 files changed
+66 -114

No files matched your search

@@ -13,7 +13,7 @@
<list-user :author= "top.author" :from_which="'top_comment'"/>
</v-col>
<v-col class="align-self-center pl-0">
<!-- <my-helper :pretext="top.comment"/> -->
<my-helper :pretext="top.comment"/>
<v-table density="compact" class="pa-0">
<thead>
<tr >
@@ -30,10 +30,11 @@
</span>
</template>
<v-card max-width='400' density="compact" class="bg-transparent">
<v-card-title>Оставлено комментариев</v-card-title>
<v-card-text class="pb-0">Оставлено комментариев</v-card-text>
<v-card-subtitle>Последний комментарий оставлен {{formaComaTime(top.comment[0].time_create)}}</v-card-subtitle>
<v-card-text>{{top.comment[0].comment}}</v-card-text>
<v-card-title>{{top.comment[0].comment}}</v-card-title>
</v-card>
</v-tooltip>
</th>
@@ -92,9 +93,8 @@ export default {
},
setup(props) {
console.log(props.top, 'gggggggggggggg')
setup() {
return {
formaComaTime
}
@@ -6,6 +6,7 @@
:ico="'mdi-comment-multiple-outline'"
>
<template v-slot:filling>
<my-helper :pretext="feedback"/>
<v-row no-gutters class="flex-column gap">
<v-col lg=1 class="w100">
<v-card variant="flat" class="text-h6 font-weight-regular">
@@ -23,7 +24,7 @@
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">
@@ -91,14 +92,15 @@ export default {
if (Object.keys(ob).length > 0){
let top = Object.keys(ob).reduce((a,b) => ob[a] > ob[b] ? a: b)
let puser = props.feedback.feed.filter(e=> e.author.id == top)
tuser=Object.assign({},puser[puser.length-1])
tuser.fio=splitname(tuser.author)
tuser.score = puser.length
tuser.comment = puser.filter(e=>e.comment.length>0).sort((a,b)=> {return a.id-b.id})
console.log(puser, ' top');
tuser.comment = puser.filter(e=>e.comment.length>0).sort((a,b)=> {return b.id-a.id})
}
@@ -108,42 +110,7 @@ export default {
}
})
const top_comment = () => {
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: ''}}
}
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
}, {})
if(Object.keys(topUser).length>0){
const sorted = topUser
.sort((a,b) => (b.comment.textarr.length - a.comment.textarr.length))
dataTopUser.value = sorted[0][1]
}else{
// console.log(props.feedback.feed, sorted, 'dataTopUser.valuedataTopUser.value');
dataTopUser.value =[]
}
}
// top_comment()
return {
formaComaTime,
+10 -3
View File
@@ -37,6 +37,8 @@
hide-header
@update:modelValue="dateStart"
border
:max="formatDash(new Date())"
:min="formatDash(appStore.countvisitor.visitdate)"
/>
</v-locale-provider>
@@ -46,7 +48,8 @@
<script>
import { ref } from 'vue'
import {formatComa} from '@/utils/universal_functions'
import {formatComa, formatDash} from '@/utils/universal_functions'
import { useAppStore } from '@/store/app'
export default {
props: {
@@ -59,7 +62,9 @@ export default {
setup(props, {emit}) {
const appStore = useAppStore()
const maxdate = formatDash(new Date())
console.log(maxdate, 'ssssssssssssssssssssss');
const menudate = ref(false)
const selectedDate = ref(null)
@@ -74,7 +79,9 @@ export default {
menudate,
selectedDate,
dateStart,
formatComa
formatComa,
formatDash,
appStore,
}
}
@@ -18,8 +18,9 @@
{{x.name}}
</v-col>
<v-col lg=6>
<v-rating
v-model="message[key].ratings"
v-model="message[key].rating"
:hover="typeof(key) == 'number'"
half-increments
color="yellow"
@@ -35,23 +36,38 @@
:title="'Средняя оценка'"
>
<template v-slot:filling_feedback>
<v-row
v-for="(x, key) in criteria"
:key = key
class="align-center mt-n2"
class="align-center flex-column scoreheight gap mt-n2"
no-gutters
>
<v-col lg=12 class="text-h6 font-weight-regular">
<div class="flex-columnd-flex gap pa-0"
v-for="(x, key) in criteria"
:key = key
>
<v-col lg=1 class="text-h6 font-weight-regular w100 pa-0"
>
<v-icon
size="small"
:color="x.color"
:icon="x.ico"
/>
{{x.name}}
</v-col>
<v-col lg=12>
</v-col>
<v-col lg=2 class=" w100 pa-2 pt-1">
<v-rating
v-model="message[key].ratings"
v-model="message[key].rating"
:hover="typeof(key) == 'number'"
@@ -61,7 +77,9 @@
:density="'comfortable'"
/>
</v-col>
</div>
</v-row>
</template>
</pattern-card-feed>
@@ -96,6 +114,7 @@ export default {
},
setup(props, { emit }) {
const message = computed({
get: () => props.ratings,
@@ -112,5 +131,7 @@ export default {
</script>
<style>
.scoreheight {
min-height: 240px;
}
</style>
@@ -40,7 +40,7 @@
v-if="from_which=='top_comment'"
@click="open=true"
cover
class="cursor-pointer"
:src="checkremote(`${spravURL}${author.login}.jpg`)"
/>
<!-- </v-list-item> -->
+1
View File
@@ -118,6 +118,7 @@ export default {
}
function feedSend() {
console.log(feedbackdata.value.nowrating, 'feedbackdata.value.nowrating----------------------');
axiosApiInstance.post(`api/feedback/feedbackdata/`, {nowrating : feedbackdata.value.nowrating, nowcomment: feedbackdata.value.nowcomment} ).then(data => {})
menusCloses()
}
+5 -52
View File
@@ -46,7 +46,7 @@
</v-row>
</v-col>
<v-col lg=2 class="bg-red">
<v-col lg=2 >
<feedmodul
:feedback="alldata.feedback"
/>
@@ -54,61 +54,14 @@
</v-row>
</v-col>
</v-row>
<!-- <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-else -->
<!-- <v-row no-gutters class="flex-column gap ma-1" >
<v-col lg=4 class="w100">
<v-row no-gutters class="h-100 gap">
<v-col lg=2>
</v-col>
<v-col lg=8>
</v-col>
</v-row>
</v-col>
<v-col class="w100 ">
<v-row no-gutters class="h-100 gap">
<v-col class="flex-column d-flex">
<v-row no-gutters class="flex-column gap" >
<v-col v-for="x in cardtotal" :key=x>
<card-total :indicator=x />
</v-col>
</v-row>
</v-col>
<v-col lg=4 class="d-flex flex-column">
</v-col>
<v-col lg=4 class="d-flex flex-column ">
</v-col>
<v-col class="d-flex flex-column">
</v-col>
</v-row>
</v-col>
</v-row> -->
</template>
<script>
import { ref, watch } from 'vue'
import {pagecounter, splitname, formatComa, formatDash, checking_for_entry} from '@/utils/universal_functions'
import {pagecounter, splitname, formatComa, formatDash, formaComaTime, checking_for_entry} from '@/utils/universal_functions'
import { axiosApiInstance } from '@/utils/axios-api'
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
@@ -175,9 +128,9 @@ setup(){
const visition = () => {
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
console.log(result.data, 'result.data');
alldata.value = preparedata(result.data)
// console.log(result.data, 'result.data');
//
totalfn()
+1 -1
View File
@@ -25,7 +25,7 @@
<v-btn block class="text-caption" @click="filter='month'">Месяц</v-btn>
<v-btn block class="text-caption" @click="filter='day'">День</v-btn>
<!-- ------------------------------------------------------------------------- -->
<my-helper :pretext="feedback"/>
{{filter}}
</v-col>
</v-row>