diff --git a/src/views/modules/course/examination/questionBank.vue b/src/views/modules/course/examination/questionBank.vue index b519700..ba06d87 100644 --- a/src/views/modules/course/examination/questionBank.vue +++ b/src/views/modules/course/examination/questionBank.vue @@ -44,20 +44,19 @@ style="display: inline-block;margin-left: 10px;" :limit="1" class="upload-demo" - :action="baseUrl + '/common/classExam/importSubject'" - :data="{ - courseId: this.course.id - }" + :action="baseUrl + '/oss/fileoss'" :show-file-list="false" multiple :on-exceed="handleExceed" :on-success="handleSuccess" + :before-upload="beforeUploadHandle" accept=".xlsx,.xls" :on-remove="handleRemoveNovel" > - 导入考题 + 导入考题 {{loadText}} + 多选题 - + - +
- - - + { - return e.id; + return e.id || e._X_ROW_KEY; }); console.log("selectIds at line 369:", selectIds); } - console.log("list at line 363:", list); var list = [...this.tableData]; list.map(e => { e.rightWrong = 0; }); if (selectIds.length > 0) { list.map(e => { - if (selectIds.includes(e.id)) { + if (selectIds.includes(e.id || e._X_ROW_KEY)) { e.rightWrong = 1; } }); } - + console.log("list at line 428:", list); return list; }, @@ -491,6 +501,7 @@ export default { // console.log('editor ready!', quill) }, init(row) { + this.tableData = []; console.log("11111", row); if (row && row.id) { this.courseId = row.id; @@ -530,21 +541,22 @@ export default { this.$refs["dataForm"].validate(valid => { if (valid) { var list = this.getRadioEvent1(); - if(list.length==0){ + if (list.length == 0) { this.$message.error("请新增答案选项"); - return false + return false; } var conditionMet = list.some(e => e.rightWrong == 1); - var conditionContent = list.some(e => e.content == '' ||!e.content); + var conditionContent = list.some(e => e.content == "" || !e.content); console.log("list at line 476:", conditionMet); - if (conditionContent) { + if (conditionContent) { this.$message.error("请输入选项"); return false; - } if (!conditionMet) { + } + if (!conditionMet) { this.$message.error("请选择正确答案"); return false; } - + this.$http({ url: this.$http.adornUrl( `${ @@ -678,5 +690,4 @@ export default { /deep/ .vxe-table--render-default .vxe-cell--radio .vxe-radio--icon { color: #17b3a3 !important; } -