diff --git a/src/front/src/components/UI/NewsCard.vue b/src/front/src/components/UI/NewsCard.vue index ab150a10d..c956a7d6c 100644 --- a/src/front/src/components/UI/NewsCard.vue +++ b/src/front/src/components/UI/NewsCard.vue @@ -11,7 +11,7 @@ @@ -53,25 +54,22 @@ export default { props: { datedefault: { type: Date, - default: '' + default: () => new Date() } }, - - setup(props, {emit}) { const appStore = useAppStore() - const maxdate = formatDash(new Date()) const menudate = ref(false) - const selectedDate = ref(null) + const selectedDate = ref(props.datedefault ? formatDash(new Date(props.datedefault)) : formatDash(new Date())) const dateStart = () => { - emit('returndate', selectedDate.value) - menudate.value=false + if (selectedDate.value) { + emit('returndate', selectedDate.value) + menudate.value = false + } } - - return { menudate, selectedDate, diff --git a/src/front/src/components/news-full.vue b/src/front/src/components/news-full.vue index a56ae7058..d761338b9 100644 --- a/src/front/src/components/news-full.vue +++ b/src/front/src/components/news-full.vue @@ -7,7 +7,7 @@ - + @@ -58,11 +58,11 @@ @@ -446,6 +446,7 @@ import { spravURL } from "@/utils/axios-api"; import { useAccountStore } from "@/store/AccountStore"; import { format } from "date-fns"; import icoUser from "@/components/UI/fiousercard/icoUser.vue"; +import defaultImage from '@/assets/emblem.png'; const accountStore = useAccountStore(); @@ -586,6 +587,7 @@ export default { spravURL, splitname, accountStore, + defaultImage, formatText, dateformat, textcomment, diff --git a/src/front/src/components/testing/AssignTestDialog.vue b/src/front/src/components/testing/AssignTestDialog.vue index df2002812..cfb6419e8 100644 --- a/src/front/src/components/testing/AssignTestDialog.vue +++ b/src/front/src/components/testing/AssignTestDialog.vue @@ -178,70 +178,60 @@ export default { }, emits: ['update:modelValue', 'assign', 'unassign'], setup(props, { emit }) { - const selectedEmployees = ref([]); - const publishNews = ref(false); - const defaultEndDate = new Date(); - defaultEndDate.setHours(18, 0, 0, 0); - const defaultStartDate = new Date(); - defaultStartDate.setHours(9, 0, 0, 0); - const completionDate = ref(defaultEndDate); - const startDate = ref(defaultStartDate); - const snackbar = ref({ - show: false, - text: '', - color: 'error' - }); - - const showSnackbar = (text, color = 'error') => { - snackbar.value = { - show: true, - text, - color - }; - }; - - const handleEmployeeSelection = (value) => { - selectedEmployees.value = value; - }; - - const handleDateChange = (date, type = 'end') => { - if (date) { - const newDate = new Date(date); - if (type === 'end') { - newDate.setHours(18, 0, 0, 0); - } else { - newDate.setHours(9, 0, 0, 0); - } + const selectedEmployees = ref([]); + const publishNews = ref(false); - const today = new Date(); - today.setHours(0, 0, 0, 0); - if (newDate < today) { - showSnackbar('Нельзя назначить прошедшую дату'); - if (type === 'end') { - completionDate.value = null; - } else { - startDate.value = null; - } - return; - } + // Устанавливаем начальные даты + const currentDate = new Date(); + const defaultStartDate = new Date(currentDate); + defaultStartDate.setHours(9, 0, 0, 0); + + const defaultEndDate = new Date(currentDate); + defaultEndDate.setHours(18, 0, 0, 0); + + const startDate = ref(defaultStartDate); + const completionDate = ref(defaultEndDate); + + const snackbar = ref({ + show: false, + text: '', + color: 'error' + }); - if (type === 'end') { - if (startDate.value && newDate < startDate.value) { - showSnackbar('Дата окончания не может быть раньше даты начала'); - completionDate.value = null; - return; - } - completionDate.value = newDate; - } else { - if (completionDate.value && newDate > completionDate.value) { - showSnackbar('Дата начала не может быть позже даты окончания'); - startDate.value = null; - return; - } - startDate.value = newDate; - } - } - }; + const showSnackbar = (text, color = 'error') => { + snackbar.value = { + show: true, + text, + color + }; + }; + + const handleEmployeeSelection = (value) => { + selectedEmployees.value = value; + }; + + const handleDateChange = (date, type = 'end') => { + if (!date) return; + + const newDate = new Date(date); + if (type === 'end') { + newDate.setHours(18, 0, 0, 0); + completionDate.value = newDate; + + if (startDate.value && newDate < startDate.value) { + startDate.value = newDate; + startDate.value.setHours(9, 0, 0, 0); + } + } else { + newDate.setHours(9, 0, 0, 0); + startDate.value = newDate; + + if (completionDate.value && newDate > completionDate.value) { + completionDate.value = newDate; + completionDate.value.setHours(18, 0, 0, 0); + } + } + }; const handleAssign = () => { if (!selectedEmployees.value.length) { diff --git a/src/front/src/components/testing/BodyDetailTesting.vue b/src/front/src/components/testing/BodyDetailTesting.vue index 0e4ef3c3e..a9f139cab 100644 --- a/src/front/src/components/testing/BodyDetailTesting.vue +++ b/src/front/src/components/testing/BodyDetailTesting.vue @@ -9,6 +9,14 @@ { 'border-b-thin': !isDialog, 'pa-0': isDialog } ]">
+
+ +
@@ -58,6 +66,7 @@