P-51 validate
This commit is contained in:
1 parent
024af28517
commit
baaeca9220
5 files changed
+41
-60
No files matched your search
@@ -74,14 +74,11 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-column">
|
<v-col class="d-flex flex-column">
|
||||||
|
|
||||||
|
|
||||||
<calendar-full
|
<calendar-full
|
||||||
:allEvent="calendarForMy.filter((e) => e.events.length > 0)"
|
:allEvent="calendarForMy.filter((e) => e.events.length > 0)"
|
||||||
@getEvent="createEvent"
|
@getEvent="createEvent"
|
||||||
@update:allEvent="infoEvent($event)"
|
@update:allEvent="infoEvent($event)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<!-- <v-navigation-drawer
|
<!-- <v-navigation-drawer
|
||||||
@@ -99,6 +96,7 @@
|
|||||||
:eventCalendar="eventFromCalendar"
|
:eventCalendar="eventFromCalendar"
|
||||||
@update:eventCalendar="eventFromCalendar = $event"
|
@update:eventCalendar="eventFromCalendar = $event"
|
||||||
@getCalendar="getCalendar"
|
@getCalendar="getCalendar"
|
||||||
|
ref="createEvents"
|
||||||
/>
|
/>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -127,19 +125,7 @@ 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 createEvents = ref(null);
|
||||||
// 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;
|
||||||
@@ -162,19 +148,16 @@ export default {
|
|||||||
|
|
||||||
getCalendar();
|
getCalendar();
|
||||||
|
|
||||||
const getEvents = (idEvent) => {
|
const getEvents = (idEvent, clik) => {
|
||||||
|
|
||||||
axiosApiInstance
|
axiosApiInstance
|
||||||
.get(
|
.get(
|
||||||
`api/calendar_of_events/my_events/${
|
`api/calendar_of_events/my_events/${
|
||||||
idEvent == undefined ? "" : `?id=${idEvent}`
|
idEvent === undefined ? "" : `?id=${idEvent}`
|
||||||
}`
|
}`
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
eventFromCalendar.value = res.data;
|
if (idEvent === undefined) {
|
||||||
|
res.data.event = {
|
||||||
if (idEvent == undefined) {
|
|
||||||
eventFromCalendar.value.event = {
|
|
||||||
name: "",
|
name: "",
|
||||||
participant: [accountStore.user.is_idEmployee],
|
participant: [accountStore.user.is_idEmployee],
|
||||||
files: [],
|
files: [],
|
||||||
@@ -185,14 +168,16 @@ export default {
|
|||||||
calendar: null,
|
calendar: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
eventFromCalendar.value = res.data;
|
||||||
|
|
||||||
|
if (clik) showDialog.value = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
getEvents();
|
getEvents();
|
||||||
|
|
||||||
const createEvent = (idEv) => {
|
const createEvent = (idEv) => {
|
||||||
showDialog.value = true;
|
getEvents(idEv, true);
|
||||||
getEvents(idEv);
|
|
||||||
if (idEv) {
|
if (idEv) {
|
||||||
getCalendar();
|
getCalendar();
|
||||||
}
|
}
|
||||||
@@ -248,7 +233,6 @@ export default {
|
|||||||
console.log(i, "iiiiiiiiii");
|
console.log(i, "iiiiiiiiii");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
drawer_right,
|
drawer_right,
|
||||||
selectdate,
|
selectdate,
|
||||||
@@ -265,7 +249,7 @@ export default {
|
|||||||
eventFromCalendar,
|
eventFromCalendar,
|
||||||
createEvent,
|
createEvent,
|
||||||
infoEvent,
|
infoEvent,
|
||||||
|
createEvents,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -116,9 +116,7 @@ export default {
|
|||||||
i.date_end = dayNextMonth.value;
|
i.date_end = dayNextMonth.value;
|
||||||
|
|
||||||
let objRule = JSON.parse(i.period);
|
let objRule = JSON.parse(i.period);
|
||||||
// console.log(objRule.origOptions, "распар правила");
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
if (objRule != null) {
|
if (objRule != null) {
|
||||||
let startnew =
|
let startnew =
|
||||||
@@ -288,7 +286,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const funRoundet = (ev, day) => {
|
const funRoundet = (ev, day) => {
|
||||||
// console.log(ev,'--------------------------------------------------------------')
|
|
||||||
if (ev.rule.freq == 3) {
|
if (ev.rule.freq == 3) {
|
||||||
if (
|
if (
|
||||||
zeroTime(day.date) != zeroTime(ev.start_event) &&
|
zeroTime(day.date) != zeroTime(ev.start_event) &&
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-card min-height="436" class="pa-3">
|
<v-card min-height="436" class="pa-3">
|
||||||
<v-card-title class="pr-0 pl-2 d-flex justify-space-between">
|
<v-card-title class="pr-0 pl-2 d-flex justify-space-between">
|
||||||
{{ title }} {{ newOrOld }}
|
{{ title }}
|
||||||
<v-icon
|
<v-icon
|
||||||
icon="mdi-close cursor-pointer"
|
icon="mdi-close cursor-pointer"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
variant="flat"
|
variant="flat"
|
||||||
>резет</v-btn
|
>резет</v-btn
|
||||||
> -->
|
> -->
|
||||||
<v-btn @click="clearFormValidation"></v-btn>
|
<!-- <v-btn @click="clearFormValidation"></v-btn> -->
|
||||||
<v-btn
|
<v-btn
|
||||||
class="text-subtitle-1"
|
class="text-subtitle-1"
|
||||||
elevation="0"
|
elevation="0"
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, inject } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -76,31 +76,22 @@ export default {
|
|||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const form_valid = ref(null);
|
const form_valid = ref(null);
|
||||||
|
|
||||||
const clearValidation =() => {
|
|
||||||
if (form_valid.value) {
|
|
||||||
form_valid.value.resetValidation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const transformation = () => {
|
const transformation = () => {
|
||||||
emit("postData", form_valid.value.isValid);
|
emit("postData", form_valid.value.isValid);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const h = inject('h')
|
|
||||||
|
|
||||||
const clearFormValidation = () => {
|
const clearFormValidation = () => {
|
||||||
console.log(h())
|
|
||||||
|
if (!!form_valid.value) {
|
||||||
|
form_valid.value.resetValidation();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
clearFormValidation()
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
form_valid,
|
form_valid,
|
||||||
transformation,
|
transformation,
|
||||||
clearValidation,
|
|
||||||
clearFormValidation
|
clearFormValidation,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ export default {
|
|||||||
const hover = ref(0);
|
const hover = ref(0);
|
||||||
|
|
||||||
const editCreatedCalendar = (cal) => {
|
const editCreatedCalendar = (cal) => {
|
||||||
|
|
||||||
if (cal === undefined) {
|
if (cal === undefined) {
|
||||||
calendar.value = {
|
calendar.value = {
|
||||||
cl_name: "",
|
cl_name: "",
|
||||||
|
|||||||
@@ -5,12 +5,13 @@
|
|||||||
@postData="postData"
|
@postData="postData"
|
||||||
@closeDialog="$emit('closeDialog')"
|
@closeDialog="$emit('closeDialog')"
|
||||||
@delObject="delEvent(propsEvent.event.id)"
|
@delObject="delEvent(propsEvent.event.id)"
|
||||||
|
ref="createDialog"
|
||||||
>
|
>
|
||||||
<template v-slot:card_text>
|
<template v-slot:card_text>
|
||||||
<v-row no-gutters class="flex-column">
|
<v-row no-gutters class="flex-column">
|
||||||
<v-col class="d-flex flex-column">
|
<v-col class="d-flex flex-column">
|
||||||
<v-row no-gutters class="align-center">
|
<v-row no-gutters class="align-center">
|
||||||
<my-helper :pretext="propsEvent.event" />
|
<!-- <my-helper :pretext="propsEvent.event" /> -->
|
||||||
|
|
||||||
<v-col class="text-body-2 text-text_grey pb-5" lg="2">
|
<v-col class="text-body-2 text-text_grey pb-5" lg="2">
|
||||||
Название
|
Название
|
||||||
@@ -189,7 +190,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { computed, ref, provide } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import { axiosApiInstance } from "@/utils/axios-api";
|
import { axiosApiInstance } from "@/utils/axios-api";
|
||||||
import DialogCreate from "@/components/calendar_of_events/UI_calendar/dialogCreate.vue";
|
import DialogCreate from "@/components/calendar_of_events/UI_calendar/dialogCreate.vue";
|
||||||
import calendarCreateSelect from "@/components/calendar_of_events/calendar-create-select.vue";
|
import calendarCreateSelect from "@/components/calendar_of_events/calendar-create-select.vue";
|
||||||
@@ -221,8 +222,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
|
||||||
|
|
||||||
|
const createDialog = ref(null)
|
||||||
|
|
||||||
const propsEvent = computed({
|
const propsEvent = computed({
|
||||||
get: () => props.eventCalendar,
|
get: () =>
|
||||||
|
{
|
||||||
|
|
||||||
|
return props.eventCalendar
|
||||||
|
}
|
||||||
|
|
||||||
|
,
|
||||||
set: (value) => emit("update:eventCalendar", value),
|
set: (value) => emit("update:eventCalendar", value),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -230,13 +241,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const clearFormValidation = () => {
|
|
||||||
|
|
||||||
console.log('hi')
|
|
||||||
// console.log(h)
|
|
||||||
}
|
|
||||||
|
|
||||||
provide('h', clearFormValidation );
|
|
||||||
|
|
||||||
const repeatRules = [
|
const repeatRules = [
|
||||||
{ type: "Не повторять", rule: {}, id: 1 },
|
{ type: "Не повторять", rule: {}, id: 1 },
|
||||||
@@ -314,11 +319,12 @@ export default {
|
|||||||
const feedalert = useAlertStore().alert;
|
const feedalert = useAlertStore().alert;
|
||||||
|
|
||||||
const req = (val) => {
|
const req = (val) => {
|
||||||
console.log(val, 'val')
|
|
||||||
return !!val || "Поле обязательно";
|
return !!val || "Поле обязательно";
|
||||||
};
|
};
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
|
|
||||||
name: [(val) => req(val)],
|
name: [(val) => req(val)],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -477,7 +483,7 @@ export default {
|
|||||||
const menudate = ref(false);
|
const menudate = ref(false);
|
||||||
|
|
||||||
const postData = (validate) => {
|
const postData = (validate) => {
|
||||||
console.log(validate, ' перед отправкой формы')
|
|
||||||
if (validate) {
|
if (validate) {
|
||||||
let postEvent = new FormData();
|
let postEvent = new FormData();
|
||||||
postEvent.append(
|
postEvent.append(
|
||||||
@@ -590,7 +596,8 @@ export default {
|
|||||||
returnPeriod,
|
returnPeriod,
|
||||||
periodDisplayRule,
|
periodDisplayRule,
|
||||||
what,
|
what,
|
||||||
clearFormValidation
|
|
||||||
|
createDialog
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user