|
@@ -1,105 +1,220 @@
|
|
|
-<template>
|
|
|
|
|
- <el-card class="box-card" shadow="hover">
|
|
|
|
|
|
|
+<template xmlns:el-col="http://www.w3.org/1999/html">
|
|
|
|
|
+ <el-card class="bQuestion-card" shadow="hover">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <div class="card-header">
|
|
|
|
|
- <span>tag</span>
|
|
|
|
|
- <ul v-for="(item, index) in questionVO.tags">
|
|
|
|
|
- <li>{{item}}</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <el-button class="button" type="text" @click="clickBriefQuestionCard">查看详情</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="2">
|
|
|
|
|
+ <span>{{curNum+1}} / {{totalNum}}</span>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <span>题目类型:{{questionvo.type}}</span>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <span>KeyPoints:{{questionvo.keyPoints}}</span>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="8"/>
|
|
|
|
|
+ <el-col :span="2">
|
|
|
|
|
+ <el-button type="text" circle @click="expand" v-if="!isAll">查看全部</el-button>
|
|
|
|
|
+ <el-button type="text" circle @click="withdraw" v-if="isAll">收起</el-button>
|
|
|
|
|
+
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1">
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"></el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1">
|
|
|
|
|
+ <el-button type="danger" icon="el-icon-delete" circle @click="deleteQuestion"></el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</template>
|
|
</template>
|
|
|
- <div class="text item">
|
|
|
|
|
- <h3 v-if="questionVO.type1 === 0">题型:选择题</h3>
|
|
|
|
|
- <h3 v-else>题型:其它类型</h3>
|
|
|
|
|
- <h4>{{questionVO.stem}}</h4>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-body">
|
|
|
|
|
+ <div class="bQuestion-card-body-stem">
|
|
|
|
|
+ <div>题目: {{questionvo.stem}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-body-options">
|
|
|
|
|
+ <div v-for="(item,index) in questionvo.options">
|
|
|
|
|
+ <div>{{index}}: {{item}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <el-divider v-if="isAll"></el-divider>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-body-tag" v-if="isAll">
|
|
|
|
|
+ <span v-if="questionvo.tags && questionvo.tags.length !== 0">
|
|
|
|
|
+ <span>Tags: </span>
|
|
|
|
|
+ <el-tag v-for="(item, index) in questionvo.tags" effect="dark">{{item}}</el-tag>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else>
|
|
|
|
|
+ <span>no tags</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-body-knowledgeID" v-if="isAll">
|
|
|
|
|
+ <span>KnowledgeId:</span>
|
|
|
|
|
+ <span v-if="questionvo.knowledgeId.length !== 0">{{questionvo.knowledgeId[0]}}</span>
|
|
|
|
|
+ <span v-else>no knowledgeId</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-body-answer" v-if="isAll">
|
|
|
|
|
+ <div>正确答案: {{questionvo.answer}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-body-analysis" v-if="isAll">
|
|
|
|
|
+ <div>解析: {{questionvo.analysis}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <el-divider v-if="isAll"></el-divider>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="bQuestion-card-foot" v-if="isAll">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="3">
|
|
|
|
|
+ <div>State: 已审核</div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="3">
|
|
|
|
|
+ <div>审核人: 小苏</div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="12"></el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="6" v-if="!questionvo.lastModifiedTime">
|
|
|
|
|
+ <div>CreateTime: {{questionvo.createdTime}}</div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="6" v-else>
|
|
|
|
|
+ <div>lastModifiedTime: {{questionvo.lastModifiedTime}}</div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
+<!-- <el-drawer-->
|
|
|
|
|
+<!-- title="更新题目"-->
|
|
|
|
|
+<!-- :before-close="handleClose"-->
|
|
|
|
|
+<!-- v-model="dialog"-->
|
|
|
|
|
+<!-- direction="rtl"-->
|
|
|
|
|
+<!-- custom-class="question-drawer"-->
|
|
|
|
|
+<!-- ref="drawer"-->
|
|
|
|
|
+<!-- size="35%"-->
|
|
|
|
|
+<!-- >-->
|
|
|
|
|
+<!-- <QuestionCreater :dialog="dialog" @closeDialog="closeDialog"/>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- </el-drawer>-->
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import axios from "axios";
|
|
|
|
|
+ import QuestionCreater from "./QuestionCreater";
|
|
|
export default {
|
|
export default {
|
|
|
name: "BriefQuestionCard",
|
|
name: "BriefQuestionCard",
|
|
|
|
|
+ components:{
|
|
|
|
|
+ // QuestionCreater
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
- questionVO: {
|
|
|
|
|
- id:{
|
|
|
|
|
- type: String,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: "00001"
|
|
|
|
|
- },
|
|
|
|
|
- type1:{
|
|
|
|
|
- type: Number,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: 0
|
|
|
|
|
- },
|
|
|
|
|
- stem:{
|
|
|
|
|
- type: String,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: ""
|
|
|
|
|
- },
|
|
|
|
|
- options:{
|
|
|
|
|
- type: Map,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: {}
|
|
|
|
|
- },
|
|
|
|
|
- answer:{
|
|
|
|
|
- type: String,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: "A"
|
|
|
|
|
- },
|
|
|
|
|
- keyPoints:{
|
|
|
|
|
- type: String,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: ""
|
|
|
|
|
- },
|
|
|
|
|
- analysis:{
|
|
|
|
|
- type: String,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: ""
|
|
|
|
|
- },
|
|
|
|
|
- tags: {
|
|
|
|
|
- type: Array,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: []
|
|
|
|
|
- },
|
|
|
|
|
- knowledgeId: {
|
|
|
|
|
- type: Array,
|
|
|
|
|
- require: true,
|
|
|
|
|
- default: []
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ questionvo: {
|
|
|
|
|
+ id: String,
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ stem: String,
|
|
|
|
|
+ options: Map,
|
|
|
|
|
+ answer: String,
|
|
|
|
|
+ keyPoints: String,
|
|
|
|
|
+ analysis: String,
|
|
|
|
|
+ tags: Array,
|
|
|
|
|
+ knowledgeId: Array,
|
|
|
|
|
+ weight: Number,
|
|
|
|
|
+ createdTime: Date,
|
|
|
|
|
+ lastModifiedTime: Date
|
|
|
|
|
+ },
|
|
|
|
|
+ totalNum: Number,
|
|
|
|
|
+ curNum: Number,
|
|
|
},
|
|
},
|
|
|
data(){
|
|
data(){
|
|
|
return{
|
|
return{
|
|
|
|
|
+ isAll: false,
|
|
|
|
|
+ dialog: false,
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- clickBriefQuestionCard(){
|
|
|
|
|
- this.$router.push({path:"/question/"+this.questionVO.id})
|
|
|
|
|
|
|
+ updateQuestion(){
|
|
|
|
|
+ // alert("update!")
|
|
|
|
|
+ this.dialog = true;
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ deleteQuestion(){
|
|
|
|
|
+ this.$confirm('此操作将永久删除该题目, 是否继续?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ axios.delete("/api/api/question/"+this.questionvo.id).then(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '删除成功!'
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch( error => {
|
|
|
|
|
+ console.log(error);
|
|
|
|
|
+ this.$notify.error({
|
|
|
|
|
+ title: '错误',
|
|
|
|
|
+ message: '删除失败'
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '已取消删除'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ // this.$emit("reclaimQuestionList");
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ expand(){
|
|
|
|
|
+ if(!this.isAll){
|
|
|
|
|
+ this.isAll = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ withdraw(){
|
|
|
|
|
+ if(this.isAll){
|
|
|
|
|
+ this.isAll = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleClose(){
|
|
|
|
|
+ this.dialog = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ closeDialog(){
|
|
|
|
|
+ this.dialog = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
- .card-header {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
|
|
+ .bQuestion-card{
|
|
|
|
|
+ margin: 20px;
|
|
|
|
|
+ font-family: "Times New Roman";
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ background-color: #fffaf4;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .text {
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
|
|
+ .bQuestion-card-body{
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ font-family: "Songti SC";
|
|
|
|
|
+ align-items: start;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .item {
|
|
|
|
|
- margin-bottom: 5px;
|
|
|
|
|
|
|
+ .bQuestion-card-body-options{
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ font-size: 18px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.box-card {
|
|
.box-card {
|
|
|
/*width: 480px;*/
|
|
/*width: 480px;*/
|
|
|
- margin: 20px auto;
|
|
|
|
|
|
|
+ margin: 20px;
|
|
|
|
|
+ background-color: #8ac6d1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|