This commit is contained in:
iriska-gri committed 2024-03-13 17:07:38 +03:00
1 parent 688249a328
commit a3c6f359b0
15 files changed
+110 -55

No files matched your search

View File
Whitespace-only changes.
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+7
View File
@@ -0,0 +1,7 @@
from django.apps import AppConfig
class CalendarOfEventsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'calendar_of_events'
verbose_name = 'Календарь событий'
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+8
View File
@@ -0,0 +1,8 @@
from django.urls import path
from rest_framework.routers import DefaultRouter
from .views import *
urlpatterns = [
]
+3
View File
@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.
@@ -99,7 +99,7 @@ export default {
tuser=Object.assign({},puser[puser.length-1])
tuser.fio=splitname(tuser.author)
tuser.score = puser.length
console.log(puser, ' top');
tuser.comment = puser.filter(e=>e.comment.length>0).sort((a,b)=> {return b.id-a.id})
}
@@ -14,12 +14,13 @@
</thead>
<tbody class="text-button">
<!-- -->
<tr
<my-helper :pretext=traffic />
<!-- <tr
v-for="(val, key) in traffic"
:key = key
>
<td style="white-space: nowrap" class="text-left text-caption pr-0 pl-4 font-weight-medium cursor-default">
<!-- -->
<v-tooltip location="top" >
<template v-slot:activator="{ props }">
<span v-bind="props" >
@@ -53,7 +54,6 @@
:key="n"
>
<v-col >
{{n}}
</v-col>
</v-row>
@@ -82,7 +82,7 @@
</td>
</tr>
</tr> -->
</tbody>
</v-table>
</template>
@@ -117,61 +117,88 @@ export default {
const filterStore = usePortalFilterStore()
const traffic = computed({
get() {
let res = {
"today": {
// let res = {
// "today": {
"tooltip": "Уникальные пользователи",
"user": [],
"proc": "",
"ico": "mdi-account-box",
"color" : "indigo"
// "tooltip": "Уникальные пользователи",
// "user": [],
// "proc": "",
// "ico": "mdi-account-box",
// "color" : "indigo"
},
"period": {
// },
// "period": {
"tooltip": "% от штата",
"user": [],
"proc": "",
"ico": "mdi-chart-pie",
"color" : "green"
// "tooltip": "% от штата",
// "user": [],
// "proc": "",
// "ico": "mdi-chart-pie",
// "color" : "green"
}
,
"before": {
// }
// ,
// "before": {
"tooltip":"По сравнению предыдущим периодом",
"user": [],
"proc": "",
"previos": 0,
"ico": "mdi-elevation-rise",
"color" : "pink-darken-4"
}
// "tooltip":"По сравнению предыдущим периодом",
// "user": [],
// "proc": "",
// "previos": 0,
// "ico": "mdi-elevation-rise",
// "color" : "pink-darken-4"
// }
// }
let res = {
"user": {
"tooltip": "Уникальные пользователи",
"today": [],
"period": [],
"ico": "mdi-account-box",
"color" : "indigo"
},
"proc": {
"tooltip": "% от штата",
"today": 0,
"period": 0,
"ico": "mdi-chart-pie",
"color" : "green"
},
"before": {
"tooltip":"По сравнению предыдущим периодом",
"today": "",
"period": 0,
"ico": "mdi-elevation-rise",
"color" : "pink-darken-4"
}
}
props.alldata.period.forEach(e => {
if (e.visitdate == formatDash(new Date())) {
checking_for_entry(res.today.user, splitname(e.user))
checking_for_entry(res.user.today, splitname(e.user))
}
if (new Date(e.visitdate) <= filterStore.date_period.enddate) {
checking_for_entry(res.period.user, splitname(e.user))
checking_for_entry(res.user.period, splitname(e.user))
}
})
res.before.user=res.period.user
res.today.proc = parseFloat(((res.today.user.length * 100) / props.alldata.staff).toFixed(2))
res.period.proc = parseFloat(((res.period.user.length * 100) / props.alldata.staff).toFixed(2))
res.period.tooltip =`% от штата (${props.alldata.staff} сотрудников не конец выбранного периода)`
// res.before.user=res.period.user
res.proc.today = parseFloat(((res.user.today.length * 100) / props.alldata.staff).toFixed(2))
res.proc.period = parseFloat(((res.user.period.length * 100) / props.alldata.staff).toFixed(2))
res.proc.tooltip =`% от штата (${props.alldata.staff} сотрудников не конец выбранного периода)`
let data1 = moment(filterStore.date_period.enddate)
let data2 = moment(filterStore.date_period.startdate)
let between = data1.diff(data2, 'days') + 1
props.alldata.beforperiod.filter( e=> data2.diff(moment(e.visitdate), 'days') < between).reduce((acc, item) => {
res.before.previos += item.user.length
res.before.period += item.user.length
return acc
}, res.before.previos)
}, res.before.period)
return res
}
@@ -191,7 +191,7 @@ export default {
}
const getColorPeriod1 = (pages) => {
console.log(pages, 'ssssssssssssssssssssssssssssssss');
if (pages > 30) return 'text-green'
else if (pages > 15) return 'text-orange'
else return 'text-red'
@@ -204,7 +204,7 @@ export default {
}
const getColorPeriod2 = (pages) => {
console.log(pages, 'ssssssssssssssssssssssssssssssss');
if (pages > 100) return 'text-green'
else if (pages > 50) return 'text-orange'
else return 'text-red'
@@ -64,7 +64,6 @@ 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)
-1
View File
@@ -122,7 +122,6 @@ 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()
+15 -12
View File
@@ -385,8 +385,11 @@ export default {
name: 'Gitt',
ico: 'mdi-github',
link: gittlink()
},
{
name: 'Swagger',
ico: 'mdi-puzzle',
link: 'http://127.0.0.1:8000/swagger/'
}
]
@@ -433,16 +436,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',
+1 -1
View File
@@ -143,7 +143,7 @@ setup(){
})}
console.log(alldata.value.feedback.last_comment,'alldata.feedback.last_comment.time_create');
visition()
const preparedata=(data)=>{
let beforperiod = []
Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB