|
@@ -0,0 +1,698 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="edit-paper">
|
|
|
|
+ <div class="edit-header">
|
|
|
|
+ <div class="edit-header-top box-justify">
|
|
|
|
+ <div class="header-info">
|
|
|
|
+ <div class="header-info-item">
|
|
|
|
+ <span>课程代码:</span>
|
|
|
|
+ <span>{{ paper.course.code }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="header-info-item">
|
|
|
|
+ <span>课程名称:</span>
|
|
|
|
+ <span>{{ paper.course.name }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="header-info-item">
|
|
|
|
+ <span>试卷名称:</span>
|
|
|
|
+ <span>
|
|
|
|
+ <el-tooltip class="item" effect="dark" placement="top-start">
|
|
|
|
+ <div slot="content">{{ paper.name }}</div>
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="paper.name"
|
|
|
|
+ size="mini"
|
|
|
|
+ class="header-info-input"
|
|
|
|
+ placeholder="试卷名称"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="header-info-item">
|
|
|
|
+ <span>试卷标题:</span>
|
|
|
|
+ <span>
|
|
|
|
+ <el-tooltip class="item" effect="dark" placement="top-start">
|
|
|
|
+ <div slot="content">{{ paper.title }}</div>
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="paper.title"
|
|
|
|
+ size="mini"
|
|
|
|
+ class="header-info-input"
|
|
|
|
+ placeholder="试卷标题"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="header-info-item">
|
|
|
|
+ <span>试卷总分:</span>
|
|
|
|
+ <span>{{ paper.totalScore }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="header-btns">
|
|
|
|
+ <el-button type="primary" size="small" @click="toSavePaper">
|
|
|
|
+ 保存
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ size="small"
|
|
|
|
+ @click="toDeletePaper(paper.id)"
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkDuplicateBtnShow"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ plain
|
|
|
|
+ @click="toCheckDuplicate"
|
|
|
|
+ >
|
|
|
|
+ 进入查重
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="toExportPaperAnswer"
|
|
|
|
+ >导出答案</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ icon="icon icon-back"
|
|
|
|
+ @click="toBack"
|
|
|
|
+ >返回</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-header-bottom box-justify">
|
|
|
|
+ <div>
|
|
|
|
+ <el-button type="info" size="small" @click="toViewBaseInfo">
|
|
|
|
+ 基础构成
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button type="info" size="small" @click="toViewQuestypeInfo">
|
|
|
|
+ 题型分布
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button type="info" size="small" @click="toViewBlueInfo">
|
|
|
|
+ 蓝图分布
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button type="info" size="small" @click="toViewAuditInfo">
|
|
|
|
+ 审核记录
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="enableCardEdit"
|
|
|
|
+ type="info"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="toEditCard"
|
|
|
|
+ >
|
|
|
|
+ 编辑题卡
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ plain
|
|
|
|
+ @click="toSwitchQuesTagShowHide"
|
|
|
|
+ >
|
|
|
|
+ {{ quesTagShow ? "隐藏" : "显示" }}属性
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ plain
|
|
|
|
+ @click="toSwitchQuesAnswerShowHide"
|
|
|
|
+ >
|
|
|
|
+ {{ quesAnswerShow ? "隐藏" : "显示" }}答案
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="edit-body">
|
|
|
|
+ <!-- 考试说明 -->
|
|
|
|
+ <div class="edit-part-list">
|
|
|
|
+ <div class="edit-part">
|
|
|
|
+ <div class="edit-cont">
|
|
|
|
+ <div class="edit-cont-title">
|
|
|
|
+ <h3>考试说明</h3>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-action">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ size="small"
|
|
|
|
+ @click="openEditExamPaperRemark"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-body">
|
|
|
|
+ <rich-text :text-json="paper.examRemark"></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 循环大题 -->
|
|
|
|
+ <div
|
|
|
|
+ v-for="(paperDetail, detailIndex) in paper.paperDetails"
|
|
|
|
+ v-show="paperDetailShow(paperDetail)"
|
|
|
|
+ :key="detailIndex"
|
|
|
|
+ class="edit-part-list"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-part">
|
|
|
|
+ <div class="edit-cont">
|
|
|
|
+ <div class="edit-cont-title">
|
|
|
|
+ <h3>
|
|
|
|
+ <span>{{ paperDetail.cnNum }}</span> <span>.</span>
|
|
|
|
+ <span>{{ paperDetail.name }}</span>
|
|
|
|
+ <span>
|
|
|
|
+ ({{
|
|
|
|
+ !paperDetail.title ? "本大题" : paperDetail.title + ","
|
|
|
|
+ }}共{{ paperDetail.unitCount }}小题,满分{{
|
|
|
|
+ paperDetail.score
|
|
|
|
+ }}分)
|
|
|
|
+ </span>
|
|
|
|
+ </h3>
|
|
|
|
+ </div>
|
|
|
|
+ <rich-text
|
|
|
|
+ class="edit-cont-body"
|
|
|
|
+ :text-json="paperDetail.description"
|
|
|
|
+ ></rich-text>
|
|
|
|
+ <div class="edit-cont-action">
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="parentView == 'gen_paper'"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="selectQues(paperDetail.id)"
|
|
|
|
+ >选题
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="openEditPaperDetail(paperDetail)"
|
|
|
|
+ >编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUp(paperDetail)"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="movePaperDetail(paperDetail, 'up')"
|
|
|
|
+ >上移
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showDown(paperDetail)"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="movePaperDetail(paperDetail, 'down')"
|
|
|
|
+ >下移
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="danger"
|
|
|
|
+ @click="deletePaperDetail(paperDetail.id)"
|
|
|
|
+ >删除
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="showButtons[detailIndex].up"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-arrow-up"
|
|
|
|
+ @click.stop="hideContent(detailIndex)"
|
|
|
|
+ ></el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="!showButtons[detailIndex].up"
|
|
|
|
+ size="small"
|
|
|
|
+ icon="el-icon-arrow-down"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click.stop="showContent(detailIndex)"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-show="quesTagShow" class="edit-property">
|
|
|
|
+ <div class="edit-property-box">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(paperDetailTag, tagIndex) in paperDetail.tags"
|
|
|
|
+ :key="tagIndex"
|
|
|
|
+ class="edit-property-item"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-property-body edit-property-danger">
|
|
|
|
+ <div class="edit-property-title">
|
|
|
|
+ {{ paperDetailTag.tag }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-property-content">
|
|
|
|
+ {{ paperDetailTag.content }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 循环小题 -->
|
|
|
|
+ <div
|
|
|
|
+ v-show="showQuestions[detailIndex].is_show"
|
|
|
|
+ class="edit-paper-questions"
|
|
|
|
+ >
|
|
|
|
+ <template
|
|
|
|
+ v-for="(paperDetailUnit, unitIndex) in paperDetail.paperDetailUnits"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-show="quesShow(paperDetailUnit.id)"
|
|
|
|
+ :key="`question-${unitIndex}`"
|
|
|
|
+ :class="[
|
|
|
|
+ 'edit-part',
|
|
|
|
+ {
|
|
|
|
+ 'question-duplicate':
|
|
|
|
+ paperDetailUnit.question.checkDuplicateStatus ==
|
|
|
|
+ 'TO_BE_DISPOSE',
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-cont">
|
|
|
|
+ <div class="edit-cont-title">
|
|
|
|
+ <span>{{ paperDetailUnit.number }}.</span>
|
|
|
|
+ <rich-text
|
|
|
|
+ :text-json="paperDetailUnit.question.quesBody"
|
|
|
|
+ ></rich-text>
|
|
|
|
+ <span> ({{ paperDetailUnit.score }}分) </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-body">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(quesOption, optionIndex) in paperDetailUnit.question
|
|
|
|
+ .quesOptions"
|
|
|
|
+ :key="optionIndex"
|
|
|
|
+ class="paper-option"
|
|
|
|
+ >
|
|
|
|
+ <span>{{ optionIndex | optionOrderWordFilter }}. </span>
|
|
|
|
+ <rich-text :text-json="quesOption.optionBody"></rich-text>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="!isNested(paperDetailUnit.questionType)">
|
|
|
|
+ <div v-show="quesAnswerShow" class="paper-answer">
|
|
|
|
+ <span>答案:</span>
|
|
|
|
+ <question-answer
|
|
|
|
+ :data="paperDetailUnit.question"
|
|
|
|
+ ></question-answer>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-action">
|
|
|
|
+ <span class="tips-info">
|
|
|
|
+ {{ paperDetailUnit.question.bodyLengthText }}
|
|
|
|
+ </span>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="
|
|
|
|
+ paperDetailUnit.question.checkDuplicateStatus ===
|
|
|
|
+ 'TO_BE_DISPOSE'
|
|
|
|
+ "
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="checkDuplicateQuestion(paperDetailUnit.question.id)"
|
|
|
|
+ >进入查重
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="editQues(paperDetailUnit, paperDetailUnit.question)"
|
|
|
|
+ >编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitUp(paperDetail, paperDetailUnit.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnit(
|
|
|
|
+ paperDetail.id,
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ 'up'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >上移
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitDown(paperDetail, paperDetailUnit.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnit(
|
|
|
|
+ paperDetail.id,
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ 'down'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >下移
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="deleteQues(paperDetailUnit)"
|
|
|
|
+ >删除
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="
|
|
|
|
+ isNested(paperDetailUnit.questionType) &&
|
|
|
|
+ showSubButtons[detailIndex + '-' + unitIndex]
|
|
|
|
+ "
|
|
|
|
+ size="small"
|
|
|
|
+ icon="el-icon-arrow-up"
|
|
|
|
+ @click.stop="hideSubContent(detailIndex + '-' + unitIndex)"
|
|
|
|
+ ></el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="
|
|
|
|
+ isNested(paperDetailUnit.questionType) &&
|
|
|
|
+ !showSubButtons[detailIndex + '-' + unitIndex]
|
|
|
|
+ "
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-arrow-down"
|
|
|
|
+ @click.stop="showSubContent(detailIndex + '-' + unitIndex)"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-show="quesTagShow" class="edit-property">
|
|
|
|
+ <div class="edit-property-box">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(questionTag, tagIndex) in paperDetailUnit.question
|
|
|
|
+ .tags"
|
|
|
|
+ :key="tagIndex"
|
|
|
|
+ class="edit-property-item"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-property-body">
|
|
|
|
+ <div class="edit-property-title">
|
|
|
|
+ {{ questionTag.tag }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-property-content">
|
|
|
|
+ {{ questionTag.content }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-show="showSubQuestions[detailIndex + '-' + unitIndex]"
|
|
|
|
+ :key="`question-sub-${unitIndex}`"
|
|
|
|
+ class="edit-paper-question-subs"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-for="(subQuestion, subIndex) in paperDetailUnit.question
|
|
|
|
+ .subQuestions"
|
|
|
|
+ v-show="quesShow(subQuestion.id)"
|
|
|
|
+ :key="subIndex"
|
|
|
|
+ class="edit-part"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-cont">
|
|
|
|
+ <div class="edit-cont-title">
|
|
|
|
+ <span>{{ subQuestion.subNumber }}. </span>
|
|
|
|
+ <rich-text :text-json="subQuestion.quesBody"></rich-text>
|
|
|
|
+ <span
|
|
|
|
+ >({{ paperDetailUnit.subScoreList[subIndex] }}分)</span
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-if="!isMatchingQuestion(paperDetailUnit.questionType)"
|
|
|
|
+ class="edit-cont-body"
|
|
|
|
+ >
|
|
|
|
+ <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>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-show="quesAnswerShow" class="paper-answer">
|
|
|
|
+ <span>答案:</span>
|
|
|
|
+ <question-answer :data="subQuestion"></question-answer>
|
|
|
|
+ <!-- <rich-text :text-json="subQuestion.quesAnswer"></rich-text> -->
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-cont-action">
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="editQues(paperDetailUnit, subQuestion)"
|
|
|
|
+ >编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitSubUp(paperDetailUnit, subQuestion.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnitSub(
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ subQuestion.id,
|
|
|
|
+ 'up'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >上移
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitSubDown(paperDetailUnit, subQuestion.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnitSub(
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ subQuestion.id,
|
|
|
|
+ 'down'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >下移
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-show="quesTagShow" class="edit-property">
|
|
|
|
+ <div class="edit-property-box">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(subQuestionTag, tagIndex) in subQuestion.tags"
|
|
|
|
+ :key="tagIndex"
|
|
|
|
+ class="edit-property-item"
|
|
|
|
+ >
|
|
|
|
+ <div class="edit-property-body">
|
|
|
|
+ <div class="edit-property-title">
|
|
|
|
+ {{ subQuestionTag.tag }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="edit-property-content">
|
|
|
|
+ {{ subQuestionTag.content }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 基础构成 -->
|
|
|
|
+ <paper-base-info ref="PaperBaseInfo" :paper-id="paperId"></paper-base-info>
|
|
|
|
+ <!-- 题型分布 -->
|
|
|
|
+ <paper-questype-info
|
|
|
|
+ ref="PaperQuestypeInfo"
|
|
|
|
+ :paper-id="paperId"
|
|
|
|
+ ></paper-questype-info>
|
|
|
|
+ <!-- 蓝图分布 -->
|
|
|
|
+ <paper-blue-info
|
|
|
|
+ ref="PaperBlueInfo"
|
|
|
|
+ :paper-id="paperId"
|
|
|
|
+ :course-id="paper.course.id"
|
|
|
|
+ ></paper-blue-info>
|
|
|
|
+ <!-- 审核记录 -->
|
|
|
|
+ <paper-audit-info
|
|
|
|
+ ref="PaperAuditInfo"
|
|
|
|
+ :paper-id="paperId"
|
|
|
|
+ ></paper-audit-info>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { paperDetailInfoApi, paperSaveApi, paperDeleteApi } from "../api";
|
|
|
|
+import { QUESTION_API } from "@/constants/constants";
|
|
|
|
+
|
|
|
|
+import PaperBaseInfo from "../components/PaperBaseInfo.vue";
|
|
|
|
+import PaperQuestypeInfo from "../components/PaperQuestypeInfo.vue";
|
|
|
|
+import PaperBlueInfo from "../components/PaperBlueInfo.vue";
|
|
|
|
+import PaperAuditInfo from "../components/PaperAuditInfo.vue";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "EditPaper",
|
|
|
|
+ components: {
|
|
|
|
+ PaperBaseInfo,
|
|
|
|
+ PaperQuestypeInfo,
|
|
|
|
+ PaperAuditInfo,
|
|
|
|
+ PaperBlueInfo,
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ paperId: "",
|
|
|
|
+ parentView: "",
|
|
|
|
+ paper: {
|
|
|
|
+ name: "",
|
|
|
|
+ title: "",
|
|
|
|
+ totalScore: 0,
|
|
|
|
+ course: {
|
|
|
|
+ code: "",
|
|
|
|
+ name: "",
|
|
|
|
+ },
|
|
|
|
+ examRemark: "",
|
|
|
|
+ paperDetails: [],
|
|
|
|
+ },
|
|
|
|
+ checkDuplicateBtnShow: false,
|
|
|
|
+ quesTagShow: false,
|
|
|
|
+ quesAnswerShow: false,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ user() {
|
|
|
|
+ return this.$store.state.user;
|
|
|
|
+ },
|
|
|
|
+ enableCardEdit() {
|
|
|
|
+ return (
|
|
|
|
+ this.paper.auditStatus === "PASS" && this.paper.paperType === "GENERATE"
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ let qt = sessionStorage.getItem("quesTagShow");
|
|
|
|
+ if (qt) {
|
|
|
|
+ this.quesTagShow = qt === "true";
|
|
|
|
+ }
|
|
|
|
+ let qa = sessionStorage.getItem("quesAnswerShow");
|
|
|
|
+ if (qa) {
|
|
|
|
+ this.quesAnswerShow = qa === "true";
|
|
|
|
+ }
|
|
|
|
+ this.paperId = Number(this.$route.params.id);
|
|
|
|
+ this.parentView = this.$route.params.parentView;
|
|
|
|
+ this.initPaper();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async initPaper() {
|
|
|
|
+ const res = await paperDetailInfoApi(this.paperId);
|
|
|
|
+ res.data.paperDetails.forEach((detail) => {
|
|
|
|
+ detail.showQuestions = true;
|
|
|
|
+ detail.paperDetailUnits.forEach((question) => {
|
|
|
|
+ question.showSubQuestions = true;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.paper = res.data;
|
|
|
|
+ this.showCheckDuplicate();
|
|
|
|
+ },
|
|
|
|
+ // header-actions
|
|
|
|
+ showCheckDuplicate() {
|
|
|
|
+ if (this.paper.checkDuplicateStatus === "DISPOSED") {
|
|
|
|
+ this.checkDuplicateBtnShow = false;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.checkDuplicateBtnShow = this.paper.paperDetails.some((detail) =>
|
|
|
|
+ detail.paperDetailUnits.some(
|
|
|
|
+ (question) =>
|
|
|
|
+ question.question.checkDuplicateStatus === "TO_BE_DISPOSE"
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ toCheckDuplicate() {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: "check_duplicate_info",
|
|
|
|
+ query: {
|
|
|
|
+ basePaperId: this.paper.id,
|
|
|
|
+ from: "paper",
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 保存试卷
|
|
|
|
+ async toSavePaper() {
|
|
|
|
+ const res = await paperSaveApi(this.paper).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("保存成功!");
|
|
|
|
+ },
|
|
|
|
+ // 删除试卷
|
|
|
|
+ async toDeletePaper() {
|
|
|
|
+ const confirm = await this.$confirm(`确定要删除该试卷吗?`, "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const res = await paperDeleteApi(this.paper).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("删除成功!");
|
|
|
|
+ window.history.go(-1);
|
|
|
|
+ this.toBack();
|
|
|
|
+ },
|
|
|
|
+ // 导出答案
|
|
|
|
+ toExportPaperAnswer() {
|
|
|
|
+ const { key, token } = this.user;
|
|
|
|
+ const url = `${QUESTION_API}/paper/answer/export/${this.paperId}?$key=${key}&$token=${token}`;
|
|
|
|
+ window.open(url);
|
|
|
|
+ },
|
|
|
|
+ toBack() {
|
|
|
|
+ window.history.go(-1);
|
|
|
|
+ },
|
|
|
|
+ // 显示/隐藏答案
|
|
|
|
+ toSwitchQuesAnswerShowHide() {
|
|
|
|
+ this.quesAnswerShow = !this.quesAnswerShow;
|
|
|
|
+ sessionStorage.setItem("quesAnswerShow", this.quesAnswerShow);
|
|
|
|
+ },
|
|
|
|
+ // 显示/隐藏属性
|
|
|
|
+ toSwitchQuesTagShowHide() {
|
|
|
|
+ this.quesTagShow = !this.quesTagShow;
|
|
|
|
+ sessionStorage.setItem("quesTagShow", this.quesTagShow);
|
|
|
|
+ },
|
|
|
|
+ // 查看基础构成
|
|
|
|
+ toViewBaseInfo() {
|
|
|
|
+ this.$refs.PaperBaseInfo.open();
|
|
|
|
+ },
|
|
|
|
+ // 查看题型分布
|
|
|
|
+ toViewQuestypeInfo() {
|
|
|
|
+ this.$refs.PaperQuestypeInfo.open();
|
|
|
|
+ },
|
|
|
|
+ // 查看蓝图分布
|
|
|
|
+ toViewBlueInfo() {
|
|
|
|
+ this.$refs.PaperBlueInfo.open();
|
|
|
|
+ },
|
|
|
|
+ // 查看审核信息
|
|
|
|
+ toViewAuditInfo() {
|
|
|
|
+ this.$refs.PaperAuditInfo.open();
|
|
|
|
+ },
|
|
|
|
+ // 编辑题卡
|
|
|
|
+ toEditCard() {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: "CardEdit",
|
|
|
|
+ params: {
|
|
|
|
+ idType: "paper",
|
|
|
|
+ paperOrCardId: this.paperId,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|