P-47 file and time completed
This commit is contained in:
1 parent
a4661443db
commit
5b600c8091
6 files changed
+257
-191
No files matched your search
@@ -0,0 +1,154 @@
|
|||||||
|
<template>
|
||||||
|
<v-col>
|
||||||
|
<v-file-input
|
||||||
|
label="Файлы"
|
||||||
|
chips
|
||||||
|
multiple
|
||||||
|
v-model="eventFiles"
|
||||||
|
density="compact"
|
||||||
|
variant="outlined"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
<template v-slot:selection="{ fileNames }">
|
||||||
|
<template v-for="(fileName, index) in fileNames" :key="fileName">
|
||||||
|
<v-chip
|
||||||
|
v-if="index < 4"
|
||||||
|
class="me-2"
|
||||||
|
color="teal-darken-3"
|
||||||
|
size="small"
|
||||||
|
label
|
||||||
|
>
|
||||||
|
{{ fileName }}
|
||||||
|
</v-chip>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-else-if="index === 4"
|
||||||
|
class="text-overline text-grey-darken-3 mx-2"
|
||||||
|
>
|
||||||
|
+{{ files.length - 4 }} файла(ов)
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</v-file-input>
|
||||||
|
</v-col>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { computed, ref } from "vue";
|
||||||
|
import { get_name } from "@/utils/universal_functions";
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
files: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props, { emit }) {
|
||||||
|
|
||||||
|
const propsFiles = computed({
|
||||||
|
get: () => props.files,
|
||||||
|
set: (value) => emit("update:files", value),
|
||||||
|
});
|
||||||
|
|
||||||
|
const arrFiles = ref([]);
|
||||||
|
|
||||||
|
const eventFiles = computed({
|
||||||
|
get() {
|
||||||
|
propsFiles.value.forEach((e) =>
|
||||||
|
{
|
||||||
|
|
||||||
|
arrFiles.value.push(
|
||||||
|
dataURLtoFile(
|
||||||
|
"data:text/plain;base64,aGVsbG8gd29ybGQ=",
|
||||||
|
get_name(decodeURI(e.file))
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
);
|
||||||
|
return arrFiles.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
set(newValue) {
|
||||||
|
let newFile = []
|
||||||
|
arrFiles.value = [];
|
||||||
|
if (newValue.length == 0) {
|
||||||
|
arrFiles.value = [];
|
||||||
|
propsFiles.value = [];
|
||||||
|
} else {
|
||||||
|
newValue.forEach((e) => {
|
||||||
|
arrFiles.value.push(e)
|
||||||
|
newFile.push(e)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
emit("postFiles", newFile);
|
||||||
|
console.log(newValue, arrFiles.value, "newValue");
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
|
//
|
||||||
|
|
||||||
|
function dataURLtoFile(dataurl, filename) {
|
||||||
|
var arr = dataurl.split(","),
|
||||||
|
mime = arr[0].match(/:(.*?);/)[1],
|
||||||
|
bstr = atob(arr[1]),
|
||||||
|
n = bstr.length,
|
||||||
|
u8arr = new Uint8Array(n);
|
||||||
|
|
||||||
|
while (n--) {
|
||||||
|
u8arr[n] = bstr.charCodeAt(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new File([u8arr], filename, { type: mime });
|
||||||
|
}
|
||||||
|
|
||||||
|
const proverka = () => {
|
||||||
|
console.log('h');
|
||||||
|
}
|
||||||
|
|
||||||
|
// const eventFiles = computed({
|
||||||
|
// get() {
|
||||||
|
// if (propsFiles.value.length > 0) {
|
||||||
|
// propsFiles.value.forEach((e) =>
|
||||||
|
// files.value.push(
|
||||||
|
// dataURLtoFile(
|
||||||
|
// "data:text/plain;base64,aGVsbG8gd29ybGQ=",
|
||||||
|
// get_name(decodeURI(e.file))
|
||||||
|
// )
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
// // let file = dataURLtoFile(
|
||||||
|
// // "data:text/plain;base64,aGVsbG8gd29ybGQ=",
|
||||||
|
// // get_name(
|
||||||
|
// // decodeURI(propsFiles.value.event.files[0].file)
|
||||||
|
// // )
|
||||||
|
// // );
|
||||||
|
|
||||||
|
// // files.value.push(file);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return files.value;
|
||||||
|
// },
|
||||||
|
// set(newValue) {
|
||||||
|
// // console.log(newValue,'file')
|
||||||
|
// newValue.forEach((e) => {
|
||||||
|
// if (!files.value.some((l) => l.name == e.name.split(" ").join("_"))) {
|
||||||
|
// files.value.push(e);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// if (newValue.length == 0) {
|
||||||
|
// files.value = [];
|
||||||
|
// propsFiles.value = [];
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
return {
|
||||||
|
eventFiles,
|
||||||
|
arrFiles,
|
||||||
|
proverka
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<v-col lg="3" :class="`order-${order[0]}`">
|
||||||
|
|
||||||
<v-col lg=3 :class="`order-${order[0]}`" >
|
|
||||||
<v-menu
|
<v-menu
|
||||||
v-model="menudate"
|
v-model="menudate"
|
||||||
:close-on-content-click="false"
|
:close-on-content-click="false"
|
||||||
@@ -11,8 +9,8 @@
|
|||||||
>
|
>
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="myDate"
|
v-model="modelDate"
|
||||||
:value="formatComa(myDate)"
|
:value="formatComa(modelDate)"
|
||||||
density="compact"
|
density="compact"
|
||||||
no-resize
|
no-resize
|
||||||
row-height="25"
|
row-height="25"
|
||||||
@@ -31,15 +29,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-textarea>
|
</v-textarea>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<v-locale-provider locale="ru">
|
<v-locale-provider locale="ru">
|
||||||
<v-date-picker
|
<v-date-picker
|
||||||
v-model="myDate"
|
v-model="modelDate"
|
||||||
show-adjacent-months
|
show-adjacent-months
|
||||||
hide-header
|
hide-header
|
||||||
border
|
border
|
||||||
no-time
|
no-time
|
||||||
:max="new Date(max_date)"
|
:max="order[0] == 2 ? new Date(propsDateEvent.date_end) : false"
|
||||||
:min="new Date(min_date).setDate(new Date(min_date).getDate()-1)"
|
:min="
|
||||||
|
order[0] == 2
|
||||||
|
? false
|
||||||
|
: new Date(
|
||||||
|
new Date(propsDateEvent.date_start).setDate(
|
||||||
|
new Date(propsDateEvent.date_start).getDate() - 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
"
|
||||||
></v-date-picker>
|
></v-date-picker>
|
||||||
</v-locale-provider>
|
</v-locale-provider>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
@@ -64,7 +71,6 @@
|
|||||||
activator="parent"
|
activator="parent"
|
||||||
transition="scale-transition"
|
transition="scale-transition"
|
||||||
>
|
>
|
||||||
|
|
||||||
<v-time-picker
|
<v-time-picker
|
||||||
v-if="menutime"
|
v-if="menutime"
|
||||||
v-model="timeEvent"
|
v-model="timeEvent"
|
||||||
@@ -72,7 +78,6 @@
|
|||||||
format="24hr"
|
format="24hr"
|
||||||
></v-time-picker>
|
></v-time-picker>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -81,74 +86,76 @@ import { formatComa, formatDash } from "@/utils/universal_functions";
|
|||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
date: {
|
dateEvent: {
|
||||||
type: String,
|
type: Object,
|
||||||
default: "2024-07-01",
|
default: () => {},
|
||||||
},
|
|
||||||
max_date: {
|
|
||||||
type: String,
|
|
||||||
default: '2555-07-01'
|
|
||||||
},
|
|
||||||
min_date: {
|
|
||||||
type: String,
|
|
||||||
default: "1970-01-01"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
order: {
|
order: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [0, 0]
|
default: [0, 0],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const menudate = ref(false);
|
const menudate = ref(false);
|
||||||
const menutime = ref(false);
|
const menutime = ref(false);
|
||||||
|
|
||||||
const myDate = computed({
|
const propsDateEvent = computed({
|
||||||
get() {
|
get: () => props.dateEvent,
|
||||||
|
set: (value) => emit("update:dateEvent", value),
|
||||||
|
});
|
||||||
|
|
||||||
return props.date;
|
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) {
|
set(newValue) {
|
||||||
// console.log( , 'newValue')
|
if (props.order[0] == 2)
|
||||||
emit(
|
propsDateEvent.value.date_start = new Date(
|
||||||
"update:date",
|
formatDash(newValue) + "T" + timeEvent.value
|
||||||
new Date(formatDash(newValue) + "T" + timeEvent.value)
|
);
|
||||||
|
if (props.order[0] == 4)
|
||||||
|
propsDateEvent.value.date_end = new Date(
|
||||||
|
formatDash(newValue) + "T" + timeEvent.value
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const timeEvent = computed({
|
const timeEvent = computed({
|
||||||
get() {
|
get() {
|
||||||
return `${new Date(props.date).getHours()}:${String(
|
let time =
|
||||||
new Date(props.date).getMinutes()
|
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")}`;
|
).padStart(2, "0")}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
emit(
|
if (props.order[0] == 2)
|
||||||
"update:date",
|
propsDateEvent.value.date_start = new Date(
|
||||||
new Date(formatDash(myDate.value) + "T" + newValue)
|
formatDash(modelDate.value) + "T" + newValue
|
||||||
|
);
|
||||||
|
if (props.order[0] == 4)
|
||||||
|
propsDateEvent.value.date_end = new Date(
|
||||||
|
formatDash(modelDate.value) + "T" + newValue
|
||||||
);
|
);
|
||||||
// console.log(formatDash(myDate.value))
|
|
||||||
|
|
||||||
// emit("update:date", newValue);
|
|
||||||
// let timeParts = newValue.split(":");
|
|
||||||
// let h = new Date(props.date).setHours(
|
|
||||||
// parseInt(timeParts[0], 10),
|
|
||||||
// parseInt(timeParts[1], 10)
|
|
||||||
// );
|
|
||||||
// emit("update:date", new Date(h));
|
|
||||||
// console.log(newValue, new Date(h), '22222222222222222')
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
propsDateEvent,
|
||||||
|
modelDate,
|
||||||
menudate,
|
menudate,
|
||||||
menutime,
|
menutime,
|
||||||
formatComa,
|
formatComa,
|
||||||
timeEvent,
|
timeEvent,
|
||||||
myDate,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
return-object
|
return-object
|
||||||
>
|
>
|
||||||
<template v-slot:selection="{ item }">
|
<template v-slot:selection="{ item }">
|
||||||
<v-chip>
|
<v-chip
|
||||||
|
class="me-2"
|
||||||
|
color="teal-darken-3"
|
||||||
|
size="small"
|
||||||
|
label>
|
||||||
<span> {{ item.title }}</span>
|
<span> {{ item.title }}</span>
|
||||||
<v-icon
|
<v-icon
|
||||||
v-if="item.value != accountStore.user.is_idEmployee"
|
v-if="item.value != accountStore.user.is_idEmployee"
|
||||||
@@ -142,24 +146,17 @@ export default {
|
|||||||
const selectedStaff = computed({
|
const selectedStaff = computed({
|
||||||
get() {
|
get() {
|
||||||
let selected = [];
|
let selected = [];
|
||||||
|
|
||||||
props.staff.forEach((e) => {
|
props.staff.forEach((e) => {
|
||||||
console.log(e, 'eeeeeeeeeeeee')
|
if (
|
||||||
if (e.employees.length != 1 && e.employees.every((n) => n[props.okey] == true)) {
|
e.employees.length != 1 &&
|
||||||
console.log(e.employees.length, 'if')
|
e.employees.every((n) => n[props.okey] == true)
|
||||||
|
) {
|
||||||
e[props.okey] = true;
|
e[props.okey] = true;
|
||||||
selected.push(e);
|
selected.push(e);
|
||||||
|
} else if (e.employees.length == 1) {
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (e.employees.length == 1 ) {
|
|
||||||
e[props.okey] = true;
|
e[props.okey] = true;
|
||||||
selected.push(...e.employees.filter((n) => n[props.okey] == true));
|
selected.push(...e.employees.filter((n) => n[props.okey] == true));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
console.log(e, 'else eeeeeeeeeeeee')
|
|
||||||
e[props.okey] = false;
|
e[props.okey] = false;
|
||||||
selected.push(...e.employees.filter((n) => n[props.okey] == true));
|
selected.push(...e.employees.filter((n) => n[props.okey] == true));
|
||||||
}
|
}
|
||||||
@@ -168,7 +165,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
set(item) {
|
set(item) {
|
||||||
|
|
||||||
// Если нажимать на пользователя с disable, то срабатывает
|
// Если нажимать на пользователя с disable, то срабатывает
|
||||||
// set и отправляет данные которые не нужны, но выдает только в виде массива.
|
// set и отправляет данные которые не нужны, но выдает только в виде массива.
|
||||||
// Остальные данные передаются объектом, кроме выбора ВСЕХ ПОЛЬЗОВАТЕЛЕЙ, для него написан отдельный клик на обработку
|
// Остальные данные передаются объектом, кроме выбора ВСЕХ ПОЛЬЗОВАТЕЛЕЙ, для него написан отдельный клик на обработку
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<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">
|
||||||
<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">
|
||||||
<my-helper :pretext= "propsCalendar " />
|
|
||||||
Название
|
Название
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
@@ -121,7 +121,6 @@ export default {
|
|||||||
let ind = propsCalendar.value.participant.find(
|
let ind = propsCalendar.value.participant.find(
|
||||||
(l) => l.participant_calendar == e.id
|
(l) => l.participant_calendar == e.id
|
||||||
);
|
);
|
||||||
console.log(indx, ind, 'inxind')
|
|
||||||
if (idPart.okey == "editor") {
|
if (idPart.okey == "editor") {
|
||||||
ind.editor = e.editor;
|
ind.editor = e.editor;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -88,24 +88,23 @@
|
|||||||
</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
|
<time-select
|
||||||
:date="propsEvent.event.date_start"
|
:dateEvent="propsEvent.event"
|
||||||
:max_date="propsEvent.event.date_end"
|
|
||||||
@update:date="propsEvent.event.date_start = $event"
|
@update:dateEvent="propsEvent.event = $event"
|
||||||
:order="[2, 1]"
|
:order="[2, 1]"
|
||||||
/> -->
|
/>
|
||||||
<!-- -->
|
|
||||||
<!-- -->
|
|
||||||
<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>
|
||||||
|
<!-- @update:dateEvent="propsEvent.event.date_start = $event" -->
|
||||||
<!-- <time-select
|
<time-select
|
||||||
:date="propsEvent.event.date_end"
|
:dateEvent="propsEvent.event"
|
||||||
:order="[4, 5]"
|
:order="[4, 5]"
|
||||||
:min_date="propsEvent.event.date_start"
|
|
||||||
@update:date="propsEvent.event.date_end = $event"
|
@update:dateEvent="propsEvent.event = $event"
|
||||||
/> -->
|
/>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row no-gutters>
|
<v-row no-gutters>
|
||||||
<v-col>
|
<v-col>
|
||||||
@@ -123,38 +122,13 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-row no-gutters class="align-center">
|
<v-row no-gutters class="align-center">
|
||||||
<v-col class="text-body-2 text-text_grey pb-5" lg="2"> Файлы </v-col>
|
<v-col class="text-body-2 text-text_grey pb-5" lg="2"> Файлы </v-col>
|
||||||
<v-col>
|
|
||||||
<v-file-input
|
|
||||||
label="Файлы"
|
|
||||||
chips
|
|
||||||
multiple
|
|
||||||
v-model="eventFiles"
|
|
||||||
variant="outlined"
|
|
||||||
>
|
|
||||||
</v-file-input>
|
|
||||||
<!-- <v-file-input
|
|
||||||
label="Файлы"
|
|
||||||
chips
|
|
||||||
multiple
|
|
||||||
v-model="eventFiles"
|
|
||||||
>
|
|
||||||
<template v-slot:selection="{ fileNames }">
|
|
||||||
<v-chip v-for="x in fileNames" :key=x>
|
|
||||||
<span> {{ x }}</span>
|
|
||||||
|
|
||||||
<v-icon
|
<uploading-file
|
||||||
|
:files="propsEvent.event.files"
|
||||||
icon="mdi-close-circle"
|
@update:files="propsEvent.event.files = $event"
|
||||||
size="x-small"
|
@postFiles="postFiles"
|
||||||
class="ml-3"
|
|
||||||
@click="proverka()"
|
|
||||||
/>
|
/>
|
||||||
</v-chip>
|
</v-row>
|
||||||
</template>
|
|
||||||
|
|
||||||
</v-file-input> -->
|
|
||||||
</v-col></v-row
|
|
||||||
>
|
|
||||||
<v-row no-gutters class="align-center">
|
<v-row no-gutters class="align-center">
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-textarea
|
<v-textarea
|
||||||
@@ -172,15 +146,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { computed, ref, watch } 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";
|
||||||
import { formatComa, get_name } from "@/utils/universal_functions";
|
import { formatComa } from "@/utils/universal_functions";
|
||||||
import TimeSelect from "@/components/calendar_of_events/UI_calendar/timeSelect.vue";
|
import TimeSelect from "@/components/calendar_of_events/UI_calendar/timeSelect.vue";
|
||||||
import { useAccountStore } from "@/store/AccountStore";
|
import { useAccountStore } from "@/store/AccountStore";
|
||||||
|
import UploadingFile from "@/components/UI/defaultportal/uploading-file.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { calendarCreateSelect, DialogCreate, TimeSelect },
|
components: { calendarCreateSelect, DialogCreate, TimeSelect, UploadingFile },
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
eventCalendar: {
|
eventCalendar: {
|
||||||
@@ -195,8 +171,6 @@ export default {
|
|||||||
set: (value) => emit("update:eventCalendar", value),
|
set: (value) => emit("update:eventCalendar", value),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const staff = ref([]);
|
const staff = ref([]);
|
||||||
|
|
||||||
axiosApiInstance
|
axiosApiInstance
|
||||||
@@ -211,21 +185,18 @@ export default {
|
|||||||
const newStaff = computed({
|
const newStaff = computed({
|
||||||
get() {
|
get() {
|
||||||
let ns = [];
|
let ns = [];
|
||||||
console.log(propsEvent.value.event.participant, '------------propsEvent.value.event.participant')
|
|
||||||
let indCal = propsEvent.value.mycalendars.findIndex(
|
let indCal = propsEvent.value.mycalendars.findIndex(
|
||||||
(e) => e.id == calendar.value[0].id
|
(e) => e.id == calendar.value[0].id
|
||||||
);
|
);
|
||||||
|
|
||||||
staff.value.forEach((e) => {
|
staff.value.forEach((e) => {
|
||||||
|
|
||||||
let emp = { ...e };
|
let emp = { ...e };
|
||||||
emp.employees = e.employees.filter((n) => {
|
emp.employees = e.employees.filter((n) => {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
n.id == accountStore.user.is_idEmployee ||
|
n.id == accountStore.user.is_idEmployee ||
|
||||||
propsEvent.value.event.participant.some((e) => n.id == e)
|
propsEvent.value.event.participant.some((e) => n.id == e)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
n.selected = true;
|
n.selected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,63 +221,14 @@ export default {
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
console.log(ns, " ns---------------");
|
|
||||||
return ns;
|
return ns;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
function dataURLtoFile(dataurl, filename) {
|
|
||||||
var arr = dataurl.split(","),
|
|
||||||
mime = arr[0].match(/:(.*?);/)[1],
|
|
||||||
bstr = atob(arr[1]),
|
|
||||||
n = bstr.length,
|
|
||||||
u8arr = new Uint8Array(n);
|
|
||||||
|
|
||||||
while (n--) {
|
|
||||||
u8arr[n] = bstr.charCodeAt(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new File([u8arr], filename, { type: mime });
|
|
||||||
}
|
|
||||||
|
|
||||||
const files = ref([]);
|
const files = ref([]);
|
||||||
|
const postFiles = (f) => {
|
||||||
const eventFiles = computed({
|
files.value = f;
|
||||||
get() {
|
console.log(f, "postFiles");
|
||||||
if (propsEvent.value.event.files.length > 0) {
|
};
|
||||||
propsEvent.value.event.files.forEach((e) =>
|
|
||||||
files.value.push(
|
|
||||||
dataURLtoFile(
|
|
||||||
"data:text/plain;base64,aGVsbG8gd29ybGQ=",
|
|
||||||
get_name(decodeURI(e.file))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
// let file = dataURLtoFile(
|
|
||||||
// "data:text/plain;base64,aGVsbG8gd29ybGQ=",
|
|
||||||
// get_name(
|
|
||||||
// decodeURI(propsEvent.value.event.files[0].file)
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
|
|
||||||
// files.value.push(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return files.value;
|
|
||||||
},
|
|
||||||
set(newValue) {
|
|
||||||
// console.log(newValue,'file')
|
|
||||||
newValue.forEach((e) => {
|
|
||||||
if (!files.value.some((l) => l.name == e.name.split(" ").join("_"))) {
|
|
||||||
files.value.push(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (newValue.length == 0) {
|
|
||||||
files.value = [];
|
|
||||||
propsEvent.value.event.files = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const calendar = computed({
|
const calendar = computed({
|
||||||
get() {
|
get() {
|
||||||
@@ -364,29 +286,25 @@ export default {
|
|||||||
const part = new Set();
|
const part = new Set();
|
||||||
|
|
||||||
const returnIdParticant = (idPart) => {
|
const returnIdParticant = (idPart) => {
|
||||||
|
|
||||||
idPart.staff.forEach((e) => {
|
idPart.staff.forEach((e) => {
|
||||||
if(e.selected == true && !propsEvent.value.event.participant.includes(e.id)) {
|
if (
|
||||||
propsEvent.value.event.participant.push(e.id)
|
e.selected == true &&
|
||||||
}
|
!propsEvent.value.event.participant.includes(e.id)
|
||||||
else {
|
) {
|
||||||
|
propsEvent.value.event.participant.push(e.id);
|
||||||
|
} else {
|
||||||
let ind = propsEvent.value.event.participant.findIndex(
|
let ind = propsEvent.value.event.participant.findIndex(
|
||||||
(l) => l == e.id
|
(l) => l == e.id
|
||||||
)
|
);
|
||||||
|
|
||||||
if (ind != -1) {
|
if (ind != -1) {
|
||||||
propsEvent.value.event.participant.splice(ind, 1);
|
propsEvent.value.event.participant.splice(ind, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const cbSelect = (item, arr) => {
|
const cbSelect = (item, arr) => {
|
||||||
|
|
||||||
item.forEach((e) => {
|
item.forEach((e) => {
|
||||||
if (!("employees" in e)) {
|
if (!("employees" in e)) {
|
||||||
if (!propsEvent.value.event.participant.includes(e.id)) {
|
if (!propsEvent.value.event.participant.includes(e.id)) {
|
||||||
@@ -430,10 +348,6 @@ export default {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const proverka = () => {
|
|
||||||
console.log("Проверка");
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
menudate,
|
menudate,
|
||||||
titleCard,
|
titleCard,
|
||||||
@@ -444,10 +358,8 @@ export default {
|
|||||||
staff,
|
staff,
|
||||||
newStaff,
|
newStaff,
|
||||||
returnIdParticant,
|
returnIdParticant,
|
||||||
eventFiles,
|
postFiles,
|
||||||
postData,
|
postData,
|
||||||
files,
|
|
||||||
proverka,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,11 +38,9 @@ export default {
|
|||||||
const selectdate = ref(new Date())
|
const selectdate = ref(new Date())
|
||||||
const hol = ['2024-05-09', '2024-05-11']
|
const hol = ['2024-05-09', '2024-05-11']
|
||||||
|
|
||||||
const addWeekend = () => {
|
|
||||||
console.log(week);
|
|
||||||
}
|
|
||||||
|
|
||||||
addWeekend()
|
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
|
|
||||||
cal.value.$el.querySelectorAll(".v-date-picker-month__day").forEach((e)=>{
|
cal.value.$el.querySelectorAll(".v-date-picker-month__day").forEach((e)=>{
|
||||||
|
|||||||
Reference in new issue
Block a user