Merge branch 'razrab'

This commit is contained in:
iriska-gri committed 2023-10-31 14:51:44 +03:00
commit db15c6e26c
20 files changed
+317 -86

No files matched your search

BIN
View File
Binary file not shown.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "front",
"version": "0.0.21",
"version": "0.0.22",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "front",
"version": "0.0.21",
"version": "0.0.22",
"dependencies": {
"@fullcalendar/core": "^6.1.8",
"@fullcalendar/daygrid": "^6.1.8",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "front",
"version": "0.0.21",
"version": "0.0.22",
"scripts": {
"dev": "vite",
"build": "vite build",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 KiB

After

Width:  |  Height:  |  Size: 490 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

+4 -2
View File
@@ -8,13 +8,14 @@
<v-btn
v-bind="props"
append-icon="mdi-login"
color="black_and_white"
>
<template v-slot:prepend>
<v-icon color="white"></v-icon>
<v-icon color="black_and_white"></v-icon>
</template>
Войти
<template v-slot:append>
<v-icon color="white"/>
<v-icon color="black_and_white"/>
</template>
</v-btn>
</template>
@@ -29,6 +30,7 @@
<v-col cols="12" class="py-0">
<v-text-field
v-model="anon.username"
color="black_and_white"
label="Логин"
variant="underlined"
:error-messages="errorer('username')"
+1 -1
View File
@@ -31,7 +31,7 @@
hover
half-increments
color="stars"
color="yellow"
/>
</v-col>
<v-divider/>
+2 -4
View File
@@ -90,15 +90,13 @@ export default {
setup() {
const burl = baseURL.slice(0,-1)
const carous=ref([{link: ""}])
const imageSrcgrupp=computed(()=> {
return new URL(`@/assets/mc.png`, import.meta.url).href;
})
getfromserver("api/navigation/carousels/", carous)
return { burl, carous, imageSrcgrupp}
return { burl, carous}
}
}
@@ -36,7 +36,7 @@
cover
class="text-white"
> -->
<v-card class="h-100 text-center g text-numeral">
<v-card class="h-100 text-center g text-black_grey">
<v-card-title class="statstyle my-2 py-0 text-overline font-weight-bold">
{{n.status}}
</v-card-title>
Whitespace-only changes.
+106
View File
@@ -0,0 +1,106 @@
<template>
<v-row class="justify-center">
<v-col cols="12"
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
>
<v-btn
class="mr-2"
color="modal_btn"
@click="excelOp"
>
Скачать
</v-btn>
<!-- <v-spacer></v-spacer> -->
<v-file-input
:rules="[val => (!!val && val.length > 0) || 'Добавьте файл']"
accept=".xlsx"
v-model="dailyfiles"
variant="underlined"
density="compact"
label="Выберите файл"
class="mr-2"></v-file-input>
<!-- <v-spacer></v-spacer> -->
<v-btn
color="modal_btn"
@click="onPickFile">
Загрузить
</v-btn>
</v-col>
</v-row>
</template>
<script>
import { ref } from 'vue'
import { baseURL } from '@/utils/axios-api'
import {getfromserver} from '@/utils/universal_functions'
import { axiosApiInstance } from '@/utils/axios-api'
export default {
setup(){
const dailyfiles = ref('')
const visiting = ref({})
const info = ref({})
const t_dailyRound = ref('')
const excelOp = () => {
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
let link = document.createElement("a")
link.href = baseURL+result.data.path
link.click()
link.remove()
})
}
const onPickFile = () => {
const sdata = new FormData()
sdata.append('dailyfiles', dailyfiles.value[0])
axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => {
info.value = result.data
console.log(result.data, '----------------')
})
showInfo.value = true
dailyfiles.value = ''
}
const detailRound = () => {
axiosApiInstance.get(`api/general_vacation/dailyload/?id=6`)
.then(data => {
console.log(data.data);
t_dailyRound.value = data.data
})
}
const showInfo = ref(false)
return {
visiting,
excelOp,
baseURL,
dailyfiles,
onPickFile,
info,
detailRound,
t_dailyRound,
showInfo
}
}
}
</script>
<style>
</style>
+1 -1
View File
@@ -100,7 +100,7 @@
<v-alert
color="bg_comments"
color="bg_white"
rounded=0
:border="accountStore.user.login==y.author.login?'end':'start'"
:border-color="accountStore.user.login==y.author.login?'success':'deep-purple accent-4'"
@@ -10,11 +10,13 @@
<v-icon
v-if="accountStore.cod2user"
class="px-3"
size="20"
size="20"
color="black_and_white"
:icon="rail ? 'mdi-chevron-right' : 'mdi-chevron-left'"
@click="rail = !rail" />
<v-card
class="bg-transparent py"
class="bg-transparent py"
color="black_and_white"
density="compact"
:prepend-avatar="imageSrc"
title="Портал МИ ФНС по ЦОД № 2"
@@ -28,6 +30,7 @@
<template v-if="accountStore.cod2user">
<v-card
class="bg-transparent"
color="black_and_white"
density="compact"
:prepend-avatar="accountStore.user.photo"
:title="accountStore.user.fio"
@@ -48,6 +51,7 @@
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn
color="black_and_white"
v-bind="props"
dark to="/faq"
icon="mdi-comment-question-outline" />
@@ -61,11 +65,12 @@
<template v-slot:activator="{ props }">
<v-btn
color="black_and_white"
v-bind="props"
dark icon="mdi-thumb-up-outline" />
</template>
<Card-like
:LikeDialog="LikeDialog"
@menusClose="LikeDialog = false" />
@@ -79,9 +84,9 @@
mdi-lightbulb-outline
</v-icon>
</v-btn>
<v-btn dark icon="mdi-magnify" />
<v-btn dark icon="mdi-account-multiple-outline" @click="drawer_right = !drawer_right" />
<v-btn dark icon="mdi-logout" @click="accountStore.logout" />
<v-btn color="black_and_white" icon="mdi-magnify" />
<v-btn color="black_and_white" icon="mdi-account-multiple-outline" @click="drawer_right = !drawer_right" />
<v-btn color="black_and_white" icon="mdi-logout" @click="accountStore.logout" />
</template>
@@ -184,7 +189,7 @@
<v-list class=" d-flex flex-column ">
<v-list-item v-if="!rail" class="text-caption font-weight-bold text-truncate">
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
<p>Посещений всего:{{ appStore.countvisitor.totalvisit }}</p>
<v-divider />
<p>Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
<v-divider />
@@ -198,7 +203,7 @@
v-model="showTooltip"
location="top">
<template v-slot:activator="{ props }">
<v-icon v-bind="props" color="eye_icon">
<v-icon v-bind="props" color="grey">
mdi-account-eye
</v-icon>
</template>
@@ -324,6 +329,7 @@ export default {
const LikeDialog = ref(false)
const rail = ref(false)
const showTooltip = ref(false)
const menuTruncated = (menus) => {
return menus.slice(0,2).toUpperCase()
+10 -10
View File
@@ -20,16 +20,16 @@ export default createVuetify({
cards: '#F5F5F5',
text_carous: '#242424',
navigation: '#004D40', // Цвет текста и иконок в левом навигационном меню
numeral: '#3C3C3C', // Цвет для карусели с цифрами в работе
black_grey: '#3C3C3C', // Цвет для карусели с цифрами в работе
modal_btn: '#1E88E5', // Цвет для кнопок в модальных окнах
eye_icon: '#7A7A7A', // Цвет иконки для отображения количества посещений
stars: '#F9A825', // Цвет для звездочек в обратной связи
grey: '#7A7A7A', // Цвет иконки для отображения количества посещений
yellow: '#F9A825', // Цвет для звездочек в обратной связи
more_details_btn: '#01579B', // Цвет для кнопки перехода "подробнее"
loading_avatar: '#37474F', // Цвет поля прогрузки аватара пользователя
bg_comments: '#FFFFFF', // Цвет заднего фона для комментариев
bg_white: '#FFFFFF', // Цвет заднего фона для комментариев
delete_btn: '#546E7A', // Цвет для кнопки удаления
app_bar: '#004D40', // Цвет для навигационной (аппбар) панели
back_number_carousel: '#FFFFFF',
black_and_white: '#FFFFFF',
},
},
dark: {
@@ -42,16 +42,16 @@ export default createVuetify({
cards: '#F5F5F5',
text_carous: '#242424',
navigation: '#FDF5E6',
numeral: '#3C3C3C',
black_grey: '#3C3C3C',
modal_btn: '#1E88E5',
eye_icon: '#7A7A7A',
stars: '#F9A825',
grey: '#7A7A7A',
yellow: '#F9A825',
more_details_btn: '#01579B',
loading_avatar: '#37474F',
bg_comments: '#FFFFFF',
bg_white: '#FFFFFF',
delete_btn: '#546E7A',
app_bar: '#212121',
back_number_carousel: '#101311',
black_and_white: '#101311',
},
},
options: {
+3 -1
View File
@@ -24,7 +24,9 @@ export function getfromserver(path, reactive){
}
}
export function bgimage(filecheck){
return new URL(`@assets/bg-for-number-carousel.png`, import.meta.url).href
}
export function checkremote(filecheck){
+117 -23
View File
@@ -66,23 +66,73 @@
>
<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">
<v-card class="h-100 text-center g text-black_grey bg-black_and_white">
<v-card-title class="statstyle py-0 text-overline font-weight-bold bg-black_and_white">
{{x.position__name}}
</v-card-title>
<v-card-text @click="detailRound(x.position)" class="numstyle mt-2 py-0 font-weight-bold pointer bg-back_number_carousel">
<v-card-text @click="detailRound(x.position)" class="numstyle mt-2 py-0 font-weight-bold pointer bg-black_and_white">
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.user__count)' :duration='2'/>
</v-card-text>
</v-card>
<!-- </v-img> -->
<!-- </v-img> :image="imageLenta" :prepend-avatar="imageLenta" -->
</v-card>
</v-col>
<v-divider/>
</v-row>
</v-card>
<v-card v-else class="h-100 d-flex justify-center bgWithoutNum">
<p class="align-self-center text-h5 text-center">Данные по сотрудникам не загружены</p>
<v-card
v-else class="h-100 d-flex justify-center"
:image="imageLenta"
>
<p class="align-self-center text-h5 text-center">
<v-row justify="center">
<v-dialog
v-model="dialoground"
persistent
width="500"
>
<template v-slot:activator="{ props }">
<v-btn
color="teal-darken-2"
v-bind="props"
>
Загрузить
</v-btn>
</template>
<v-card>
<v-card-title>
<span class="text-h5">Загрузить файл</span>
</v-card-title>
<v-card-text>
<v-container>
<load-round/>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="blue-darken-1"
variant="text"
@click="dialoground = false"
>
Закрыть
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
<!-- Данные по сотрудникам не загружены -->
<!-- <v-btn icon="mdi-calendar" size="x-large"></v-btn> -->
</p>
</v-card>
</v-col>
</v-row>
@@ -107,7 +157,7 @@
</v-btn>
</v-col>
</v-row>
<my-helper :pretext="t_daily.length"/>
</v-card>
</v-col>
</v-row>
@@ -160,14 +210,16 @@
<v-card-title class="fixed-bar bg-white">
<v-toolbar class="bg-teal-lighten-2 ">
<!-- <my-helper :pretext="t_dailyRound"/> -->
<v-row class="ma-0">
<v-col class="pa-3 align-self-center">
<v-toolbar-title>{{t_dailyRound.position}}</v-toolbar-title>
</v-col>
<v-col lg=7 class="pa-0"> <v-textarea
v-model="searchname"
append-inner-icon="mdi-magnify"
clearable
prepend-inner-icon="mdi-magnify"
hide-details
class="mx-2"
label="Поиск"
@@ -183,7 +235,7 @@
</v-toolbar>
</v-card-title>
{{ searchname}}
<div
@@ -204,6 +256,7 @@
:title="item.fio"
:subtitle="item.post"
variant="text"
@click="getcard(item.login)"
>
</v-card>
@@ -216,12 +269,21 @@
</v-dialog>
<v-dialog
v-model="menuGetUserDialog"
persistent width="800">
<Card-users
:menuGetUserDialog="menuGetUserDialog"
:loging="iduser"
@menusClose="menuGetUserDialog = false" />
</v-dialog>
</div>
</v-container>
</template>
<script>
import { ref, onMounted,watch } from 'vue'
import { ref, onMounted,watch, computed } from 'vue'
import {useAppStore} from '@/store/app'
import {useAccountStore} from '@/store/AccountStore'
import {pagecounter} from '@/utils/universal_functions'
@@ -232,8 +294,9 @@
import CalendarFull from '@/components/UI/Calendar-full.vue'
import NewsListHome from '@/components/news-list-home.vue'
import { spravURL } from '@/utils/axios-api'
import {checkremote} from '@/utils/universal_functions'
import {checkremote, bgimage} from '@/utils/universal_functions'
import CardUsers from '@/components/cardUsers.vue'
import LoadRound from '@/components/load-round.vue'
export default {
components: {
@@ -241,7 +304,9 @@ import {checkremote} from '@/utils/universal_functions'
CarouselList,
CarouselNumbers,
CalendarFull,
NewsListHome
NewsListHome,
CardUsers,
LoadRound
},
setup(){
@@ -251,6 +316,9 @@ import {checkremote} from '@/utils/universal_functions'
const dialogDetailRound = ref(false)
const searchname = ref('')
const idpos = ref('')
const menuGetUserDialog = ref(false)
const iduser = ref('')
const dialoground = ref(false)
@@ -266,13 +334,23 @@ import {checkremote} from '@/utils/universal_functions'
const accountStore = useAccountStore()
watch(()=> searchname.value,(newValue,oldValue)=>{
console.log(newValue,'newValue', oldValue,'oldValue');
if(newValue){
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${idpos.value}&searchname=${newValue}`)
.then(data => {
console.log(newValue);
// t_daily.value = data.data.daily
console.log(data.data);
t_dailyRound.value = data.data
})
}
else {
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${idpos.value}`)
.then(data => {
console.log(data.data, '-----------------');
t_dailyRound.value = data.data
})
}
}, {deep:true})
@@ -286,11 +364,15 @@ import {checkremote} from '@/utils/universal_functions'
}
function dailyfun(){
axiosApiInstance.get('api/general_vacation/dailyload/')
// if (t_daily.value.length>0){
axiosApiInstance.get('api/general_vacation/dailyload/')
.then(data => {
// console.log();
t_daily.value = data.data.daily
})
// }
}
const detailRound = (pos) => {
@@ -303,6 +385,14 @@ import {checkremote} from '@/utils/universal_functions'
})
}
const getcard = async (idus) => {
menuGetUserDialog.value = true
iduser.value = idus
}
const imageLenta=computed(()=> {
return new URL(`/src/assets/bg-for-number-carousel.png`, import.meta.url).href;
})
return {
accountStore,
@@ -314,8 +404,15 @@ import {checkremote} from '@/utils/universal_functions'
detailRound,
dialogDetailRound,
checkremote,
bgimage,
spravURL,
searchname
searchname,
menuGetUserDialog,
getcard,
iduser,
imageLenta,
dialoground
}
}
}
@@ -344,10 +441,7 @@ import {checkremote} from '@/utils/universal_functions'
overflow: auto;
}
.bgWithoutNum {
background: url("/src/assets/bg-for-number-carousel.png");
opacity: 0.7;
}
.fixed-bar {
position: sticky;
+35 -9
View File
@@ -1,14 +1,23 @@
<template>
<v-row class="justify-center">
<v-col cols="6"
<v-container class="my-auto">
<v-row justify="center">
<!-- <v-alert
class="d-flex align-self-center"
v-model="showInfo"
:border="'start'"
variant="tonal"
type="info"
max-width="max-content"
closable>{{ info.mess }}
</v-alert> -->
<!-- v-if="!showInfo" -->
<v-col cols="7"
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
>
{{t_dailyRound}}
<v-btn @click="detailRound">
Тык
<v-btn class="mr-2" @click="detailRound">
Уточнение
</v-btn>
<v-btn
@@ -39,7 +48,20 @@
</v-col>
</v-row>
<v-row justify="center">
<v-col cols="2">
<v-alert
v-model="showInfo"
:border="'start'"
variant="tonal"
type="info"
width="max-content"
closable>
{{ info.mess }}
</v-alert>
</v-col>
</v-row>
</v-container>
</template>
<script>
@@ -72,7 +94,8 @@ export default {
info.value = result.data
console.log(result.data, '----------------')
})
showInfo.value = true
dailyfiles.value = ''
}
@@ -88,6 +111,8 @@ export default {
}
const showInfo = ref(false)
return {
visiting,
excelOp,
@@ -96,7 +121,8 @@ export default {
onPickFile,
info,
detailRound,
t_dailyRound
t_dailyRound,
showInfo
}
}
+20 -23
View File
@@ -210,6 +210,7 @@ class DailyRoundUpAPIView(APIView):
def post(self, request):
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'id')
dfuser = pd.DataFrame.from_records(user)
@@ -262,10 +263,12 @@ class DailyRoundUpAPIView(APIView):
pos = DailyRoundUp.objects.values('position__name', 'position').filter(position=6,todaysDate=date.today()).annotate(Count('user'))
print('-------', pos)
mess = "Файл загружен"
except Exception as e:
print(e, '--------jjjjjjjjjjjjjjjjjj------------------------------')
pos=''
mess = 'Файл не найден'
@@ -281,39 +284,33 @@ class DailyRoundUpAPIView(APIView):
class DailyloadAPIView(APIView):
def get(self, request):
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname')
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'fio', 'post')
dailyr = DailyRoundUp.objects.filter(todaysDate=date.today()).values_list('user', 'position__name', 'position')
df_user = pd.DataFrame.from_records(user)
df_daily = pd.DataFrame.from_records(dailyr)
df_daily.columns = ["login", "pos", "idpos"]
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
print(df, 'df_user---------------------------')
# print(df_daily , 'df_daily---------------------------')
result={}
pos=dailyr[0][1]
if request.GET.__contains__('id'):
daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=date.today()).values_list('user', 'position__name')
df=df.loc[df['idpos']==int(request.GET.get("id"))]
if request.GET.__contains__('searchname'):
# daily1 = DictEmployee.objects.using('user_directory').filter(login__in=[x[0] for x in daily])
# daily1 = daily1.filter(fio__icontains=request.GET.get("searchname"))
u= DictEmployee.objects.using('user_directory').values('familyname').filter(fio__icontains=request.GET.get("searchname"))
print(daily, '-----------------------------')
else:
u=DictEmployee.objects.using('user_directory').filter(login__in=[x[0] for x in daily])
print('1111111111111111111111111111111111111111111')
pos=daily[0][1]
result = {}
for x in u:
if x.department in result.keys():
result[x.department].append({'login':x.login,'fio':x.fio, 'post':x.post})
df = df.loc[df["fio"].str.contains(request.GET.get("searchname"))]
for index, row in df.iterrows ():
if row['department'] in result.keys():
result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post']})
else:
result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}]
result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post']}]
print(result, '111111111111111111111')
daily = result
else:
pos=''
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
Binary file not shown.
Binary file not shown.