PreviewOperation.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="operation">
  3. <div v-show="permissionControl.can_answer" class="button retry" @click="retry()"></div>
  4. <div v-show="permissionControl.can_correct || permissionControl.can_check_correct" class="button correct"></div>
  5. <div
  6. v-show="permissionControl.can_judge_correct || permissionControl.can_show_answer"
  7. class="button answer"
  8. @click="showAnswerAnalysis()"
  9. ></div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'PreviewOperation',
  15. inject: ['getPermissionControl'],
  16. data() {
  17. return {};
  18. },
  19. computed: {
  20. permissionControl() {
  21. return this.getPermissionControl();
  22. },
  23. },
  24. methods: {
  25. showAnswerAnalysis() {
  26. this.$emit('showAnswerAnalysis');
  27. },
  28. // 重做
  29. retry() {
  30. this.$emit('retry');
  31. },
  32. },
  33. };
  34. </script>
  35. <style lang="scss" scoped>
  36. .operation {
  37. display: flex;
  38. justify-content: flex-end;
  39. margin-top: 8px;
  40. .button {
  41. width: 90px;
  42. height: 40px;
  43. cursor: pointer;
  44. border-radius: 5px;
  45. & + .button {
  46. margin-left: 24px;
  47. }
  48. &.retry {
  49. background: url('@/assets/component/component-retry.png') no-repeat center;
  50. }
  51. &.correct {
  52. background: url('@/assets/component/component-correct.png') no-repeat center;
  53. }
  54. &.answer {
  55. background: url('@/assets/component/component-answer.png') no-repeat center;
  56. }
  57. }
  58. }
  59. </style>