добавлен вывод списков
This commit is contained in:
1 parent
ec4d3774bc
commit
97ef96cf36
3 files changed
+78
-19
No files matched your search
@@ -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-title>
|
||||
Форма
|
||||
Лучший сотрудник
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<vote-form :type_fetch="'bst'" />
|
||||
</v-card-text>
|
||||
|
||||
<!-- Кнопка активации поворота -->
|
||||
<v-card-actions class="justify-center vote-button">
|
||||
<v-btn size="x-large" @click="toggleFlip1" variant="elevated" color="teal-darken-1"
|
||||
<v-card-actions class="justify-center vote-button-back">
|
||||
<v-btn @click="toggleFlip1" variant="elevated" color="teal-darken-1"
|
||||
type="button">назад</v-btn>
|
||||
</v-card-actions>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
|
||||
</v-card>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,12 +84,18 @@
|
||||
<v-card class="justify-center elevation-24" width="500" height="700" variant="elevated">
|
||||
|
||||
<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-btn size="x-large" @click="toggleFlip2" variant="elevated" color="teal-darken-1"
|
||||
<v-card-actions class="justify-center vote-button-back">
|
||||
<v-btn @click="toggleFlip2" variant="elevated" color="teal-darken-1"
|
||||
type="button">назад</v-btn>
|
||||
</v-card-actions>
|
||||
<!-- Кнопка активации поворота КОНЕЦ-->
|
||||
@@ -105,18 +113,20 @@
|
||||
</template>
|
||||
<script>
|
||||
import { ref } from "vue";
|
||||
import { useAccountStore } from '@/store/AccountStore'
|
||||
import { spravURL } from "@/utils/axios-api";
|
||||
import { useDisplay } from "vuetify";
|
||||
import VoteForm from '@/components/VoteForm.vue';
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
VoteForm,
|
||||
},
|
||||
|
||||
setup() {
|
||||
const account_id = useAccountStore().login;
|
||||
|
||||
const isFlipped1 = ref(false);
|
||||
const isFlipped2 = ref(false);
|
||||
|
||||
console.log(account_id);
|
||||
|
||||
const toggleFlip1 = () => {
|
||||
isFlipped1.value = !isFlipped1.value;
|
||||
|
||||
@@ -129,11 +139,9 @@ export default {
|
||||
isFlipped1,
|
||||
toggleFlip1,
|
||||
isFlipped2,
|
||||
toggleFlip2
|
||||
toggleFlip2,
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@@ -170,9 +178,14 @@ export default {
|
||||
.vote-card-title {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
color: white;
|
||||
font-size: 1.7em;
|
||||
}
|
||||
|
||||
.vote-button {
|
||||
margin-top: 590px;
|
||||
margin-top: 580px;
|
||||
}
|
||||
|
||||
.vote-button-back {
|
||||
margin-top: 10%;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user