изменения в редакторе для голосования

This commit is contained in:
Denzel committed 2025-01-15 16:09:42 +03:00
1 parent 1638833dd8
commit fcf2f0c02c
2 files changed
+24 -28

No files matched your search

+7 -9
View File
@@ -19,14 +19,14 @@
density="compact" density="compact"
v-bind="props" v-bind="props"
> >
<template v-slot:prepend-inner> <template v-slot:prepend-inner>
<v-icon <v-icon
v-bind="props" v-bind="props"
icon='mdi-calendar-today' icon='mdi-calendar-today'
color="cyan-darken-3" color="cyan-darken-3"
size="x-small" size="x-small"
/> />
</template> </template>
</v-textarea> </v-textarea>
</template> </template>
@@ -37,8 +37,6 @@
hide-header hide-header
@update:modelValue="dateStart" @update:modelValue="dateStart"
border border
:max="formatDash(new Date())"
:min="formatDash(appStore.countvisitor.visitdate)"
/> />
</v-locale-provider> </v-locale-provider>
@@ -59,14 +57,14 @@ export default {
} }
}, },
setup(props, {emit}) { setup(props, {emit}) {
const appStore = useAppStore() const appStore = useAppStore()
const maxdate = formatDash(new Date()) const maxdate = formatDash(new Date())
const menudate = ref(false) const menudate = ref(false)
const selectedDate = ref(null) const selectedDate = ref(null)
const dateStart = () => { const dateStart = () => {
emit('returndate', selectedDate.value) emit('returndate', selectedDate.value)
menudate.value=false menudate.value=false
@@ -102,4 +100,4 @@ export default {
.v-field__prepend-inner { .v-field__prepend-inner {
align-items: center!important; align-items: center!important;
} }
</style> </style>
@@ -36,14 +36,9 @@
outlined outlined
></v-textarea> ></v-textarea>
<div class="d-flex ga-xl-16">
<div> <div>
<v-date-picker <h6 class="text-h6">Дата начала:</h6>
v-model="form.startDate" <date-select :datedefault="form.startDate" @returndate="returnstart" />
color="teal-darken-4"
hide-weekdays
title="дата начала"
/>
<v-select <v-select
v-model="selectedTimeStart" v-model="selectedTimeStart"
:items="timeOptions" :items="timeOptions"
@@ -54,13 +49,8 @@
/> />
</div> </div>
<div> <div>
<v-date-picker <h6 class="text-h6">Дата окончания:</h6>
v-model="form.endDate" <date-select :datedefault="form.endDate" @returndate="returnend" />
color="teal-darken-4"
hide-weekdays
title="дата окончания"
/>
<v-select <v-select
v-model="selectedTimeEnd" v-model="selectedTimeEnd"
:items="timeOptions" :items="timeOptions"
@@ -70,10 +60,6 @@
prepend-icon="mdi-calendar-clock" prepend-icon="mdi-calendar-clock"
/> />
</div> </div>
</div>
<pre>начало {{ form.startDate }}</pre>
<pre>окончание {{ form.endDate }}</pre>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
@@ -242,8 +228,10 @@
<script> <script>
import {computed, ref, watch} from "vue"; import {computed, ref, watch} from "vue";
import {createVote} from "@/utils/axios-api"; import {createVote} from "@/utils/axios-api";
import DateSelect from "@/components/UI/date-select.vue";
export default { export default {
components: {DateSelect},
emits: ['updating'], emits: ['updating'],
setup(props, {emit}) { setup(props, {emit}) {
const step = ref(0); const step = ref(0);
@@ -363,7 +351,7 @@ export default {
updateStartDate() updateStartDate()
}) })
watch(selectedTimeEnd, () => { watch(selectedTimeEnd, () => {
updateEndDate() updateEndDate()
}) })
@@ -377,7 +365,17 @@ export default {
form.value.endDate.setHours(hours, minutes); form.value.endDate.setHours(hours, minutes);
}; };
const returnstart = (dates) => {
form.value.startDate = dates
}
const returnend = (dates) => {
form.value.endtDate = dates
}
return { return {
returnend,
returnstart,
step, step,
form, form,
questionTypes, questionTypes,