События
This commit is contained in:
1 parent
bb654239af
commit
4c75c980b4
2 files changed
+92
-37
No files matched your search
Binary file not shown.
@@ -1,16 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
<vue-cal
|
<!-- xsmall
|
||||||
locale="ru"
|
|
||||||
xsmall
|
|
||||||
:time="false"
|
:time="false"
|
||||||
hide-view-selector
|
hide-view-selector
|
||||||
active-view="month"
|
active-view="month"
|
||||||
:disable-views="['years', 'year', 'week', 'day']"
|
:disable-views="['years', 'year', 'week', 'day']"
|
||||||
@cell-focus="selectedDate = $event"
|
@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>
|
<template #arrow-prev>
|
||||||
<v-icon icon="mdi-menu-left"></v-icon>
|
<v-icon icon="mdi-menu-left"></v-icon>
|
||||||
@@ -18,18 +28,24 @@
|
|||||||
<template #arrow-next>
|
<template #arrow-next>
|
||||||
<v-icon icon="mdi-menu-right"></v-icon>
|
<v-icon icon="mdi-menu-right"></v-icon>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</vue-cal>
|
</vue-cal>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
|
|
||||||
<vue-cal
|
<vue-cal
|
||||||
locale="ru"
|
locale="ru"
|
||||||
xsmall
|
xsmall
|
||||||
:time="false"
|
:time="false"
|
||||||
hide-view-selector
|
hide-view-selector
|
||||||
|
|
||||||
|
|
||||||
|
: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"
|
||||||
class="vuecal--blue-theme"
|
class="vuecal--blue-theme vuecal--rounded-theme"
|
||||||
|
|
||||||
>
|
>
|
||||||
<template #arrow-prev>
|
<template #arrow-prev>
|
||||||
<v-icon icon="mdi-menu-left"></v-icon>
|
<v-icon icon="mdi-menu-left"></v-icon>
|
||||||
@@ -51,35 +67,80 @@
|
|||||||
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'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
components: { VueCal },
|
components: { VueCal },
|
||||||
|
|
||||||
setup() {
|
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 selectedDate = ref(null)
|
||||||
|
|
||||||
const events = [
|
|
||||||
{
|
// {
|
||||||
start: '2023-11-20 14:00',
|
// start: '2023-11-20 14:00',
|
||||||
end: '2023-11-20 18:00',
|
// end: '2023-11-20 18:00',
|
||||||
title: 'Need to go shopping',
|
// title: 'Need to go shopping',
|
||||||
icon: 'shopping_cart', // Custom attribute.
|
// icon: 'shopping_cart', // Custom attribute.
|
||||||
content: 'Click to see my shopping list',
|
// 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.
|
// 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'
|
// class: 'leisure'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
start: '2023-10-10 14:00',
|
// start: '2023-10-10 14:00',
|
||||||
end: '2023-10-20 14:00',
|
// end: '2023-10-20 14:00',
|
||||||
title: 'Golf with John',
|
// title: 'Golf with John',
|
||||||
icon: 'golf_course', // Custom attribute.
|
// icon: 'golf_course', // Custom attribute.
|
||||||
content: 'Do I need to tell how many holes?',
|
// content: 'Do I need to tell how many holes?',
|
||||||
contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
|
// contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
|
||||||
class: 'sport'
|
// class: 'sport'
|
||||||
}
|
// }
|
||||||
]
|
|
||||||
return { events, selectedDate }
|
return { events, selectedDate, f_generalvacation }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,22 +149,16 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.vuecal__cell-events-count {
|
|
||||||
width: 18px;
|
|
||||||
height: 2px;
|
|
||||||
color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dot indicator */
|
/* Dot indicator */
|
||||||
.vuecal__cell-events-count {
|
.vuecal__cell-events-count {
|
||||||
width: 4px;
|
width: 20px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
height: 4px;
|
height: 11px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cell background indicator */
|
|
||||||
.vuecal__cell--has-events {background-color: #fffacd;}
|
|
||||||
.vuecal__cell-events-count {display: none;}
|
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user