P-51
This commit is contained in:
1 parent
0cd3e1b92c
commit
fb4880dfb6
8 files changed
+273
-254
No files matched your search
Generated
+10
-2
@@ -33,6 +33,7 @@
|
|||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"pinia": "^2.0.23",
|
"pinia": "^2.0.23",
|
||||||
"roboto-fontface": "*",
|
"roboto-fontface": "*",
|
||||||
|
"rrule": "^2.8.1",
|
||||||
"v-tooltip": "^2.1.3",
|
"v-tooltip": "^2.1.3",
|
||||||
"vee-validate": "^4.12.8",
|
"vee-validate": "^4.12.8",
|
||||||
"vue": "^3.2.0",
|
"vue": "^3.2.0",
|
||||||
@@ -18028,6 +18029,14 @@
|
|||||||
"fsevents": "~2.3.2"
|
"fsevents": "~2.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/rrule": {
|
||||||
|
"version": "2.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/rrule/-/rrule-2.8.1.tgz",
|
||||||
|
"integrity": "sha512-hM3dHSBMeaJ0Ktp7W38BJZ7O1zOgaFEsn41PDk+yHoEtfLV+PoJt9E9xAlZiWgf/iqEqionN0ebHFZIDAp+iGw==",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/run-async": {
|
"node_modules/run-async": {
|
||||||
"version": "2.4.1",
|
"version": "2.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
|
||||||
@@ -19786,8 +19795,7 @@
|
|||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "2.6.1",
|
"version": "2.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz",
|
||||||
"integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==",
|
"integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/tsutils": {
|
"node_modules/tsutils": {
|
||||||
"version": "3.21.0",
|
"version": "3.21.0",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"pinia": "^2.0.23",
|
"pinia": "^2.0.23",
|
||||||
"roboto-fontface": "*",
|
"roboto-fontface": "*",
|
||||||
|
"rrule": "^2.8.1",
|
||||||
"v-tooltip": "^2.1.3",
|
"v-tooltip": "^2.1.3",
|
||||||
"vee-validate": "^4.12.8",
|
"vee-validate": "^4.12.8",
|
||||||
"vue": "^3.2.0",
|
"vue": "^3.2.0",
|
||||||
|
|||||||
@@ -74,12 +74,13 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn @click="drawer_right = !drawer_right">
|
<calendar-full />
|
||||||
{{ drawer_right }}
|
<!-- <v-btn @click="drawer_right = !drawer_right">
|
||||||
</v-btn>
|
{{ drawer_right }}y
|
||||||
|
</v-btn> -->
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-navigation-drawer
|
<!-- <v-navigation-drawer
|
||||||
v-model="drawer_right"
|
v-model="drawer_right"
|
||||||
floating
|
floating
|
||||||
permanent
|
permanent
|
||||||
@@ -87,7 +88,7 @@
|
|||||||
rail-width="400"
|
rail-width="400"
|
||||||
rail
|
rail
|
||||||
>
|
>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer> -->
|
||||||
<v-dialog v-model="showDialog" max-width="700">
|
<v-dialog v-model="showDialog" max-width="700">
|
||||||
<event-create
|
<event-create
|
||||||
@closeDialog = "showDialog = false"
|
@closeDialog = "showDialog = false"
|
||||||
@@ -105,11 +106,14 @@ import EventCreate from "@/components/calendar_of_events/event-create.vue";
|
|||||||
import CalendarMy from "@/components/calendar_of_events/calendar-my.vue";
|
import CalendarMy from "@/components/calendar_of_events/calendar-my.vue";
|
||||||
import { axiosApiInstance } from "@/utils/axios-api";
|
import { axiosApiInstance } from "@/utils/axios-api";
|
||||||
import { useAccountStore } from "@/store/AccountStore";
|
import { useAccountStore } from "@/store/AccountStore";
|
||||||
|
import CalendarFull from '@/components/calendar_of_events/UI_calendar/calendarFull.vue';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { EventCreate, CalendarMy },
|
components: { EventCreate, CalendarMy, CalendarFull },
|
||||||
|
|
||||||
setup(props, {emit}) {
|
setup(props, {emit}) {
|
||||||
|
|
||||||
const accountStore = useAccountStore();
|
const accountStore = useAccountStore();
|
||||||
const showDialog = ref(false);
|
const showDialog = ref(false);
|
||||||
const week = useWeekendsStore();
|
const week = useWeekendsStore();
|
||||||
@@ -123,6 +127,21 @@ export default {
|
|||||||
// const idEvent = ref(null)
|
// const idEvent = ref(null)
|
||||||
const idEvent = ref(2)
|
const idEvent = ref(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// const rule = new RRule({
|
||||||
|
// freq: RRule.WEEKLY,
|
||||||
|
// interval: 5,
|
||||||
|
// byweekday: [RRule.MO, RRule.FR],
|
||||||
|
// dtstart: datetime(2024, 7, 1),
|
||||||
|
// until: datetime(2024, 8, 15)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// const dates = rule.all()
|
||||||
|
|
||||||
|
// // const dates = rule.all();
|
||||||
|
// console.log(dates, '===============================');
|
||||||
|
|
||||||
const getMonth = (month) => {
|
const getMonth = (month) => {
|
||||||
MyMonth.value = month + 1;
|
MyMonth.value = month + 1;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<v-sheet>
|
||||||
|
<v-locale-provider locale="ru">
|
||||||
|
<v-calendar
|
||||||
|
ref="calendar"
|
||||||
|
v-model="value"
|
||||||
|
:events="events"
|
||||||
|
:view-mode="type"
|
||||||
|
:weekdays="weekday"
|
||||||
|
>
|
||||||
|
<template v-slot:header="{ title }">
|
||||||
|
<v-col class="d-flex flex-column p">
|
||||||
|
<v-row no-gutters class="gap">
|
||||||
|
<v-col class="flex-grow-0" lg="2">
|
||||||
|
<v-btn class="text-subtitle-1" variant="outlined">
|
||||||
|
Сегодня
|
||||||
|
</v-btn>
|
||||||
|
<v-btn icon="mdi-menu-left" variant="text" />
|
||||||
|
|
||||||
|
<v-btn icon="mdi-menu-right" variant="text" />
|
||||||
|
</v-col>
|
||||||
|
<v-col class="text-h6 align-self-center ml-n6">
|
||||||
|
{{ title.charAt(0).toUpperCase() + title.slice(1) }}
|
||||||
|
</v-col>
|
||||||
|
<v-col class="text-end align-self-center">
|
||||||
|
<v-btn
|
||||||
|
v-for="x in types"
|
||||||
|
:key="x"
|
||||||
|
:active="type != null && type == x.type"
|
||||||
|
variant="text"
|
||||||
|
@click="switchCalendar(x.type)"
|
||||||
|
class="text-subtitle-1"
|
||||||
|
:color="
|
||||||
|
type != null && type == x.type ? 'btn_text' : 'text_grey'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ x.text }}
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<!-- {{title}}
|
||||||
|
<v-btn @click="prev">
|
||||||
|
d :class="'font-weight-regular'"
|
||||||
|
</v-btn>
|
||||||
|
-->
|
||||||
|
</template>
|
||||||
|
</v-calendar>
|
||||||
|
</v-locale-provider>
|
||||||
|
</v-sheet>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { useDate } from "vuetify";
|
||||||
|
import { ref, computed } from "vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const adapter = useDate();
|
||||||
|
|
||||||
|
const type = ref("month");
|
||||||
|
const types = [
|
||||||
|
{ type: "day", text: "День" },
|
||||||
|
{ type: "week", text: "Неделя" },
|
||||||
|
{ type: "month", text: "Месяц" },
|
||||||
|
{ type: "modntdh", text: "Год" },
|
||||||
|
{ type: "modnth", text: "Расписание" },
|
||||||
|
];
|
||||||
|
const weekday = [1, 2, 3, 4, 5, 6, 0];
|
||||||
|
|
||||||
|
const switchCalendar = (t) => {
|
||||||
|
type.value = t;
|
||||||
|
};
|
||||||
|
|
||||||
|
const value = [new Date()];
|
||||||
|
const events = [];
|
||||||
|
const colors = [
|
||||||
|
"blue",
|
||||||
|
"indigo",
|
||||||
|
"deep-purple",
|
||||||
|
"cyan",
|
||||||
|
"green",
|
||||||
|
"orange",
|
||||||
|
"grey darken-1",
|
||||||
|
];
|
||||||
|
const titles = [
|
||||||
|
"Meeting",
|
||||||
|
"Holiday",
|
||||||
|
"PTO",
|
||||||
|
"Travel",
|
||||||
|
"Event",
|
||||||
|
"Birthday",
|
||||||
|
"Conference",
|
||||||
|
"Party",
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
weekday,
|
||||||
|
type,
|
||||||
|
types,
|
||||||
|
switchCalendar,
|
||||||
|
};
|
||||||
|
// const getEvents = ({ start, end }) => {
|
||||||
|
// const events = []
|
||||||
|
|
||||||
|
// const min = start
|
||||||
|
// const max = end
|
||||||
|
// const days = (max.getTime() - min.getTime()) / 86400000
|
||||||
|
// const eventCount = rnd(days, days + 20)
|
||||||
|
|
||||||
|
// for (let i = 0; i < eventCount; i++) {
|
||||||
|
// const allDay = this.rnd(0, 3) === 0
|
||||||
|
// const firstTimestamp = this.rnd(min.getTime(), max.getTime())
|
||||||
|
// const first = new Date(firstTimestamp - (firstTimestamp % 900000))
|
||||||
|
// const secondTimestamp = this.rnd(2, allDay ? 288 : 8) * 900000
|
||||||
|
// const second = new Date(first.getTime() + secondTimestamp)
|
||||||
|
|
||||||
|
// events.push({
|
||||||
|
// title: this.titles[rnd(0, this.titles.length - 1)],
|
||||||
|
// start: first,
|
||||||
|
// end: second,
|
||||||
|
// color: this.colors[rnd(0, this.colors.length - 1)],
|
||||||
|
// allDay: !allDay,
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// this.events = events
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const getEventColor = (event) => {
|
||||||
|
// return event.value.color
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const rnd = (a, b) => {
|
||||||
|
// return Math.floor((b - a + 1) * Math.random()) + a
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-col class="pb-2 d-flex flex-column ml-n3">
|
<v-col class="pb-2 pt-2 d-flex flex-column ml-n3 " lg=3>
|
||||||
<v-row no-gutters class="gap">
|
<v-row no-gutters class="gap ">
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-checkbox-btn
|
<v-checkbox-btn
|
||||||
v-model="newDate"
|
v-model="newDate"
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
label="Весь день"
|
label="Весь день"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col></v-col>
|
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,208 +0,0 @@
|
|||||||
<template>
|
|
||||||
<v-col lg="3" :class="`order-${order[0]}`">
|
|
||||||
<v-menu
|
|
||||||
v-model="menudate"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
:nudge-right="40"
|
|
||||||
transition="scale-transition"
|
|
||||||
offset-y
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-textarea
|
|
||||||
v-model="modelDate"
|
|
||||||
:value="formatComa(modelDate)"
|
|
||||||
density="compact"
|
|
||||||
no-resize
|
|
||||||
row-height="25"
|
|
||||||
rows="1"
|
|
||||||
variant="outlined"
|
|
||||||
v-bind="props"
|
|
||||||
readonly
|
|
||||||
hide-details
|
|
||||||
>
|
|
||||||
<template v-slot:prepend-inner>
|
|
||||||
<v-icon
|
|
||||||
v-bind="props"
|
|
||||||
icon="mdi-calendar-today"
|
|
||||||
color="cyan-darken-3"
|
|
||||||
size="x-small"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</v-textarea>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<v-locale-provider locale="ru">
|
|
||||||
<v-date-picker
|
|
||||||
v-model="modelDate"
|
|
||||||
show-adjacent-months
|
|
||||||
hide-header
|
|
||||||
border
|
|
||||||
no-time
|
|
||||||
:max="order[0] == 2 ? new Date(propsDateEvent.date_end) : false"
|
|
||||||
:min="
|
|
||||||
order[0] == 2
|
|
||||||
? false
|
|
||||||
: new Date(
|
|
||||||
new Date(propsDateEvent.date_start).setDate(
|
|
||||||
new Date(propsDateEvent.date_start).getDate() - 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
"
|
|
||||||
></v-date-picker>
|
|
||||||
</v-locale-provider>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
<v-col class="flex-grow-0" :class="`order-${order[1]}`">
|
|
||||||
<v-textarea
|
|
||||||
density="compact"
|
|
||||||
no-resize
|
|
||||||
row-height="25"
|
|
||||||
width="75"
|
|
||||||
rows="1"
|
|
||||||
readonly
|
|
||||||
variant="outlined"
|
|
||||||
v-model="timeEvent"
|
|
||||||
:active="menutime"
|
|
||||||
:focus="menutime"
|
|
||||||
hide-details
|
|
||||||
:disabled="chek"
|
|
||||||
>
|
|
||||||
</v-textarea>
|
|
||||||
<v-menu
|
|
||||||
v-model="menutime"
|
|
||||||
:close-on-content-click="false"
|
|
||||||
activator="parent"
|
|
||||||
transition="scale-transition"
|
|
||||||
>
|
|
||||||
<v-time-picker
|
|
||||||
v-if="menutime"
|
|
||||||
v-model="timeEvent"
|
|
||||||
full-width
|
|
||||||
format="24hr"
|
|
||||||
></v-time-picker>
|
|
||||||
</v-menu>
|
|
||||||
</v-col>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { formatComa, formatDash } from "@/utils/universal_functions";
|
|
||||||
import { ref, computed } from "vue";
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
dateEvent: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {},
|
|
||||||
},
|
|
||||||
|
|
||||||
order: {
|
|
||||||
type: Array,
|
|
||||||
default: [0, 0],
|
|
||||||
},
|
|
||||||
|
|
||||||
chek: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
setup(props, { emit }) {
|
|
||||||
const menudate = ref(false);
|
|
||||||
const menutime = ref(false);
|
|
||||||
|
|
||||||
const propsDateEvent = computed({
|
|
||||||
get: () => props.dateEvent,
|
|
||||||
set: (value) => emit("update:dateEvent", value),
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const modelDate = computed({
|
|
||||||
get() {
|
|
||||||
let date =
|
|
||||||
props.order[0] == 2
|
|
||||||
? new Date(propsDateEvent.value.date_start)
|
|
||||||
: new Date(propsDateEvent.value.date_end);
|
|
||||||
|
|
||||||
return date;
|
|
||||||
},
|
|
||||||
set(newValue) {
|
|
||||||
console.log(newValue, 'datas')
|
|
||||||
if(props.chek) {
|
|
||||||
if (props.order[0] == 4) {
|
|
||||||
propsDateEvent.value.date_end = new Date(newValue.setHours(23,59))
|
|
||||||
}
|
|
||||||
if (props.order[0] == 2) {
|
|
||||||
propsDateEvent.value.date_start = new Date(newValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// else {
|
|
||||||
// if (
|
|
||||||
// new Date(formatDash(newValue) + "T" + timeEvent.value) >=
|
|
||||||
// propsDateEvent.value.date_start
|
|
||||||
// ) {
|
|
||||||
// if (props.order[0] == 4)
|
|
||||||
// propsDateEvent.value.date_end = new Date(
|
|
||||||
// formatDash(newValue) + "T" + timeEvent.value
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// if (props.order[0] == 4)
|
|
||||||
// propsDateEvent.value.date_end = propsDateEvent.value.date_start;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (props.order[0] == 2)
|
|
||||||
// propsDateEvent.value.date_start = new Date(
|
|
||||||
// formatDash(newValue) + "T" + timeEvent.value
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const timeEvent = computed({
|
|
||||||
get() {
|
|
||||||
let time =
|
|
||||||
props.order[0] == 2
|
|
||||||
? propsDateEvent.value.date_start
|
|
||||||
: propsDateEvent.value.date_end;
|
|
||||||
|
|
||||||
return `${new Date(time).getHours()}:${String(
|
|
||||||
new Date(time).getMinutes()
|
|
||||||
).padStart(2, "0")}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
set(newValue) {
|
|
||||||
if (
|
|
||||||
new Date(formatDash(modelDate.value) + "T" + newValue) >=
|
|
||||||
propsDateEvent.value.date_start
|
|
||||||
) {
|
|
||||||
if (props.order[0] == 4)
|
|
||||||
propsDateEvent.value.date_end = new Date(
|
|
||||||
formatDash(modelDate.value) + "T" + newValue
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if (props.order[0] == 4)
|
|
||||||
propsDateEvent.value.date_end = propsDateEvent.value.date_start;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (props.order[0] == 2)
|
|
||||||
propsDateEvent.value.date_start = new Date(
|
|
||||||
formatDash(modelDate.value) + "T" + newValue
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
propsDateEvent,
|
|
||||||
modelDate,
|
|
||||||
menudate,
|
|
||||||
menutime,
|
|
||||||
formatComa,
|
|
||||||
timeEvent,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style></style>
|
|
||||||
@@ -90,43 +90,44 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-column">
|
<v-col class="d-flex flex-column">
|
||||||
<v-row no-gutters class="gap">
|
<v-row no-gutters class="gap">
|
||||||
<!-- <time-select
|
|
||||||
:chek ="allDay"
|
|
||||||
:dateEvent="propsEvent.event"
|
|
||||||
@update:dateEvent="propsEvent.event = $event"
|
|
||||||
:order="[2, 1]"
|
|
||||||
/> -->
|
|
||||||
<time-select
|
<time-select
|
||||||
:chek ="allDay"
|
:chek="allDay"
|
||||||
:order="[2, 1]"
|
:order="[2, 1]"
|
||||||
:dateEvent=propsEvent.event.date_start
|
:dateEvent="propsEvent.event.date_start"
|
||||||
:limitation = propsEvent.event.date_end
|
:limitation="propsEvent.event.date_end"
|
||||||
@update:dateEvent="propsEvent.event.date_start = $event"
|
@update:dateEvent="propsEvent.event.date_start = $event"
|
||||||
/>
|
/>
|
||||||
<v-col class="order-3 flex-grow-0">
|
<v-col class="order-3 flex-grow-0">
|
||||||
<v-icon icon="mdi-minus pt-4" color="grey-darken-1" />
|
<v-icon icon="mdi-minus pt-4" color="grey-darken-1" />
|
||||||
</v-col>
|
</v-col>
|
||||||
<time-select
|
<time-select
|
||||||
:chek ="allDay"
|
:chek="allDay"
|
||||||
:order="[4, 5]"
|
|
||||||
:dateEvent=propsEvent.event.date_end
|
|
||||||
:limitation = propsEvent.event.date_start
|
|
||||||
@update:dateEvent="propsEvent.event.date_end = $event"
|
|
||||||
/>
|
|
||||||
<!-- @update:dateEvent="propsEvent.event.date_start = $event" -->
|
|
||||||
<!-- <time-select
|
|
||||||
:chek ="allDay"
|
|
||||||
:dateEvent="propsEvent.event"
|
|
||||||
:order="[4, 5]"
|
:order="[4, 5]"
|
||||||
@update:dateEvent="propsEvent.event = $event"
|
:dateEvent="propsEvent.event.date_end"
|
||||||
/> -->
|
:limitation="propsEvent.event.date_start"
|
||||||
|
@update:dateEvent="propsEvent.event.date_end = $event"
|
||||||
|
/>
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row no-gutters>
|
<v-row no-gutters>
|
||||||
<period-events
|
<period-events
|
||||||
@chekUp ="allDay = $event"
|
@chekUp="allDay = $event"
|
||||||
:dateEventStart="propsEvent.event"
|
:dateEventStart="propsEvent.event"
|
||||||
@update:dateEventStart="propsEvent.event = $event"
|
@update:dateEventStart="propsEvent.event = $event"
|
||||||
/>
|
/>
|
||||||
|
<v-col lg=7 class="pt-2 ml-5">
|
||||||
|
<v-autocomplete
|
||||||
|
v-model="returnPeriod"
|
||||||
|
:items="repeatRules"
|
||||||
|
variant="outlined"
|
||||||
|
density="compact"
|
||||||
|
return-object
|
||||||
|
item-title="type"
|
||||||
|
item-id="type"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
</v-row> </v-col
|
</v-row> </v-col
|
||||||
></v-row>
|
></v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -189,6 +190,7 @@ import UploadingFile from "@/components/UI/defaultportal/uploading-file.vue";
|
|||||||
import ReminderEvent from "@/components/calendar_of_events/UI_calendar/reminderEvent.vue";
|
import ReminderEvent from "@/components/calendar_of_events/UI_calendar/reminderEvent.vue";
|
||||||
import PeriodEvents from "@/components/calendar_of_events/UI_calendar/periodEvents.vue";
|
import PeriodEvents from "@/components/calendar_of_events/UI_calendar/periodEvents.vue";
|
||||||
import { useAlertStore } from "@/store/useAlertStore";
|
import { useAlertStore } from "@/store/useAlertStore";
|
||||||
|
import { datetime, RRule, RRuleSet, rrulestr } from "rrule";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -208,8 +210,61 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
const repeatRules = [
|
||||||
|
{ type: "Не повторять", rule: {} },
|
||||||
|
{ type: "Каждый день", rule: { freq: 3 } },
|
||||||
|
{ type: "Каждую неделю", rule: { freq: 2 } },
|
||||||
|
{ type: "Каждый месяц", rule: { freq: 1 } },
|
||||||
|
{ type: "Каждый год", rule: { freq: 0 } },
|
||||||
|
];
|
||||||
|
|
||||||
const allDay = ref(false)
|
const dateEventsRules = ref({});
|
||||||
|
|
||||||
|
const returnPeriod = computed({
|
||||||
|
get() {
|
||||||
|
let select = [];
|
||||||
|
|
||||||
|
|
||||||
|
let objRule = JSON.parse(propsEvent.value.event.period);
|
||||||
|
|
||||||
|
if (objRule != null) {
|
||||||
|
repeatRules.findIndex(e=> e.rule.freq == objRule.origOptions.freq)
|
||||||
|
// let rule = new RRule({
|
||||||
|
// freq: objRule.origOptions.freq,
|
||||||
|
// dtstart: new Date(objRule.origOptions.dtstart),
|
||||||
|
// until: new Date(objRule.origOptions.until),
|
||||||
|
// });
|
||||||
|
// dateEventsRules.value = rule.all();
|
||||||
|
}
|
||||||
|
|
||||||
|
// let rule = new RRule({
|
||||||
|
// dtstart: objRule.origOptions.dtstart
|
||||||
|
// // ...objRule.origOptions
|
||||||
|
// })
|
||||||
|
select.push(repeatRules[objRule != null?repeatRules.findIndex(e=> e.rule.freq == objRule.origOptions.freq): 0]);
|
||||||
|
|
||||||
|
|
||||||
|
console.log(dateEventsRules.value, "------dateEventsRules.value =");
|
||||||
|
return select;
|
||||||
|
},
|
||||||
|
set(newValue) {
|
||||||
|
let newRulse = new RRule({
|
||||||
|
...newValue.rule,
|
||||||
|
dtstart: new Date(propsEvent.value.event.date_start),
|
||||||
|
until: new Date(propsEvent.value.event.date_end),
|
||||||
|
});
|
||||||
|
console.log(Object.keys(newValue.rule).length == 0, "00");
|
||||||
|
// let ruleObject = newRulse.toJSON();
|
||||||
|
propsEvent.value.event.period =
|
||||||
|
Object.keys(newValue.rule).length == 0
|
||||||
|
? null
|
||||||
|
: JSON.stringify(newRulse);
|
||||||
|
dateEventsRules.value = newRulse.all();
|
||||||
|
console.log(dateEventsRules.value, "returnP");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allDay = ref(false);
|
||||||
|
|
||||||
const propsEvent = computed({
|
const propsEvent = computed({
|
||||||
get: () => props.eventCalendar,
|
get: () => props.eventCalendar,
|
||||||
@@ -289,7 +344,7 @@ export default {
|
|||||||
emit("getCalendar");
|
emit("getCalendar");
|
||||||
});
|
});
|
||||||
emit("closeDialog");
|
emit("closeDialog");
|
||||||
}
|
};
|
||||||
|
|
||||||
const files = ref([]);
|
const files = ref([]);
|
||||||
const postFiles = (f) => {
|
const postFiles = (f) => {
|
||||||
@@ -317,7 +372,8 @@ export default {
|
|||||||
id: propsEvent.value.mycalendars[0].id,
|
id: propsEvent.value.mycalendars[0].id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(propsEvent.value.event.calendar==null) propsEvent.value.event.calendar = propsEvent.value.mycalendars[0].id;
|
if (propsEvent.value.event.calendar == null)
|
||||||
|
propsEvent.value.event.calendar = propsEvent.value.mycalendars[0].id;
|
||||||
return selected;
|
return selected;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -326,8 +382,6 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const titleCard = ref("");
|
const titleCard = ref("");
|
||||||
const newEvent = ref(false);
|
const newEvent = ref(false);
|
||||||
|
|
||||||
@@ -337,7 +391,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
titleCard.value = "Новое событие";
|
titleCard.value = "Новое событие";
|
||||||
newEvent.value = true;
|
newEvent.value = true;
|
||||||
console.log( newEvent.value, ' newEvent.value')
|
console.log(newEvent.value, " newEvent.value");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -379,7 +433,7 @@ export default {
|
|||||||
|
|
||||||
const dateEvent = computed({
|
const dateEvent = computed({
|
||||||
get() {
|
get() {
|
||||||
console.log('работает?')
|
console.log("работает?");
|
||||||
return formatComa(new Date(propsEvent.value.event.date_start));
|
return formatComa(new Date(propsEvent.value.event.date_start));
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -395,7 +449,6 @@ export default {
|
|||||||
const menudate = ref(false);
|
const menudate = ref(false);
|
||||||
|
|
||||||
const postData = (validate) => {
|
const postData = (validate) => {
|
||||||
|
|
||||||
if (validate) {
|
if (validate) {
|
||||||
let postEvent = new FormData();
|
let postEvent = new FormData();
|
||||||
postEvent.append(
|
postEvent.append(
|
||||||
@@ -433,7 +486,9 @@ export default {
|
|||||||
postData,
|
postData,
|
||||||
rules,
|
rules,
|
||||||
delEvent,
|
delEvent,
|
||||||
allDay
|
allDay,
|
||||||
|
repeatRules,
|
||||||
|
returnPeriod,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { VTimePicker } from 'vuetify/labs/VTimePicker'
|
|||||||
export default createVuetify({
|
export default createVuetify({
|
||||||
|
|
||||||
locale: {
|
locale: {
|
||||||
messages: { ru },
|
messages: { ru, },
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
VCalendar,
|
VCalendar,
|
||||||
|
|||||||
Reference in new issue
Block a user