События

This commit is contained in:
iriska-gri committed 2023-11-10 15:26:44 +03:00
1 parent bb654239af
commit 4c75c980b4
2 files changed
+110 -55

No files matched your search

BIN
View File
Binary file not shown.
+110 -55
View File
@@ -1,14 +1,49 @@
<template>
<v-row>
<v-col>
<vue-cal
locale="ru"
xsmall
<!-- 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
locale="ru"
xsmall
:time="false"
hide-view-selector
:disable-views="['years', 'year', 'week', 'day']"
events-count-on-year-view
active-view="month"
:events="events"
class="vuecal--blue-theme"
@cell-focus="selectedDate = $event"
>
<template #arrow-prev>
<v-icon icon="mdi-menu-left"></v-icon>
</template>
<template #arrow-next>
<v-icon icon="mdi-menu-right"></v-icon>
</template>
</vue-cal>
</v-col>
<v-col>
<vue-cal
locale="ru"
xsmall
:time="false"
hide-view-selector
:events="events"
active-view="day"
:disable-views="['years', 'year', 'month', 'week']"
:selected-date="selectedDate"
class="vuecal--blue-theme vuecal--rounded-theme"
>
@@ -18,26 +53,7 @@
<template #arrow-next>
<v-icon icon="mdi-menu-right"></v-icon>
</template>
</vue-cal>
</v-col>
<v-col>
<vue-cal
locale="ru"
xsmall
:time="false"
hide-view-selector
active-view="day"
:disable-views="['years', 'year', 'month', 'week']"
:selected-date="selectedDate"
class="vuecal--blue-theme"
>
<template #arrow-prev>
<v-icon icon="mdi-menu-left"></v-icon>
</template>
<template #arrow-next>
<v-icon icon="mdi-menu-right"></v-icon>
</template>
</vue-cal>
</vue-cal>
</v-col>
</v-row>
@@ -51,35 +67,80 @@
import VueCal from 'vue-cal'
import 'vue-cal/dist/vuecal.css'
import { ref, onMounted } from 'vue'
import { axiosApiInstance } from '@/utils/axios-api'
export default {
components: { VueCal },
setup() {
const events = ref([
// {
// start: '2023-11-15',
// end: '2023-11-21',
// title: 'Need to go shopping',
// content: '<i class="icon material-icons">shopping_cart</i>',
// class: 'leisure'
// },
])
function f_generalvacation() {
axiosApiInstance.get('api/general_vacation/generalvacation/')
.then(data => {
console.log(data.data,'----------------------');
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})
}
)
}
}
})
}
onMounted(() => {
f_generalvacation()
})
const selectedDate = ref(null)
const events = [
{
start: '2023-11-20 14:00',
end: '2023-11-20 18:00',
title: 'Need to go shopping',
icon: 'shopping_cart', // Custom attribute.
content: 'Click to see my shopping list',
contentFull: 'My shopping list is rather long:<br><ul><li>Avocados</li><li>Tomatoes</li><li>Potatoes</li><li>Mangoes</li></ul>', // Custom attribute.
class: 'leisure'
},
{
start: '2023-10-10 14:00',
end: '2023-10-20 14:00',
title: 'Golf with John',
icon: 'golf_course', // Custom attribute.
content: 'Do I need to tell how many holes?',
contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
class: 'sport'
}
]
return { events, selectedDate }
// {
// start: '2023-11-20 14:00',
// end: '2023-11-20 18:00',
// title: 'Need to go shopping',
// icon: 'shopping_cart', // Custom attribute.
// content: 'Click to see my shopping list',
// contentFull: 'My shopping list is rather long:<br><ul><li>Avocados</li><li>Tomatoes</li><li>Potatoes</li><li>Mangoes</li></ul>', // Custom attribute.
// class: 'leisure'
// },
// {
// start: '2023-10-10 14:00',
// end: '2023-10-20 14:00',
// title: 'Golf with John',
// icon: 'golf_course', // Custom attribute.
// content: 'Do I need to tell how many holes?',
// contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
// class: 'sport'
// }
return { events, selectedDate, f_generalvacation }
}
@@ -88,22 +149,16 @@ export default {
</script>
<style>
.vuecal__cell-events-count {
width: 18px;
height: 2px;
color: transparent;
}
/* Dot indicator */
.vuecal__cell-events-count {
width: 4px;
width: 20px;
min-width: 0;
height: 4px;
height: 11px;
padding: 0;
color: transparent;
}
/* Cell background indicator */
.vuecal__cell--has-events {background-color: #fffacd;}
.vuecal__cell-events-count {display: none;}
</style>