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