P-51
This commit is contained in:
1 parent
ebc1445a18
commit
5b942ba862
2 files changed
+36
-55
No files matched your search
@@ -128,7 +128,7 @@ export default {
|
||||
const calendarForMy = ref([]);
|
||||
const eventFromCalendar = ref({});
|
||||
const idEvent = ref(null);
|
||||
// const idEvent = ref(4)
|
||||
// const idEvent = ref(27)
|
||||
|
||||
// const rule = new RRule({
|
||||
// freq: RRule.WEEKLY,
|
||||
@@ -151,7 +151,7 @@ export default {
|
||||
};
|
||||
|
||||
const getCalendar = () => {
|
||||
console.log(idEvent.value,' idEvent.value');
|
||||
console.log(idEvent.value, " idEvent.value");
|
||||
axiosApiInstance
|
||||
.get(`api/calendar_of_events/my_calendars/`)
|
||||
.then((res) => {
|
||||
@@ -167,7 +167,7 @@ export default {
|
||||
getCalendar();
|
||||
|
||||
const getEvents = () => {
|
||||
|
||||
console.log(idEvent.value, "idEvent.value----------------");
|
||||
axiosApiInstance
|
||||
.get(
|
||||
`api/calendar_of_events/my_events/${
|
||||
@@ -175,7 +175,6 @@ export default {
|
||||
}`
|
||||
)
|
||||
.then((res) => {
|
||||
console.log(eventFromCalendar.value, 'eventFromCalendar.value')
|
||||
eventFromCalendar.value = res.data;
|
||||
|
||||
if (idEvent.value == null) {
|
||||
@@ -190,22 +189,14 @@ export default {
|
||||
calendar: null,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
getEvents();
|
||||
|
||||
const createEvent = () => {
|
||||
|
||||
|
||||
const createEvent = (idEv) => {
|
||||
showDialog.value = true;
|
||||
getCalendar();
|
||||
console.log('1');
|
||||
// emit("getCalendar");
|
||||
// getEvents();
|
||||
};
|
||||
|
||||
const weekendsData = () => {
|
||||
|
||||
@@ -90,7 +90,6 @@
|
||||
</v-col>
|
||||
<v-col class="d-flex flex-column">
|
||||
<v-row no-gutters class="gap">
|
||||
|
||||
<time-select
|
||||
:chek="allDay"
|
||||
:order="[2, 1]"
|
||||
@@ -108,7 +107,6 @@
|
||||
:limitation="propsEvent.event.date_start"
|
||||
@update:dateEvent="propsEvent.event.date_end = $event"
|
||||
/>
|
||||
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
<period-events
|
||||
@@ -116,18 +114,17 @@
|
||||
:dateEventStart="propsEvent.event"
|
||||
@update:dateEventStart="propsEvent.event = $event"
|
||||
/>
|
||||
<v-col lg=7 class="pt-2 ml-5">
|
||||
<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-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>
|
||||
@@ -218,36 +215,28 @@ export default {
|
||||
{ type: "Каждый год", rule: { freq: 0 } },
|
||||
];
|
||||
|
||||
const dateEventsRules = ref({});
|
||||
|
||||
const returnPeriod = computed({
|
||||
get() {
|
||||
console.log(propsEvent.value, 'propsEvent.value');
|
||||
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();
|
||||
repeatRules.findIndex((e) => e.rule.freq == objRule.origOptions.freq);
|
||||
}
|
||||
|
||||
// let rule = new RRule({
|
||||
// dtstart: objRule.origOptions.dtstart
|
||||
// // ...objRule.origOptions
|
||||
// new Date(
|
||||
// new Date().setDate(
|
||||
// new Date().getDate() - 3
|
||||
// })
|
||||
select.push(repeatRules[objRule != null?repeatRules.findIndex(e=> e.rule.freq == objRule.origOptions.freq): 0]);
|
||||
select.push(
|
||||
repeatRules[
|
||||
objRule != null
|
||||
? repeatRules.findIndex(
|
||||
(e) => e.rule.freq == objRule.origOptions.freq
|
||||
)
|
||||
: 0
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
return select;
|
||||
},
|
||||
set(newValue) {
|
||||
@@ -256,12 +245,15 @@ export default {
|
||||
dtstart: new Date(propsEvent.value.event.date_start),
|
||||
until: new Date(propsEvent.value.event.date_end),
|
||||
});
|
||||
|
||||
Object.keys(newValue.rule).length == 0
|
||||
? null
|
||||
: JSON.stringify(newRulse);
|
||||
dateEventsRules.value = newRulse.all();
|
||||
|
||||
|
||||
Object.keys(newValue.rule).length == 0
|
||||
? null
|
||||
: (propsEvent.value.event.period = JSON.stringify(
|
||||
newRulse
|
||||
));
|
||||
// : (propsEvent.value.event.period = JSON.stringify(
|
||||
// newRulse.origOptions
|
||||
// ));
|
||||
},
|
||||
});
|
||||
|
||||
@@ -351,7 +343,6 @@ export default {
|
||||
const files = ref([]);
|
||||
const postFiles = (f) => {
|
||||
files.value = f;
|
||||
|
||||
};
|
||||
|
||||
const calendar = computed({
|
||||
@@ -434,7 +425,6 @@ export default {
|
||||
|
||||
const dateEvent = computed({
|
||||
get() {
|
||||
|
||||
return formatComa(new Date(propsEvent.value.event.date_start));
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user