You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
2.6 KiB

  1. <!-- 用于审核通过驳回的对话框 -->
  2. <template>
  3. <!-- close-on-click-modal="false" 禁止点击遮罩层关闭对话框 -->
  4. <el-dialog
  5. v-model="visible"
  6. :width="width"
  7. :close-on-click-modal="false"
  8. :style="{
  9. backgroundImage: 'url(/src/assets/SvgIcons/背景.svg)',
  10. backgroundSize: 'cover',
  11. backgroundPosition: 'center',
  12. height: '400px'
  13. }"
  14. @close="handleClose">
  15. <div class="confirm-content">
  16. 将要{{ message }}
  17. <br>
  18. </div>
  19. <template #footer>
  20. <div class="dialog-footer-button">
  21. <el-button round class="custom-large-button" @click="handleCancel">
  22. 取消
  23. </el-button>
  24. <el-button round class="custom-large-button" type="primary" @click="handleConfirm">
  25. 通过
  26. </el-button>
  27. </div>
  28. </template>
  29. </el-dialog>
  30. </template>
  31. <script setup>
  32. import { ref, watch } from 'vue'
  33. // 组件属性
  34. const props = defineProps({
  35. // 是否显示对话框
  36. modelValue: {
  37. type: Boolean,
  38. default: false
  39. },
  40. // 对话框宽度
  41. width: {
  42. type: String,
  43. default: '700px'
  44. },
  45. // 消息内容
  46. message: {
  47. type: String,
  48. default: '通过该记录!'
  49. }
  50. })
  51. // 组件事件
  52. const emit = defineEmits(['update:modelValue', 'confirm', 'cancel', 'close'])
  53. // 内部可见性状态
  54. const visible = ref(false)
  55. // 监听外部modelValue变化
  56. watch(() => props.modelValue, (newVal) => {
  57. visible.value = newVal
  58. })
  59. // 监听内部visible变化,同步到外部
  60. watch(visible, (newVal) => {
  61. emit('update:modelValue', newVal)
  62. })
  63. // 确认按钮点击事件
  64. const handleConfirm = () => {
  65. emit('confirm')
  66. visible.value = false
  67. }
  68. // 取消按钮点击事件
  69. const handleCancel = () => {
  70. emit('cancel')
  71. visible.value = false
  72. }
  73. // 对话框关闭事件
  74. const handleClose = () => {
  75. emit('close')
  76. visible.value = false
  77. }
  78. </script>
  79. <style scoped>
  80. /* 将要**的样式 */
  81. .confirm-content {
  82. text-align: center;
  83. font-size: 40px;
  84. font-weight: bold;
  85. color: #333;
  86. line-height: 1.5;
  87. padding: 20px;
  88. position: absolute;
  89. top: 57%;
  90. left: 53%;
  91. transform: translate(-50%, -50%);
  92. width: 100%;
  93. }
  94. /* 确认取消按钮组样式 */
  95. .dialog-footer-button {
  96. display: flex;
  97. justify-content: center;
  98. align-items: center;
  99. display: flex;
  100. justify-content: center;
  101. font-size: 50px;
  102. gap: 10px;
  103. height: 60px;
  104. margin-top: 20px;
  105. position: absolute;
  106. top: 70%;
  107. left: 30%;
  108. }
  109. /* 确认取消按钮样式 */
  110. .custom-large-button {
  111. font-size: 20px !important;
  112. height: 40px !important;
  113. min-width: 40px !important;
  114. padding: 0 40px !important;
  115. }
  116. </style>