wrong-book-item.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="bg-white mx-card">
  3. <view class="p-30">
  4. <mx-question-content v-model="question.answer" :question="question" :sys-answer="question.answer1"
  5. disabled readonly/>
  6. <mx-question-parse :question="question" class="mt-40"/>
  7. </view>
  8. <uv-line/>
  9. <view class="grid grid-cols-3 py-20">
  10. <mx-question-collect :question="question" class="!items-start"/>
  11. <mx-question-correct :question="question" class="!items-center"/>
  12. <mx-tag-button type="error" icon="trash" text="删除" class="!items-end" @click="handleDelete"/>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. import {createPropDefine} from "@/utils";
  18. import MxQuestionParse from "@/components/mx-question/components/mx-question-parse.vue";
  19. import MxQuestionCollect from "@/components/mx-question/components/mx-question-collect.vue";
  20. import MxQuestionCorrect from "@/components/mx-question/components/mx-question-correct.vue";
  21. import {confirmAsync} from "@/utils/uni-helper";
  22. import {deleteWrongQuestion} from "@/api/webApi/webQue";
  23. const props = defineProps({
  24. question: createPropDefine({}, Object)
  25. })
  26. const emits = defineEmits(['delete'])
  27. const handleDelete = async () => {
  28. await confirmAsync('确认从错题本删除该题?')
  29. await deleteWrongQuestion({questionId: props.question.questionId})
  30. emits('delete', props.question.questionId)
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. </style>