Merge branch 'dev-denzel' into сja
This commit is contained in:
commit
694e00c2f5
3 files changed
+112
-109
No files matched your search
@@ -14,9 +14,7 @@
|
|||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item>
|
<v-stepper-item :complete="step > 1" step="2">Создание опроса</v-stepper-item>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-stepper-item :complete="step > 2" step="3">Настройка ответов</v-stepper-item>
|
<v-stepper-item :complete="step > 2" step="3">Подтверждение</v-stepper-item>
|
||||||
<v-divider></v-divider>
|
|
||||||
<v-stepper-item step="4">Подтверждение</v-stepper-item>
|
|
||||||
</v-stepper-header>
|
</v-stepper-header>
|
||||||
|
|
||||||
<v-stepper-window>
|
<v-stepper-window>
|
||||||
@@ -37,11 +35,12 @@
|
|||||||
outlined
|
outlined
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
></v-textarea>
|
></v-textarea>
|
||||||
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
:placeholder="form.startDate.toLocaleDateString()"
|
:placeholder="`${form.startDate.toLocaleDateString()} ${form.startDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`"
|
||||||
:value="form.startDate.toLocaleDateString()"
|
:value="`${form.startDate.toLocaleDateString()} ${form.startDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`"
|
||||||
color="teal-darken-4"
|
color="teal-darken-4"
|
||||||
label="Дата начала"
|
label="Дата и время начала"
|
||||||
persistentPlaceholder
|
persistentPlaceholder
|
||||||
readonly
|
readonly
|
||||||
>
|
>
|
||||||
@@ -51,19 +50,18 @@
|
|||||||
color="teal-darken-4"
|
color="teal-darken-4"
|
||||||
hideHeader
|
hideHeader
|
||||||
hideWeekdays
|
hideWeekdays
|
||||||
>
|
/>
|
||||||
</v-date-picker>
|
|
||||||
</v-menu>
|
</v-menu>
|
||||||
<v-btn flat icon style="background-color: transparent">
|
<v-btn flat icon style="background-color: transparent">
|
||||||
<v-icon>mdi-calendar</v-icon>
|
<v-icon>mdi-calendar-clock</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
:placeholder="form.endDate.toLocaleDateString()"
|
:placeholder="`${form.endDate.toLocaleDateString()} ${form.endDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`"
|
||||||
:value="form.endDate.toLocaleDateString()"
|
:value="`${form.endDate.toLocaleDateString()} ${form.endDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`"
|
||||||
color="teal-darken-4"
|
color="teal-darken-4"
|
||||||
label="Дата окончания"
|
label="Дата и время окончания"
|
||||||
persistentPlaceholder
|
persistentPlaceholder
|
||||||
readonly
|
readonly
|
||||||
>
|
>
|
||||||
@@ -73,13 +71,13 @@
|
|||||||
color="teal-darken-4"
|
color="teal-darken-4"
|
||||||
hideHeader
|
hideHeader
|
||||||
hideWeekdays
|
hideWeekdays
|
||||||
>
|
/>
|
||||||
</v-date-picker>
|
|
||||||
</v-menu>
|
</v-menu>
|
||||||
<v-btn flat icon style="background-color: transparent">
|
<v-btn flat icon style="background-color: transparent">
|
||||||
<v-icon>mdi-calendar</v-icon>
|
<v-icon>mdi-calendar-clock</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
|
<v-btn color="teal-darken-4" size="medium" @click="step = 1">Далее</v-btn>
|
||||||
@@ -93,12 +91,17 @@
|
|||||||
<v-card-title>Создание опроса</v-card-title>
|
<v-card-title>Создание опроса</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
|
<div v-for="(question, index) in form.questions" :key="index" class="mb-4">
|
||||||
<v-text-field
|
<div class="d-flex">
|
||||||
|
<v-text-field
|
||||||
v-model="question.text"
|
v-model="question.text"
|
||||||
:label="'Вопрос ' + (index + 1)"
|
:label="'Вопрос ' + (index + 1)"
|
||||||
outlined
|
outlined
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
<v-btn color="error" icon @click="removeQuestion(index)">
|
||||||
|
<v-icon>mdi-delete</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
<v-file-input
|
<v-file-input
|
||||||
v-model="question.image"
|
v-model="question.image"
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
@@ -111,9 +114,73 @@
|
|||||||
label="Тип ответа"
|
label="Тип ответа"
|
||||||
outlined
|
outlined
|
||||||
></v-select>
|
></v-select>
|
||||||
<v-btn color="error" icon @click="removeQuestion(index)">
|
<v-switch
|
||||||
<v-icon>mdi-delete</v-icon>
|
v-model="question.multiChoice"
|
||||||
</v-btn>
|
color="teal-darken-4"
|
||||||
|
:label="`Множественный выбор: ${question.multiChoice ? 'да' : 'нет'}`"
|
||||||
|
:false-value="false"
|
||||||
|
:true-value="true"
|
||||||
|
hide-details
|
||||||
|
></v-switch>
|
||||||
|
<v-card-text>
|
||||||
|
<div v-if="question.type === 'Ввести вручную'">
|
||||||
|
<div
|
||||||
|
v-for="(answer, index) in question.answers"
|
||||||
|
:key="index"
|
||||||
|
class="d-flex align-start mb-4"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="answer.text"
|
||||||
|
:label="'Ответ ' + (index + 1)"
|
||||||
|
class="mr-4"
|
||||||
|
outlined
|
||||||
|
:rules="[rules.required]"
|
||||||
|
></v-text-field>
|
||||||
|
<v-file-input
|
||||||
|
v-model="answer.image"
|
||||||
|
accept="image/*"
|
||||||
|
dense
|
||||||
|
hide-details
|
||||||
|
label="Картинка"
|
||||||
|
outlined
|
||||||
|
></v-file-input>
|
||||||
|
<v-btn color="error" icon @click="removeAnswer(index)">
|
||||||
|
<v-icon>mdi-delete</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
<v-btn color="teal-darken-4" @click="addAnswer">Добавить ответ</v-btn>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<v-autocomplete
|
||||||
|
v-model="currentQuestion.selectedEmployees"
|
||||||
|
:items="groupedEmployees"
|
||||||
|
item-title="fio"
|
||||||
|
item-value="id"
|
||||||
|
label="Выберите сотрудников"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
></v-autocomplete>
|
||||||
|
<div
|
||||||
|
v-for="(person, index) in currentQuestion.selectedEmployees"
|
||||||
|
:key="person.id"
|
||||||
|
class="d-flex align-center mb-4"
|
||||||
|
>
|
||||||
|
<v-chip>{{ findEmployeeById(person).fio }}</v-chip>
|
||||||
|
<v-file-input
|
||||||
|
v-model="currentQuestion.selectedEmployeeImages[person]"
|
||||||
|
accept="image/*"
|
||||||
|
class="ml-4"
|
||||||
|
dense
|
||||||
|
hide-details
|
||||||
|
label="Картинка"
|
||||||
|
outlined
|
||||||
|
></v-file-input>
|
||||||
|
<v-btn color="error" icon @click="removeEmployee(index)">
|
||||||
|
<v-icon>mdi-delete</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</v-card-text>
|
||||||
</div>
|
</div>
|
||||||
<v-btn color="teal-darken-4" @click="addQuestion">Добавить вопрос</v-btn>
|
<v-btn color="teal-darken-4" @click="addQuestion">Добавить вопрос</v-btn>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@@ -124,95 +191,8 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-stepper-window-item>
|
</v-stepper-window-item>
|
||||||
|
|
||||||
<!-- Настройка ответов -->
|
|
||||||
<v-stepper-window-item step="3">
|
|
||||||
<v-card flat>
|
|
||||||
<v-card-title>
|
|
||||||
Настройка ответов
|
|
||||||
<v-select
|
|
||||||
v-model="currentQuestionIndex"
|
|
||||||
:items="form.questions.map((q, i) => ({ text: `Вопрос ${i + 1}: ${q.text || 'Без названия'}`, value: i }))"
|
|
||||||
class="ml-4"
|
|
||||||
dense
|
|
||||||
item-title="text"
|
|
||||||
item-value="value"
|
|
||||||
label="Выберите вопрос"
|
|
||||||
outlined
|
|
||||||
></v-select>
|
|
||||||
</v-card-title>
|
|
||||||
<v-card-text>
|
|
||||||
<div v-if="currentQuestion">
|
|
||||||
<div v-if="currentQuestion.type === 'Ввести вручную'">
|
|
||||||
<div
|
|
||||||
v-for="(answer, index) in currentQuestion.answers"
|
|
||||||
:key="index"
|
|
||||||
class="d-flex align-start mb-4"
|
|
||||||
>
|
|
||||||
<v-text-field
|
|
||||||
v-model="answer.text"
|
|
||||||
:label="'Ответ ' + (index + 1)"
|
|
||||||
class="mr-4"
|
|
||||||
outlined
|
|
||||||
:rules="[rules.required]"
|
|
||||||
></v-text-field>
|
|
||||||
<v-file-input
|
|
||||||
v-model="answer.image"
|
|
||||||
accept="image/*"
|
|
||||||
dense
|
|
||||||
hide-details
|
|
||||||
label="Картинка"
|
|
||||||
outlined
|
|
||||||
></v-file-input>
|
|
||||||
<v-btn color="error" icon @click="removeAnswer(index)">
|
|
||||||
<v-icon>mdi-delete</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
<v-btn color="teal-darken-4" @click="addAnswer">Добавить ответ</v-btn>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<v-autocomplete
|
|
||||||
v-model="currentQuestion.selectedEmployees"
|
|
||||||
:items="groupedEmployees"
|
|
||||||
item-title="fio"
|
|
||||||
item-value="id"
|
|
||||||
label="Выберите сотрудников"
|
|
||||||
multiple
|
|
||||||
outlined
|
|
||||||
></v-autocomplete>
|
|
||||||
<div
|
|
||||||
v-for="(person, index) in currentQuestion.selectedEmployees"
|
|
||||||
:key="person.id"
|
|
||||||
class="d-flex align-center mb-4"
|
|
||||||
>
|
|
||||||
<v-chip>{{ findEmployeeById(person).fio }}</v-chip>
|
|
||||||
<v-file-input
|
|
||||||
v-model="currentQuestion.selectedEmployeeImages[person]"
|
|
||||||
accept="image/*"
|
|
||||||
class="ml-4"
|
|
||||||
dense
|
|
||||||
hide-details
|
|
||||||
label="Картинка"
|
|
||||||
outlined
|
|
||||||
></v-file-input>
|
|
||||||
<v-btn color="error" icon @click="removeEmployee(index)">
|
|
||||||
<v-icon>mdi-delete</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<p>Выберите вопрос, чтобы добавить ответы.</p>
|
|
||||||
</div>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-actions>
|
|
||||||
<v-btn color="teal-darken-4" size="medium" @click="step -= 1">Назад</v-btn>
|
|
||||||
<v-btn color="teal-darken-4" size="medium" @click="step = 3">Далее</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-stepper-window-item>
|
|
||||||
|
|
||||||
<!-- Подтверждение -->
|
<!-- Подтверждение -->
|
||||||
<v-stepper-window-item step="4">
|
<v-stepper-window-item step="3">
|
||||||
<v-card flat>
|
<v-card flat>
|
||||||
<v-card-title>Подтверждение</v-card-title>
|
<v-card-title>Подтверждение</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
@@ -310,6 +290,7 @@ export default {
|
|||||||
answers: [],
|
answers: [],
|
||||||
selectedEmployees: [],
|
selectedEmployees: [],
|
||||||
selectedEmployeeImages: {},
|
selectedEmployeeImages: {},
|
||||||
|
multiChoice: false
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -383,3 +364,24 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-datetime-picker {
|
||||||
|
.v-tabs-slider-wrapper {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.v-picker__title {
|
||||||
|
height: 90px;
|
||||||
|
}
|
||||||
|
.v-time-picker-title__time * {
|
||||||
|
font-size: 60px;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
.v-picker__body {
|
||||||
|
height: 290px;
|
||||||
|
}
|
||||||
|
.v-tabs-items {
|
||||||
|
height: 380px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -118,6 +118,7 @@ async function createVote(voteData, files) {
|
|||||||
formData.append('startDate', new Date(voteData.startDate).toISOString());
|
formData.append('startDate', new Date(voteData.startDate).toISOString());
|
||||||
formData.append('endDate', new Date(voteData.endDate).toISOString());
|
formData.append('endDate', new Date(voteData.endDate).toISOString());
|
||||||
formData.append('questions', JSON.stringify(voteData.questions));
|
formData.append('questions', JSON.stringify(voteData.questions));
|
||||||
|
formData.append('settings', {...voteData.type});
|
||||||
|
|
||||||
const response = await axiosApiInstance.post('/api/vote/votecreate/', formData, {
|
const response = await axiosApiInstance.post('/api/vote/votecreate/', formData, {
|
||||||
headers: {'Content-Type': 'multipart/form-data'},
|
headers: {'Content-Type': 'multipart/form-data'},
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
{{res}}
|
||||||
<v-dialog v-model="editVoteModal" max-width="1200px" @click:outside="closeModal">
|
<v-dialog v-model="editVoteModal" max-width="1200px" @click:outside="closeModal">
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-title>Редактировать голосование: {{ selectedVoting?.title }}</v-card-title>
|
<v-card-title>Редактировать голосование: {{ selectedVoting?.title }}</v-card-title>
|
||||||
|
|||||||
Reference in new issue
Block a user