knowledgePaps.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="knowledgePaps">
  3. <div class="chart_title">
  4. <div class="title_left">
  5. <span class="secondary_title" style="font-weight: bold;">3、</span>
  6. <span class="secondary_title" v-if="titleParts.knowledgeName">{{ titleParts.knowledgeName }} / </span>
  7. <span class="main_title">薄弱知识点精准提升</span>
  8. </div>
  9. <button class="export_btn" @click="$emit('export-knowledge-paps')">
  10. <i class="iconfont icon_export"></i>
  11. 导出精准提升试题
  12. </button>
  13. </div>
  14. <div class="data_container" v-if="knowledgData.length > 0">
  15. <div class="question_item" v-for="(item, index) in knowledgData" :key="index">
  16. <!-- 推题头部 -->
  17. <div class="question_header">
  18. <div class="question_meta">
  19. <span class="question_num">{{ index + 1 }}</span>
  20. <span class="question_type">题型类型:
  21. <i class="typeColor" style="color:#333333;font-weight: bold;">{{ item.questionType }}</i>
  22. </span>
  23. <span class="question_difficulty">难度:
  24. <i class="typeColor" style="color:#fac858;font-weight: bold;">{{ item.questionLevel }}</i>
  25. </span>
  26. </div>
  27. <div class="question_source">来源:
  28. <i class="typeColor" style="color:#999999;">{{ item.fromPaper }}</i>
  29. </div>
  30. </div>
  31. <!-- 推题内容 -->
  32. <div class="question_content">
  33. <p v-html ='item.title || "" '></p>
  34. </div>
  35. <!-- 推题底部 -->
  36. <div class="question_tags">
  37. <span class="tags_label">知识点:</span>
  38. <span class="tag" v-for="(knowledge, index) in (item.knowledge || '').split('、')" :key="index" v-if="knowledge">
  39. {{ knowledge }}
  40. </span>
  41. </div>
  42. </div>
  43. </div>
  44. <div
  45. class="module_chart no_content_data no_data"
  46. element-loading-background="#ffffff" v-else>
  47. <span>暂无数据</span>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. export default {
  53. name: "knowledgePaps",
  54. props: {
  55. // 知识点名称
  56. knowledgeName: {
  57. type: String,
  58. default: ''
  59. },
  60. // 薄弱知识点精准提升数据
  61. knowledgData: {
  62. type: Array,
  63. default: () => []
  64. }
  65. },
  66. computed: {
  67. // 标题部分
  68. titleParts() {
  69. return {
  70. knowledgeName: this.knowledgeName
  71. }
  72. }
  73. },
  74. data() {
  75. return {
  76. }
  77. },
  78. mounted() {
  79. },
  80. watch: {
  81. // knowledgData: {
  82. // handler(newVal, oldVal) {
  83. // console.log(newVal);
  84. // },
  85. // deep: true
  86. // }
  87. },
  88. methods: {
  89. },
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .knowledgePaps {
  94. background: #FFFFFF;
  95. border-radius: 10px;
  96. padding: 20px;
  97. margin-bottom: 10px;
  98. position: relative;
  99. // 标题部分
  100. .chart_title {
  101. font-size: 16px;
  102. margin-bottom: 20px;
  103. display: flex;
  104. justify-content: space-between;
  105. align-items: center;
  106. flex-wrap: wrap;
  107. gap: 10px;
  108. .title_left {
  109. display: flex;
  110. align-items: center;
  111. gap: 5px;
  112. }
  113. .main_title {
  114. font-weight: 600;
  115. color: #333;
  116. }
  117. .secondary_title {
  118. font-weight: normal;
  119. color: #999;
  120. }
  121. .export_btn {
  122. display: flex;
  123. align-items: center;
  124. gap: 5px;
  125. width: 152px;
  126. height: 36px;
  127. line-height: 36px;
  128. background: #2E64FA;
  129. color: white;
  130. border: none;
  131. border-radius: 4px;
  132. font-size: 14px;
  133. cursor: pointer;
  134. padding:0;
  135. transition: all 0.3s ease;
  136. &:hover {
  137. background: #5883fb;
  138. }
  139. &:active {
  140. background: #2E64FA;
  141. }
  142. .iconfont {
  143. width: 14px;
  144. margin-left: 10px;
  145. }
  146. }
  147. }
  148. // 内容部分
  149. .question_item {
  150. background: #FFFFFF;
  151. border-radius: 10px 10px 10px 10px;
  152. border: 1px solid #DCDFE6;
  153. padding: 20px;
  154. margin-bottom: 10px;
  155. transition: all 0.3s ease;
  156. &:hover {
  157. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  158. }
  159. // 试题标题
  160. .question_header {
  161. display: flex;
  162. justify-content: space-between;
  163. align-items: center;
  164. padding-bottom: 20px;
  165. flex-wrap: wrap;
  166. gap: 10px;
  167. border-bottom: 1px solid #EBEEF5;
  168. .question_meta {
  169. display: flex;
  170. align-items: center;
  171. gap: 10px;
  172. flex-wrap: wrap;
  173. .question_num {
  174. display: inline-block;
  175. width: 24px;
  176. height: 24px;
  177. line-height: 24px;
  178. background: #2E64FA;
  179. color: white;
  180. border-radius: 4px;
  181. text-align: center;
  182. font-size: 14px;
  183. }
  184. .question_type,
  185. .question_difficulty {
  186. font-size: 14px;
  187. color: #999999;
  188. }
  189. }
  190. .question_source {
  191. font-size: 14px;
  192. color: #999;
  193. }
  194. }
  195. // 试题内容
  196. .question_content {
  197. padding: 20px 0;
  198. border-bottom: 1px solid #EBEEF5;
  199. p {
  200. font-size: 16px;
  201. color: #333333;
  202. margin-bottom: 10px;
  203. line-height: 2;
  204. }
  205. }
  206. // 试题底部
  207. .question_tags {
  208. display: flex;
  209. align-items: center;
  210. gap: 10px;
  211. flex-wrap: wrap;
  212. margin-top: 20px;
  213. .tags_label {
  214. font-size: 14px;
  215. color: #666;
  216. }
  217. .tag {
  218. display: inline-block;
  219. padding: 4px 10px;
  220. background: rgba(59,162,114,0.1);
  221. border-radius: 4px 4px 4px 4px;
  222. border: 1px solid #3BA272;
  223. color: #3BA272;
  224. }
  225. }
  226. }
  227. .question_item:last-child {
  228. margin-bottom: 0;
  229. }
  230. // 暂无数据
  231. .no_data{
  232. display: flex;
  233. justify-content: center;
  234. align-items: center;
  235. width: 100%;
  236. height: 220px;
  237. font-size: 14px;
  238. span{
  239. margin-top: 11%;
  240. }
  241. }
  242. }
  243. </style>