Отражение данных из БД
Без периодичности
This commit is contained in:
1 parent
79a62561c5
commit
efeca2d1ef
10 files changed
+228
-65
No files matched your search
@@ -70,7 +70,7 @@
|
||||
<v-col
|
||||
class="text-h6 pt-8 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
За выбранный период активных критиков нет
|
||||
За выбранный период комментариев нет
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
cover
|
||||
/>
|
||||
</v-col>
|
||||
<v-col class="text-center align-self-center text-h6 px-3">
|
||||
<v-col class="text-center align-self-center font-weight-medium px-3">
|
||||
<!-- <v-card-subtitle>
|
||||
{{x.name}}
|
||||
<my-helper :pretext="x" />
|
||||
@@ -172,10 +172,10 @@ export default {
|
||||
} */
|
||||
|
||||
.minh {
|
||||
min-height: 43px;
|
||||
min-height: 45px;
|
||||
}
|
||||
.heightfoto {
|
||||
max-height: 156px;
|
||||
min-height: 156px;
|
||||
max-height: 110px;
|
||||
min-height: 110px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
# Календарь событий
|
||||
|
||||
Пример объекта
|
||||
```
|
||||
const events = ref([
|
||||
{
|
||||
start: '2024-04-15 14:00',
|
||||
end: '2024-04-25 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',
|
||||
repeat: {
|
||||
every: 'week', // You can repeat on multiple days of the week.
|
||||
until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
}
|
||||
},
|
||||
{
|
||||
start: '2024-04-15 10:00',
|
||||
end: '2024-04-25 15: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'
|
||||
}
|
||||
])
|
||||
|
||||
```
|
||||
|
||||
Повторяющиеся события
|
||||
Когда это будет готово, вот как это будет работать.
|
||||
Вы можете повторить событие:
|
||||
Каждый день - предоставляя свойство every: "день".
|
||||
Каждую неделю - предоставляя каждую: "неделю" свойство.
|
||||
Каждый месяц - путем предоставления каждого: свойства "месяц".
|
||||
Каждый год - путем предоставления каждого: "годового" объекта недвижимости.
|
||||
Для каждого конкретного дня недели - путем предоставления массива дней недели, содержащего номера дней недели (от 1 до 7 для воскресенья).
|
||||
Каждые x дней - путем предоставления свойства every: x, где x является целым числом.
|
||||
Навсегда; Или до истечения срока действия, если вы предоставляете свойство until: {String | Date}.
|
||||
Будь то однодневный, многодневный, фоновый, на весь день, со временем или вне времени.
|
||||
|
||||
repeat: {
|
||||
weekdays: [1, 3], // You can repeat on multiple days of the week.
|
||||
until: '2020-11-30' // Don't need a time here as it will take the same as original event date.
|
||||
}
|
||||
|
||||
repeat: {
|
||||
weekdays: [5] // If original event day is not in these days, original event will still show up.
|
||||
// Without `until` property, it will go on forever.
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 'week',
|
||||
until: new Date('2019/06/01') // You can also use a Javascript Date.
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 14,
|
||||
until: '2019-01-20'
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 'month',
|
||||
until: '2019-12-26'
|
||||
}
|
||||
|
||||
repeat: {
|
||||
every: 'year'
|
||||
}
|
||||
+52
-26
@@ -19,11 +19,15 @@
|
||||
:time-from="8 * 60"
|
||||
:time-to="23 * 60"
|
||||
hide-weekends
|
||||
hide-view-selector
|
||||
events-count-on-year-view
|
||||
editable-events
|
||||
show-all-day-events
|
||||
xsmall
|
||||
locale="ru"
|
||||
:events="events"
|
||||
:on-event-click="onEventClick"
|
||||
:disable-views="['years', 'year', 'week', 'day']"
|
||||
@cell-focus="selectedDate = $event">
|
||||
</vue-cal>
|
||||
<v-dialog v-model="showDialog">
|
||||
@@ -125,7 +129,7 @@ import VueCal from "vue-cal";
|
||||
import "vue-cal/dist/vuecal.css";
|
||||
import { ref } from "vue";
|
||||
import { axiosApiInstance } from "@/utils/axios-api";
|
||||
|
||||
import {formaDashTime} from '@/utils/universal_functions'
|
||||
export default {
|
||||
components: { VueCal },
|
||||
|
||||
@@ -134,34 +138,32 @@ export default {
|
||||
const showDialog =ref(false)
|
||||
|
||||
const events = ref([
|
||||
{
|
||||
start: '2024-04-15 14:00',
|
||||
end: '2024-04-25 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',
|
||||
repeat: {
|
||||
every: 'week', // You can repeat on multiple days of the week.
|
||||
until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
}
|
||||
},
|
||||
{
|
||||
start: '2024-04-15 10:00',
|
||||
end: '2024-04-25 15: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'
|
||||
}
|
||||
// {
|
||||
// start: '2024-04-15 14:00',
|
||||
// end: '2024-04-25 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',
|
||||
// repeat: {
|
||||
// every: 'week', // You can repeat on multiple days of the week.
|
||||
// until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// start: '2024-04-15 10:00',
|
||||
// end: '2024-04-25 15: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'
|
||||
// }
|
||||
])
|
||||
|
||||
const onEventClick = (event, e) => {
|
||||
|
||||
selectedEvent.value = event
|
||||
console.log(event, e, '1111111111111');
|
||||
showDialog.value = true
|
||||
e.stopPropagation()
|
||||
}
|
||||
@@ -170,7 +172,31 @@ export default {
|
||||
axiosApiInstance
|
||||
.get("api/calendar_of_events/calendarEvents/")
|
||||
.then((data) => {
|
||||
console.log(data, 'dataaaaaaaaaaaaa');
|
||||
for (let x in data.data[0].event) {
|
||||
events.value.push({
|
||||
start: formaDashTime(data.data[0].event[x].cdate),
|
||||
end: formaDashTime(data.data[0].event[x].enddate),
|
||||
title: data.data[0].event[x].name,
|
||||
contentFull: data.data[0].event[x].description,
|
||||
});
|
||||
console.log(formaDashTime(data.data[0].event[x].cdate), 'data.data[0].event[x]')
|
||||
console.log(data.data[0].event[x], 'xxxxxxxxxx')
|
||||
}
|
||||
|
||||
|
||||
// {
|
||||
// start: '2024-04-15 14:00',
|
||||
// end: '2024-04-25 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',
|
||||
// repeat: {
|
||||
// every: 'week', // You can repeat on multiple days of the week.
|
||||
// until: '2024-05-30' // Don't need a time here as it will take the same as original event date.
|
||||
// }
|
||||
console.log(data.data, 'dataaaaaaaaaaaaa');
|
||||
})
|
||||
// for (let x in data.data) {
|
||||
// if (x == "План-график") {
|
||||
@@ -10,21 +10,11 @@
|
||||
import { baseURL, axiosApiInstance } from "@/utils/axios-api";
|
||||
import { ref } from "vue";
|
||||
import ical from "ical.js";
|
||||
import { formatDash } from "@/utils/universal_functions";
|
||||
|
||||
const burl = baseURL.slice(0, -1);
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const participant = ref("");
|
||||
const calendar = ref("");
|
||||
const useICalReader = async () => {
|
||||
@@ -39,6 +29,11 @@ export default {
|
||||
.map((vevent) => new ical.Event(vevent));
|
||||
|
||||
const calendarEvents = events.map((event) => {
|
||||
let attendees = [];
|
||||
event.attendees.map((att) => {
|
||||
attendees.push(att.jCal[1].cn);
|
||||
});
|
||||
|
||||
return {
|
||||
summary: event.summary,
|
||||
description: event.description,
|
||||
@@ -46,13 +41,11 @@ export default {
|
||||
start: event.startDate.toJSDate(),
|
||||
end: event.endDate.toJSDate(),
|
||||
location: event.location,
|
||||
attendees: event.attendees,
|
||||
attendees: attendees,
|
||||
};
|
||||
});
|
||||
participant.value = name;
|
||||
calendar.value = calendarEvents;
|
||||
console.log(name, "name");
|
||||
console.log(calendarEvents, "calendarEventse");
|
||||
f_feedbackdata();
|
||||
};
|
||||
|
||||
@@ -68,7 +61,7 @@ export default {
|
||||
}
|
||||
|
||||
return {
|
||||
useICalReader, selectedEvent
|
||||
useICalReader,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -21,11 +21,15 @@ export function formaComaTime(date) {
|
||||
return moment(date).format("DD.MM.YYYY H:mm");
|
||||
}
|
||||
|
||||
export function formaDashTime(date) {
|
||||
return moment(date).format("YYYY-MM-DD H:mm");
|
||||
}
|
||||
|
||||
export function checking_for_entry(where, what) {
|
||||
if (!where.includes(what)) {
|
||||
where.push(what);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getfromserver(path, reactive) {
|
||||
try {
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
import DigitalLetna from '@/components/digital-letna.vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
|
||||
import EventCalendar from '@/components/UI/event-calendar.vue'
|
||||
import EventCalendar from '@/components/calendar_of_events/event-calendar.vue'
|
||||
|
||||
export default {
|
||||
|
||||
|
||||
Reference in new issue
Block a user