|
|
@@ -1,97 +1,86 @@
|
|
|
<template>
|
|
|
- <el-card v-if="questionvo!==undefined" class="primary-question-card" shadow="hover">
|
|
|
+ <el-card v-if="questionVO!==undefined" class="primary-question-card" shadow="hover">
|
|
|
<template #header>
|
|
|
- <el-row>
|
|
|
- <el-col :span="2">
|
|
|
- <span><strong>S/N: </strong>{{ curNum + 1 }} / {{ totalNum }}</span>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <span><strong>题目类型: </strong>{{ questionvo.type }}</span>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="8">
|
|
|
- <el-button type="text" circle @click="expand" v-show="!isAll"><strong>展开</strong></el-button>
|
|
|
- <el-button type="text" circle @click="withdraw" v-show="isAll"><strong>收起</strong></el-button>
|
|
|
- </el-col>
|
|
|
- <slot name="button">
|
|
|
- <!--按钮插槽,用于不同的卡片更换不同的按钮-->
|
|
|
- <el-col :span="1">
|
|
|
- <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"/>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1">
|
|
|
- <el-button v-if="isDelete === false" type="danger" icon="el-icon-delete" circle @click="deleteQuestion"/>
|
|
|
- <el-button v-else type="success" icon="el-icon-delete" circle @click="recoverQuestion"/>
|
|
|
- </el-col>
|
|
|
- </slot>
|
|
|
- </el-row>
|
|
|
- <!--知识点插槽,用于更新题目卡片中可能存在的知识点改变差异-->
|
|
|
- <slot name="knowledgeId">
|
|
|
- <span><strong>KnowledgeId: </strong></span>
|
|
|
- <!--知识点显示内容-->
|
|
|
- <el-tooltip
|
|
|
- v-if="questionvo.knowledgeId && questionvo.knowledgeId.length !== 0"
|
|
|
- v-for="item in questionvo.knowledgeId"
|
|
|
- effect="dark"
|
|
|
- placement="bottom">
|
|
|
- <template #content>
|
|
|
- {{ map(item) }}
|
|
|
- </template>
|
|
|
- <el-tag effect="dark" style="margin-right: 2px">{{ item }}</el-tag>
|
|
|
- </el-tooltip>
|
|
|
- <span v-else>null</span>
|
|
|
+ <!-- <el-space>-->
|
|
|
+ <el-space style="display: flex">
|
|
|
+ <span><strong>S/N: </strong>{{ curNum + 1 }} / {{ totalNum }}</span>
|
|
|
+ <span><strong>题目类型: </strong>{{ questionVO.type }}</span>
|
|
|
+ <el-button type="text" circle @click="isAllShow=!isAllShow"><strong>{{ isAllShowText }}</strong></el-button>
|
|
|
+ <div>
|
|
|
+ <!--知识点插槽,用于更新题目卡片中可能存在的知识点改变差异-->
|
|
|
+ <slot name="knowledgeId">
|
|
|
+ <span><strong>KnowledgeId: </strong></span>
|
|
|
+ <!--知识点显示内容-->
|
|
|
+ <el-tooltip
|
|
|
+ v-if="questionVO.knowledgeId && questionVO.knowledgeId.length !== 0"
|
|
|
+ v-for="item in questionVO.knowledgeId"
|
|
|
+ effect="dark"
|
|
|
+ placement="bottom">
|
|
|
+ <template #content>
|
|
|
+ {{ map(item) }}
|
|
|
+ </template>
|
|
|
+ <el-tag effect="dark" style="margin-right: 2px">{{ item }}</el-tag>
|
|
|
+ </el-tooltip>
|
|
|
+ <span v-else>null</span>
|
|
|
+ </slot>
|
|
|
+ </div>
|
|
|
+ </el-space>
|
|
|
+ <slot name="button">
|
|
|
+ <!--按钮插槽,用于不同的卡片更换不同的按钮-->
|
|
|
+ <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"/>
|
|
|
+ <el-button v-if="isDelete === false" type="danger" icon="el-icon-delete" circle @click="deleteQuestion"/>
|
|
|
+ <el-button v-else type="success" icon="el-icon-delete" circle @click="recoverQuestion"/>
|
|
|
</slot>
|
|
|
+ <!-- </el-space>-->
|
|
|
</template>
|
|
|
-
|
|
|
<!--题目内容部分-->
|
|
|
<div class="primary-question-card-body">
|
|
|
<!--题干部分-->
|
|
|
<!--题干-题目描述部分-->
|
|
|
<slot name="stem">
|
|
|
- <MarkdownText :raw="'<strong>题目: </strong>'+questionvo.stem"></MarkdownText>
|
|
|
+ <MarkdownText :raw="'<strong>题目: </strong>'+questionVO.stem"></MarkdownText>
|
|
|
</slot>
|
|
|
<!--题干-题目答案部分-->
|
|
|
- <div v-show="isAll">
|
|
|
+ <div v-show="isAllShow">
|
|
|
<!--单选题和多选题答案-->
|
|
|
<slot name="choiceOption"
|
|
|
- v-if="questionvo.type==='choice' || questionvo.type==='multiple_choice'">
|
|
|
- <choice-option :question-v-o="questionvo"/>
|
|
|
+ v-if="questionVO.type==='choice' || questionVO.type==='multiple_choice'">
|
|
|
+ <choice-option :question-v-o="questionVO"/>
|
|
|
</slot>
|
|
|
<!--todo:其他若干答案显示组件替代这里的div-->
|
|
|
- <div class="bQuestion-card-body-blanks" v-if="questionvo.type === 'blank'">
|
|
|
- <div v-for="index in Object.keys(questionvo.blanks).length">
|
|
|
+ <div class="bQuestion-card-body-blanks" v-if="questionVO.type === 'blank'">
|
|
|
+ <div v-for="index in Object.keys(questionVO.blanks).length">
|
|
|
<div class="correct_answer">
|
|
|
- __{{ index }}__: {{ questionvo.blanks['__' + index + '__'] }}
|
|
|
+ __{{ index }}__: {{ questionVO.blanks['__' + index + '__'] }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="bQuestion-card-body-true_false" v-if="questionvo.type === 'true_false'">
|
|
|
- <div class="correct_answer"> {{ questionvo.answer }}</div>
|
|
|
+ <div class="bQuestion-card-body-true_false" v-if="questionVO.type === 'true_false'">
|
|
|
+ <div class="correct_answer"> {{ questionVO.answer }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <el-divider v-show="isAll"></el-divider>
|
|
|
-
|
|
|
+ <el-divider v-show="isAllShow"></el-divider>
|
|
|
<!--题目解析部分-->
|
|
|
- <div class="primary-question-card-analysis" v-show="isAll">
|
|
|
+ <div class="primary-question-card-analysis" v-show="isAllShow">
|
|
|
<!--题目解析-题目信息部分-->
|
|
|
<div class="analysis-block">
|
|
|
<el-row>
|
|
|
<slot name="keypoint">
|
|
|
<el-col :span="10">
|
|
|
- <strong>KeyPoints: </strong>{{ questionvo.keyPoints }}
|
|
|
+ <strong>KeyPoints: </strong>{{ questionVO.keyPoints }}
|
|
|
</el-col>
|
|
|
</slot>
|
|
|
<slot name="difficulty">
|
|
|
<el-col :span="6">
|
|
|
- <strong>题目难度: </strong>{{ questionvo.weight }}/5
|
|
|
+ <strong>题目难度: </strong>{{ questionVO.weight }}/5
|
|
|
</el-col>
|
|
|
</slot>
|
|
|
<slot name="tag">
|
|
|
<el-col :span="4">
|
|
|
<span><strong>Tags: </strong></span>
|
|
|
- <span v-if="questionvo.tags && questionvo.tags.length !== 0">
|
|
|
- <el-tag v-for="(item, index) in questionvo.tags" effect="dark">
|
|
|
+ <span v-if="questionVO.tags && questionVO.tags.length !== 0">
|
|
|
+ <el-tag v-for="(item, index) in questionVO.tags" effect="dark">
|
|
|
{{ item }}
|
|
|
</el-tag>
|
|
|
</span>
|
|
|
@@ -106,11 +95,11 @@
|
|
|
<div class="analysis-block">
|
|
|
<!--单选、多选、判断、简单-->
|
|
|
<slot name="answer1"
|
|
|
- v-if="questionvo.type === 'choice' ||
|
|
|
- questionvo.type === 'multiple_choice' ||
|
|
|
- questionvo.type === 'true_false' ||
|
|
|
- questionvo.type === 'short_answer'">
|
|
|
- <MarkdownText :raw="'<strong>正确答案: </strong>'+questionvo.answer"></MarkdownText>
|
|
|
+ v-if="questionVO.type === 'choice' ||
|
|
|
+ questionVO.type === 'multiple_choice' ||
|
|
|
+ questionVO.type === 'true_false' ||
|
|
|
+ questionVO.type === 'short_answer'">
|
|
|
+ <MarkdownText :raw="'<strong>正确答案: </strong>'+questionVO.answer"></MarkdownText>
|
|
|
</slot>
|
|
|
<!--todo: 简答-->
|
|
|
</div>
|
|
|
@@ -118,31 +107,29 @@
|
|
|
<div class="analysis-block">
|
|
|
<!--单选、多选、判断-->
|
|
|
<slot name="analysis1"
|
|
|
- v-if="questionvo.type === 'choice' ||
|
|
|
- questionvo.type === 'multiple_choice' ||
|
|
|
- questionvo.type === 'true_false'">
|
|
|
- <MarkdownText :raw="'<strong>解析: </strong>'+questionvo.analysis"></MarkdownText>
|
|
|
+ v-if="questionVO.type === 'choice' ||
|
|
|
+ questionVO.type === 'multiple_choice' ||
|
|
|
+ questionVO.type === 'true_false'">
|
|
|
+ <MarkdownText :raw="'<strong>解析: </strong>'+questionVO.analysis"></MarkdownText>
|
|
|
</slot>
|
|
|
<!--填空-->
|
|
|
- <div v-if="questionvo.type === 'blank' && questionvo.analysis.length > 5">
|
|
|
- <MarkdownText :raw="'<strong>解析: </strong>'+questionvo.analysis"></MarkdownText>
|
|
|
+ <div v-if="questionVO.type === 'blank' && questionVO.analysis.length > 5">
|
|
|
+ <MarkdownText :raw="'<strong>解析: </strong>'+questionVO.analysis"></MarkdownText>
|
|
|
</div>
|
|
|
<!--简答-->
|
|
|
- <div v-if="questionvo.type === 'short_answer' && questionvo.analysis.length > 5">
|
|
|
- <MarkdownText :raw="'<strong>解析: </strong>'+questionvo.analysis"></MarkdownText>
|
|
|
+ <div v-if="questionVO.type === 'short_answer' && questionVO.analysis.length > 5">
|
|
|
+ <MarkdownText :raw="'<strong>解析: </strong>'+questionVO.analysis"></MarkdownText>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <el-divider v-show="isAll"></el-divider>
|
|
|
-
|
|
|
+ <el-divider v-show="isAllShow"></el-divider>
|
|
|
<!--题目操作记录部分-->
|
|
|
- <div class="primary-question-card-record" v-show="isAll">
|
|
|
+ <div class="primary-question-card-record" v-show="isAllShow">
|
|
|
<!--题目当前状态-->
|
|
|
<div class="record-block">
|
|
|
<el-row>
|
|
|
<el-col :span="3">
|
|
|
- <div><strong>状态: </strong>{{ questionvo.state }}</div>
|
|
|
+ <div><strong>状态: </strong>{{ questionVO.state }}</div>
|
|
|
</el-col>
|
|
|
<el-col :span="5">
|
|
|
<div><strong>审核人: </strong>{{ checkedUserName }}</div>
|
|
|
@@ -174,7 +161,7 @@
|
|
|
ref="drawer"
|
|
|
size="35%"
|
|
|
>
|
|
|
- <QuestionUpdater :question="questionvo" @closeDialog="closeDialog"/>
|
|
|
+ <QuestionUpdater :question="questionVO" @closeDialog="closeDialog"/>
|
|
|
</el-drawer>
|
|
|
|
|
|
</template>
|
|
|
@@ -185,8 +172,9 @@ import {map} from "@/utils/knowledgeMapper";
|
|
|
import {toMyDate} from "@/utils/dateConvertor";
|
|
|
import QuestionUpdater from "@/components/QuestionUpdater";
|
|
|
import store from "@/store";
|
|
|
-
|
|
|
-import ChoiceOption from "@/components/QuestionCard/AnswerOption/ChoiceOption";
|
|
|
+import ChoiceOption from "@/components/QuestionCard/AnswerDisplay/ChoiceDisplay/index";
|
|
|
+import {ElDivider} from "element-plus";
|
|
|
+import {h, resolveComponent} from "vue";
|
|
|
|
|
|
export default {
|
|
|
name: "PrimaryQuestionCard",
|
|
|
@@ -197,32 +185,34 @@ export default {
|
|
|
ChoiceOption,
|
|
|
},
|
|
|
props: {
|
|
|
- questionvo: Object,
|
|
|
+ questionVO: Object,
|
|
|
curNum: Number,
|
|
|
totalNum: Number,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- isAll: false,
|
|
|
+ isAllShow: false,
|
|
|
isAllRecord: false,
|
|
|
isDelete: false,
|
|
|
dialog: false,
|
|
|
checkedUserName: '',
|
|
|
recordList: [],
|
|
|
recordNameDict: {},
|
|
|
+
|
|
|
+ spacer: h(ElDivider, {direction: 'vertical'})
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
toMyDate,
|
|
|
map,
|
|
|
expand() {
|
|
|
- if (!this.isAll) {
|
|
|
- this.isAll = true;
|
|
|
+ if (!this.isAllShow) {
|
|
|
+ this.isAllShow = true;
|
|
|
}
|
|
|
},
|
|
|
withdraw() {
|
|
|
- if (this.isAll) {
|
|
|
- this.isAll = false;
|
|
|
+ if (this.isAllShow) {
|
|
|
+ this.isAllShow = false;
|
|
|
}
|
|
|
},
|
|
|
updateQuestion() {
|
|
|
@@ -246,13 +236,13 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.questionvo.lastModifiedTime = new Date();
|
|
|
- this.questionvo.state = "DELETED";
|
|
|
+ this.questionVO.lastModifiedTime = new Date();
|
|
|
+ this.questionVO.state = "DELETED";
|
|
|
let record = {
|
|
|
userId: store.state.user.id,
|
|
|
operationType: "Delete",
|
|
|
}
|
|
|
- this.$api.updateQuestion(this.questionvo)
|
|
|
+ this.$api.updateQuestion(this.questionVO)
|
|
|
.then(res => {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
@@ -303,11 +293,15 @@ export default {
|
|
|
recordTable1.push(recordDict);
|
|
|
}
|
|
|
return recordTable1;
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ isAllShowText() {
|
|
|
+ return this.isAllShow ? "收起" : "展开";
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
- if (this.questionvo.checkedUserId) {
|
|
|
- this.$api.getUserById(this.questionvo.checkedUserId) // 异步函数1:根据用户ID获得用户名称
|
|
|
+ if (this.questionVO.checkedUserId) {
|
|
|
+ this.$api.getUserById(this.questionVO.checkedUserId) // 异步函数1:根据用户ID获得用户名称
|
|
|
.then(res => {
|
|
|
if (res.data.result.name) {
|
|
|
this.checkedUserName = res.data.result.name;
|
|
|
@@ -317,7 +311,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- this.$api.getRecordByQid(this.questionvo.id) // 异步函数2:根据题目id获得ope_record
|
|
|
+ this.$api.getRecordByQid(this.questionVO.id) // 异步函数2:根据题目id获得ope_record
|
|
|
.then(res1 => {
|
|
|
let tempList = res1.data.result.content;
|
|
|
this.recordList = tempList;
|