Собрать людей
This commit is contained in:
1 parent
1d38024e88
commit
a41123acb8
5 files changed
+124
-48
No files matched your search
BIN
Binary file not shown.
@@ -40,7 +40,7 @@
|
||||
<v-card-title class="statstyle my-2 py-0 text-overline font-weight-bold">
|
||||
{{n.status}}
|
||||
</v-card-title>
|
||||
<v-card-text class="numstyle mt-4 py-0 font-weight-bold">
|
||||
<v-card-text class="numstyle mt-4 py-0 font-weight-bold">
|
||||
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(n.num)' :duration='1'/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<v-list-item v-for="x in onlineuser" v-show=" x!=accountStore.user.login"
|
||||
:key="x"
|
||||
:prepend-avatar="checkremote( `${spravURL}${x}.jpg`)"
|
||||
title="x"
|
||||
nav
|
||||
@click="whatuser(x)">
|
||||
|
||||
<v-dialog
|
||||
v-model="menuGetUserDialog"
|
||||
persistent
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
<v-col class="pt-0">
|
||||
<v-card class="h-100 flex-column">
|
||||
|
||||
<my-helper :pretext = 't_daily'/>
|
||||
<v-row v-for="x in stat" :key="x">
|
||||
|
||||
<v-row v-for="x in t_daily" :key="x">
|
||||
|
||||
<v-col>
|
||||
<v-card
|
||||
@@ -68,10 +68,10 @@
|
||||
|
||||
<v-card class="h-100 text-center g text-numeral bg-back_number_carousel">
|
||||
<v-card-title class="statstyle py-0 text-overline font-weight-bold bg-back_number_carousel">
|
||||
{{x.status}}
|
||||
{{x.position__name}}
|
||||
</v-card-title>
|
||||
<v-card-text class="numstyle mt-2 py-0 font-weight-bold bg-back_number_carousel">
|
||||
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.num)' :duration='2'/>
|
||||
<v-card-text @click="detailRound(x.position)" class="numstyle mt-2 py-0 font-weight-bold pointer bg-back_number_carousel">
|
||||
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.user__count)' :duration='2'/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
@@ -141,7 +141,57 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
<v-dialog
|
||||
v-model="dialogDetailRound"
|
||||
width="auto"
|
||||
>
|
||||
<v-card
|
||||
class="mx-auto"
|
||||
width="450"
|
||||
height="500"
|
||||
>
|
||||
<my-helper :pretext = 't_dailyRound'/>
|
||||
<!-- <v-toolbar color="cyan-lighten-1">
|
||||
<v-btn variant="text" icon="mdi-menu"></v-btn>
|
||||
|
||||
<v-toolbar-title>Inbox</v-toolbar-title>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn variant="text" icon="mdi-magnify"></v-btn>
|
||||
</v-toolbar> -->
|
||||
|
||||
<!-- <v-list
|
||||
:items="items"
|
||||
item-props
|
||||
lines="three"
|
||||
>
|
||||
<template v-slot:subtitle="{ subtitle }">
|
||||
<div v-html="subtitle"></div>
|
||||
</template>
|
||||
</v-list> -->
|
||||
<v-table density="compact">
|
||||
|
||||
<tbody v-for="item in t_dailyRound"
|
||||
:key="item.name">
|
||||
<tr
|
||||
|
||||
>
|
||||
<td>{{ item.department }}</td>
|
||||
|
||||
</tr>
|
||||
<tr v-for="i in item.author" :key="i">
|
||||
|
||||
|
||||
<td >{{ i }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
@@ -156,7 +206,7 @@
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
||||
import NewsListHome from '@/components/news-list-home.vue'
|
||||
import {getfromserver} from '@/utils/universal_functions'
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
@@ -170,6 +220,8 @@
|
||||
setup(){
|
||||
const t_baseCriteria = ref([])
|
||||
const t_daily = ref('')
|
||||
const t_dailyRound = ref('')
|
||||
const dialogDetailRound = ref(false)
|
||||
|
||||
|
||||
|
||||
@@ -184,28 +236,11 @@
|
||||
const model= null
|
||||
const accountStore = useAccountStore()
|
||||
|
||||
|
||||
const stat = [
|
||||
{status:'В инспекции', num:'57', img: "/media/newsimage/default.jpg"},
|
||||
{status:'Работают удаленно', num:'13', img: "/media/newsimage/numbers/vacation.jpg"},
|
||||
{status:'В командировке', num:'3', img: "/media/newsimage/numbers/med.jpg"},
|
||||
{status:'В отпусках', num:'45', img: "/media/newsimage/numbers/vacation.jpg"},
|
||||
{status:'Болеют', num:'1', img: "/media/newsimage/numbers/med.jpg"},
|
||||
|
||||
]
|
||||
// const onlines = [
|
||||
// {status:'Всего', num: 1, img: "/media/newsimage/numbers/calendar.jpg"},
|
||||
// {status:'Сегодня', num: 2, img: "/media/newsimage/numbers/sept.jpg"},
|
||||
// {status:'Уникальных', num: 3, img: "/media/newsimage/numbers/uni.jpg"},
|
||||
// ]
|
||||
const onlines = ref([
|
||||
{status:'Всего', num: appStore.countvisitor.totalvisit, img: "/media/newsimage/numbers/calendar.jpg"},
|
||||
{status:'Сегодня', num: appStore.countvisitor.visittoday, img: "/media/newsimage/numbers/sept.jpg"},
|
||||
{status:'Уникальных', num: appStore.countvisitor.uniqtoday, img: "/media/newsimage/numbers/uni.jpg"},
|
||||
])
|
||||
|
||||
|
||||
|
||||
function proba(){
|
||||
axiosApiInstance.get('api/feedback/feedbackdata/')
|
||||
axiosApiInstance.get('api/feedback/feedbackdata/')
|
||||
.then(data => {
|
||||
t_baseCriteria.value = data.data.results
|
||||
})
|
||||
@@ -214,7 +249,6 @@
|
||||
}
|
||||
|
||||
function dailyfun(){
|
||||
// getfromserver(`api/general_vacation/dailyload/`, t_daily.value)
|
||||
axiosApiInstance.get('api/general_vacation/dailyload/')
|
||||
.then(data => {
|
||||
|
||||
@@ -222,14 +256,25 @@
|
||||
})
|
||||
}
|
||||
|
||||
const detailRound = (pos) => {
|
||||
dialogDetailRound.value=!dialogDetailRound.value
|
||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`)
|
||||
.then(data => {
|
||||
|
||||
t_dailyRound.value = data.data
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
accountStore,
|
||||
stat,
|
||||
model,
|
||||
onlines,
|
||||
appStore,
|
||||
proba,
|
||||
t_daily
|
||||
t_daily,
|
||||
t_dailyRound,
|
||||
detailRound,
|
||||
dialogDetailRound
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+46
-17
@@ -18,6 +18,7 @@ from openpyxl.styles import Font, Alignment, Side, Border, PatternFill
|
||||
from openpyxl.worksheet.formula import ArrayFormula
|
||||
from pandas.api.types import CategoricalDtype
|
||||
import urllib.request
|
||||
from django.db.models import Count
|
||||
|
||||
class GeneralVacationAPIView(APIView):
|
||||
def get(self, request):
|
||||
@@ -270,22 +271,50 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
class DailyloadAPIView(APIView):
|
||||
def get(self, request):
|
||||
daily = DailyRoundUp.objects.filter(todaysDate=datetime.now())
|
||||
position = BasePosition.objects.all()
|
||||
print(position, '-------------')
|
||||
result = []
|
||||
n=1
|
||||
for x in daily:
|
||||
a=model_to_dict(x)
|
||||
# print(x.user, '------------', n)
|
||||
a['user'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.user))
|
||||
# print(x.user, '!!!!!!!!', n)
|
||||
n=n+1
|
||||
result.append(a)
|
||||
# print(a)
|
||||
# print(x.user,'222222222222222222')
|
||||
# user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'id')
|
||||
|
||||
if request.GET.__contains__('id'):
|
||||
print(request.GET.get("id"), '-------------------------------------')
|
||||
|
||||
return Response({"Обход":result})
|
||||
# return Response({"Обход":serializer_for_daily})
|
||||
|
||||
depart = DictEmployee.objects.using('user_directory').values('department')
|
||||
daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=datetime.now()).values('user')
|
||||
result = []
|
||||
|
||||
for x in daily:
|
||||
for z in depart.filter(login=x['user']).distinct():
|
||||
if not z in result:
|
||||
result.append(z)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# for r in result:
|
||||
# r['author'] = [{"author":v.fio} for v in DictEmployee.objects.using('user_directory').filter(login=x['user'], department=r['department'])]
|
||||
# print(user,'---------------------')
|
||||
print(result, '---------------')
|
||||
|
||||
|
||||
# z['author'] = [{v.fio for v in DictEmployee.objects.using('user_directory').filter(login=x['user'], department=z['department'])}]
|
||||
# print(z, '---------------')
|
||||
# result.append(z)
|
||||
# for x in daily:
|
||||
# z['author'] = [v.fio for v in DictEmployee.objects.using('user_directory').filter(login=x['user'], department=z['department'])]
|
||||
# result.append(z)
|
||||
daily = result
|
||||
# for x in daily:
|
||||
# x['user'] = DictEmployee.objects.using('user_directory').filter(login=x['user'])
|
||||
# result.append(x)
|
||||
# print(x,'---------------------------------')
|
||||
|
||||
# print(request.GET.get("id"), '-------------------------------------')
|
||||
|
||||
|
||||
|
||||
# for x in daily:
|
||||
# x['user'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x['user']))
|
||||
# result.append(x)
|
||||
else:
|
||||
daily = DailyRoundUp.objects.values('position__name', 'position').annotate(Count('user'))
|
||||
|
||||
return Response(daily)
|
||||
Reference in new issue
Block a user