P-47 time
This commit is contained in:
1 parent
bd04bd6d08
commit
48a66002ef
4 files changed
+68
-16
No files matched your search
@@ -23,7 +23,7 @@
|
|||||||
color="btn_text"
|
color="btn_text"
|
||||||
block
|
block
|
||||||
elevation="1"
|
elevation="1"
|
||||||
@click="showDialog = true"
|
@click="createEvent()"
|
||||||
>Создать событие</v-btn
|
>Создать событие</v-btn
|
||||||
>
|
>
|
||||||
<!-- {{eventFromCalendar}} -->
|
<!-- {{eventFromCalendar}} -->
|
||||||
@@ -92,6 +92,7 @@
|
|||||||
<event-create
|
<event-create
|
||||||
@closeDialog = "showDialog = false"
|
@closeDialog = "showDialog = false"
|
||||||
:eventCalendar="eventFromCalendar"
|
:eventCalendar="eventFromCalendar"
|
||||||
|
@getCalendar="$emit('getCalendar')"
|
||||||
/>
|
/>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -108,7 +109,7 @@ import { useAccountStore } from "@/store/AccountStore";
|
|||||||
export default {
|
export default {
|
||||||
components: { EventCreate, CalendarMy },
|
components: { EventCreate, CalendarMy },
|
||||||
|
|
||||||
setup() {
|
setup(props, {emit}) {
|
||||||
const accountStore = useAccountStore();
|
const accountStore = useAccountStore();
|
||||||
const showDialog = ref(false);
|
const showDialog = ref(false);
|
||||||
const week = useWeekendsStore();
|
const week = useWeekendsStore();
|
||||||
@@ -119,8 +120,8 @@ export default {
|
|||||||
const MyMonth = ref(selectdate.value.getMonth() + 1);
|
const MyMonth = ref(selectdate.value.getMonth() + 1);
|
||||||
const calendarForMy = ref([]);
|
const calendarForMy = ref([]);
|
||||||
const eventFromCalendar = ref({})
|
const eventFromCalendar = ref({})
|
||||||
// const idEvent = ref(null)
|
const idEvent = ref(null)
|
||||||
const idEvent = ref(1)
|
// const idEvent = ref(1)
|
||||||
|
|
||||||
const getMonth = (month) => {
|
const getMonth = (month) => {
|
||||||
MyMonth.value = month + 1;
|
MyMonth.value = month + 1;
|
||||||
@@ -161,6 +162,11 @@ export default {
|
|||||||
|
|
||||||
getEvents();
|
getEvents();
|
||||||
|
|
||||||
|
const createEvent = () => {
|
||||||
|
showDialog.value = true
|
||||||
|
emit("getCalendar");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const weekendsData = () => {
|
const weekendsData = () => {
|
||||||
cal.value.$el
|
cal.value.$el
|
||||||
@@ -221,7 +227,8 @@ export default {
|
|||||||
calendarForMy,
|
calendarForMy,
|
||||||
accountStore,
|
accountStore,
|
||||||
getCalendar,
|
getCalendar,
|
||||||
eventFromCalendar
|
eventFromCalendar,
|
||||||
|
createEvent
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,8 +39,11 @@ export default {
|
|||||||
(propsDateEvent.value.date_start = new Date(
|
(propsDateEvent.value.date_start = new Date(
|
||||||
new Date(propsDateEvent.value.date_start).setHours(0, 0, 0)
|
new Date(propsDateEvent.value.date_start).setHours(0, 0, 0)
|
||||||
))
|
))
|
||||||
: (propsDateEvent.value.date_end = new Date());
|
: (propsDateEvent.value.date_end = new Date())&&(propsDateEvent.value.date_start = new Date())
|
||||||
|
|
||||||
|
console.log(propsDateEvent.value.date_start, 'propsDateEvent.value.date_start');
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const propsDateEvent = computed({
|
const propsDateEvent = computed({
|
||||||
|
|||||||
@@ -111,6 +111,27 @@ export default {
|
|||||||
set: (value) => emit("update:dateEvent", value),
|
set: (value) => emit("update:dateEvent", value),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const minEnd = (val) => {
|
||||||
|
// console.log(val, '111')
|
||||||
|
// console.log( new Date(formatDash(modelDate.value) + "T" + val) >
|
||||||
|
// propsDateEvent.value.date_start);
|
||||||
|
// console.log( new Date(formatDash(modelDate.value) + "T" + val),
|
||||||
|
// propsDateEvent.value.date_start);
|
||||||
|
if (
|
||||||
|
new Date(formatDash(modelDate.value) + "T" + val) >
|
||||||
|
propsDateEvent.value.date_start
|
||||||
|
) {
|
||||||
|
if (props.order[0] == 4)
|
||||||
|
propsDateEvent.value.date_end = new Date(
|
||||||
|
formatDash(modelDate.value) + "T" + val
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (props.order[0] == 4)
|
||||||
|
propsDateEvent.value.date_end = propsDateEvent.value.date_start
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const modelDate = computed({
|
const modelDate = computed({
|
||||||
get() {
|
get() {
|
||||||
let date =
|
let date =
|
||||||
@@ -128,6 +149,7 @@ export default {
|
|||||||
).getHours()}:${String(
|
).getHours()}:${String(
|
||||||
new Date(propsDateEvent.value.date_end).getMinutes()
|
new Date(propsDateEvent.value.date_end).getMinutes()
|
||||||
).padStart(2, "0")}`;
|
).padStart(2, "0")}`;
|
||||||
|
|
||||||
disbleTime.value =
|
disbleTime.value =
|
||||||
clockStart == "0:00" &&
|
clockStart == "0:00" &&
|
||||||
clockEnd == "23:59" &&
|
clockEnd == "23:59" &&
|
||||||
@@ -139,17 +161,37 @@ export default {
|
|||||||
return date;
|
return date;
|
||||||
},
|
},
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
if (props.order[0] == 2)
|
||||||
propsDateEvent.value.date_start = new Date(
|
propsDateEvent.value.date_start = new Date(
|
||||||
formatDash(newValue) + "T" + timeEvent.value
|
formatDash(newValue) + "T" + timeEvent.value
|
||||||
);
|
);
|
||||||
if (props.order[0] == 4)
|
// if (props.order[0] == 4)
|
||||||
propsDateEvent.value.date_end = new Date(
|
// propsDateEvent.value.date_end = new Date(
|
||||||
formatDash(newValue) + "T" + timeEvent.value
|
// formatDash(newValue) + "T" + timeEvent.value
|
||||||
);
|
// );
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const timeEvent = computed({
|
const timeEvent = computed({
|
||||||
get() {
|
get() {
|
||||||
let time =
|
let time =
|
||||||
@@ -163,14 +205,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
|
|
||||||
|
minEnd(newValue)
|
||||||
|
|
||||||
if (props.order[0] == 2)
|
if (props.order[0] == 2)
|
||||||
propsDateEvent.value.date_start = new Date(
|
propsDateEvent.value.date_start = new Date(
|
||||||
formatDash(modelDate.value) + "T" + newValue
|
formatDash(modelDate.value) + "T" + newValue
|
||||||
);
|
);
|
||||||
if (props.order[0] == 4)
|
|
||||||
propsDateEvent.value.date_end = new Date(
|
|
||||||
formatDash(modelDate.value) + "T" + newValue
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ export default {
|
|||||||
feedalert.text = result.data.mess;
|
feedalert.text = result.data.mess;
|
||||||
feedalert.ico = "mdi-check";
|
feedalert.ico = "mdi-check";
|
||||||
feedalert.color = "orange-accent-1";
|
feedalert.color = "orange-accent-1";
|
||||||
|
emit("getCalendar");
|
||||||
});
|
});
|
||||||
emit("closeDialog");
|
emit("closeDialog");
|
||||||
}
|
}
|
||||||
@@ -298,7 +298,7 @@ export default {
|
|||||||
id: propsEvent.value.mycalendars[0].id,
|
id: propsEvent.value.mycalendars[0].id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
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;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -394,6 +394,7 @@ export default {
|
|||||||
feedalert.text = result.data.mess;
|
feedalert.text = result.data.mess;
|
||||||
feedalert.ico = "mdi-check";
|
feedalert.ico = "mdi-check";
|
||||||
feedalert.color = "green-darken-4";
|
feedalert.color = "green-darken-4";
|
||||||
|
emit("getCalendar");
|
||||||
emit("closeDialog");
|
emit("closeDialog");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user