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