добавлен вывод списков
This commit is contained in:
1 parent
ec4d3774bc
commit
97ef96cf36
3 files changed
+78
-19
No files matched your search
@@ -20,8 +20,6 @@ class GetForBst(APIView):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
user_login = request.GET.get('login')
|
user_login = request.GET.get('login')
|
||||||
dep_id = request.GET.get('dep')
|
dep_id = request.GET.get('dep')
|
||||||
print(user_login)
|
|
||||||
print(dep_id)
|
|
||||||
emp_user = DictEmployee.objects.filter(Q(id_dict_department=dep_id), ~Q(
|
emp_user = DictEmployee.objects.filter(Q(id_dict_department=dep_id), ~Q(
|
||||||
post="Начальник отдела"), ~Q(login=user_login))
|
post="Начальник отдела"), ~Q(login=user_login))
|
||||||
return Response(GetEmpSerializer(emp_user, many=True).data)
|
return Response(GetEmpSerializer(emp_user, many=True).data)
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<template>
|
||||||
|
<v-card height="520">
|
||||||
|
<v-virtual-scroll :items="vote_data" :height="500" :item-height="30">
|
||||||
|
<v-card-text v-for="item in vote_data">
|
||||||
|
<p>{{ item.fio }}</p>
|
||||||
|
</v-card-text>
|
||||||
|
</v-virtual-scroll>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { clearAxios } from "@/utils/axios-api";
|
||||||
|
import { useAccountStore } from '@/store/AccountStore';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['type_fetch'],
|
||||||
|
setup(props) {
|
||||||
|
let account_login = useAccountStore().user.login;
|
||||||
|
let department_id = useAccountStore().user.id_dict_department;
|
||||||
|
let type_fetch = props.type_fetch;
|
||||||
|
let get_address = ref();
|
||||||
|
let vote_data = ref([]);
|
||||||
|
|
||||||
|
|
||||||
|
if (type_fetch == "thn") {
|
||||||
|
get_address = `api/vote/get_for_thn/?login=${account_login}`;
|
||||||
|
} else if (type_fetch == "bst") {
|
||||||
|
get_address = `api/vote/get_for_bst/?login=${account_login}&dep=${department_id}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const getVotesData = () => {
|
||||||
|
clearAxios.get(get_address).then((data) => {
|
||||||
|
vote_data.value = data.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
getVotesData();
|
||||||
|
return {
|
||||||
|
vote_data,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style></style>
|
||||||
@@ -33,16 +33,18 @@
|
|||||||
<v-card class="justify-center elevation-24" width="500" height="700">
|
<v-card class="justify-center elevation-24" width="500" height="700">
|
||||||
|
|
||||||
<v-card-title>
|
<v-card-title>
|
||||||
Форма
|
Лучший сотрудник
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<vote-form :type_fetch="'bst'" />
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
<!-- Кнопка активации поворота -->
|
<!-- Кнопка активации поворота -->
|
||||||
<v-card-actions class="justify-center vote-button">
|
<v-card-actions class="justify-center vote-button-back">
|
||||||
<v-btn size="x-large" @click="toggleFlip1" variant="elevated" color="teal-darken-1"
|
<v-btn @click="toggleFlip1" variant="elevated" color="teal-darken-1"
|
||||||
type="button">назад</v-btn>
|
type="button">назад</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,12 +84,18 @@
|
|||||||
<v-card class="justify-center elevation-24" width="500" height="700" variant="elevated">
|
<v-card class="justify-center elevation-24" width="500" height="700" variant="elevated">
|
||||||
|
|
||||||
<v-card-title>
|
<v-card-title>
|
||||||
Форма
|
СПАСИБО
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
|
|
||||||
|
<v-card-text>
|
||||||
|
|
||||||
|
<vote-form :type_fetch="'thn'" />
|
||||||
|
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
<!-- Кнопка активации поворота -->
|
<!-- Кнопка активации поворота -->
|
||||||
<v-card-actions class="justify-center vote-button">
|
<v-card-actions class="justify-center vote-button-back">
|
||||||
<v-btn size="x-large" @click="toggleFlip2" variant="elevated" color="teal-darken-1"
|
<v-btn @click="toggleFlip2" variant="elevated" color="teal-darken-1"
|
||||||
type="button">назад</v-btn>
|
type="button">назад</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||||
@@ -105,18 +113,20 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useAccountStore } from '@/store/AccountStore'
|
import VoteForm from '@/components/VoteForm.vue';
|
||||||
import { spravURL } from "@/utils/axios-api";
|
|
||||||
import { useDisplay } from "vuetify";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
components: {
|
||||||
|
VoteForm,
|
||||||
|
},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const account_id = useAccountStore().login;
|
|
||||||
const isFlipped1 = ref(false);
|
const isFlipped1 = ref(false);
|
||||||
const isFlipped2 = ref(false);
|
const isFlipped2 = ref(false);
|
||||||
|
|
||||||
console.log(account_id);
|
|
||||||
const toggleFlip1 = () => {
|
const toggleFlip1 = () => {
|
||||||
isFlipped1.value = !isFlipped1.value;
|
isFlipped1.value = !isFlipped1.value;
|
||||||
|
|
||||||
@@ -129,11 +139,9 @@ export default {
|
|||||||
isFlipped1,
|
isFlipped1,
|
||||||
toggleFlip1,
|
toggleFlip1,
|
||||||
isFlipped2,
|
isFlipped2,
|
||||||
toggleFlip2
|
toggleFlip2,
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -170,9 +178,14 @@ export default {
|
|||||||
.vote-card-title {
|
.vote-card-title {
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
color: white;
|
color: white;
|
||||||
|
font-size: 1.7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vote-button {
|
.vote-button {
|
||||||
margin-top: 590px;
|
margin-top: 580px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vote-button-back {
|
||||||
|
margin-top: 10%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user