QuestionItem.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="question_preview">
  3. <div class="question_header">
  4. <div class="header_title">
  5. <div class="header_index">
  6. {{ index}}
  7. </div>
  8. <span class="header_type">
  9. {{question.questionType}}
  10. </span>
  11. <span class="header_difficulty" :style="{color:GetDiffcutyColor(question.questionLevel || question.diffName)}">
  12. {{question.questionLevel || question.diffName}}
  13. </span>
  14. <div class="header_exam_name">
  15. 来源:{{question.fromPaper || question.source || question.sourceName}}
  16. </div>
  17. </div>
  18. <slot name="header_right">
  19. </slot>
  20. </div>
  21. <div class="question_content" v-html="question.title">
  22. </div>
  23. <!-- 小题 -->
  24. <div class="question_content" v-for="subQues in (question?.subQuestions || [])" :key="subQues.questionId" v-html="subQues.title"></div>
  25. </div>
  26. </template>
  27. <script>
  28. // 题目预览公共组件
  29. import { mapGetters } from "vuex";
  30. export default {
  31. components: {
  32. },
  33. props: {
  34. question: {
  35. type: Object,
  36. default: () => {
  37. return {};
  38. },
  39. },
  40. index: {
  41. type: Number,
  42. default: 1,
  43. },
  44. },
  45. computed: {
  46. },
  47. data() {
  48. return {
  49. questionContent:"<div class=\"qml-stem\" data-copyright=\"xkw.com-1778721752-107161725521013800-LOqLkjMPMHlPSNdJ2YSObDfSIpJYVbaMq2PwNexeT3jLb8OIq6bBG4DxeSUqDFM9\"><p style=\"text-align: left;\"><span style=\"font-family: 宋体;\">赏析有误的一项是(<span style=\"font-family: 'Times New Roman'\" qml-space-size=\"3\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>)</span></p><p style=\"text-align: center;\"><span style=\"font-family: 楷体;\">十一月四日风雨大作(其二)</span></p><p style=\"text-align: center;\"><span style=\"font-family: 楷体;\">陆游</span></p><p style=\"text-align: center;\"><span style=\"font-family: 楷体;\">僵卧孤村不自哀,尚思为国戍轮台。</span></p><p style=\"text-align: center;\"><span style=\"font-family: 楷体;\">夜阑卧听风吹雨,铁马冰河入梦来。</span></p><div class=\" qml-og\"><table class=\"qml-og\" style=\"width:100%\"><tr><td>A.&nbsp;<span class=\"qml-op\"><span style=\"font-family: 宋体;\">全诗由述志和记梦两部分组成,两者之间是因果关系。</span></span></td></tr><tr><td>B.&nbsp;<span class=\"qml-op\"><span style=\"font-family: 宋体;\">诗中“尚”字表现了诗人强烈而至死不渝的爱国之情,报国之志。</span></span></td></tr><tr><td>C.&nbsp;<span class=\"qml-op\"><span style=\"font-family: 宋体;\">诗的后两句都是写梦境,与前两句写实相映衬。</span></span></td></tr><tr><td colspan=\"1\">D.&nbsp;<span class=\"qml-op\"><span style=\"font-family: 宋体;\">全诗气势豪壮,感情真挚,具有强烈的感染力。</span></span></td></tr></table></div></div>",//总菜单
  50. };
  51. },
  52. watch: {
  53. userInfo: {
  54. handler(newValue, oldValue) {
  55. console.log(newValue, oldValue);
  56. },
  57. deep: true, // 监听对象的深层变化
  58. },
  59. },
  60. created() {
  61. },
  62. mounted() {
  63. },
  64. methods: {
  65. // 获取题目难度颜色
  66. GetDiffcutyColor(value)
  67. {
  68. console.log("打印难易度",value);
  69. return this.$global.getDiffcutyColor(value);
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="scss" scoped>
  75. .question_preview
  76. {
  77. width: 100%;
  78. height: auto;
  79. // background: #FFFFFF;
  80. // border-radius: 10px 10px 10px 10px;
  81. // border: 1px solid #DCDFE6;
  82. // padding: 16px;
  83. // box-sizing: border-box;
  84. .question_header
  85. {
  86. width: 100%;
  87. height: 25px;
  88. background: #fff;
  89. display: flex;
  90. justify-content:space-between;
  91. align-items: center;
  92. gap: 16px;
  93. margin-bottom: 16px;
  94. .header_title
  95. {
  96. display: flex;
  97. justify-content:flex-start;
  98. align-items: center;
  99. gap: 16px;
  100. }
  101. .header_index
  102. {
  103. width: 20px;
  104. height: 20px;
  105. line-height: 18px;
  106. background: #F3F3F3;
  107. border-radius: 2px 2px 2px 2px;
  108. font-weight: 500;
  109. font-size: 14px;
  110. color: #333333;
  111. text-align: center;
  112. }
  113. .header_type
  114. {
  115. font-weight: 600;
  116. font-size: 14px;
  117. color: #333333;
  118. }
  119. .header_difficulty
  120. {
  121. font-weight: 400;
  122. font-size: 14px;
  123. color: #90CB75;
  124. }
  125. .header_exam_name
  126. {
  127. font-weight: 400;
  128. font-size: 14px;
  129. color: #999999;
  130. }
  131. }
  132. .question_content
  133. {
  134. width: 100%;
  135. height: auto;
  136. background: #fff;
  137. line-height: 30px;
  138. overflow-y: auto;
  139. }
  140. }
  141. </style>