diff --git a/src/db.sqlite3 b/src/db.sqlite3 index e5b735af0..3386bec12 100644 Binary files a/src/db.sqlite3 and b/src/db.sqlite3 differ diff --git a/src/front/src/App.vue b/src/front/src/App.vue index 95aea1ca8..2e763e7bb 100644 --- a/src/front/src/App.vue +++ b/src/front/src/App.vue @@ -48,4 +48,9 @@ import {useAccountStore} from '@/store/AccountStore' .pointer { cursor:pointer } + +.bggrad { + background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)); +} + diff --git a/src/front/src/components/UI/Auth-form.vue b/src/front/src/components/UI/Auth-form.vue index a38b7dde9..7a13125c8 100644 --- a/src/front/src/components/UI/Auth-form.vue +++ b/src/front/src/components/UI/Auth-form.vue @@ -88,7 +88,7 @@ export default { const menuAuthDialog = ref(false) const anon=reactive({ - username:"9966-00-125", + username:"9966-00-", password:"" }) diff --git a/src/front/src/layouts/default/DefaultPortal.vue b/src/front/src/layouts/default/DefaultPortal.vue index 4c4a26081..8fba9fcb1 100644 --- a/src/front/src/layouts/default/DefaultPortal.vue +++ b/src/front/src/layouts/default/DefaultPortal.vue @@ -24,7 +24,7 @@ :to="'/'" /> - + diff --git a/src/front/src/utils/universal_functions.js b/src/front/src/utils/universal_functions.js index 9a9ef02d2..c813a8ca9 100644 --- a/src/front/src/utils/universal_functions.js +++ b/src/front/src/utils/universal_functions.js @@ -30,8 +30,8 @@ export function bgimage(filecheck){ export function checkremote(filecheck){ - return "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg" - // return 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); diff --git a/src/front/src/views/HomePage.vue b/src/front/src/views/HomePage.vue index 0c60c5559..6b4f3f50b 100644 --- a/src/front/src/views/HomePage.vue +++ b/src/front/src/views/HomePage.vue @@ -85,18 +85,48 @@ v-else class="h-100 d-flex justify-center" :image="imageLenta" > - - + + + + + + + + + + + + + + + @@ -177,7 +207,7 @@ - + @@ -221,6 +251,7 @@ > + - - - - - {{t_dailyRound.position}} + + + + {{t_dailyRound.position}} + + + + + - - - - - - - - + - + - + {{key}} @@ -284,6 +313,17 @@ + + + + Закрыть + + @@ -385,12 +425,12 @@ } function dailyfun(){ - // if (t_daily.value.length>0){ - axiosApiInstance.get('api/general_vacation/dailyload/') + + axiosApiInstance.get('api/general_vacation/dailyload/') .then(data => { t_daily.value = data.data.daily }) - // } + @@ -415,6 +455,22 @@ return new URL(`/src/assets/bg-for-number-carousel.png`, import.meta.url).href; }) + 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('----------------') + dailyfiles.value = '' + // dailyfun() + + + + + } + return { accountStore, model, @@ -433,7 +489,8 @@ iduser, imageLenta, dialoground, - dailyfiles + dailyfiles, + onPickFile } } @@ -471,5 +528,7 @@ top: 0em; z-index: 2; } + + diff --git a/src/general_vacation/views.py b/src/general_vacation/views.py index aa57709e7..82e83de7e 100644 --- a/src/general_vacation/views.py +++ b/src/general_vacation/views.py @@ -284,37 +284,40 @@ class DailyRoundUpAPIView(APIView): class DailyloadAPIView(APIView): def get(self, request): - 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") - - result={} - pos=dailyr[0][1] - - if request.GET.__contains__('id'): - df=df.loc[df['idpos']==int(request.GET.get("id"))] - if request.GET.__contains__('searchname'): - - df = df.loc[df["fio"].str.contains(request.GET.get("searchname"))] - - + try: + 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") - 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[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post']}] - print(result, '111111111111111111111') - daily = result - + result={} + pos=dailyr[0][1] - else: + if request.GET.__contains__('id'): + df=df.loc[df['idpos']==int(request.GET.get("id"))] + if request.GET.__contains__('searchname'): + + 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[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')) + except Exception as e: pos='' - daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user')) - + daily="" return Response({'daily':daily, 'position':pos}) class SearchUserAPIView(APIView):