Заливка
This commit is contained in:
1 parent
09a192e83e
commit
7d751989ee
20 files changed
+62
-939
No files matched your search
@@ -89,8 +89,7 @@ class CustomAuth(ModelBackend):
|
|||||||
homeuser.last_login=user.last_login
|
homeuser.last_login=user.last_login
|
||||||
user.id=homeuser.id
|
user.id=homeuser.id
|
||||||
homeuser.userinfo = user
|
homeuser.userinfo = user
|
||||||
# print("OOOOOOOOOOOOOOOOOOOO")
|
|
||||||
# print(homeuser)
|
|
||||||
return homeuser
|
return homeuser
|
||||||
|
|
||||||
# except Exception as e:
|
# except Exception as e:
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class UserJSONRenderer(JSONRenderer):
|
|||||||
if token is not None and isinstance(token, bytes):
|
if token is not None and isinstance(token, bytes):
|
||||||
# Как говорится выше, декодирует token если он имеет тип bytes.
|
# Как говорится выше, декодирует token если он имеет тип bytes.
|
||||||
data['token'] = token.decode('utf-8')
|
data['token'] = token.decode('utf-8')
|
||||||
# print(data)
|
|
||||||
# Наконец, мы можем отобразить наши данные в простанстве имен 'user'.
|
# Наконец, мы можем отобразить наши данные в простанстве имен 'user'.
|
||||||
return json.dumps({
|
return json.dumps({
|
||||||
'user': data,
|
'user': data,
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class getuserAPIView(APIView):
|
|||||||
dt=datetime.now()
|
dt=datetime.now()
|
||||||
queryset = DictEmployee.objects.get(login=request.query_params.get('userlogin'))
|
queryset = DictEmployee.objects.get(login=request.query_params.get('userlogin'))
|
||||||
r=CardUserSerializer(queryset).data
|
r=CardUserSerializer(queryset).data
|
||||||
print(datetime.now()-dt)
|
|
||||||
|
|
||||||
return Response(CardUserSerializer(queryset).data)
|
return Response(CardUserSerializer(queryset).data)
|
||||||
|
|
||||||
@@ -36,7 +36,6 @@ class FeedbackAPIView(APIView):
|
|||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
comment, created = UserComment.objects.update_or_create(id=request.data['nowcomment']['id'],user_id=self.request.user.id, defaults={'comment':request.data['nowcomment']['comment'], 'time_create':datetime.datetime.now()})
|
comment, created = UserComment.objects.update_or_create(id=request.data['nowcomment']['id'],user_id=self.request.user.id, defaults={'comment':request.data['nowcomment']['comment'], 'time_create':datetime.datetime.now()})
|
||||||
print(request.data['nowrating'], '--------------------------------------')
|
|
||||||
for x in request.data['nowrating']:
|
for x in request.data['nowrating']:
|
||||||
RatingStatus.objects.update_or_create(id=x['id'], defaults={'rating':x['rating'], 'crit_id':x['crit'], 'usercom_id':comment.id})
|
RatingStatus.objects.update_or_create(id=x['id'], defaults={'rating':x['rating'], 'crit_id':x['crit'], 'usercom_id':comment.id})
|
||||||
return Response({})
|
return Response({})
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
<template v-slot:filling_feedback>
|
<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">
|
<v-col lg=5 class="bg-teal-lighten-4 align-self-center">
|
||||||
<list-user :author= "top.author" :from_which="'top_comment'"/>
|
<list-user :author= "top.author" :from_which="'top_comment'"/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="align-self-center pl-0">
|
<v-col class="align-self-center pl-0">
|
||||||
|
|
||||||
<v-table density="compact" class="pa-0">
|
<v-table density="compact" class="pa-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr >
|
<tr >
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<v-card max-width='400' density="compact" class="bg-transparent">
|
<v-card max-width='400' density="compact" class="bg-transparent">
|
||||||
<v-card-text class="pb-0">Оставлено комментариев</v-card-text>
|
<v-card-text class="pb-0">Оставлено комментариев</v-card-text>
|
||||||
|
|
||||||
|
|
||||||
<v-card-subtitle>Последний комментарий оставлен {{formaComaTime(top.comment[0].time_create)}}</v-card-subtitle>
|
<v-card-subtitle>Последний комментарий оставлен {{formaComaTime(top.comment[0].time_create)}}</v-card-subtitle>
|
||||||
<v-card-title>{{top.comment[0].comment}}</v-card-title>
|
<v-card-title>{{top.comment[0].comment}}</v-card-title>
|
||||||
@@ -66,7 +66,20 @@
|
|||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</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>
|
</template>
|
||||||
</pattern-card-feed>
|
</pattern-card-feed>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export default {
|
|||||||
{
|
{
|
||||||
feedback: {
|
feedback: {
|
||||||
type: Object,
|
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({
|
const dataTopUser = computed({
|
||||||
get() {
|
get() {
|
||||||
let ob = {}
|
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) => {
|
props.feedback.feed.forEach((e) => {
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,6 @@
|
|||||||
>
|
>
|
||||||
<v-col >
|
<v-col >
|
||||||
{{val.tooltip}}
|
{{val.tooltip}}
|
||||||
|
|
||||||
val.user.length - {{val.user.length}}
|
|
||||||
val.previos - {{val.previos}}
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
@@ -76,14 +73,15 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<span v-if="val.previos!=0">
|
<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>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
0%
|
0%
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<!-- <td v-if="!val.previos"></td> -->
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</v-table>
|
</v-table>
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
:headers="headers"
|
:headers="headers"
|
||||||
:items="tabledata"
|
:items="tabledata"
|
||||||
height="400"
|
height="400"
|
||||||
class=""
|
class="mytable"
|
||||||
item-value="name"
|
item-value="name"
|
||||||
@update:sortBy=customSort
|
@update:sortBy=customSort
|
||||||
v-model:sort-by="sortBy"
|
v-model:sort-by="sortBy"
|
||||||
density="compact"
|
density="compact"
|
||||||
>
|
>
|
||||||
<template v-slot:header.name>
|
<template v-slot:header.name>
|
||||||
<!-- <my-helper :pretext="tabledata"/> -->
|
<!-- v-model:sort-by="sortBy" -->
|
||||||
<v-switch
|
<v-switch
|
||||||
:label="untot"
|
:label="untot"
|
||||||
false-value='уникальные'
|
false-value='уникальные'
|
||||||
@@ -273,6 +273,10 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mytable tr {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.myleft {
|
.myleft {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,11 +54,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:expanded-row="{ columns, item }">
|
<template v-slot:expanded-row="{ columns, item }">
|
||||||
<tr>
|
|
||||||
<td :colspan="columns.length">
|
|
||||||
More info about {{ item.name }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td :colspan="columns.length">
|
<td :colspan="columns.length">
|
||||||
<v-card class="my-2 elevation-0" color='grey'>
|
<v-card class="my-2 elevation-0" color='grey'>
|
||||||
|
|||||||
@@ -364,16 +364,16 @@ export default {
|
|||||||
ico: 'mdi-newspaper',
|
ico: 'mdi-newspaper',
|
||||||
path: "/news"
|
path: "/news"
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: 'Безопасность',
|
// name: 'Безопасность',
|
||||||
ico: 'mdi-security',
|
// ico: 'mdi-security',
|
||||||
submenu: [
|
// submenu: [
|
||||||
{
|
// {
|
||||||
name: 'Пожарная безопасность',
|
// name: 'Пожарная безопасность',
|
||||||
path: "/fire_safety"
|
// path: "/fire_safety"
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: 'О портале',
|
name: 'О портале',
|
||||||
ico: 'mdi-information-variant',
|
ico: 'mdi-information-variant',
|
||||||
|
|||||||
@@ -56,24 +56,7 @@ export function bgimage(filecheck){
|
|||||||
export function checkremote(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
|
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 router = useRouter()
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
console.log(router.currentRoute.value.meta, '----роутер страницы--');
|
|
||||||
let postdata = {
|
let postdata = {
|
||||||
user__id: "user" in accountStore &&"id" in accountStore.user? accountStore.user.id: null,
|
user__id: "user" in accountStore &&"id" in accountStore.user? accountStore.user.id: null,
|
||||||
page: router.currentRoute.value.meta.title,
|
page: router.currentRoute.value.meta.title,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
|
||||||
<v-progress-circular
|
<v-progress-circular
|
||||||
:size="150"
|
:size="150"
|
||||||
@@ -96,7 +96,7 @@ export default {
|
|||||||
RatingPage,
|
RatingPage,
|
||||||
|
|
||||||
CardTotal,
|
CardTotal,
|
||||||
// Feedmodul
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@@ -132,13 +132,13 @@ setup(){
|
|||||||
|
|
||||||
|
|
||||||
const filterStore = usePortalFilterStore()
|
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 = () => {
|
const visition = () => {
|
||||||
|
|
||||||
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
||||||
|
|
||||||
alldata.value = preparedata(result.data)
|
alldata.value = preparedata(result.data)
|
||||||
//
|
|
||||||
totalfn()
|
totalfn()
|
||||||
|
|
||||||
|
|
||||||
@@ -241,258 +241,9 @@ setup(){
|
|||||||
|
|
||||||
|
|
||||||
}, {deep:true})
|
}, {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()
|
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 {
|
return {
|
||||||
@@ -500,18 +251,7 @@ console.log(alldata.value.feedback.feed.length, 'alldata.feedback.feed')
|
|||||||
cardtotal,
|
cardtotal,
|
||||||
dataLineChart,
|
dataLineChart,
|
||||||
filterStore,
|
filterStore,
|
||||||
// visiting,
|
|
||||||
// pages_count,
|
|
||||||
// visitionreduce,
|
|
||||||
// dataLineChart,
|
|
||||||
// dataActivusers,
|
|
||||||
// formatComa,
|
|
||||||
// selected_days,
|
|
||||||
// for_formulas,
|
|
||||||
// dataAttendance,
|
|
||||||
// dataIndicators,
|
|
||||||
// dataChart,
|
|
||||||
// feedback,
|
|
||||||
filter: ref('d'),
|
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>
|
<template>
|
||||||
|
|
||||||
<!-- <v-row>
|
<v-row>
|
||||||
|
|
||||||
<v-col
|
<v-col
|
||||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||||
>
|
>
|
||||||
F.A.Q.
|
F.A.Q.
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row> -->
|
</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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
// getfromserver("api/fns/links/", carous)
|
// getfromserver("api/fns/links/", carous)
|
||||||
|
|
||||||
const carushi = computed(()=> {
|
const carushi = computed(()=> {
|
||||||
console.log(window.innerHeight, window.innerHeight-50);
|
|
||||||
return window.innerHeight-50
|
return window.innerHeight-50
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ function getSafety() {
|
|||||||
function getResponsibility() {
|
function getResponsibility() {
|
||||||
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
|
axiosApiInstance.get(`api/safety/committee_files/`).then(result => {
|
||||||
responsibilityData.value = result.data
|
responsibilityData.value = result.data
|
||||||
console.log(responsibilityData.value);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ from .serializers import *
|
|||||||
class CaorusAPIView(ListAPIView):
|
class CaorusAPIView(ListAPIView):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
queryset = Carousels.objects.using('add_base').all().order_by('order')
|
queryset = Carousels.objects.using('add_base').all().order_by('order')
|
||||||
print(queryset, '----------------queryset')
|
|
||||||
return Response(CarouselsSerializer(queryset, many=True).data)
|
return Response(CarouselsSerializer(queryset, many=True).data)
|
||||||
@@ -77,7 +77,6 @@ class NewsSerializer(serializers.ModelSerializer):
|
|||||||
return CommentNewsSerializer(obj.get_comment_news.all(), many=True).data
|
return CommentNewsSerializer(obj.get_comment_news.all(), many=True).data
|
||||||
|
|
||||||
def get_gallery(self, obj):
|
def get_gallery(self, obj):
|
||||||
# print(obj.get_gallery.all(), '---------------------')
|
|
||||||
# return 'gal'
|
# return 'gal'
|
||||||
return GallerySerializer(obj.get_gallery_news.all(), many=True).data
|
return GallerySerializer(obj.get_gallery_news.all(), many=True).data
|
||||||
|
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ class NewsAPIView(ListAPIView):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
if request.GET.__contains__('id'):
|
if request.GET.__contains__('id'):
|
||||||
print('Получена одна новость по ид')
|
|
||||||
newsqueryset = News.objects.filter(pk=int(request.GET.get('id')))
|
newsqueryset = News.objects.filter(pk=int(request.GET.get('id')))
|
||||||
allnews = 1
|
allnews = 1
|
||||||
else:
|
else:
|
||||||
print('Получены все новости по ид')
|
|
||||||
newsqueryset = News.objects.all().order_by('-cdate')
|
newsqueryset = News.objects.all().order_by('-cdate')
|
||||||
allnews =newsqueryset.count()
|
allnews =newsqueryset.count()
|
||||||
|
|
||||||
@@ -100,18 +100,18 @@ class NewsCrossroadAPIView(ListAPIView):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
if request.GET.__contains__('id'):
|
if request.GET.__contains__('id'):
|
||||||
print('Получена одна новость по ид')
|
|
||||||
newsqueryset = News.objects.filter(pk=int(request.GET.get('id')))
|
newsqueryset = News.objects.filter(pk=int(request.GET.get('id')))
|
||||||
countpage= 0
|
countpage= 0
|
||||||
else:
|
else:
|
||||||
print('Получены все новости по ид')
|
|
||||||
newsqueryset = News.objects.all().order_by('-cdate')
|
newsqueryset = News.objects.all().order_by('-cdate')
|
||||||
countpage = newsqueryset.count()
|
countpage = newsqueryset.count()
|
||||||
if request.GET.get("name") == "/":
|
if request.GET.get("name") == "/":
|
||||||
print('Запрос на новости для главной страницы')
|
|
||||||
newsqueryset = newsqueryset[:10]
|
newsqueryset = newsqueryset[:10]
|
||||||
else:
|
else:
|
||||||
print('Запрос на новости с пагинацией')
|
|
||||||
|
|
||||||
pagesel = int(request.GET.get("page"))*int(request.GET.get("countpage"))
|
pagesel = int(request.GET.get("page"))*int(request.GET.get("countpage"))
|
||||||
|
|
||||||
|
|||||||
@@ -70,17 +70,17 @@ class TestwatcherAPIView(ListAPIView):
|
|||||||
data_end = datetime.strptime(request.GET.get("end"), "%Y-%m-%d").date()
|
data_end = datetime.strptime(request.GET.get("end"), "%Y-%m-%d").date()
|
||||||
data_rating = data_end + timedelta(days=1)
|
data_rating = data_end + timedelta(days=1)
|
||||||
beetween = data_end - (data_start - timedelta(days=1))
|
beetween = data_end - (data_start - timedelta(days=1))
|
||||||
print(beetween, 'beetween')
|
|
||||||
#
|
#
|
||||||
res = CountVisitor.objects.filter(visitdate__lt = request.GET.get("start"), visitdate__gte=data_start - beetween*2).distinct().values('visitdate','user__user_id')
|
res = CountVisitor.objects.filter(visitdate__lt = request.GET.get("start"), visitdate__gte=data_start - beetween*2).distinct().values('visitdate','user__user_id')
|
||||||
# .annotate(total=Count('user', distinct=True)).order_by('visitdate')
|
# .annotate(total=Count('user', distinct=True)).order_by('visitdate')
|
||||||
per = CountVisitor.objects.filter(Q(visitdate__lte = request.GET.get("end"), visitdate__gte =request.GET.get("start")) | Q(visitdate=date.today()))
|
per = CountVisitor.objects.filter(Q(visitdate__lte = request.GET.get("end"), visitdate__gte =request.GET.get("start")) | Q(visitdate=date.today()))
|
||||||
# print( DictEmployee.objects.filter(Q(deleteddate__isnull= True) | Q(deleteddate__gte = request.GET.get("end"))).count())
|
|
||||||
# Обратная связь
|
# Обратная связь
|
||||||
feed = UserComment.objects.all()
|
feed = UserComment.objects.all()
|
||||||
rating = RatingStatus.objects.values('crit__name', 'crit__ico', 'crit__color', 'rating').filter(usercom__time_create__range=[request.GET.get("start"), data_rating])
|
rating = RatingStatus.objects.values('crit__name', 'crit__ico', 'crit__color', 'rating').filter(usercom__time_create__range=[request.GET.get("start"), data_rating])
|
||||||
|
|
||||||
print(feed, ' -------------------------rating')
|
|
||||||
d = feed.filter(time_create__range=[request.GET.get("start"), data_rating])
|
d = feed.filter(time_create__range=[request.GET.get("start"), data_rating])
|
||||||
return Response({
|
return Response({
|
||||||
'beforperiod': res,
|
'beforperiod': res,
|
||||||
|
|||||||
Reference in new issue
Block a user