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