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

This commit is contained in:
iriska-gri committed 2024-04-16 09:07:59 +03:00
1 parent 62b4bcd597
commit 109ab871be
1 file changed
+158 -219
+158 -219
View File
@@ -1,191 +1,126 @@
<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
:time="false" :time="false"
hide-view-selector hide-view-selector
:disable-views="['years', 'year', 'week', 'day']" :disable-views="['years', 'year', 'week', 'day']"
events-count-on-year-view events-count-on-year-view
active-view="month" active-view="month"
:events="events" :events="events"
todayButton todayButton
@cell-focus="selectedDate = $event" @cell-focus="selectedDate = $event"
> >
<template #arrow-prev> <template #arrow-prev>
<v-icon icon="mdi-menu-left"></v-icon> <v-icon icon="mdi-menu-left"></v-icon>
</template> </template>
<template #arrow-next> <template #arrow-next>
<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
@click="selectedDate = new Date()"
v-bind="props"
<v-tooltip text="Сегодня" location="bottom"> icon="mdi-crosshairs-gps"
<template v-slot:activator="{ props }"> size="x-small"
class="pt-1 pr-3"
<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"/> color="more_details_btn"
</template> />
</v-tooltip> </template>
</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-title class="text-center"
<v-card class="h-100"> >События на {{ dayformat(selectedDate) }}</v-card-title
<v-card-title class="text-center">События на {{dayformat(selectedDate)}}</v-card-title>
<!-- <v-card-text>ddd</v-card-text> -->
<vue-cal
locale="ru"
xsmall
:time="false"
hide-view-selector
hideTitleBar
split
header-format= "DD"
:events="events"
active-view="day"
:disable-views="['years', 'year', 'month', 'week']"
:selected-date="selectedDate"
> >
<template #arrow-prev> <vue-cal
<v-icon icon="mdi-menu-left"></v-icon> locale="ru"
</template> xsmall
<template #arrow-next> :time="false"
<v-icon icon="mdi-menu-right"></v-icon> hide-view-selector
</template> hideTitleBar
<template #today-button> split
header-format="DD"
:events="events"
active-view="day"
:disable-views="['years', 'year', 'month', 'week']"
:selected-date="selectedDate"
<!-- <v-tooltip text="Сегодня" location="bottom"> >
<template v-slot:activator="{ props }"> <template #arrow-prev>
<v-icon v-bind="props" icon="mdi-crosshairs-gps" size="x-small" class="pt-1 pr-3" color="more_details_btn"/> <v-icon icon="mdi-menu-left"></v-icon>
</template> </template>
</v-tooltip> --> <template #arrow-next>
<v-icon icon="mdi-menu-right"></v-icon>
</template>
<template #today-button>
</template> </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 },
setup() {
const events = ref([]);
function f_generalvacation() {
axiosApiInstance
components: { VueCal }, .get("api/general_vacation/generalvacation/")
.then((data) => {
setup() { for (let x in data.data) {
const events = ref([ if (x == "План-график") {
data.data[x].map((e) => {
]) events.value.push({
function f_generalvacation() { name: e.name,
axiosApiInstance.get('api/general_vacation/generalvacation/') start: e.start_work_period,
.then(data => { end: e.end_work_period,
content: e.name,
});
for (let x in data.data) { });
if (x=="План-график") {
data.data[x].map(e=>{
events.value.push({ name: e.name, start: e.start_work_period, end: e.end_work_period, content: e.name})
}
)
}
}
})
}
onMounted(() => {
f_generalvacation()
})
const selectedDate = ref(null)
function dayformat(days) {
const d = new Date(days)
let mess= 'сегодня'
if (d.getFullYear() != '1970'){
mess = `${d.getDate()} число`
} }
}
});
}
return mess onMounted(() => {
} f_generalvacation();
});
const selectedDate = ref(null);
function dayformat(days) {
const d = new Date(days);
let mess = "сегодня";
if (d.getFullYear() != "1970") {
mess = `${d.getDate()} число`;
}
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;
@@ -196,90 +131,94 @@ export default {
} }
.vuecal { .vuecal {
border-radius: 6px; border-radius: 6px;
} }
.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 {
font-family: sans-serif; font-family: sans-serif;
} }
.vuecal__cell-events-count { .vuecal__cell-events-count {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 65%; top: 65%;
transform: translate(-50%); transform: translate(-50%);
min-width: 15px; min-width: 15px;
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,
border-radius: 12px; rgba(19, 84, 122, 0.8),
font-size: 10px; rgba(128, 208, 199, 0.8)
box-sizing: border-box; );
color: #f8fff9 !important;
border-radius: 12px;
font-size: 10px;
box-sizing: border-box;
} }
.vuecal__event { .vuecal__event {
color: #666; color: #666;
background-color: transparent; background-color: transparent;
padding: 10px; padding: 10px;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
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;
} }
.vuecal--rounded-theme .vuecal__cell-content { .vuecal--rounded-theme .vuecal__cell-content {
width: 30px; width: 30px;
height: 30px; height: 30px;
flex-grow: 0; flex-grow: 0;
border: 1px solid #00a5bc00; border: 1px solid #00a5bc00;
background: #c2e9d78c; background: #c2e9d78c;
border-radius: 30px; border-radius: 30px;
color: #333; color: #333;
} }
.vuecal__cell-content { .vuecal__cell-content {
cursor: pointer; cursor: pointer;
} }
.vuecal__body { .vuecal__body {
position: relative; position: relative;
overflow: auto; overflow: auto;
height: 0; height: 0;
} }
.vuecal--no-time .vuecal__event { .vuecal--no-time .vuecal__event {
min-height: 20px; min-height: 20px;
}
.vuecal__cell--selected:before {border-color: rgba(30, 65, 49, 0.5);}
.vuecal__cell--today, .vuecal__cell--current {
background-color: rgba(238, 181, 214, 0.548);
} }
.vuecal__cell--selected:before { .vuecal__cell--selected:before {
border-color: rgba(30, 65, 49, 0); border-color: rgba(30, 65, 49, 0.5);
}
.vuecal__cell--today,
.vuecal__cell--current {
background-color: rgba(238, 181, 214, 0.548);
}
.vuecal__cell--selected:before {
border-color: rgba(30, 65, 49, 0);
} }
.vuecal__cell--selected { .vuecal__cell--selected {
background-color: #3a97694a; background-color: #3a97694a;
z-index: 2; z-index: 2;
} }
</style>
</style>