Merge branch 'dev-denzel' into cja_new

This commit is contained in:
cja committed 2025-06-03 11:45:02 +03:00
commit 9a21d5bf20
7 files changed
+94 -80

No files matched your search

+4 -2
View File
@@ -11,7 +11,7 @@
<v-row class="flex-grow-0">
<v-col class="d-flex flex-column ">
<v-img
:src="`${burl}${news.link}`"
:src="news.link ? `${burl}${news.link}` : defaultImage"
height="170px"
width="92%"
class="mx-auto"
@@ -125,6 +125,7 @@ import { axiosApiInstance } from '@/utils/axios-api'
import {splitname} from '@/utils/universal_functions'
import moment from 'moment'
import icoUser from '@/components/UI/fiousercard/icoUser.vue'
import defaultImage from '@/assets/emblem.png'
const accountStore = useAccountStore()
@@ -179,7 +180,8 @@ export default {
splitname,
toggleIncrementLike,
openOneImg,
formatDate
formatDate,
defaultImage
}
}
+7 -9
View File
@@ -35,6 +35,7 @@
v-model="selectedDate"
show-adjacent-months
hide-header
:min="new Date().toISOString().slice(0, 10)"
@update:modelValue="dateStart"
border
/>
@@ -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,
+5 -3
View File
@@ -7,7 +7,7 @@
<v-col class="flex-column d-flex">
<v-row class="flex-grow-0">
<v-col class="pb-0 pr-0">
<v-card height="350px" class="rounded-b-0">
<v-card class="rounded-b-0">
<v-card-title class="pt-0 pb-1 flex-column d-flex">
<v-row>
<v-col lg="9" class="pt-4">
@@ -58,11 +58,11 @@
<!-- -->
<v-img
:src="`${burl}${newsFull.link}`"
:src="newsFull.link ? `${burl}${newsFull.link}` : defaultImage"
height="450px"
width="96%"
class="mx-auto"
cover
contain
@click="openOneImg(newsFull.link)"
/>
</v-card>
@@ -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,
@@ -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) {
@@ -9,6 +9,14 @@
{ 'border-b-thin': !isDialog, 'pa-0': isDialog }
]">
<div class="test-info">
<div class="d-flex justify-center mb-4">
<v-img
:src="data?.file || defaultImage"
class="rounded-lg"
max-height="200"
contain
/>
</div>
<div class="text-body-1 mb-4" v-html="formatDescription(data?.description)"></div>
<div class="d-flex align-center mb-3">
@@ -58,6 +66,7 @@
<script>
import { useRoute } from 'vue-router';
import { computed } from 'vue';
import defaultImage from '@/assets/emblem.png';
export default {
props: {
@@ -115,7 +124,8 @@ export default {
isExamMode,
timeWordDeclension,
formatDescription,
formatTime
formatTime,
defaultImage
};
}
};
@@ -7,11 +7,11 @@
Вопрос {{ currentQuestion + 1 }} из {{ totalQuestions }}
</v-card-title>
<h3 class="mb-2 px-4">{{ question.name }}</h3>
<v-card-text style="overflow-y: scroll">
<v-card-text>
<v-img
v-if="question.file"
:src="`http://127.0.0.1:8000${question.file}`"
class="w-50 mx-auto"
class="w-50 mx-auto mb-4"
/>
<!-- Одиночный выбор -->
@@ -145,6 +145,11 @@ export default {
padding: 16px !important;
}
.v-card-text {
max-height: 550px;
overflow-y: auto;
}
.v-radio-group :deep(.v-radio),
.v-checkbox {
margin-bottom: 12px;
@@ -186,4 +191,9 @@ export default {
margin: 0 auto;
display: block;
}
.v-img {
max-width: 100% !important;
height: auto !important;
}
</style>
@@ -349,6 +349,7 @@ export default {
const testImage = ref(null);
const imagePreview = ref(null);
const selectedEmployees = ref([]);
const imageError = ref('');
const rules = {
required: (value) => !!value || 'Это поле обязательно для заполнения',
@@ -688,7 +689,8 @@ export default {
getImagePreviewUrl,
actualQuestionCount,
actualTestQuestionCount,
isTest: props.isTest
isTest: props.isTest,
imageError
};
},
};