Заливка
This commit is contained in:
1 parent
09a192e83e
commit
7d751989ee
20 files changed
+62
-939
No files matched your search
@@ -8,12 +8,12 @@
|
||||
<template v-slot:filling_feedback>
|
||||
|
||||
|
||||
<v-row no-gutters>
|
||||
<v-row no-gutters v-if="top.comment[0].time_create != '1990-01-01'">
|
||||
<v-col lg=5 class="bg-teal-lighten-4 align-self-center">
|
||||
<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 >
|
||||
@@ -31,7 +31,7 @@
|
||||
</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>
|
||||
@@ -66,7 +66,20 @@
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-else
|
||||
|
||||
class="align-center flex-column
|
||||
|
||||
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>
|
||||
</template>
|
||||
</pattern-card-feed>
|
||||
</template>
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
{
|
||||
feedback: {
|
||||
type: Object,
|
||||
default: () => {return {feed:[], last_comment:{time_create:'2024-01-01'}}}
|
||||
default: () => {return {feed:[], last_comment:{time_create:'1990-01-01'}}}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
const dataTopUser = computed({
|
||||
get() {
|
||||
let ob = {}
|
||||
let tuser = {comment:[{time_create:'2024-01-01', comment: ''}], score: 0}
|
||||
let tuser = {comment:[{time_create:'1990-01-01', comment: ''}], score: 0}
|
||||
|
||||
props.feedback.feed.forEach((e) => {
|
||||
|
||||
|
||||
@@ -36,9 +36,6 @@
|
||||
>
|
||||
<v-col >
|
||||
{{val.tooltip}}
|
||||
|
||||
val.user.length - {{val.user.length}}
|
||||
val.previos - {{val.previos}}
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-tooltip>
|
||||
@@ -76,14 +73,15 @@
|
||||
/>
|
||||
|
||||
<span v-if="val.previos!=0">
|
||||
{{parseFloat((val.user.length * 100 /val.previos).toFixed(2))-100}} %
|
||||
|
||||
{{parseFloat(((val.user.length * 100 /val.previos)-100).toFixed(2))}} %
|
||||
</span>
|
||||
<span v-else>
|
||||
0%
|
||||
</span>
|
||||
|
||||
</td>
|
||||
<!-- <td v-if="!val.previos"></td> -->
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
:headers="headers"
|
||||
:items="tabledata"
|
||||
height="400"
|
||||
class=""
|
||||
class="mytable"
|
||||
item-value="name"
|
||||
@update:sortBy=customSort
|
||||
v-model:sort-by="sortBy"
|
||||
density="compact"
|
||||
>
|
||||
<template v-slot:header.name>
|
||||
<!-- <my-helper :pretext="tabledata"/> -->
|
||||
<!-- v-model:sort-by="sortBy" -->
|
||||
<v-switch
|
||||
:label="untot"
|
||||
false-value='уникальные'
|
||||
@@ -273,6 +273,10 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
.mytable tr {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.myleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -54,11 +54,7 @@
|
||||
</tr>
|
||||
</template>
|
||||
<template v-slot:expanded-row="{ columns, item }">
|
||||
<tr>
|
||||
<td :colspan="columns.length">
|
||||
More info about {{ item.name }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td :colspan="columns.length">
|
||||
<v-card class="my-2 elevation-0" color='grey'>
|
||||
|
||||
@@ -364,16 +364,16 @@ export default {
|
||||
ico: 'mdi-newspaper',
|
||||
path: "/news"
|
||||
},
|
||||
{
|
||||
name: 'Безопасность',
|
||||
ico: 'mdi-security',
|
||||
submenu: [
|
||||
{
|
||||
name: 'Пожарная безопасность',
|
||||
path: "/fire_safety"
|
||||
},
|
||||
]
|
||||
},
|
||||
// {
|
||||
// name: 'Безопасность',
|
||||
// ico: 'mdi-security',
|
||||
// submenu: [
|
||||
// {
|
||||
// name: 'Пожарная безопасность',
|
||||
// path: "/fire_safety"
|
||||
// },
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
name: 'О портале',
|
||||
ico: 'mdi-information-variant',
|
||||
|
||||
@@ -56,24 +56,7 @@ export function bgimage(filecheck){
|
||||
export function checkremote(filecheck){
|
||||
|
||||
return process.env.NODE_ENV == 'development'? "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg":filecheck
|
||||
// try{
|
||||
// let http = new XMLHttpRequest();
|
||||
// http.open('HEAD', filecheck, false);
|
||||
// http.send();
|
||||
// console.log(http.status)
|
||||
// return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
|
||||
// }
|
||||
// catch(e){
|
||||
// return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
|
||||
// }
|
||||
// let tmp = new Image
|
||||
// tmp.src=filecheck
|
||||
// if(tmp.complete){
|
||||
// return filecheck
|
||||
// }
|
||||
// else {
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +72,7 @@ export function pagecounter(){
|
||||
const router = useRouter()
|
||||
const accountStore = useAccountStore()
|
||||
const appStore = useAppStore()
|
||||
console.log(router.currentRoute.value.meta, '----роутер страницы--');
|
||||
|
||||
let postdata = {
|
||||
user__id: "user" in accountStore &&"id" in accountStore.user? accountStore.user.id: null,
|
||||
page: router.currentRoute.value.meta.title,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-row v-if="alldata.feedback.last_comment.time_create=='2024-01-01'">
|
||||
<v-row v-if="alldata.feedback.last_comment.time_create=='1990-01-01'">
|
||||
<v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
|
||||
<v-progress-circular
|
||||
:size="150"
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
RatingPage,
|
||||
|
||||
CardTotal,
|
||||
// Feedmodul
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -132,13 +132,13 @@ setup(){
|
||||
|
||||
|
||||
const filterStore = usePortalFilterStore()
|
||||
const alldata =ref({period: [], staff: 0, beforperiod: [], feedback: {criteria: [], feed: [], last_comment:{time_create:'2024-01-01'}}})
|
||||
const alldata =ref({period: [], staff: 0, beforperiod: [], feedback: {criteria: [], feed: [], last_comment:{time_create:'1190-01-01'}}})
|
||||
const visition = () => {
|
||||
|
||||
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
||||
|
||||
alldata.value = preparedata(result.data)
|
||||
//
|
||||
|
||||
totalfn()
|
||||
|
||||
|
||||
@@ -241,258 +241,9 @@ setup(){
|
||||
|
||||
|
||||
}, {deep:true})
|
||||
// const filter = ref('day')
|
||||
// const visiting = ref([])
|
||||
// const feedback = ref([])
|
||||
// const for_formulas = ref({})
|
||||
|
||||
|
||||
// const dataActivusers = ref([])
|
||||
// const dataAttendance = ref({})
|
||||
// const dataIndicators = ref({})
|
||||
// const dataChart = ref({})
|
||||
|
||||
// const unicuser = ref([])
|
||||
|
||||
// const selected_days = ref({today: 'сегодня', year: {start: new Date(), end: new Date()}})
|
||||
// const pages_count = ref({data: {}, title: {}})
|
||||
|
||||
|
||||
pagecounter()
|
||||
|
||||
// const visition = () => {
|
||||
|
||||
// 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
|
||||
// visiting.value = result.data.result
|
||||
// feedback.value = result.data.feedback
|
||||
// dataIndicators.value = result.data.indicators
|
||||
// dataChart.value = result.data.chart,
|
||||
// console.log(result.data, 'result.data');
|
||||
|
||||
// visitionreduce()
|
||||
// funActiveUser()
|
||||
|
||||
// })}
|
||||
|
||||
// visition()
|
||||
|
||||
// const checking_for_entry = (where, what) => {
|
||||
// if (!where.includes(what))
|
||||
// {
|
||||
// where.push(what)
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// const funLineChart = (data, item) => {
|
||||
// if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||
// if (!data[item.visitdate]) {
|
||||
// data[item.visitdate] = {count: 0, unic: []}
|
||||
// }
|
||||
// checking_for_entry(data[item.visitdate]['unic'], splitname(item.author))
|
||||
// data[item.visitdate].count += item.count
|
||||
// }
|
||||
// }
|
||||
|
||||
// const funActiveUser = () => {
|
||||
// dataActivusers.value = []
|
||||
// unicuser.value.map(iduser => {
|
||||
|
||||
// let activuser ={
|
||||
// user: {
|
||||
// id: "",
|
||||
// login: "",
|
||||
// post: "",
|
||||
// fio: ""
|
||||
// },
|
||||
// info: {
|
||||
// count: 0,
|
||||
// session: 0,
|
||||
// pages: 0
|
||||
// },
|
||||
// tooltip: [],
|
||||
// }
|
||||
|
||||
// let yearpages = {}
|
||||
// let pages = []
|
||||
// let user = visiting.value.filter(e => e.author.id == iduser)
|
||||
|
||||
// const groupUser = user.reduce((acc, item) => {
|
||||
// if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||
// funyearpages(yearpages, item)
|
||||
// checking_for_entry(pages, item.pages)
|
||||
// acc['id'] = item.author.id
|
||||
// acc['login'] = item.author.login
|
||||
// acc['post'] = item.author.post
|
||||
// acc['fio'] = splitname(item.author)
|
||||
// acc['count'] += item.count
|
||||
// acc['session'] = Object.keys(yearpages).length
|
||||
// }
|
||||
// return acc
|
||||
// }, {count: 0})
|
||||
|
||||
// let arrbigs = []
|
||||
// pages.map(namepages => {
|
||||
// let onetooltip = {
|
||||
// namepages: "",
|
||||
// count: 0,
|
||||
// unic: 0
|
||||
// }
|
||||
|
||||
// let unicpages = user.filter(e => (e.pages == namepages))
|
||||
|
||||
// const pagesData = unicpages.reduce((accpag, pag) => {
|
||||
// accpag['pages'] = pag.pages
|
||||
// accpag['count'] += pag.count
|
||||
// accpag['unic'] += 1
|
||||
// return accpag
|
||||
// }, {count: 0, unic: 0})
|
||||
|
||||
// onetooltip.namepages = pagesData.pages
|
||||
// onetooltip.count = pagesData.count
|
||||
// onetooltip.unic = pagesData.unic
|
||||
// arrbigs.push(onetooltip)
|
||||
// }
|
||||
// )
|
||||
// activuser.user.id = groupUser.id
|
||||
// activuser.user.login = groupUser.login
|
||||
// activuser.user.post = groupUser.post
|
||||
// activuser.user.fio = groupUser.fio
|
||||
// activuser.info.count = groupUser.count
|
||||
// activuser.info.session = groupUser.session
|
||||
// activuser.info.pages = user.length
|
||||
// activuser.tooltip = arrbigs
|
||||
// dataActivusers.value.push(activuser)
|
||||
// })
|
||||
// }
|
||||
|
||||
// const funyearpages = (data, item) => {
|
||||
// if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||
// if (!data[item.visitdate]) {
|
||||
// data[item.visitdate] = {}
|
||||
// }
|
||||
// if (!data[item.visitdate][item.pages]) {
|
||||
// data[item.visitdate][item.pages] = 0
|
||||
// }
|
||||
|
||||
// data[item.visitdate][item.pages] += item.count
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// const data_collection = (data, obj) => {
|
||||
// let attendance = {
|
||||
// today: {
|
||||
// title: 'сегодня',
|
||||
// user: [],
|
||||
// proc: 0
|
||||
// },
|
||||
// period: {
|
||||
// title: 'за период',
|
||||
// user: [],
|
||||
// proc: 0,
|
||||
// previos: 0
|
||||
// },
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// const groupedData = data.reduce((acc, item) => {
|
||||
|
||||
// if (!acc[item.pages]) {
|
||||
// acc[item.pages] = {
|
||||
// now:
|
||||
// {unique: [], countall: 0},
|
||||
// year:
|
||||
// {unique: [], countall: 0}
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (obj) {
|
||||
// funLineChart(obj, item)
|
||||
// }
|
||||
|
||||
// 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(acc[item.pages].year.unique, splitname(item.author))
|
||||
// acc[item.pages].year.countall += item.count
|
||||
|
||||
// checking_for_entry(attendance.period.user, splitname(item.author))
|
||||
// }
|
||||
|
||||
// if (item.visitdate == formatDash(new Date())) {
|
||||
// // console.log(item, 'item');
|
||||
|
||||
// checking_for_entry(acc[item.pages].now.unique, splitname(item.author))
|
||||
// acc[item.pages].now.countall += item.count
|
||||
|
||||
// checking_for_entry(attendance.today.user, splitname(item.author))
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// return acc
|
||||
// }, {})
|
||||
// let proctoday = (attendance.today.user.length*100)/for_formulas.value.staff
|
||||
// let procperiod = (attendance.period.user.length*100)/for_formulas.value.staff
|
||||
// attendance.today.proc = `${Number.isInteger(proctoday)?proctoday:(proctoday).toFixed(2)}%`
|
||||
// attendance.period.proc = `${Number.isInteger(procperiod)?procperiod:(procperiod).toFixed(2)}%`
|
||||
|
||||
// let previos = (for_formulas.value.previos*100)/attendance.period.user.length
|
||||
// attendance.period.previos = 100- (Number.isInteger(previos)?previos:(previos).toFixed(2))
|
||||
// dataAttendance.value = attendance
|
||||
// // console.log(attendance, 'attendance[splitname(item.author)]')
|
||||
// return groupedData
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// const visitionreduce = () => {
|
||||
|
||||
// let lineCharts = {}
|
||||
|
||||
// unicuser.value = []
|
||||
|
||||
|
||||
// pages_count.value.data= data_collection(visiting.value, lineCharts)
|
||||
|
||||
// // const gruppitovka= () => {
|
||||
// // console.log(visiting.value, 'dataLineChart');
|
||||
// // }
|
||||
// // gruppitovka()
|
||||
|
||||
// Object.entries(lineCharts).map(e=> {
|
||||
// lineCharts[e[0]].crr = dataChart.value[e[0]].crr
|
||||
// lineCharts[e[0]].br = dataChart.value[e[0]].br
|
||||
// lineCharts[e[0]].ppv = dataChart.value[e[0]].ppv
|
||||
// })
|
||||
|
||||
// dataLineChart.value = lineCharts
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// watch(()=>filterStore.date_period,(newValue,oldValue)=>{
|
||||
// if(newValue){
|
||||
// visition()
|
||||
// visitionreduce()
|
||||
// title_period()
|
||||
// }
|
||||
// }, {deep:true})
|
||||
|
||||
|
||||
// const title_period = () => {
|
||||
// selected_days.value.year.start = formatComa(filterStore.date_period.startdate)
|
||||
// selected_days.value.year.end = formatComa(filterStore.date_period.enddate)
|
||||
// pages_count.value.title = selected_days.value
|
||||
// }
|
||||
|
||||
// title_period()
|
||||
console.log(alldata.value.feedback.feed.length, 'alldata.feedback.feed')
|
||||
|
||||
|
||||
return {
|
||||
@@ -500,18 +251,7 @@ console.log(alldata.value.feedback.feed.length, 'alldata.feedback.feed')
|
||||
cardtotal,
|
||||
dataLineChart,
|
||||
filterStore,
|
||||
// visiting,
|
||||
// pages_count,
|
||||
// visitionreduce,
|
||||
// dataLineChart,
|
||||
// dataActivusers,
|
||||
// formatComa,
|
||||
// selected_days,
|
||||
// for_formulas,
|
||||
// dataAttendance,
|
||||
// dataIndicators,
|
||||
// dataChart,
|
||||
// feedback,
|
||||
|
||||
filter: ref('d'),
|
||||
|
||||
|
||||
|
||||
@@ -1,603 +0,0 @@
|
||||
<template>
|
||||
<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/>
|
||||
<v-col lg=3 class="w100">
|
||||
<v-row no-gutters class="h-100 gap">
|
||||
<v-col >
|
||||
<!-- <portal-traffic :traffic=dataAttendance /> -->
|
||||
</v-col>
|
||||
<v-col lg=9>
|
||||
|
||||
<!-- <line-chart :dataLineChart="dataLineChart" :dataChart="dataChart"/> -->
|
||||
</v-col>
|
||||
<v-col >
|
||||
<v-btn block class="text-caption" @click="filter='year'">Год</v-btn>
|
||||
<v-btn block class="text-caption" @click="filter='month'">Месяц</v-btn>
|
||||
<v-btn block class="text-caption" @click="filter='day'">День</v-btn>
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
{{filter}}
|
||||
</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 dataIndicators" :key=x>
|
||||
<!-- -->
|
||||
<card-total :indicator=x />
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
<v-col lg=4 class="d-flex flex-column">
|
||||
<!-- <rating-page :pages_count=pages_count /> -->
|
||||
</v-col>
|
||||
<v-col lg=4 class="d-flex flex-column ">
|
||||
|
||||
<!-- <top-user
|
||||
:activusers = dataActivusers
|
||||
|
||||
/> -->
|
||||
|
||||
</v-col>
|
||||
<v-col lg=2 class="d-flex flex-column">
|
||||
<feedmodul
|
||||
:feedback="feedback"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
import {pagecounter, splitname, formatComa, formatDash} from '@/utils/universal_functions'
|
||||
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
||||
|
||||
import Feedmodul from '@/components/UI/aboutportal/feedmodul.vue'
|
||||
import DateSelect from '@/components/UI/date-select.vue'
|
||||
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||
import LineChart from '@/components/UI/aboutportal/line-chart.vue'
|
||||
import PortalTraffic from '@/components/UI/aboutportal/portal-traffic.vue'
|
||||
import ToolbarFilter from '@/components/UI/aboutportal/toolbar-filter.vue'
|
||||
import RatingPage from '@/components/UI/aboutportal/rating-page.vue'
|
||||
|
||||
import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
||||
// import Feedmodul from '@/components/UI/aboutportal/feedmodul.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Feedmodul,
|
||||
DateSelect,
|
||||
TopUser,
|
||||
LineChart,
|
||||
PortalTraffic,
|
||||
ToolbarFilter,
|
||||
RatingPage,
|
||||
|
||||
CardTotal,
|
||||
// Feedmodul
|
||||
},
|
||||
|
||||
|
||||
setup(){
|
||||
const filterStore = usePortalFilterStore()
|
||||
const filter = ref('day')
|
||||
const visiting = ref([])
|
||||
const feedback = ref([])
|
||||
const for_formulas = ref({})
|
||||
|
||||
const dataLineChart = ref({})
|
||||
const dataActivusers = ref([])
|
||||
const dataAttendance = ref({})
|
||||
const dataIndicators = ref({})
|
||||
const dataChart = ref({})
|
||||
|
||||
const unicuser = ref([])
|
||||
|
||||
const selected_days = ref({today: 'сегодня', year: {start: new Date(), end: new Date()}})
|
||||
const pages_count = ref({data: {}, title: {}})
|
||||
|
||||
|
||||
pagecounter()
|
||||
|
||||
const visition = () => {
|
||||
|
||||
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
|
||||
visiting.value = result.data.result
|
||||
feedback.value = result.data.feedback
|
||||
dataIndicators.value = result.data.indicators
|
||||
dataChart.value = result.data.chart,
|
||||
console.log(result.data, 'result.data');
|
||||
|
||||
visitionreduce()
|
||||
funActiveUser()
|
||||
|
||||
})}
|
||||
|
||||
visition()
|
||||
|
||||
const checking_for_entry = (where, what) => {
|
||||
if (!where.includes(what))
|
||||
{
|
||||
where.push(what)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const funLineChart = (data, item) => {
|
||||
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||
if (!data[item.visitdate]) {
|
||||
data[item.visitdate] = {count: 0, unic: []}
|
||||
}
|
||||
checking_for_entry(data[item.visitdate]['unic'], splitname(item.author))
|
||||
data[item.visitdate].count += item.count
|
||||
}
|
||||
}
|
||||
|
||||
const funActiveUser = () => {
|
||||
dataActivusers.value = []
|
||||
unicuser.value.map(iduser => {
|
||||
|
||||
let activuser ={
|
||||
user: {
|
||||
id: "",
|
||||
login: "",
|
||||
post: "",
|
||||
fio: ""
|
||||
},
|
||||
info: {
|
||||
count: 0,
|
||||
session: 0,
|
||||
pages: 0
|
||||
},
|
||||
tooltip: [],
|
||||
}
|
||||
|
||||
let yearpages = {}
|
||||
let pages = []
|
||||
let user = visiting.value.filter(e => e.author.id == iduser)
|
||||
|
||||
const groupUser = user.reduce((acc, item) => {
|
||||
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||
funyearpages(yearpages, item)
|
||||
checking_for_entry(pages, item.pages)
|
||||
acc['id'] = item.author.id
|
||||
acc['login'] = item.author.login
|
||||
acc['post'] = item.author.post
|
||||
acc['fio'] = splitname(item.author)
|
||||
acc['count'] += item.count
|
||||
acc['session'] = Object.keys(yearpages).length
|
||||
}
|
||||
return acc
|
||||
}, {count: 0})
|
||||
|
||||
let arrbigs = []
|
||||
pages.map(namepages => {
|
||||
let onetooltip = {
|
||||
namepages: "",
|
||||
count: 0,
|
||||
unic: 0
|
||||
}
|
||||
|
||||
let unicpages = user.filter(e => (e.pages == namepages))
|
||||
|
||||
const pagesData = unicpages.reduce((accpag, pag) => {
|
||||
accpag['pages'] = pag.pages
|
||||
accpag['count'] += pag.count
|
||||
accpag['unic'] += 1
|
||||
return accpag
|
||||
}, {count: 0, unic: 0})
|
||||
|
||||
onetooltip.namepages = pagesData.pages
|
||||
onetooltip.count = pagesData.count
|
||||
onetooltip.unic = pagesData.unic
|
||||
arrbigs.push(onetooltip)
|
||||
}
|
||||
)
|
||||
activuser.user.id = groupUser.id
|
||||
activuser.user.login = groupUser.login
|
||||
activuser.user.post = groupUser.post
|
||||
activuser.user.fio = groupUser.fio
|
||||
activuser.info.count = groupUser.count
|
||||
activuser.info.session = groupUser.session
|
||||
activuser.info.pages = user.length
|
||||
activuser.tooltip = arrbigs
|
||||
dataActivusers.value.push(activuser)
|
||||
})
|
||||
}
|
||||
|
||||
const funyearpages = (data, item) => {
|
||||
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
|
||||
if (!data[item.visitdate]) {
|
||||
data[item.visitdate] = {}
|
||||
}
|
||||
if (!data[item.visitdate][item.pages]) {
|
||||
data[item.visitdate][item.pages] = 0
|
||||
}
|
||||
|
||||
data[item.visitdate][item.pages] += item.count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const data_collection = (data, obj) => {
|
||||
let attendance = {
|
||||
today: {
|
||||
title: 'сегодня',
|
||||
user: [],
|
||||
proc: 0
|
||||
},
|
||||
period: {
|
||||
title: 'за период',
|
||||
user: [],
|
||||
proc: 0,
|
||||
previos: 0
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const groupedData = data.reduce((acc, item) => {
|
||||
|
||||
if (!acc[item.pages]) {
|
||||
acc[item.pages] = {
|
||||
now:
|
||||
{unique: [], countall: 0},
|
||||
year:
|
||||
{unique: [], countall: 0}
|
||||
}
|
||||
}
|
||||
|
||||
if (obj) {
|
||||
funLineChart(obj, item)
|
||||
}
|
||||
|
||||
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(acc[item.pages].year.unique, splitname(item.author))
|
||||
acc[item.pages].year.countall += item.count
|
||||
|
||||
checking_for_entry(attendance.period.user, splitname(item.author))
|
||||
}
|
||||
|
||||
if (item.visitdate == formatDash(new Date())) {
|
||||
// console.log(item, 'item');
|
||||
|
||||
checking_for_entry(acc[item.pages].now.unique, splitname(item.author))
|
||||
acc[item.pages].now.countall += item.count
|
||||
|
||||
checking_for_entry(attendance.today.user, splitname(item.author))
|
||||
}
|
||||
|
||||
|
||||
|
||||
return acc
|
||||
}, {})
|
||||
let proctoday = (attendance.today.user.length*100)/for_formulas.value.staff
|
||||
let procperiod = (attendance.period.user.length*100)/for_formulas.value.staff
|
||||
attendance.today.proc = `${Number.isInteger(proctoday)?proctoday:(proctoday).toFixed(2)}%`
|
||||
attendance.period.proc = `${Number.isInteger(procperiod)?procperiod:(procperiod).toFixed(2)}%`
|
||||
|
||||
let previos = (for_formulas.value.previos*100)/attendance.period.user.length
|
||||
attendance.period.previos = 100- (Number.isInteger(previos)?previos:(previos).toFixed(2))
|
||||
dataAttendance.value = attendance
|
||||
// console.log(attendance, 'attendance[splitname(item.author)]')
|
||||
return groupedData
|
||||
}
|
||||
|
||||
|
||||
|
||||
const visitionreduce = () => {
|
||||
|
||||
let lineCharts = {}
|
||||
|
||||
unicuser.value = []
|
||||
|
||||
|
||||
pages_count.value.data= data_collection(visiting.value, lineCharts)
|
||||
|
||||
// const gruppitovka= () => {
|
||||
// console.log(visiting.value, 'dataLineChart');
|
||||
// }
|
||||
// gruppitovka()
|
||||
|
||||
Object.entries(lineCharts).map(e=> {
|
||||
lineCharts[e[0]].crr = dataChart.value[e[0]].crr
|
||||
lineCharts[e[0]].br = dataChart.value[e[0]].br
|
||||
lineCharts[e[0]].ppv = dataChart.value[e[0]].ppv
|
||||
})
|
||||
|
||||
dataLineChart.value = lineCharts
|
||||
|
||||
|
||||
}
|
||||
|
||||
watch(()=>filterStore.date_period,(newValue,oldValue)=>{
|
||||
if(newValue){
|
||||
visition()
|
||||
visitionreduce()
|
||||
title_period()
|
||||
}
|
||||
}, {deep:true})
|
||||
|
||||
|
||||
const title_period = () => {
|
||||
selected_days.value.year.start = formatComa(filterStore.date_period.startdate)
|
||||
selected_days.value.year.end = formatComa(filterStore.date_period.enddate)
|
||||
pages_count.value.title = selected_days.value
|
||||
}
|
||||
|
||||
title_period()
|
||||
|
||||
|
||||
|
||||
return {
|
||||
visiting,
|
||||
pages_count,
|
||||
visitionreduce,
|
||||
dataLineChart,
|
||||
dataActivusers,
|
||||
formatComa,
|
||||
selected_days,
|
||||
for_formulas,
|
||||
dataAttendance,
|
||||
dataIndicators,
|
||||
dataChart,
|
||||
feedback,
|
||||
filter
|
||||
// countgrupp,
|
||||
// activuser,
|
||||
|
||||
// feedback,
|
||||
// traffic,
|
||||
// crit,
|
||||
// visition,
|
||||
|
||||
|
||||
// icons,
|
||||
// periodname,
|
||||
// weekstart,
|
||||
// selected_days,
|
||||
// modelrating,
|
||||
// pages_count
|
||||
|
||||
|
||||
}
|
||||
// const pages_count = ref({})
|
||||
|
||||
// const traffic = ref({
|
||||
// now: {
|
||||
// title: '',
|
||||
// unique: new Set(),
|
||||
// percentage_staff: 0,
|
||||
// comparison_period: new Set(),
|
||||
// percentage_period: 0
|
||||
// },
|
||||
// year: {
|
||||
// title: '',
|
||||
// unique: new Set(),
|
||||
// percentage_staff: 0,
|
||||
// comparison_period: new Set(),
|
||||
// percentage_period: 0
|
||||
// }
|
||||
// })
|
||||
// const crit = ref([])
|
||||
|
||||
// const last_days = ref(new Date())
|
||||
// const previous_period = ref(new Date())
|
||||
// const icons = ['mdi-numeric-1-box-outline', 'mdi-numeric-2-box-outline', 'mdi-numeric-3-box-outline']
|
||||
// const modelrating = ref(false)
|
||||
|
||||
|
||||
|
||||
// const weekstart = () => {
|
||||
|
||||
|
||||
// let days_between = Math.floor((new Date(enddate.value) - new Date(startdate.value)) / (1000*60*60*24))
|
||||
// if (startdate.value == enddate.value) {
|
||||
// days_between = 1
|
||||
// }
|
||||
// previous_period.value = new Date(new Date(startdate.value).setDate(new Date(startdate.value).getDate() - days_between))
|
||||
|
||||
// }
|
||||
|
||||
// const lastperiod = () => {
|
||||
// let last_day = []
|
||||
// visiting.value.map((e)=>{
|
||||
|
||||
// if (e.visitdate < formatDash(enddate.value)) {
|
||||
// last_day.push(e.visitdate)
|
||||
// }
|
||||
|
||||
// })
|
||||
// last_days.value = last_day[last_day.length-1]
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const countgrupp = () => {
|
||||
// let us = {}
|
||||
// let portal_traffic = {
|
||||
// now: {
|
||||
// title: '',
|
||||
// info: '',
|
||||
// unique: new Set(),
|
||||
// percentage_staff: 0,
|
||||
// comparison_period: new Set(),
|
||||
// percentage_period: 0
|
||||
// },
|
||||
// year: {
|
||||
// title: 'За период',
|
||||
// info: '',
|
||||
// unique: new Set(),
|
||||
// percentage_staff: 0,
|
||||
// comparison_period: new Set(),
|
||||
// percentage_period: 0
|
||||
// }
|
||||
// }
|
||||
|
||||
// const groupedData =
|
||||
// visiting.value.reduce((acc, item) => {
|
||||
|
||||
// if (!acc[item.pages]) {
|
||||
// acc[item.pages] = {
|
||||
// now:
|
||||
// {unique: new Set(), countall: 0},
|
||||
// year:
|
||||
// {unique: new Set(), countall: 0}
|
||||
// }
|
||||
// }
|
||||
|
||||
// acc[item.pages].year.unique.add(item.author.id)
|
||||
// acc[item.pages].year.countall += item.count
|
||||
|
||||
// portal_traffic.year.unique.add(item.author.id)
|
||||
|
||||
// if (item.visitdate == formatDash(enddate.value)) {
|
||||
// acc[item.pages].now.unique.add(item.author.id)
|
||||
// acc[item.pages].now.countall += item.count
|
||||
|
||||
// portal_traffic.now.unique.add(item.author.id)
|
||||
// }
|
||||
|
||||
// Посещаемость портала для периода 1 день
|
||||
// if (item.visitdate ==formatDash(last_days.value)){
|
||||
// portal_traffic.now.comparison_period.add(item.author.id)
|
||||
// portal_traffic.now.info = `за ${formatComa(last_days.value)}`
|
||||
// }
|
||||
// portal_traffic.year.info = `с ${formatComa(previous_period.value)} по ${formatComa(startdate.value)} `
|
||||
// console.log( `${formatComa(previous_period.value)} >=${formatComa(item.visitdate)} <= ${formatComa(startdate.value)}`,'до')
|
||||
|
||||
|
||||
// Посещаемость портала для периода - выбранный период фильтра
|
||||
// if (item.visitdate >= formatDash(previous_period.value) && item.visitdate < formatDash(startdate.value)) {
|
||||
// console.log( `${formatComa(previous_period.value)} >=${formatComa(item.visitdate)} < ${formatComa(startdate.value)}`,'после')
|
||||
// console.log(previous_period.value, formatDash(startdate.value), '-------------------------------')
|
||||
// portal_traffic.year.comparison_period.add(item.author.id)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// if (!us[splitname(item.author)])
|
||||
// {
|
||||
// us[splitname(item.author)] = {page: new Set(), login: 0}
|
||||
// }
|
||||
|
||||
// us[splitname(item.author)]['page'].add(item.pages)
|
||||
// us[splitname(item.author)]['login'] = item.author.login
|
||||
|
||||
|
||||
// let arrcount = []
|
||||
// for (let [key,val] of Object.entries(us)) {
|
||||
|
||||
// arrcount.push({fio:key,max:val.page.size, login: val.login})
|
||||
// }
|
||||
// arrcount.sort((a, b) => {
|
||||
|
||||
// return b['max']- a['max']
|
||||
// })
|
||||
|
||||
// crit.value = arrcount.slice(0, 3)
|
||||
|
||||
// return acc
|
||||
// }, {});
|
||||
|
||||
// portal_traffic.now.percentage_staff = percentageStaff(portal_traffic.now.unique, staff.value)
|
||||
// portal_traffic.now.percentage_period = percentageStaff(portal_traffic.now.comparison_period, portal_traffic.now.unique.size)
|
||||
// portal_traffic.year.percentage_staff = percentageStaff(portal_traffic.year.unique, staff.value)
|
||||
// portal_traffic.year.percentage_period = percentageStaff(portal_traffic.year.comparison_period, portal_traffic.year.unique.size)
|
||||
// portal_traffic.now.title = `На ${selected_days.value.today}`
|
||||
|
||||
// pages_count.value = groupedData
|
||||
// traffic.value = portal_traffic
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// const percentageStaff = (customers, delitel) => {
|
||||
// return Math.round((customers.size*100)/delitel)+'%'
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const activuser = () => {
|
||||
|
||||
// const groupedData =
|
||||
// visiting.value.reduce((acc, item) => {
|
||||
|
||||
// if (!acc[splitname(item.author)]) {
|
||||
// acc[splitname(item.author)] = {count: 0, login: '', fio: '', post: '', info: new Set()}
|
||||
// }
|
||||
|
||||
// acc[splitname(item.author)]['fio'] = splitname(item.author)
|
||||
// acc[splitname(item.author)]['info'].add(item.pages)
|
||||
// acc[splitname(item.author)]['login'] = item.author.login
|
||||
// acc[splitname(item.author)]['post'] = item.author.post
|
||||
// acc[splitname(item.author)]['count'] += item.count
|
||||
|
||||
// return acc
|
||||
// }, {})
|
||||
|
||||
|
||||
// const sorted = Object.entries(groupedData)
|
||||
// .sort(([,a],[,b]) => (b.count - a.count))
|
||||
// .reduce((r, [k, v]) =>
|
||||
// ({ ...r, [k]: v } ), {}
|
||||
|
||||
// )
|
||||
|
||||
|
||||
|
||||
|
||||
// return sorted
|
||||
// }
|
||||
|
||||
// visition()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,17 +1,14 @@
|
||||
<template>
|
||||
|
||||
<!-- <v-row>
|
||||
<v-row>
|
||||
|
||||
<v-col
|
||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
F.A.Q.
|
||||
</v-col>
|
||||
</v-row> -->
|
||||
<v-row class="flex-column">
|
||||
<v-col lg=8 class="w100 bg-red">1</v-col>
|
||||
<v-col class="bg-green">2</v-col>
|
||||
</v-row>
|
||||
</v-row>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
// getfromserver("api/fns/links/", carous)
|
||||
|
||||
const carushi = computed(()=> {
|
||||
console.log(window.innerHeight, window.innerHeight-50);
|
||||
|
||||
return window.innerHeight-50
|
||||
|
||||
})
|
||||
|
||||
@@ -141,7 +141,7 @@ function getSafety() {
|
||||
function getResponsibility() {
|
||||
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
|
||||
responsibilityData.value = result.data
|
||||
console.log(responsibilityData.value);
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user