|
@@ -4,7 +4,7 @@
|
|
:visible.sync="modalIsShow"
|
|
:visible.sync="modalIsShow"
|
|
:title="title"
|
|
:title="title"
|
|
top="10px"
|
|
top="10px"
|
|
- width="540px"
|
|
|
|
|
|
+ width="600px"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
append-to-body
|
|
append-to-body
|
|
@@ -93,29 +93,16 @@
|
|
>
|
|
>
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="examSetDate"
|
|
v-model="examSetDate"
|
|
- type="date"
|
|
|
|
|
|
+ type="datetimerange"
|
|
value-format="timestamp"
|
|
value-format="timestamp"
|
|
|
|
+ format="yyyy-MM-dd HH:mm"
|
|
placeholder="考试日期"
|
|
placeholder="考试日期"
|
|
- style="width: 150px; margin-bottom: 5px"
|
|
|
|
:clearable="false"
|
|
:clearable="false"
|
|
- @change="timeChange"
|
|
|
|
- >
|
|
|
|
- </el-date-picker>
|
|
|
|
- <el-time-picker
|
|
|
|
- v-model="examSetTime"
|
|
|
|
- is-range
|
|
|
|
- range-separator="至"
|
|
|
|
start-placeholder="考试开始时间"
|
|
start-placeholder="考试开始时间"
|
|
end-placeholder="考试结束时间"
|
|
end-placeholder="考试结束时间"
|
|
- placeholder="选择时间范围"
|
|
|
|
- value-format="timestamp"
|
|
|
|
- :picker-options="{
|
|
|
|
- format: 'HH:mm',
|
|
|
|
- }"
|
|
|
|
- :default-value="defaultTime"
|
|
|
|
@change="timeChange"
|
|
@change="timeChange"
|
|
>
|
|
>
|
|
- </el-time-picker>
|
|
|
|
|
|
+ </el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item
|
|
<el-form-item
|
|
v-if="checkRequiredFieldValid('examRoom')"
|
|
v-if="checkRequiredFieldValid('examRoom')"
|
|
@@ -381,9 +368,7 @@ export default {
|
|
extendFields: [],
|
|
extendFields: [],
|
|
courseList: [],
|
|
courseList: [],
|
|
// date-picker
|
|
// date-picker
|
|
- defaultTime: "",
|
|
|
|
- examSetDate: "",
|
|
|
|
- examSetTime: [],
|
|
|
|
|
|
+ examSetDate: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -395,10 +380,7 @@ export default {
|
|
|
|
|
|
const { examStartTime, examEndTime } = val;
|
|
const { examStartTime, examEndTime } = val;
|
|
if (examStartTime && examEndTime) {
|
|
if (examStartTime && examEndTime) {
|
|
- this.examSetTime = [examStartTime, examEndTime];
|
|
|
|
- this.examSetDate = getTimeDatestamp(examStartTime);
|
|
|
|
- this.modalForm.examStartTime = this.examSetTime[0];
|
|
|
|
- this.modalForm.examEndTime = this.examSetTime[1];
|
|
|
|
|
|
+ this.examSetDate = [examStartTime, examEndTime];
|
|
} else {
|
|
} else {
|
|
this.getInitCreateTime();
|
|
this.getInitCreateTime();
|
|
}
|
|
}
|
|
@@ -416,8 +398,6 @@ export default {
|
|
this.courseList = [];
|
|
this.courseList = [];
|
|
}
|
|
}
|
|
|
|
|
|
- this.defaultTime = getTimeDatestamp(Date.now());
|
|
|
|
-
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.modalFormComp.clearValidate();
|
|
this.$refs.modalFormComp.clearValidate();
|
|
});
|
|
});
|
|
@@ -453,9 +433,7 @@ export default {
|
|
getInitCreateTime() {
|
|
getInitCreateTime() {
|
|
const curDate = getTimeDatestamp(Date.now());
|
|
const curDate = getTimeDatestamp(Date.now());
|
|
const hour = 60 * 60 * 1000;
|
|
const hour = 60 * 60 * 1000;
|
|
- this.examSetTime = [curDate + 8 * hour, curDate + 10 * hour];
|
|
|
|
- this.examSetDate = "";
|
|
|
|
- console.log(this.examSetTime);
|
|
|
|
|
|
+ this.examSetDate = [curDate + 8 * hour, curDate + 10 * hour];
|
|
},
|
|
},
|
|
visibleChange() {
|
|
visibleChange() {
|
|
this.initData(this.instance);
|
|
this.initData(this.instance);
|
|
@@ -503,17 +481,16 @@ export default {
|
|
this.modalForm.clazzId = "";
|
|
this.modalForm.clazzId = "";
|
|
},
|
|
},
|
|
timeChange() {
|
|
timeChange() {
|
|
- if (!this.examSetDate || !this.examSetTime) {
|
|
|
|
|
|
+ if (!this.examSetDate) {
|
|
this.modalForm.examStartTime = "";
|
|
this.modalForm.examStartTime = "";
|
|
this.modalForm.examEndTime = "";
|
|
this.modalForm.examEndTime = "";
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- const curDate = getTimeDatestamp(this.examSetDate);
|
|
|
|
- const timeDate = getTimeDatestamp(this.examSetTime[0]);
|
|
|
|
|
|
+ this.modalForm.examStartTime = this.examSetDate[0];
|
|
|
|
+ this.modalForm.examEndTime = this.examSetDate[1];
|
|
|
|
|
|
- this.modalForm.examStartTime = curDate + this.examSetTime[0] - timeDate;
|
|
|
|
- this.modalForm.examEndTime = curDate + this.examSetTime[1] - timeDate;
|
|
|
|
|
|
+ // this.$refs.modalFormComp.validateField("examStartTime", () => {});
|
|
},
|
|
},
|
|
getModelData() {
|
|
getModelData() {
|
|
const data = this.$objAssign(requiredModalForm, this.modalForm);
|
|
const data = this.$objAssign(requiredModalForm, this.modalForm);
|