78156aa6
yangzhi
级联菜单
|
1
2
3
4
|
<template>
<div class="container">
<h3>{{ info.TestPaperName }}</h3>
<div class="header-opts">
|
e1cd1e22
yangzhi
史总在拉屎 王哥在摸鱼
|
5
6
7
8
9
10
11
12
|
<el-dropdown @command="handleCommand" v-if="videos && videos.length">
<span class="el-dropdown-link">
查看回放<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="item in videos" :key="item.id" :command="item.video_url">{{ item.file_id }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
|
78156aa6
yangzhi
级联菜单
|
13
14
15
16
17
18
19
20
21
|
</div>
<div class="questions">
<el-card class="box-card" v-for="item in list" :key="item.id">
<h4>
<el-tag size="mini" type="success" effect="dark">{{
item.QuestionClassName
}}</el-tag>
【{{ item.subjectName }}】{{ item.subject }}
</h4>
|
b007c7c1
yangzhi
冲突了 志哥解决了 志哥牛批
|
22
|
<div v-if="item.subjectType == 4 || item.subjectType == 3">
|
69c09356
yangzhi
答题详情优化
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<template v-if="item.audio">
<p >{{ item.answer }}</p>
<audio controls>
<source :src="BASE_URL + item.audio" />
</audio>
</template>
<template v-else-if="isAnswerAudio(item.answer)">
<audio controls>
<source :src="BASE_URL + item.answer" />
</audio>
</template>
<template v-else>
<p>{{ item.answer }}</p>
</template>
|
a63af57c
yangzhi
超哥牛批
|
37
38
39
40
41
42
43
|
</div>
<ul class="answer-list" v-if="item.subjectType == 1">
<li
v-for="i in item.subjectContentObj"
:key="i.option"
:class="{ active: item.answer == i.option }"
>
|
78156aa6
yangzhi
级联菜单
|
44
45
46
47
48
49
|
<el-tag size="mini" type="primary" effect="dark">{{
i.option
}}</el-tag>
{{ i.optionContent }}
</li>
</ul>
|
a63af57c
yangzhi
超哥牛批
|
50
51
|
<!-- <p v-if="item.subjectType == 1">Ta的答案:{{ item.answer }}</p> -->
<!-- <p v-if="item.subjectType == 1">正确答案:B</p> -->
|
78156aa6
yangzhi
级联菜单
|
52
53
54
55
56
57
58
59
60
61
62
63
64
|
</el-card>
</div>
</div>
</template>
<style lang="scss" scoped>
.container {
width: 80%;
max-width: 1200px;
min-width: 600px;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
|
a63af57c
yangzhi
超哥牛批
|
65
66
67
68
69
70
71
72
|
.header-opts {
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
}
.box-card {
margin-bottom: 20px;
|
78156aa6
yangzhi
级联菜单
|
73
74
75
76
|
}
.questions {
width: 100%;
}
|
a63af57c
yangzhi
超哥牛批
|
77
78
79
80
81
82
83
84
85
86
87
88
|
.answer-list {
display: flex;
flex-direction: column;
li {
list-style: none;
margin-bottom: 10px;
padding: 10px 10px;
&.active {
border: 2px solid #00c9ff;
border-radius: 10px;
}
}
|
78156aa6
yangzhi
级联菜单
|
89
90
91
92
93
94
95
96
97
98
|
}
}
</style>
<script>
import { SelectQuestionBankListForHistoryId } from "@/api/HistoryAnswer";
export default {
data() {
return {
info: {},
list: [],
|
e1cd1e22
yangzhi
史总在拉屎 王哥在摸鱼
|
99
|
videos:[],
|
78156aa6
yangzhi
级联菜单
|
100
101
102
103
104
105
106
|
};
},
created() {
let id = this.$route.query.id;
this.getDetail(id);
},
methods: {
|
e1cd1e22
yangzhi
史总在拉屎 王哥在摸鱼
|
107
108
109
|
handleCommand(command){
window.open(command, "_blank");
},
|
78156aa6
yangzhi
级联菜单
|
110
111
|
getDetail(id) {
SelectQuestionBankListForHistoryId(id).then((res) => {
|
e1cd1e22
yangzhi
史总在拉屎 王哥在摸鱼
|
112
113
|
let { info, list,videos } = res.data.data;
this.videos = videos;
|
78156aa6
yangzhi
级联菜单
|
114
115
116
117
118
119
120
|
this.info = info;
this.list = list.map((t) => {
t.subjectContentObj = JSON.parse(t.subjectContent);
return t;
});
});
},
|
69c09356
yangzhi
答题详情优化
|
121
122
123
|
isAnswerAudio(answer){
return /[\/a-zA-Z_\d]+\.mp3/.test(answer);
},
|
78156aa6
yangzhi
级联菜单
|
124
125
126
127
128
129
|
getList() {},
},
};
</script>
<style lang="scss" scoped>
</style>
|