fix [P-290]: добавление файла к событию
This commit is contained in:
1 parent
fc041bda3c
commit
739d2f03be
5 files changed
+14
-12
No files matched your search
@@ -20,11 +20,10 @@ class ExclusionDatesAPIView(APIView):
|
|||||||
year = self.request.query_params.get('year', datetime.now().year)
|
year = self.request.query_params.get('year', datetime.now().year)
|
||||||
exclude = ExclusionDates.objects.filter(exclusiondate__year=year)
|
exclude = ExclusionDates.objects.filter(exclusiondate__year=year)
|
||||||
months = {}
|
months = {}
|
||||||
for i in range(1,12):
|
for i in range(1,13):
|
||||||
months[i] = exclude.filter(exclusiondate__month=i).values_list("exclusiondate", flat=True)
|
months[i] = exclude.filter(exclusiondate__month=i).values_list("exclusiondate", flat=True)
|
||||||
return Response({year:months})
|
return Response({year:months})
|
||||||
|
|
||||||
|
|
||||||
class MyCalendars(APIView):
|
class MyCalendars(APIView):
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|||||||
@@ -66,8 +66,12 @@ export default {
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
newFiles: {
|
||||||
|
type: Array,
|
||||||
|
default: [],
|
||||||
},
|
},
|
||||||
emits: ['update:files', 'postFiles'],
|
},
|
||||||
|
emits: ['update:files', 'update: newFiles', 'postFiles'],
|
||||||
|
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const localNewFiles = ref([]);
|
const localNewFiles = ref([]);
|
||||||
@@ -80,6 +84,7 @@ export default {
|
|||||||
(newVal) => {
|
(newVal) => {
|
||||||
localNewFiles.value = [...newVal];
|
localNewFiles.value = [...newVal];
|
||||||
},
|
},
|
||||||
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const formatFileSize = (bytes) => {
|
const formatFileSize = (bytes) => {
|
||||||
@@ -176,6 +181,8 @@ export default {
|
|||||||
|
|
||||||
// Обработка изменения новых файлов
|
// Обработка изменения новых файлов
|
||||||
const handleFilesChange = (files) => {
|
const handleFilesChange = (files) => {
|
||||||
|
|
||||||
|
|
||||||
if (!files) {
|
if (!files) {
|
||||||
// localNewFiles.value = [];
|
// localNewFiles.value = [];
|
||||||
emit('postFiles', []);
|
emit('postFiles', []);
|
||||||
|
|||||||
@@ -377,12 +377,8 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
await calendarStore.fetchHolidays(currentYear);
|
calendarStore.fetchHolidays(currentYear);
|
||||||
} catch (error) {
|
|
||||||
console.error('Failed to load holidays:', error);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(selectedDate, (newDate) => {
|
watch(selectedDate, (newDate) => {
|
||||||
|
|||||||
@@ -234,7 +234,6 @@ export default {
|
|||||||
],
|
],
|
||||||
calendar: [(val) => !!val || 'Выберите календарь'],
|
calendar: [(val) => !!val || 'Выберите календарь'],
|
||||||
};
|
};
|
||||||
console.log(propsEvent.value);
|
|
||||||
const repeatRules = [
|
const repeatRules = [
|
||||||
{ type: 'Не повторять', rule: null, id: 1 },
|
{ type: 'Не повторять', rule: null, id: 1 },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -205,11 +205,12 @@ export const useCalendarStore = defineStore('calendarStore', () => {
|
|||||||
// Проверка на исключение (рабочая суббота или праздничный будний день)
|
// Проверка на исключение (рабочая суббота или праздничный будний день)
|
||||||
const isExceptionDay = holidaysForMonth.includes(normalizedCurrentDate);
|
const isExceptionDay = holidaysForMonth.includes(normalizedCurrentDate);
|
||||||
|
|
||||||
return {
|
const result = {
|
||||||
isNonWorking: (isWeekend && !isExceptionDay) || (!isWeekend && isExceptionDay),
|
isNonWorking: (isWeekend && !isExceptionDay) || (!isWeekend && isExceptionDay),
|
||||||
isWeekendForStyling: isWeekend && !isExceptionDay, // только для серого фона
|
isWeekendForStyling: isWeekend && !isExceptionDay,
|
||||||
isHoliday: !isWeekend && isExceptionDay, // только праздничный будний
|
isHoliday: !isWeekend && isExceptionDay,
|
||||||
};
|
};
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Открыть диалог создания/редактирования
|
// Открыть диалог создания/редактирования
|
||||||
|
|||||||
Reference in new issue
Block a user