实训平台创建试卷代码调整

This commit is contained in:
joylink_cuiweidong 2019-11-29 17:46:14 +08:00
parent 1e9ac72960
commit 8bc69347e7

View File

@ -23,6 +23,7 @@
style="width: 100%;"
value-format="timestamp"
:disabled="isEdit"
:picker-options="pickerOptions"
/>
</el-form-item>
</el-col>
@ -35,7 +36,8 @@
:placeholder="$t('publish.endTestTime')"
style="width: 100%;"
value-format="timestamp"
:disabled="isEdit"
:disabled="true"
:picker-options="pickerOptions"
/>
</el-form-item>
</el-col>
@ -111,6 +113,11 @@ export default {
}, 100);
};
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date(new Date().toLocaleDateString()).getTime();
}
},
formDetail: {
name: '',
region: '',
@ -224,12 +231,21 @@ export default {
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.form.startDate=this.getDate(this.form.startDate);
this.form.endDate=this.getDate(this.form.endDate);
this.form['trial'] = this.trial;
this.$store.dispatch('exam/setCourseDetail', this.form);
this.$emit('definition', this.form);
}
});
},
getDate(date) {
let now = new Date(date),
   y = now.getFullYear(),
   m = now.getMonth() + 1,
   d = now.getDate();
   return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8);
},
updateForm() {
this.$refs['form'].validate((valid) => {
if (valid) {