|
@@ -1,78 +1,83 @@
|
|
|
<template>
|
|
|
- <div class="app-container" id="paperContainer">
|
|
|
- <el-card style="margin-bottom: 10px; text-align: center">
|
|
|
- <el-input v-model="papername" style="width: 150px" />
|
|
|
- <el-button style="margin-left: 10px" type="text" @click="savePaper" :loading="isLoading">保存试卷</el-button>
|
|
|
- <el-button style="margin-left: 10px" type="text" @click="toQuestionList()">继续出题</el-button>
|
|
|
- </el-card>
|
|
|
- <el-card style="margin-bottom: 10px" v-for="(questionData, index) in questionList" :key="index">
|
|
|
- <div :class="'drag_' + index">
|
|
|
- <div slot="header" class="clearfix" @mouseover="showSorce(questionData, index)" @mouseout="hideSorce(questionData, index)" draggable="true" @dragstart="handleDragStart($event, questionData)" @dragover.prevent="handleDragOver($event, questionData)" @drop="handleDragEnter($event, questionData)" @dragend="handleDragEnd($event, questionData)">
|
|
|
+ <div class="app-container" >
|
|
|
+ <div id="paperContainer">
|
|
|
+ <el-card style="margin-bottom: 10px; text-align: center">
|
|
|
+ <el-input v-model="papername" style="width: 150px" />
|
|
|
+ <el-button style="margin-left: 10px" type="text" @click="savePaper" :loading="isLoading">保存试卷</el-button>
|
|
|
+ <el-button style="margin-left: 10px" type="text" @click="toQuestionList()">继续出题</el-button>
|
|
|
+ </el-card>
|
|
|
+ <el-card style="margin-bottom: 10px" v-for="(questionData, index) in questionList" :key="index">
|
|
|
+ <div :class="'drag_' + index">
|
|
|
+ <div slot="header" class="clearfix" @mouseover="showSorce(questionData, index)" @mouseout="hideSorce(questionData, index)" draggable="true" @dragstart="handleDragStart($event, questionData)" @dragover.prevent="handleDragOver($event, questionData)" @drop="handleDragEnter($event, questionData)" @dragend="handleDragEnd($event, questionData)">
|
|
|
<span style="color: #000000; font-size: 14px; font-weight: bold">{{ NumberToChinese(index + 1) }}、{{ questionData.title }}(共{{
|
|
|
questionData.num
|
|
|
}}题;共{{ questionData.score }}分)</span>
|
|
|
- <span style="float: right; display: none" :id="'parent_score_' + index">
|
|
|
+ <span style="float: right; display: none" :id="'parent_score_' + index">
|
|
|
<el-button type="text" @click="
|
|
|
openParentScore = true;
|
|
|
currentIndex = index;
|
|
|
">批量设置得分</el-button>
|
|
|
<el-button type="text" @click="deleteType(index)">删除分类</el-button>
|
|
|
</span>
|
|
|
- </div>
|
|
|
- <div v-for="(questionInfo, index2) in questionData.list" :key="index2" style="margin-bottom: 10px" @mouseover="showQuestionSorce(index, index2)" @mouseout="hideQuestionSorce(index, index2)" @dragstart="handleQuestionDragStart($event, questionInfo, index2)" @dragover.prevent="handleQuestionDragOver($event, questionInfo)" @drop="handleQuestionDragEnter($event, questionInfo, index, index2)" @dragend="handleQuestionDragEnd($event, questionInfo)" draggable="true">
|
|
|
- <div style="display: none" :id="'score_' + index + '_' + index2">
|
|
|
- <el-button type="text" @click="
|
|
|
+ </div>
|
|
|
+ <div v-for="(questionInfo, index2) in questionData.list" :key="index2" style="margin-bottom: 10px" @mouseover="showQuestionSorce(index, index2)" @mouseout="hideQuestionSorce(index, index2)" @dragstart="handleQuestionDragStart($event, questionInfo, index2)" @dragover.prevent="handleQuestionDragOver($event, questionInfo)" @drop="handleQuestionDragEnter($event, questionInfo, index, index2)" @dragend="handleQuestionDragEnd($event, questionInfo)" draggable="true">
|
|
|
+ <div style="display: none" :id="'score_' + index + '_' + index2">
|
|
|
+ <el-button type="text" @click="
|
|
|
openScore = true;
|
|
|
currentIndex = index;
|
|
|
questionIndex = index2;
|
|
|
">设置得分</el-button>
|
|
|
- <el-button type="text" @click="setCurrentVal(index, index2, questionInfo)">解析</el-button>
|
|
|
- <el-button type="text" @click="deleteQuestion(index, index2)">删除题目</el-button>
|
|
|
+ <el-button type="text" @click="setCurrentVal(index, index2, questionInfo)">解析</el-button>
|
|
|
+ <el-button type="text" @click="deleteQuestion(index, index2)">删除题目</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ {{ index2 + 1 }}.
|
|
|
+ <span style="color: #1890ff">题号:{{ questionInfo.id }}({{ questionInfo.score }}分)</span><span v-html="questionInfo.title"></span>
|
|
|
+ </div>
|
|
|
+ <!--<div v-for="child in questionInfo.subquestions" v-html="child.title"></div>-->
|
|
|
</div>
|
|
|
- <div>
|
|
|
- {{ index2 + 1 }}.
|
|
|
- <span style="color: #1890ff">题号:{{ questionInfo.id }}({{ questionInfo.score }}分)</span><span v-html="questionInfo.title"></span>
|
|
|
- </div>
|
|
|
- <!--<div v-for="child in questionInfo.subquestions" v-html="child.title"></div>-->
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ </el-card>
|
|
|
|
|
|
- <!-- 批量设置分数-->
|
|
|
- <el-dialog :visible.sync="openParentScore" width="500px" append-to-body>
|
|
|
- <el-form label-width="80px">
|
|
|
- <el-form-item label="分数" prop="parentScore">
|
|
|
- <el-input-number v-model.number="parentScore" :min="1" placeholder="请输入分数" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="setParentScore">确 定</el-button>
|
|
|
- <el-button @click="openParentScore = false">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- <!-- 设置题目分数 -->
|
|
|
- <el-dialog :visible.sync="openScore" width="500px" append-to-body>
|
|
|
- <el-form label-width="80px">
|
|
|
- <el-form-item label="分数" prop="parentScore">
|
|
|
- <el-input-number v-model.number="questionScore" :min="1" placeholder="请输入分数" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="setScore">确 定</el-button>
|
|
|
- <el-button @click="openScore = false">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ <!-- 批量设置分数-->
|
|
|
+ <el-dialog :visible.sync="openParentScore" width="500px" append-to-body>
|
|
|
+ <el-form label-width="80px">
|
|
|
+ <el-form-item label="分数" prop="parentScore">
|
|
|
+ <el-input-number v-model.number="parentScore" :min="1" placeholder="请输入分数" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="setParentScore">确 定</el-button>
|
|
|
+ <el-button @click="openParentScore = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 设置题目分数 -->
|
|
|
+ <el-dialog :visible.sync="openScore" width="500px" append-to-body>
|
|
|
+ <el-form label-width="80px">
|
|
|
+ <el-form-item label="分数" prop="parentScore">
|
|
|
+ <el-input-number v-model.number="questionScore" :min="1" placeholder="请输入分数" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="setScore">确 定</el-button>
|
|
|
+ <el-button @click="openScore = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
<!-- 试题篮 -->
|
|
|
- <el-dialog title="解析" :visible.sync="openQuestionParseDialog" width="500px" append-to-body center>
|
|
|
- <el-form label-width="80px">
|
|
|
+ <el-dialog v-if="openQuestionParseDialog" title="解析" :visible.sync="openQuestionParseDialog" width="70%" append-to-body center>
|
|
|
+ <el-form label-width="80px" id="paperDialog" >
|
|
|
<el-form-item label="解析">
|
|
|
- <editor v-model="currentQuestionParse" :min-height="122" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="答案1">
|
|
|
- <editor v-model="currentQuestionAnswer1" :min-height="122" />
|
|
|
+ <div v-html="currentQuestionParse"></div>
|
|
|
+<!-- <editor v-model="currentQuestionParse" :min-height="122" />-->
|
|
|
</el-form-item>
|
|
|
+<!-- <el-form-item label="答案1">-->
|
|
|
+<!-- <div v-html="currentQuestionAnswer1"></div>-->
|
|
|
+<!--<!– <editor v-model="currentQuestionAnswer1" :min-height="122" />–>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
<el-form-item label="答案2">
|
|
|
- <editor v-model="currentQuestionAnswer2" :min-height="122" />
|
|
|
+ <div v-html="currentQuestionAnswer2"></div>
|
|
|
+<!-- <editor v-model="currentQuestionAnswer2" :min-height="122" />-->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -86,6 +91,7 @@
|
|
|
<script>
|
|
|
import { savePaperInfo, deleteQuestionCard } from "@/api/webApi/webQue.js";
|
|
|
import Editor from "@/components/Editor";
|
|
|
+
|
|
|
export default {
|
|
|
name: "Paper",
|
|
|
components: {
|
|
@@ -134,6 +140,9 @@ export default {
|
|
|
this.currentQuestionParse = questionInfo.parse;
|
|
|
this.currentQuestionAnswer1 = questionInfo.answer1;
|
|
|
this.currentQuestionAnswer2 = questionInfo.answer2;
|
|
|
+ setTimeout(_=>{
|
|
|
+ this.mxGlobal.MathQueue("paperDialog")
|
|
|
+ }, 500)
|
|
|
},
|
|
|
getQuestionList() {
|
|
|
this.questionList = []
|