|
@@ -28,11 +28,29 @@
|
|
|
}
|
|
|
}
|
|
|
.change-area{
|
|
|
+ width: calc(100% - 60px);
|
|
|
+ &>div{
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+ padding: 15px;
|
|
|
+ textarea{
|
|
|
+ width: 100%;
|
|
|
+ min-height: 50px;
|
|
|
+ margin: 10px;
|
|
|
+ font-size: 16px;
|
|
|
+ &:first-child{
|
|
|
+ min-height: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.material-part{
|
|
|
width: 400px;
|
|
|
}
|
|
|
.question-part{
|
|
|
- width: 800px;
|
|
|
+ width: 100%;
|
|
|
+ &.halfScreen{
|
|
|
+ width: calc(100% - 400px);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/deep/.el-drawer__header{
|
|
@@ -67,14 +85,15 @@
|
|
|
</el-collapse>
|
|
|
</div>
|
|
|
<div class="change-area">
|
|
|
- <!-- <div class="material-part">
|
|
|
+ <div class="material-part" v-if="paper.sections[currentSection - 1].hasMaterial">
|
|
|
|
|
|
</div>
|
|
|
- <div class="question-part">
|
|
|
- <textarea></textarea>
|
|
|
- <textarea></textarea> -->
|
|
|
+ <div class="question-part" :class="{'halfScreen':paper.sections[currentSection - 1].hasMaterial}">
|
|
|
+ <textarea v-model="paper.questions[currentQuestion].content"></textarea>
|
|
|
+ <textarea v-for="answer in paper.questions[currentQuestion].options" :key="answer.id" v-model="answer.content"></textarea>
|
|
|
<el-button @click="drawer = true" type="primary">查看</el-button>
|
|
|
- <!-- </div> -->
|
|
|
+ <el-button @click="updateQuestion" type="warning">保存</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<el-drawer
|
|
|
:visible.sync="drawer"
|
|
@@ -136,7 +155,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getPaperById } from "@/api/exam";
|
|
|
+import { getPaperById , updateQuestion } from "@/api/exam";
|
|
|
import { OPTION_LIST } from '@/services/constant';
|
|
|
|
|
|
export default {
|
|
@@ -191,13 +210,13 @@ export default {
|
|
|
},100);
|
|
|
}
|
|
|
},
|
|
|
- // updateUser(){
|
|
|
- // updateUser(this.changeUser).then((result) => {
|
|
|
- // alert(result.message);
|
|
|
- // this.visibleChange = false
|
|
|
- // this.searchDoc();
|
|
|
- // })
|
|
|
- // },
|
|
|
+ updateQuestion(){
|
|
|
+ updateQuestion(this.paper.questions[this.currentQuestion]).then((result) => {
|
|
|
+ alert(result.message);
|
|
|
+ this.getQuestion(this.$route.params.pid);
|
|
|
+ this.changePage(this.currentQuestion);
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|