|
|
@@ -111,26 +111,86 @@
|
|
|
></v-time-picker>
|
|
|
</v-menu>
|
|
|
</v-row>
|
|
|
- <v-slider
|
|
|
- label="评测时长"
|
|
|
- :tick-labels="examLengthTicks"
|
|
|
- class="ma-4"
|
|
|
- max="5"
|
|
|
- v-model="examLength"
|
|
|
- ></v-slider>
|
|
|
+ <!-- <v-slider-->
|
|
|
+ <!-- label="评测时长"-->
|
|
|
+ <!-- :tick-labels="examLengthTicks"-->
|
|
|
+ <!-- class="ma-4"-->
|
|
|
+ <!-- max="5"-->
|
|
|
+ <!-- v-model="examLength"-->
|
|
|
+ <!-- ></v-slider>-->
|
|
|
+ <!-- <v-row class="ma-4">-->
|
|
|
+ <!-- <v-text-field-->
|
|
|
+ <!-- :value="computedEndDate"-->
|
|
|
+ <!-- label="结束日期"-->
|
|
|
+ <!-- prepend-icon="mdi-calendar"-->
|
|
|
+ <!-- disabled-->
|
|
|
+ <!-- ></v-text-field>-->
|
|
|
+ <!-- <v-text-field-->
|
|
|
+ <!-- :value="computedEndTime"-->
|
|
|
+ <!-- label="结束时间"-->
|
|
|
+ <!-- prepend-icon="mdi-clock-time-four-outline"-->
|
|
|
+ <!-- disabled-->
|
|
|
+ <!-- ></v-text-field>-->
|
|
|
+ <!-- </v-row>-->
|
|
|
+ <!--结束日期/时间-->
|
|
|
<v-row class="ma-4">
|
|
|
- <v-text-field
|
|
|
- :value="computedEndDate"
|
|
|
- label="结束日期"
|
|
|
- prepend-icon="mdi-calendar"
|
|
|
- disabled
|
|
|
- ></v-text-field>
|
|
|
- <v-text-field
|
|
|
- :value="computedEndTime"
|
|
|
- label="结束时间"
|
|
|
- prepend-icon="mdi-clock-time-four-outline"
|
|
|
- disabled
|
|
|
- ></v-text-field>
|
|
|
+ <v-menu
|
|
|
+ v-model="menu3"
|
|
|
+ :close-on-content-click="false"
|
|
|
+ transition="scale-transition"
|
|
|
+ offset-y
|
|
|
+ max-width="290px"
|
|
|
+ min-width="290px"
|
|
|
+ >
|
|
|
+ <template v-slot:activator="{ on, attrs }">
|
|
|
+ <v-text-field
|
|
|
+ v-model="endDate"
|
|
|
+ label="结束日期"
|
|
|
+ prepend-icon="mdi-calendar"
|
|
|
+ readonly
|
|
|
+ v-bind="attrs"
|
|
|
+ v-on="on"
|
|
|
+ ></v-text-field>
|
|
|
+ </template>
|
|
|
+ <v-date-picker
|
|
|
+ v-model="endDate"
|
|
|
+ no-title
|
|
|
+ @input="menu3 = false"
|
|
|
+ :min="minEndDate"
|
|
|
+ ></v-date-picker>
|
|
|
+ </v-menu>
|
|
|
+
|
|
|
+ <v-menu
|
|
|
+ v-model="menu4"
|
|
|
+ ref="menu4"
|
|
|
+ :close-on-content-click="false"
|
|
|
+ :nudge-right="40"
|
|
|
+ :return-value.sync="endTime"
|
|
|
+ transition="scale-transition"
|
|
|
+ offset-y
|
|
|
+ max-width="290px"
|
|
|
+ min-width="290px"
|
|
|
+ >
|
|
|
+ <template v-slot:activator="{ on, attrs }">
|
|
|
+ <v-text-field
|
|
|
+ v-model="endTime"
|
|
|
+ label="结束时间"
|
|
|
+ prepend-icon="mdi-clock-time-four-outline"
|
|
|
+ readonly
|
|
|
+ v-bind="attrs"
|
|
|
+ v-on="on"
|
|
|
+ :rules="arrayRules"
|
|
|
+ ></v-text-field>
|
|
|
+ </template>
|
|
|
+ <v-time-picker
|
|
|
+ v-if="menu4"
|
|
|
+ v-model="endTime"
|
|
|
+ full-width
|
|
|
+ @click:minute="$refs.menu4.save(endTime)"
|
|
|
+ :min="minEndTime"
|
|
|
+ format="24hr"
|
|
|
+ ></v-time-picker>
|
|
|
+ </v-menu>
|
|
|
</v-row>
|
|
|
<v-row class="pl-2">
|
|
|
<v-switch
|
|
|
@@ -222,6 +282,8 @@ export default Vue.extend({
|
|
|
difficulty: 50,
|
|
|
startDate: '',
|
|
|
startTime: '',
|
|
|
+ endDate: '',
|
|
|
+ endTime: '',
|
|
|
comment: '',
|
|
|
antiCheating: false,
|
|
|
isPrivate: false,
|
|
|
@@ -241,6 +303,7 @@ export default Vue.extend({
|
|
|
],
|
|
|
examLength: 0,
|
|
|
minStartDate: '',
|
|
|
+ minEndDate: '',
|
|
|
nowDateTimeFormatted: '',
|
|
|
nowDatetime: (null as unknown) as Dayjs
|
|
|
}
|
|
|
@@ -256,6 +319,15 @@ export default Vue.extend({
|
|
|
}
|
|
|
return ''
|
|
|
},
|
|
|
+ minEndTime(): string {
|
|
|
+ const nowDate = this.nowDateTimeFormatted.substr(0, 10)
|
|
|
+ const min = this.nowDatetime.add(5, 'minute').format('HH:mm') // bad
|
|
|
+
|
|
|
+ if (this.endDate === nowDate) {
|
|
|
+ return min
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
|
|
|
computedEndDate(): string {
|
|
|
if (this.startTime === '') {
|
|
|
@@ -294,7 +366,7 @@ export default Vue.extend({
|
|
|
skills: this.skills,
|
|
|
difficulty: this.difficulty,
|
|
|
startTime: this.startDate + ' ' + this.startTime + ':00',
|
|
|
- endTime: this.computedExamEndDateTime,
|
|
|
+ endTime: this.endDate + ' ' + this.endTime + ':00',
|
|
|
comment: this.comment,
|
|
|
antiCheating: this.antiCheating,
|
|
|
isPublic: !this.isPrivate
|
|
|
@@ -316,7 +388,9 @@ export default Vue.extend({
|
|
|
this.nowDatetime = dayjs()
|
|
|
this.nowDateTimeFormatted = this.nowDatetime.format(TIME_FORMAT)
|
|
|
this.startDate = this.nowDateTimeFormatted.substr(0, 10)
|
|
|
+ this.endDate = this.startDate
|
|
|
this.minStartDate = this.startDate
|
|
|
+ this.minEndDate = this.startDate
|
|
|
}
|
|
|
})
|
|
|
</script>
|