PreviewOperation.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div class="operation">
  3. <div v-show="permissionControl.can_answer" class="button retry" @click="retry()"></div>
  4. <div
  5. v-show="permissionControl.can_correct || permissionControl.can_check_correct"
  6. class="button correct"
  7. @click="openAnswerCorrect()"
  8. ></div>
  9. <div v-show="permissionControl.can_show_answer" class="button answer" @click="showAnswerAnalysis()"></div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'PreviewOperation',
  15. inject: ['getPermissionControl', 'openAnswerCorrect'],
  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. height: 40px;
  40. margin-top: 8px;
  41. .button {
  42. width: 90px;
  43. height: 40px;
  44. cursor: pointer;
  45. border-radius: 5px;
  46. & + .button {
  47. margin-left: 24px;
  48. }
  49. &.retry {
  50. background: url('@/assets/component/component-retry.png') no-repeat center;
  51. }
  52. &.correct {
  53. background: url('@/assets/component/component-correct.png') no-repeat center;
  54. }
  55. &.answer {
  56. background: url('@/assets/component/component-answer.png') no-repeat center;
  57. }
  58. }
  59. }
  60. </style>