mx-question-board-parse.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="pl30 pr30 pt20 pb20">
  3. <el-row :gutter="40">
  4. <el-col :span="12">
  5. <span v-if="!useBoardImageStyle">答:{{ question.answer }}</span>
  6. <image-upload v-else :value="question.attachments" disabled></image-upload>
  7. </el-col>
  8. <el-col :span="12">
  9. <div v-if="useBoardParseStyle" class="fx-column answer">
  10. <div v-html="'正确答案:'+sysAnswer"></div>
  11. <div class="mt30" v-html="question.parse"></div>
  12. </div>
  13. <div v-if="useBoardScoreStyle" class="fx-column fx-sta-cen">
  14. <span>此题总分{{ question['scoreTotal'] }}分</span>
  15. <el-input-number ref="scoreInput" v-model="question._score" :min="0" :max="question['scoreTotal']"
  16. controls-position="right" class="mt20" style="width: 125px"
  17. placeholder="输入得分"></el-input-number>
  18. <el-button type="success" round @click="handleLocalScore" class="mt30"
  19. style="width: 100px">提交
  20. </el-button>
  21. </div>
  22. </el-col>
  23. </el-row>
  24. </div>
  25. </template>
  26. <script>
  27. import questionMixin from './mx-question-mixin'
  28. export default {
  29. mixins: [questionMixin],
  30. name: 'mx-question-board-parse',
  31. data() {
  32. return {
  33. localScore: 0,
  34. useMathJax: true
  35. }
  36. },
  37. watch: {
  38. useBoardParseStyle() {
  39. //console.log('watch user board parse style changed - call math jax format', this)
  40. this.$nextTick(_ => this.mxGlobal.MathQueue())
  41. },
  42. 'question.questionId'() {
  43. this.$nextTick(_ => this.$refs.scoreInput?.focus())
  44. },
  45. useBoardScoreStyle() {
  46. this.$nextTick(_ => this.$refs.scoreInput?.focus())
  47. }
  48. },
  49. methods: {
  50. handleLocalScore() {
  51. console.log('parse area key up - enter')
  52. this.question._score = this.question._score || 0
  53. this.eventScoreQuestion(this.options)
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. /*/deep/.score .el-input__inner {*/
  60. /* text-align: center;*/
  61. /*}*/
  62. </style>