Merge branch 'dev-denzel' into cja_new

This commit is contained in:
cja committed 2025-06-02 15:49:57 +03:00
commit 8495a7b126
4 files changed
+14 -11

No files matched your search

@@ -302,8 +302,8 @@ export default {
background-color: #004d40; background-color: #004d40;
color: white; color: white;
padding: 16px; padding: 16px;
border-top-left-radius: 8px; border-top-left-radius: 4px;
border-top-right-radius: 8px; border-top-right-radius: 4px;
} }
.v-dialog .v-card-actions { .v-dialog .v-card-actions {
@@ -20,12 +20,12 @@
<div v-if="!isTest" class="pt-2 d-flex align-center"> <div v-if="!isTest" class="pt-2 d-flex align-center">
<span class="text-overline text-grey text-center">Публикация новости: </span> <span class="text-overline text-grey text-center">Публикация новости: </span>
<v-switch <v-switch
v-model="localForm.createnews" v-model="localForm.news"
class="px-2" class="px-2"
density="comfortable" density="comfortable"
hide-details hide-details
color="primary" color="primary"
:label="localForm.createnews ? 'да' : 'нет'" :label="localForm.news ? 'да' : 'нет'"
></v-switch> ></v-switch>
</div> </div>
<div v-if="!isTest" class="text-overline text-grey">Дата и время:</div> <div v-if="!isTest" class="text-overline text-grey">Дата и время:</div>
@@ -107,7 +107,7 @@ export default {
: { : {
title: '', title: '',
description: '', description: '',
createnews: false, news: false,
appoint: false, appoint: false,
startDate: new Date(), startDate: new Date(),
endDate: new Date(), endDate: new Date(),
@@ -335,7 +335,7 @@ export default {
startDate: props.isTest ? null : new Date(), startDate: props.isTest ? null : new Date(),
endDate: props.isTest ? null : new Date(new Date().setDate(new Date().getDate() + 14)), endDate: props.isTest ? null : new Date(new Date().setDate(new Date().getDate() + 14)),
questions: [], questions: [],
createnews: false, news: false,
appoint: false appoint: false
}); });
@@ -540,11 +540,14 @@ export default {
} }
} catch (error) { } catch (error) {
console.error('Ошибка при создании:', error); console.error('Ошибка при создании:', error);
let errorMessage = 'Произошла ошибка при создании'; let msg = 'Произошла ошибка при создании';
if (error.response?.data?.message) { if (error.response?.data?.message) {
errorMessage += ': ' + error.response.data.message; msg = error.response.data.message;
} else if (error.message) {
msg = error.message;
} }
alert(errorMessage); errorMessage.value = msg;
alert(msg);
} }
}; };
@@ -567,7 +570,7 @@ export default {
startDate: props.isTest ? null : new Date(), startDate: props.isTest ? null : new Date(),
endDate: props.isTest ? null : new Date(new Date().setDate(new Date().getDate() + 14)), endDate: props.isTest ? null : new Date(new Date().setDate(new Date().getDate() + 14)),
questions: [], questions: [],
createnews: false, news: false,
appoint: false appoint: false
}; };
testSettings.value = { testSettings.value = {
+1 -1
View File
@@ -120,7 +120,7 @@ async function createVote(voteData) {
}); });
formData.append('createnews', voteData.createnews); formData.append('news', voteData.news);
formData.append('title', voteData.title); formData.append('title', voteData.title);
formData.append('description', voteData.description); formData.append('description', voteData.description);
formData.append('startDate', new Date(voteData.startDate).toISOString()); formData.append('startDate', new Date(voteData.startDate).toISOString());