События
This commit is contained in:
1 parent
bb654239af
commit
4c75c980b4
2 files changed
+103
-48
No files matched your search
Binary file not shown.
@@ -1,16 +1,26 @@
|
||||
<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"
|
||||
class="vuecal--blue-theme vuecal--rounded-theme"
|
||||
|
||||
|
||||
: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>
|
||||
@@ -18,26 +28,32 @@
|
||||
<template #arrow-next>
|
||||
<v-icon icon="mdi-menu-right"></v-icon>
|
||||
</template>
|
||||
</vue-cal>
|
||||
|
||||
</vue-cal>
|
||||
</v-col>
|
||||
<v-col>
|
||||
|
||||
<vue-cal
|
||||
locale="ru"
|
||||
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>
|
||||
: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"
|
||||
|
||||
>
|
||||
<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>
|
||||
Reference in new issue
Block a user