s
This commit is contained in:
1 parent
50eefccda2
commit
b34ce38324
2 files changed
+52
-67
No files matched your search
+2
-2
@@ -21,8 +21,8 @@
|
||||
"vitepress": "^1.6.3"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,ts,vue}": [
|
||||
"eslint --fix","prettier --write"
|
||||
"*.{js,ts,vue}": ["prettier --write",
|
||||
"eslint --fix"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,7 @@
|
||||
<v-row no-gutters class="flex-column">
|
||||
<v-col class="d-flex flex-column">
|
||||
<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-textarea
|
||||
density="compact"
|
||||
@@ -37,8 +34,8 @@
|
||||
propsCalendar.cl_color === null
|
||||
? 'flat'
|
||||
: propsCalendar.cl_color === x
|
||||
? 'flat'
|
||||
: 'tonal'
|
||||
? 'flat'
|
||||
: 'tonal'
|
||||
"
|
||||
/> </v-col
|
||||
></v-row>
|
||||
@@ -80,8 +77,8 @@
|
||||
<v-icon v-bind="props" icon="mdi-help-circle-outline" />
|
||||
</template>
|
||||
<div class="custom-tooltip">
|
||||
Участники с доступом редактирования смогут изменять поля
|
||||
календаря, а также редактировать и удалять события
|
||||
Участники с доступом редактирования смогут изменять поля календаря, а также
|
||||
редактировать и удалять события
|
||||
</div>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
@@ -92,12 +89,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed, ref } from "vue";
|
||||
import { axiosApiInstance } from "@/utils/axios-api";
|
||||
import calendarCreateSelect from "@/components/calendar_of_events/calendar-create-select.vue";
|
||||
import { useAlertStore } from "@/store/useAlertStore";
|
||||
import DialogCreate from "./UI_calendar/dialogCreate.vue";
|
||||
import { useAccountStore } from "@/store/AccountStore";
|
||||
import { computed, ref } from 'vue';
|
||||
import { axiosApiInstance } from '@/utils/axios-api';
|
||||
import calendarCreateSelect from '@/components/calendar_of_events/calendar-create-select.vue';
|
||||
import { useAlertStore } from '@/store/useAlertStore';
|
||||
import DialogCreate from './UI_calendar/dialogCreate.vue';
|
||||
import { useAccountStore } from '@/store/AccountStore';
|
||||
|
||||
export default {
|
||||
components: { calendarCreateSelect, DialogCreate },
|
||||
@@ -105,7 +102,7 @@ export default {
|
||||
props: {
|
||||
calendar: {
|
||||
type: Object,
|
||||
default: {},
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -113,15 +110,10 @@ export default {
|
||||
const accountStore = useAccountStore();
|
||||
|
||||
const returnIdParticant = (idPart) => {
|
||||
|
||||
idPart.staff.forEach((e) => {
|
||||
let indx = propsCalendar.value.participant.findIndex(
|
||||
(l) => l.participant_calendar == e.id
|
||||
);
|
||||
let ind = propsCalendar.value.participant.find(
|
||||
(l) => l.participant_calendar == e.id
|
||||
);
|
||||
if (idPart.okey == "editor") {
|
||||
let indx = propsCalendar.value.participant.findIndex((l) => l.participant_calendar == e.id);
|
||||
let ind = propsCalendar.value.participant.find((l) => l.participant_calendar == e.id);
|
||||
if (idPart.okey == 'editor') {
|
||||
ind.editor = e.editor;
|
||||
} else {
|
||||
if (e.selected == true) {
|
||||
@@ -135,7 +127,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
let ind = propsCalendar.value.participant.findIndex(
|
||||
(l) => l.participant_calendar == e.id
|
||||
(l) => l.participant_calendar == e.id,
|
||||
);
|
||||
|
||||
if (ind != -1) {
|
||||
@@ -144,32 +136,29 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const propsCalendar = computed({
|
||||
get: () => props.calendar,
|
||||
set: (value) => emit("update:calendar", value),
|
||||
set: (value) => emit('update:calendar', value),
|
||||
});
|
||||
|
||||
const feedalert = useAlertStore().alert;
|
||||
|
||||
const rules = {
|
||||
|
||||
cl_name: [(val) => req(val)],
|
||||
cl_descr: [(val) => req(val)],
|
||||
};
|
||||
|
||||
const titleCard = ref("");
|
||||
const titleCard = ref('');
|
||||
const newCalendar = ref(false);
|
||||
|
||||
const calendarNewOrOld = () => {
|
||||
if (propsCalendar.value.hasOwnProperty("id")) {
|
||||
titleCard.value = "Редактирование календаря";
|
||||
if (propsCalendar.value.author != accountStore.user.is_idEmployee)
|
||||
newCalendar.value = true;
|
||||
if ('id' in propsCalendar.value) {
|
||||
titleCard.value = 'Редактирование календаря';
|
||||
if (propsCalendar.value.author != accountStore.user.is_idEmployee) newCalendar.value = true;
|
||||
} else {
|
||||
titleCard.value = "Новый календарь";
|
||||
titleCard.value = 'Новый календарь';
|
||||
|
||||
newCalendar.value = true;
|
||||
}
|
||||
@@ -186,22 +175,19 @@ export default {
|
||||
.then((result) => {
|
||||
feedalert.alert = true;
|
||||
feedalert.text = result.data.mess;
|
||||
feedalert.ico = "mdi-check";
|
||||
feedalert.color = "green-darken-4";
|
||||
emit("getCalendar");
|
||||
emit("closeDialog");
|
||||
feedalert.ico = 'mdi-check';
|
||||
feedalert.color = 'green-darken-4';
|
||||
emit('getCalendar');
|
||||
emit('closeDialog');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const staff = ref([]);
|
||||
|
||||
axiosApiInstance
|
||||
|
||||
.get("api/calendar_of_events/get_employees/")
|
||||
.then((res) => {
|
||||
staff.value = res.data.filter((e) => e.employees.length > 0);
|
||||
});
|
||||
axiosApiInstance.get('api/calendar_of_events/get_employees/').then((res) => {
|
||||
staff.value = res.data.filter((e) => e.employees.length > 0);
|
||||
});
|
||||
|
||||
const newStaff = computed({
|
||||
get() {
|
||||
@@ -209,7 +195,7 @@ export default {
|
||||
if (propsCalendar.value.participant.length > 0) {
|
||||
e.employees.forEach((empl) => {
|
||||
let ab = propsCalendar.value.participant.find(
|
||||
(a) => a.participant_calendar === empl.id
|
||||
(a) => a.participant_calendar === empl.id,
|
||||
);
|
||||
if (ab) {
|
||||
empl.selected = true;
|
||||
@@ -227,21 +213,21 @@ export default {
|
||||
});
|
||||
|
||||
const color = [
|
||||
"red",
|
||||
"pink",
|
||||
"deep-orange",
|
||||
"amber",
|
||||
"yellow",
|
||||
"lime",
|
||||
"light-green",
|
||||
"green",
|
||||
"light-blue",
|
||||
"blue",
|
||||
"indigo",
|
||||
"deep-purple",
|
||||
"purple",
|
||||
"blue-grey",
|
||||
"brown",
|
||||
'red',
|
||||
'pink',
|
||||
'deep-orange',
|
||||
'amber',
|
||||
'yellow',
|
||||
'lime',
|
||||
'light-green',
|
||||
'green',
|
||||
'light-blue',
|
||||
'blue',
|
||||
'indigo',
|
||||
'deep-purple',
|
||||
'purple',
|
||||
'blue-grey',
|
||||
'brown',
|
||||
];
|
||||
|
||||
const colorPik = (col) => {
|
||||
@@ -258,16 +244,15 @@ export default {
|
||||
.then((result) => {
|
||||
feedalert.alert = true;
|
||||
feedalert.text = result.data.mess;
|
||||
feedalert.ico = "mdi-check";
|
||||
feedalert.color = "orange-accent-1";
|
||||
emit("getCalendar");
|
||||
feedalert.ico = 'mdi-check';
|
||||
feedalert.color = 'orange-accent-1';
|
||||
emit('getCalendar');
|
||||
});
|
||||
emit("closeDialog");
|
||||
emit('closeDialog');
|
||||
};
|
||||
|
||||
const req = (val) => {
|
||||
|
||||
return !!val || "Поле обязательно";
|
||||
return !!val || 'Поле обязательно';
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user