|
|
@@ -4,18 +4,17 @@
|
|
|
<!-- <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>
|
|
|
+ <span style="margin-left: 20px"><strong>题目类型: </strong>{{ questionVO.type }}</span>
|
|
|
+ <span style="margin-left: 20px"><strong>知识点: </strong></span>
|
|
|
<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">
|
|
|
+ v-if="questionVO.knowledgeId && questionVO.knowledgeId.length !== 0"
|
|
|
+ v-for="item in questionVO.knowledgeId"
|
|
|
+ effect="dark"
|
|
|
+ placement="bottom">
|
|
|
<template #content>
|
|
|
{{ map(item) }}
|
|
|
</template>
|
|
|
@@ -24,13 +23,14 @@
|
|
|
<span v-else>null</span>
|
|
|
</slot>
|
|
|
</div>
|
|
|
+ <el-button type="text" circle @click="isAllShow=!isAllShow"><strong>{{ isAllShowText }}</strong></el-button>
|
|
|
+ <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>
|
|
|
- <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>
|
|
|
<!--题目内容部分-->
|
|
|
@@ -67,32 +67,32 @@
|
|
|
<div class="analysis-block">
|
|
|
<el-row>
|
|
|
<slot name="keypoint">
|
|
|
- <el-col :span="10">
|
|
|
- <strong>KeyPoints: </strong>{{ questionVO.keyPoints }}
|
|
|
+ <el-col :span="6" style="text-align: left">
|
|
|
+ <strong>关键词: </strong>{{ questionVO.keyPoints ? questionVO.keyPoints : '无' }}
|
|
|
</el-col>
|
|
|
</slot>
|
|
|
<slot name="difficulty">
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="6" style="text-align: left">
|
|
|
<strong>题目难度: </strong>{{ questionVO.weight }}/5
|
|
|
</el-col>
|
|
|
</slot>
|
|
|
<slot name="tag">
|
|
|
- <el-col :span="4">
|
|
|
- <span><strong>Tags: </strong></span>
|
|
|
+ <el-col :span="12" style="text-align: left">
|
|
|
+ <span><strong>标签: </strong></span>
|
|
|
<span v-if="questionVO.tags && questionVO.tags.length !== 0">
|
|
|
- <el-tag v-for="(item, index) in questionVO.tags" effect="dark">
|
|
|
- {{ item }}
|
|
|
- </el-tag>
|
|
|
- </span>
|
|
|
+ <el-tag v-for="(item, index) in questionVO.tags" effect="dark">
|
|
|
+ {{ item }}
|
|
|
+ </el-tag>
|
|
|
+ </span>
|
|
|
<span v-else>
|
|
|
- <span>no tags</span>
|
|
|
+ <span><el-tag effect="dark">无</el-tag></span>
|
|
|
</span>
|
|
|
</el-col>
|
|
|
</slot>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<!--题目解析-正确答案-->
|
|
|
- <div class="analysis-block">
|
|
|
+ <div class="analysis-block" style="text-align: left">
|
|
|
<!--单选、多选、判断、简单-->
|
|
|
<slot name="answer1"
|
|
|
v-if="questionVO.type === 'choice' ||
|
|
|
@@ -104,7 +104,7 @@
|
|
|
<!--todo: 简答-->
|
|
|
</div>
|
|
|
<!--题目解析-解析部分-->
|
|
|
- <div class="analysis-block">
|
|
|
+ <div class="analysis-block" style="text-align: left">
|
|
|
<!--单选、多选、判断-->
|
|
|
<slot name="analysis1"
|
|
|
v-if="questionVO.type === 'choice' ||
|
|
|
@@ -152,17 +152,17 @@
|
|
|
</div>
|
|
|
</el-card>
|
|
|
|
|
|
-<!-- <el-drawer-->
|
|
|
-<!-- title="更新题目"-->
|
|
|
-<!-- :before-close="handleClose"-->
|
|
|
-<!-- v-model="dialog"-->
|
|
|
-<!-- direction="rtl"-->
|
|
|
-<!-- custom-class="question-drawer"-->
|
|
|
-<!-- ref="drawer"-->
|
|
|
-<!-- size="35%"-->
|
|
|
-<!-- >-->
|
|
|
-<!-- <QuestionUpdater :question="questionVO" @closeDialog="closeDialog"/>-->
|
|
|
-<!-- </el-drawer>-->
|
|
|
+ <!-- <el-drawer-->
|
|
|
+ <!-- title="更新题目"-->
|
|
|
+ <!-- :before-close="handleClose"-->
|
|
|
+ <!-- v-model="dialog"-->
|
|
|
+ <!-- direction="rtl"-->
|
|
|
+ <!-- custom-class="question-drawer"-->
|
|
|
+ <!-- ref="drawer"-->
|
|
|
+ <!-- size="35%"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- <QuestionUpdater :question="questionVO" @closeDialog="closeDialog"/>-->
|
|
|
+ <!-- </el-drawer>-->
|
|
|
|
|
|
</template>
|
|
|
|
|
|
@@ -243,21 +243,21 @@ export default {
|
|
|
operationType: "Delete",
|
|
|
}
|
|
|
this.$api.updateQuestion(this.questionVO)
|
|
|
- .then(res => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- this.isDelete = true;
|
|
|
- record.questionId = res.data.result.id;
|
|
|
- record.time = new Date();
|
|
|
- this.$api.createRecord(record)
|
|
|
- .then(res1 => {
|
|
|
- console.log(res1);
|
|
|
- }).catch(err1 => {
|
|
|
- console.log(err1);
|
|
|
- })
|
|
|
- }).catch(error => {
|
|
|
+ .then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ this.isDelete = true;
|
|
|
+ record.questionId = res.data.result.id;
|
|
|
+ record.time = new Date();
|
|
|
+ this.$api.createRecord(record)
|
|
|
+ .then(res1 => {
|
|
|
+ console.log(res1);
|
|
|
+ }).catch(err1 => {
|
|
|
+ console.log(err1);
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
console.log(error);
|
|
|
this.$notify.error({
|
|
|
title: '错误',
|
|
|
@@ -302,32 +302,32 @@ export default {
|
|
|
mounted() {
|
|
|
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;
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.result.name) {
|
|
|
+ this.checkedUserName = res.data.result.name;
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
console.log(err);
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.$api.getRecordByQid(this.questionVO.id) // 异步函数2:根据题目id获得ope_record
|
|
|
- .then(res1 => {
|
|
|
- let tempList = res1.data.result.content;
|
|
|
- this.recordList = tempList;
|
|
|
- for (let record of tempList) { //这里换成this.recordList是没问题的
|
|
|
- if (!this.recordNameDict[record.userId]) {
|
|
|
- this.$api.getUserById(record.userId) //异步函数3:根据记录中的用户ID获得其name
|
|
|
- .then(res2 => {
|
|
|
- if (res2.data.result.name) {
|
|
|
- this.recordNameDict[record.userId] = res2.data.result.name;
|
|
|
- }
|
|
|
- }).catch(err2 => {
|
|
|
- console.log(err2);
|
|
|
- })
|
|
|
+ .then(res1 => {
|
|
|
+ let tempList = res1.data.result.content;
|
|
|
+ this.recordList = tempList;
|
|
|
+ for (let record of tempList) { //这里换成this.recordList是没问题的
|
|
|
+ if (!this.recordNameDict[record.userId]) {
|
|
|
+ this.$api.getUserById(record.userId) //异步函数3:根据记录中的用户ID获得其name
|
|
|
+ .then(res2 => {
|
|
|
+ if (res2.data.result.name) {
|
|
|
+ this.recordNameDict[record.userId] = res2.data.result.name;
|
|
|
+ }
|
|
|
+ }).catch(err2 => {
|
|
|
+ console.log(err2);
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }).catch(err1 => {
|
|
|
+ }).catch(err1 => {
|
|
|
console.log(err1);
|
|
|
});
|
|
|
},
|