Вывод на экран

This commit is contained in:
iriska-gri committed 2024-04-16 09:07:59 +03:00
1 parent 62b4bcd597
commit 109ab871be
1 file changed
+59 -120
+59 -120
View File
@@ -1,18 +1,7 @@
<template> <template>
<v-row> <v-row>
<v-col class="flex-column pr-0"> <v-col class="flex-column pr-0">
<v-card class="h-100"> <v-card class="h-100">
<!-- xsmall
:time="false"
hide-view-selector
active-view="month"
:disable-views="['years', 'year', 'week', 'day']"
@cell-focus="selectedDate = $event"
:events="events"
class="vuecal--blue-theme vuecal--rounded-theme" -->
<vue-cal <vue-cal
locale="ru" locale="ru"
xsmall xsmall
@@ -32,32 +21,27 @@
<v-icon icon="mdi-menu-right"></v-icon> <v-icon icon="mdi-menu-right"></v-icon>
</template> </template>
<template #today-button> <template #today-button>
<v-tooltip text="Сегодня" location="bottom"> <v-tooltip text="Сегодня" location="bottom">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-icon
<v-icon @click="selectedDate =new Date()" v-bind="props" icon="mdi-crosshairs-gps" size="x-small" class="pt-1 pr-3" color="more_details_btn"/> @click="selectedDate = new Date()"
v-bind="props"
icon="mdi-crosshairs-gps"
size="x-small"
class="pt-1 pr-3"
color="more_details_btn"
/>
</template> </template>
</v-tooltip> </v-tooltip>
</template>
</template>
</vue-cal> </vue-cal>
</v-card> </v-card>
</v-col> </v-col>
<v-col> <v-col>
<!-- todayButton -->
<v-card class="h-100"> <v-card class="h-100">
<v-card-title class="text-center">События на {{dayformat(selectedDate)}}</v-card-title> <v-card-title class="text-center"
<!-- <v-card-text>ddd</v-card-text> --> >События на {{ dayformat(selectedDate) }}</v-card-title
>
<vue-cal <vue-cal
locale="ru" locale="ru"
xsmall xsmall
@@ -65,13 +49,11 @@
hide-view-selector hide-view-selector
hideTitleBar hideTitleBar
split split
header-format= "DD" header-format="DD"
:events="events" :events="events"
active-view="day" active-view="day"
:disable-views="['years', 'year', 'month', 'week']" :disable-views="['years', 'year', 'month', 'week']"
:selected-date="selectedDate" :selected-date="selectedDate"
> >
<template #arrow-prev> <template #arrow-prev>
<v-icon icon="mdi-menu-left"></v-icon> <v-icon icon="mdi-menu-left"></v-icon>
@@ -80,112 +62,65 @@
<v-icon icon="mdi-menu-right"></v-icon> <v-icon icon="mdi-menu-right"></v-icon>
</template> </template>
<template #today-button> <template #today-button>
<!-- <v-tooltip text="Сегодня" location="bottom">
<template v-slot:activator="{ props }">
<v-icon v-bind="props" icon="mdi-crosshairs-gps" size="x-small" class="pt-1 pr-3" color="more_details_btn"/>
</template> </template>
</v-tooltip> -->
</template>
</vue-cal> </vue-cal>
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
</template> </template>
<script> <script>
import VueCal from 'vue-cal' import VueCal from "vue-cal";
import 'vue-cal/dist/vuecal.css' import "vue-cal/dist/vuecal.css";
import { ref, onMounted } from 'vue' import { ref, onMounted } from "vue";
import { axiosApiInstance } from '@/utils/axios-api' import { axiosApiInstance } from "@/utils/axios-api";
export default { export default {
components: { VueCal }, components: { VueCal },
setup() { setup() {
const events = ref([ const events = ref([]);
])
function f_generalvacation() { function f_generalvacation() {
axiosApiInstance.get('api/general_vacation/generalvacation/') axiosApiInstance
.then(data => { .get("api/general_vacation/generalvacation/")
.then((data) => {
for (let x in data.data) { for (let x in data.data) {
if (x == "План-график") {
if (x=="План-график") { data.data[x].map((e) => {
data.data[x].map(e=>{ events.value.push({
name: e.name,
start: e.start_work_period,
events.value.push({ name: e.name, start: e.start_work_period, end: e.end_work_period, content: e.name}) end: e.end_work_period,
content: e.name,
} });
});
)
} }
} }
});
})
} }
onMounted(() => { onMounted(() => {
f_generalvacation() f_generalvacation();
}) });
const selectedDate = ref(null);
const selectedDate = ref(null)
function dayformat(days) { function dayformat(days) {
const d = new Date(days) const d = new Date(days);
let mess= 'сегодня' let mess = "сегодня";
if (d.getFullYear() != '1970'){ if (d.getFullYear() != "1970") {
mess = `${d.getDate()} число` mess = `${d.getDate()} число`;
} }
return mess;
return mess
} }
return { events, selectedDate, f_generalvacation, dayformat };
},
};
return { events, selectedDate, f_generalvacation, dayformat }
}
}
</script> </script>
<style> <style>
/* Dot indicator */ /* Dot indicator */
.vuecal__cell-events-count { .vuecal__cell-events-count {
width: 20px; width: 20px;
@@ -200,12 +135,12 @@ export default {
} }
.vuecal__title-bar { .vuecal__title-bar {
border-top-left-radius: 3px; border-top-left-radius: 3px;
border-top-right-radius: 3px; border-top-right-radius: 3px;
} }
.vuecal__title-bar { .vuecal__title-bar {
background: var(--cards) background: var(--cards);
/* background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)); */ /* background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)); */
} }
.vuecal__flex .vuecal__title { .vuecal__flex .vuecal__title {
@@ -220,8 +155,12 @@ border-top-right-radius: 3px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
padding: 0; padding: 0;
background: linear-gradient(to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)); background: linear-gradient(
color: #f8fff9!important; to top right,
rgba(19, 84, 122, 0.8),
rgba(128, 208, 199, 0.8)
);
color: #f8fff9 !important;
border-radius: 12px; border-radius: 12px;
font-size: 10px; font-size: 10px;
box-sizing: border-box; box-sizing: border-box;
@@ -236,7 +175,7 @@ border-top-right-radius: 3px;
left: 0; left: 0;
width: 100%; width: 100%;
z-index: 1; z-index: 1;
transition: box-shadow .3s,left .3s,width .3s; transition: box-shadow 0.3s, left 0.3s, width 0.3s;
overflow: hidden; overflow: hidden;
text-align: justify; text-align: justify;
} }
@@ -249,7 +188,6 @@ border-top-right-radius: 3px;
background: #c2e9d78c; background: #c2e9d78c;
border-radius: 30px; border-radius: 30px;
color: #333; color: #333;
} }
.vuecal__cell-content { .vuecal__cell-content {
@@ -266,11 +204,13 @@ border-top-right-radius: 3px;
min-height: 20px; min-height: 20px;
} }
.vuecal__cell--selected:before {border-color: rgba(30, 65, 49, 0.5);} .vuecal__cell--selected:before {
border-color: rgba(30, 65, 49, 0.5);
}
.vuecal__cell--today, .vuecal__cell--current { .vuecal__cell--today,
.vuecal__cell--current {
background-color: rgba(238, 181, 214, 0.548); background-color: rgba(238, 181, 214, 0.548);
} }
.vuecal__cell--selected:before { .vuecal__cell--selected:before {
@@ -281,5 +221,4 @@ border-top-right-radius: 3px;
background-color: #3a97694a; background-color: #3a97694a;
z-index: 2; z-index: 2;
} }
</style> </style>