beforeSubmitMask.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="mask" v-show="show">
  3. <div>
  4. <div class="dialog">
  5. <div class="title">
  6. <span>考试确认窗口</span>
  7. </div>
  8. <div class="mid">
  9. <div class="mid-line1">操作提示:</div>
  10. <div class="mid-line2">
  11. 你当前考试答对{{ correctScore }}题,答错{{ errorScore }}题,未答{{
  12. total - correctScore - errorScore
  13. }}题
  14. </div>
  15. <div class="mid-line3">
  16. <span>1.点击【确认交卷】,将提交考试成绩,结束考试!</span>
  17. </div>
  18. <div class="mid-line4">
  19. <span>1.点击【继续考试】,将关闭本窗口,继续考试!</span>
  20. </div>
  21. </div>
  22. <div class="bottom">
  23. <button @click="sendPaper">确认交卷</button>
  24. <button @click="cancelSubmit">继续考试</button>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import { defineProps, reactive, toRefs } from 'vue';
  32. export default {
  33. setup(props, { emit }) {
  34. const state = reactive({
  35. count: 0,
  36. });
  37. const sendPaper = () => {
  38. emit("confirm");
  39. };
  40. const cancelSubmit=()=>{
  41. emit("cancel");
  42. }
  43. return {
  44. ...toRefs(state),
  45. props,
  46. sendPaper,
  47. cancelSubmit
  48. };
  49. },
  50. props: {
  51. show: {
  52. type:Boolean,
  53. required:true,
  54. default:false
  55. },
  56. correctScore: {
  57. type: Number,
  58. required: true,
  59. default: 0,
  60. },
  61. errorScore: {
  62. type: Number,
  63. required: true,
  64. default: 0,
  65. },
  66. total: {
  67. type: Number,
  68. required: true,
  69. default: 0,
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="scss" scoped>
  75. .mask {
  76. position: fixed;
  77. top: 0;
  78. width: 100vw;
  79. height: 100vh;
  80. background-color: rgb(0, 0, 0, 0.65);
  81. z-index: 10;
  82. display: flex;
  83. align-content: center;
  84. align-items: center;
  85. justify-content: center;
  86. .dialog {
  87. width: 400px;
  88. height: 210px;
  89. background: #fff;
  90. .title {
  91. width: 100%;
  92. line-height: 40px;
  93. height: 40px;
  94. background: #498ef5;
  95. color: #fff;
  96. font-size: 14px;
  97. }
  98. .mid {
  99. width: 100%;
  100. background: #fff;
  101. height: 120px;
  102. padding-left: 10px;
  103. padding-right: 10px;
  104. .mid-line1 {
  105. line-height: 25px;
  106. height: 25px;
  107. text-align: left;
  108. }
  109. .mid-line2 {
  110. text-align: left;
  111. line-height: 30px;
  112. }
  113. .mid-line3 {
  114. text-align: left;
  115. line-height: 30px;
  116. }
  117. .mid-line4 {
  118. text-align: left;
  119. line-height: 30px;
  120. }
  121. }
  122. .bottom {
  123. background: #498ef5;
  124. width: 100%;
  125. height: 50px;
  126. display: flex;
  127. justify-content: center;
  128. align-content: center;
  129. align-items: center;
  130. button:nth-child(1) {
  131. height: 30px;
  132. margin-right: 30px;
  133. }
  134. button:nth-child(2) {
  135. height: 30px;
  136. }
  137. }
  138. }
  139. }
  140. </style>