question-preview.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div class="app-container">
  3. <mx-question-content v-if="question" :options="questionOptions"></mx-question-content>
  4. <div v-else-if="questionId">
  5. loading question id: {{ questionId }}
  6. </div>
  7. <div v-else>请输入questionId</div>
  8. </div>
  9. </template>
  10. <script>
  11. import { getNextQuestionForImageGenerate } from '@/api/webApi/webQue'
  12. import MxQuestionContent from '@/components/MxPaper/mx-question-content'
  13. export default {
  14. name: 'QuestionPreview',
  15. components: { MxQuestionContent },
  16. data() {
  17. return {
  18. question: null
  19. }
  20. },
  21. computed: {
  22. questionId() {
  23. return this.$route.query.id || this.$route.query.questionId || 0
  24. },
  25. questionOptions() {
  26. return {
  27. question: this.question,
  28. allowAnswer: false,
  29. allowScore: false,
  30. examineeType: '',
  31. paperOptions: null
  32. }
  33. }
  34. },
  35. mounted() {
  36. this.loadQuestion()
  37. },
  38. methods: {
  39. loadQuestion() {
  40. if (this.questionId) {
  41. getNextQuestionForImageGenerate(this.$route.query)
  42. .then(res => this.question = res.data)
  43. }
  44. }
  45. }
  46. }
  47. </script>
  48. <style scoped>
  49. </style>