实训平台 添加试卷 编辑试卷规则 代码调整

This commit is contained in:
joylink_cuiweidong 2020-12-31 13:47:08 +08:00
parent d1ff775c1f
commit 18a318cda7
3 changed files with 17 additions and 31 deletions

View File

@ -45,10 +45,6 @@ export default {
type: String,
required: true
},
editCourse: {
type: Object,
required: true
},
lineCode: {
type: String,
default: ''
@ -111,20 +107,6 @@ export default {
trainingOperateTypeMap: {}
};
},
watch: {
editCourse: function (val) {
this.title = this.$t('publish.modifyRules');
this.editOk = true;
this.form = {
course: val.trainingType,
operateType: val.operateType,
number: val.num,
mark: val.point
};
this.changeCourse(val.trainingType);
this.changeOperation(val.operateType);
}
},
async mounted() {
await this.getList();
await this.refresh();
@ -164,7 +146,19 @@ export default {
}
},
methods: {
show() {
show(detail) {
if (detail) {
this.title = this.$t('publish.modifyRules');
this.editOk = true;
this.changeCourse(detail.trainingType);
this.form = {
course: detail.trainingType,
operateType: detail.operateType,
number: detail.num,
mark: detail.point
};
this.changeOperation(detail.operateType);
}
this.dialogShow = true;
},
checkIncludes(list, obj) {
@ -187,7 +181,7 @@ export default {
});
if (this.editOk) {
//
this.$emit('editRuleList', this.form);
this.$emit('editRuleList', this.form, this.options);
this.editOk = false;
setTimeout(() => {
this.handleCancel();
@ -235,7 +229,6 @@ export default {
});
this.options = list;
this.changeCourseDisable();
this.$store.dispatch('exam/setCourse', this.options);
}).catch(() => {
this.$messageBox(this.$t('publish.refreshFailed'));
});
@ -265,7 +258,6 @@ export default {
this.topicNum = resp.data;
return this.topicNum;
}
this.$store.dispatch('exam/setCourse', this.options);
},
async changeOperation(val) {
const param = {
@ -278,7 +270,6 @@ export default {
this.topicNum = resp.data;
return this.topicNum;
}
this.$store.dispatch('exam/setCourse', this.options);
},
//
changeCourseDisable() {
@ -309,7 +300,6 @@ export default {
res.disabled = false;
}
});
this.$store.dispatch('exam/setCourse', this.options);
}
}
};

View File

@ -22,6 +22,7 @@
:placeholder="$t('publish.startTestTime')"
style="width: 100%;"
value-format="timestamp"
:default-value="new Date()"
:disabled="isEdit"
:picker-options="pickerOptions"
@change="handle"

View File

@ -18,7 +18,6 @@
ref="addRule"
:course-id="courseId"
:line-code="lineCode"
:edit-course="editCourse"
@addRuleList="addRuleList"
@editRuleList="editRuleList"
/>
@ -52,7 +51,6 @@ export default {
return {
ruleList: this.$store.state.exam.ruleList,
courseId: this.course.region,
editCourse: {},
formDetail: {
name: '',
region: '',
@ -215,8 +213,7 @@ export default {
});
});
},
editRuleList(data) {
var arr = this.$store.state.exam.courseList;
editRuleList(data, arr) {
let value;
arr.forEach(res => {
if (res.code == data.course) {
@ -239,7 +236,6 @@ export default {
this.ruleList.splice(this.indexCourse, 1, element);
},
handleForm(data) {
// editCourse
this.indexCourse = data.$index;
const list = JSON.stringify(data.row);
const detail = JSON.parse(list);
@ -250,8 +246,7 @@ export default {
return detail.name;
}
});
this.editCourse = detail;
this.handleAdd();
this.$refs.addRule.show(detail);
},
deleteForm(data) {
const index = data.$index;