|
@@ -1,155 +1,184 @@
|
|
<template>
|
|
<template>
|
|
- <el-dialog
|
|
|
|
- custom-class="question-preview-dialog edit-paper"
|
|
|
|
- :visible.sync="modalIsShow"
|
|
|
|
- title="试题预览"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- :close-on-press-escape="false"
|
|
|
|
- append-to-body
|
|
|
|
- @open="openHandle"
|
|
|
|
- >
|
|
|
|
- <div class="edit-part" :key="question.id">
|
|
|
|
- <div class="edit-cont">
|
|
|
|
- <div class="edit-cont-title">
|
|
|
|
- <rich-text :text-json="question.quesBody"></rich-text>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ custom-class="question-preview-dialog edit-paper"
|
|
|
|
+ :visible.sync="modalIsShow"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
+ append-to-body
|
|
|
|
+ @open="openHandle"
|
|
|
|
+ >
|
|
|
|
+ <div class="box-justify" slot="title">
|
|
|
|
+ <h2>试题预览</h2>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showLog"
|
|
|
|
+ icon="el-icon-document"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="toViewLog"
|
|
|
|
+ >修改记录</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button icon="el-icon-back" @click="cancel">返回</el-button>
|
|
</div>
|
|
</div>
|
|
- <div class="edit-cont-body">
|
|
|
|
- <template v-if="question.quesOptions">
|
|
|
|
- <div
|
|
|
|
- v-for="(quesOption, optionIndex) in question.quesOptions"
|
|
|
|
- :key="optionIndex"
|
|
|
|
- class="paper-option"
|
|
|
|
- >
|
|
|
|
- <span>{{ optionIndex | optionOrderWordFilter }}. </span>
|
|
|
|
- <rich-text :text-json="quesOption.optionBody"></rich-text>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-part" :key="question.id">
|
|
|
|
+ <div class="edit-cont">
|
|
|
|
+ <div class="edit-cont-title">
|
|
|
|
+ <rich-text :text-json="question.quesBody"></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-body">
|
|
|
|
+ <template v-if="question.quesOptions">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(quesOption, optionIndex) in question.quesOptions"
|
|
|
|
+ :key="optionIndex"
|
|
|
|
+ class="paper-option"
|
|
|
|
+ >
|
|
|
|
+ <span>{{ optionIndex | optionOrderWordFilter }}. </span>
|
|
|
|
+ <rich-text :text-json="quesOption.optionBody"></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <div v-if="!isNested(question.questionType)" class="paper-answer">
|
|
|
|
+ <span>答案:</span>
|
|
|
|
+ <question-answer :data="question"></question-answer>
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
- <div v-if="!isNested(question.questionType)" class="paper-answer">
|
|
|
|
- <span>答案:</span>
|
|
|
|
- <question-answer :data="question"></question-answer>
|
|
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- v-if="!isNested(question.questionType) && question.quesProperties"
|
|
|
|
- class="edit-cont-props"
|
|
|
|
- style="margin-top: 10px"
|
|
|
|
- >
|
|
|
|
- <el-tag
|
|
|
|
- v-for="(content, propIndex) in question.quesProperties"
|
|
|
|
- :key="propIndex"
|
|
|
|
- type="primary"
|
|
|
|
- effect="dark"
|
|
|
|
- style="margin-right: 5px; margin-bottom: 5px"
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-if="!isNested(question.questionType) && question.quesProperties"
|
|
|
|
+ class="edit-cont-props"
|
|
|
|
+ style="margin-top: 10px"
|
|
>
|
|
>
|
|
- <!-- {{ content.courseProperty && content.courseProperty.name }}
|
|
|
|
- <span style="margin: 0 3px">/</span> -->
|
|
|
|
- {{ content.firstProperty && content.firstProperty.name }}
|
|
|
|
- <span
|
|
|
|
- v-if="content.secondProperty && content.secondProperty.name"
|
|
|
|
- style="margin: 0 3px"
|
|
|
|
- >/</span
|
|
|
|
|
|
+ <el-tag
|
|
|
|
+ v-for="(content, propIndex) in question.quesProperties"
|
|
|
|
+ :key="propIndex"
|
|
|
|
+ type="primary"
|
|
|
|
+ effect="dark"
|
|
|
|
+ style="margin-right: 5px; margin-bottom: 5px"
|
|
>
|
|
>
|
|
- {{ content.secondProperty && content.secondProperty.name }}
|
|
|
|
- </el-tag>
|
|
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- v-if="isNested(question.questionType)"
|
|
|
|
- class="edit-paper-question-subs"
|
|
|
|
- >
|
|
|
|
|
|
+ <!-- {{ content.courseProperty && content.courseProperty.name }}
|
|
|
|
+ <span style="margin: 0 3px">/</span> -->
|
|
|
|
+ {{ content.firstProperty && content.firstProperty.name }}
|
|
|
|
+ <span
|
|
|
|
+ v-if="content.secondProperty && content.secondProperty.name"
|
|
|
|
+ style="margin: 0 3px"
|
|
|
|
+ >/</span
|
|
|
|
+ >
|
|
|
|
+ {{ content.secondProperty && content.secondProperty.name }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </div>
|
|
<div
|
|
<div
|
|
- v-for="(subQuestion, subIndex) in question.subQuestions"
|
|
|
|
- :key="subIndex"
|
|
|
|
- class="edit-part"
|
|
|
|
|
|
+ v-if="isNested(question.questionType)"
|
|
|
|
+ class="edit-paper-question-subs"
|
|
>
|
|
>
|
|
- <div class="edit-cont">
|
|
|
|
- <div class="edit-cont-title">
|
|
|
|
- <span>{{ subIndex + 1 }}. </span>
|
|
|
|
- <rich-text :text-json="subQuestion.quesBody"></rich-text>
|
|
|
|
- </div>
|
|
|
|
- <div class="edit-cont-body">
|
|
|
|
- <template v-if="!isMatchingQuestion(question.questionType)">
|
|
|
|
- <div
|
|
|
|
- v-for="(
|
|
|
|
- subQuesOption, subOptIndex
|
|
|
|
- ) in subQuestion.quesOptions"
|
|
|
|
- :key="subOptIndex"
|
|
|
|
- class="paper-option"
|
|
|
|
- >
|
|
|
|
- <span>{{ subOptIndex | optionOrderWordFilter }}. </span>
|
|
|
|
- <rich-text
|
|
|
|
- :text-json="subQuesOption.optionBody"
|
|
|
|
- ></rich-text>
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-for="(subQuestion, subIndex) in question.subQuestions"
|
|
|
|
+ :key="subIndex"
|
|
|
|
+ class="edit-part"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-cont">
|
|
|
|
+ <div class="edit-cont-title">
|
|
|
|
+ <span>{{ subIndex + 1 }}. </span>
|
|
|
|
+ <rich-text :text-json="subQuestion.quesBody"></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-body">
|
|
|
|
+ <template v-if="!isMatchingQuestion(question.questionType)">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(
|
|
|
|
+ subQuesOption, subOptIndex
|
|
|
|
+ ) in subQuestion.quesOptions"
|
|
|
|
+ :key="subOptIndex"
|
|
|
|
+ class="paper-option"
|
|
|
|
+ >
|
|
|
|
+ <span>{{ subOptIndex | optionOrderWordFilter }}. </span>
|
|
|
|
+ <rich-text
|
|
|
|
+ :text-json="subQuesOption.optionBody"
|
|
|
|
+ ></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="paper-answer">
|
|
|
|
+ <span>答案:</span>
|
|
|
|
+ <question-answer :data="subQuestion"></question-answer>
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
- <div class="paper-answer">
|
|
|
|
- <span>答案:</span>
|
|
|
|
- <question-answer :data="subQuestion"></question-answer>
|
|
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- v-if="subQuestion.quesProperties"
|
|
|
|
- class="edit-cont-props"
|
|
|
|
- style="margin-top: 10px"
|
|
|
|
- >
|
|
|
|
- <el-tag
|
|
|
|
- v-for="(content, propIndex) in subQuestion.quesProperties"
|
|
|
|
- :key="propIndex"
|
|
|
|
- type="primary"
|
|
|
|
- effect="dark"
|
|
|
|
- style="margin-right: 5px; margin-bottom: 5px"
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-if="subQuestion.quesProperties"
|
|
|
|
+ class="edit-cont-props"
|
|
|
|
+ style="margin-top: 10px"
|
|
>
|
|
>
|
|
- <!-- {{ content.courseProperty && content.courseProperty.name }}
|
|
|
|
- <span style="margin: 0 3px">/</span> -->
|
|
|
|
- {{ content.firstProperty && content.firstProperty.name }}
|
|
|
|
- <span
|
|
|
|
- v-if="content.secondProperty && content.secondProperty.name"
|
|
|
|
- style="margin: 0 3px"
|
|
|
|
- >/</span
|
|
|
|
|
|
+ <el-tag
|
|
|
|
+ v-for="(content, propIndex) in subQuestion.quesProperties"
|
|
|
|
+ :key="propIndex"
|
|
|
|
+ type="primary"
|
|
|
|
+ effect="dark"
|
|
|
|
+ style="margin-right: 5px; margin-bottom: 5px"
|
|
>
|
|
>
|
|
- {{ content.secondProperty && content.secondProperty.name }}
|
|
|
|
- </el-tag>
|
|
|
|
|
|
+ <!-- {{ content.courseProperty && content.courseProperty.name }}
|
|
|
|
+ <span style="margin: 0 3px">/</span> -->
|
|
|
|
+ {{ content.firstProperty && content.firstProperty.name }}
|
|
|
|
+ <span
|
|
|
|
+ v-if="
|
|
|
|
+ content.secondProperty && content.secondProperty.name
|
|
|
|
+ "
|
|
|
|
+ style="margin: 0 3px"
|
|
|
|
+ >/</span
|
|
|
|
+ >
|
|
|
|
+ {{ content.secondProperty && content.secondProperty.name }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
|
|
- <div class="box-justify" slot="footer">
|
|
|
|
- <div>
|
|
|
|
|
|
+ <div class="text-center" slot="footer">
|
|
<template v-if="showSwitch">
|
|
<template v-if="showSwitch">
|
|
- <el-button
|
|
|
|
- icon="el-icon-caret-left"
|
|
|
|
- :disabled="loading"
|
|
|
|
- @click="toPrev"
|
|
|
|
- ></el-button>
|
|
|
|
- <el-button
|
|
|
|
- icon="el-icon-caret-right"
|
|
|
|
- :disabled="loading"
|
|
|
|
- @click="toNext"
|
|
|
|
- ></el-button>
|
|
|
|
|
|
+ <el-button type="primary" :disabled="loading" @click="toPrev"
|
|
|
|
+ >上一题</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="primary" :disabled="loading" @click="toNext"
|
|
|
|
+ >下一题</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
|
|
+ <el-button v-if="showEdit" type="primary" @click="toEdit"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
- <el-button @click="cancel">关闭</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- QuestionEditLogDialog -->
|
|
|
|
+ <question-edit-log-dialog
|
|
|
|
+ v-if="showLog"
|
|
|
|
+ ref="QuestionEditLogDialog"
|
|
|
|
+ :paper-id="this.question.id"
|
|
|
|
+ ></question-edit-log-dialog>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import QuestionAnswer from "./QuestionAnswer.vue";
|
|
import QuestionAnswer from "./QuestionAnswer.vue";
|
|
|
|
+import QuestionEditLogDialog from "./QuestionEditLogDialog.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "QuestionPreviewDialog",
|
|
name: "QuestionPreviewDialog",
|
|
- components: { QuestionAnswer },
|
|
|
|
|
|
+ components: { QuestionAnswer, QuestionEditLogDialog },
|
|
props: {
|
|
props: {
|
|
data: {
|
|
data: {
|
|
type: Object,
|
|
type: Object,
|
|
default: null,
|
|
default: null,
|
|
},
|
|
},
|
|
|
|
+ showEdit: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false,
|
|
|
|
+ },
|
|
showSwitch: {
|
|
showSwitch: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false,
|
|
default: false,
|
|
},
|
|
},
|
|
|
|
+ showLog: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false,
|
|
|
|
+ },
|
|
listInfo: {
|
|
listInfo: {
|
|
type: Object,
|
|
type: Object,
|
|
default: null,
|
|
default: null,
|
|
@@ -190,6 +219,12 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
|
|
+ toEdit() {
|
|
|
|
+ this.$emit("on-edit", this.question);
|
|
|
|
+ },
|
|
|
|
+ toViewLog() {
|
|
|
|
+ this.$refs.QuestionEditLogDialog.open();
|
|
|
|
+ },
|
|
isNested(questionType) {
|
|
isNested(questionType) {
|
|
const nestedQuestion = [
|
|
const nestedQuestion = [
|
|
"PARAGRAPH_MATCHING",
|
|
"PARAGRAPH_MATCHING",
|