Digital Office Automation System
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

RemarkDialog.vue 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <transition name="slide-up">
  3. <div v-if="visible" class="remark-panel">
  4. <div class="remark-mask" @click="$emit('close')" />
  5. <div class="remark-content">
  6. <div class="remark-header">
  7. <div class="remark-title">{{ title }}</div>
  8. <div class="remark-close" @click="$emit('close')">×</div>
  9. </div>
  10. <div class="remark-body">
  11. <div class="remark-input">
  12. <textarea
  13. :value="remark"
  14. @input="$emit('update:remark', $event.target.value)"
  15. placeholder="请输入备注信息(选填)"
  16. maxlength="200"
  17. rows="4"
  18. />
  19. <div class="remark-count">{{ remark.length }}/200</div>
  20. </div>
  21. </div>
  22. <div class="remark-footer">
  23. <button class="remark-submit" @click="$emit('submit')">
  24. 确认打卡
  25. </button>
  26. </div>
  27. </div>
  28. </div>
  29. </transition>
  30. </template>
  31. <script>
  32. export default {
  33. name: 'RemarkDialog',
  34. props: {
  35. visible: {
  36. type: Boolean,
  37. default: false
  38. },
  39. title: {
  40. type: String,
  41. default: ''
  42. },
  43. remark: {
  44. type: String,
  45. default: ''
  46. }
  47. },
  48. emits: ['close', 'submit', 'update:remark']
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .remark-panel {
  53. position: fixed;
  54. top: 0;
  55. left: 0;
  56. right: 0;
  57. bottom: 0;
  58. z-index: 1000;
  59. .remark-mask {
  60. position: absolute;
  61. top: 0;
  62. left: 0;
  63. right: 0;
  64. bottom: 0;
  65. background: rgba(0, 0, 0, 0.5);
  66. }
  67. .remark-content {
  68. position: absolute;
  69. left: 0;
  70. right: 0;
  71. bottom: 0;
  72. background: #fff;
  73. border-radius: 16px 16px 0 0;
  74. transform: translateY(0);
  75. transition: transform 0.3s ease-out;
  76. }
  77. .remark-header {
  78. display: flex;
  79. align-items: center;
  80. justify-content: space-between;
  81. padding: 16px 20px;
  82. border-bottom: 1px solid #eee;
  83. }
  84. .remark-title {
  85. font-size: 16px;
  86. font-weight: 500;
  87. color: #333;
  88. }
  89. .remark-close {
  90. font-size: 24px;
  91. color: #999;
  92. padding: 4px;
  93. cursor: pointer;
  94. }
  95. .remark-body {
  96. padding: 20px;
  97. }
  98. .remark-input {
  99. position: relative;
  100. textarea {
  101. width: 100%;
  102. border: 1px solid #eee;
  103. border-radius: 8px;
  104. padding: 12px;
  105. font-size: 14px;
  106. line-height: 1.5;
  107. resize: none;
  108. outline: none;
  109. &:focus {
  110. border-color: #2196f3;
  111. }
  112. }
  113. .remark-count {
  114. position: absolute;
  115. right: 12px;
  116. bottom: 12px;
  117. font-size: 12px;
  118. color: #999;
  119. }
  120. }
  121. .remark-footer {
  122. padding: 12px 20px 20px;
  123. .remark-submit {
  124. width: 100%;
  125. height: 44px;
  126. background: #2196f3;
  127. border: none;
  128. border-radius: 22px;
  129. color: #fff;
  130. font-size: 16px;
  131. font-weight: 500;
  132. &:active {
  133. opacity: 0.9;
  134. }
  135. }
  136. }
  137. }
  138. .slide-up-enter-active,
  139. .slide-up-leave-active {
  140. transition: all 0.3s ease-out;
  141. }
  142. .slide-up-enter-from,
  143. .slide-up-leave-to {
  144. .remark-mask {
  145. opacity: 0;
  146. }
  147. .remark-content {
  148. transform: translateY(100%);
  149. }
  150. }
  151. </style>