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.

129 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(${BackgroundSvg})`,
  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. import BackgroundSvg from '@/assets/SvgIcons/promptBackground.svg'
  34. // 组件属性
  35. const props = defineProps({
  36. // 是否显示对话框
  37. modelValue: {
  38. type: Boolean,
  39. default: false
  40. },
  41. // 对话框宽度
  42. width: {
  43. type: String,
  44. default: '700px'
  45. },
  46. // 消息内容
  47. message: {
  48. type: String,
  49. default: '通过该记录!'
  50. }
  51. })
  52. // 组件事件
  53. const emit = defineEmits(['update:modelValue', 'confirm', 'cancel', 'close'])
  54. // 内部可见性状态
  55. const visible = ref(false)
  56. // 监听外部modelValue变化
  57. watch(() => props.modelValue, (newVal) => {
  58. visible.value = newVal
  59. })
  60. // 监听内部visible变化,同步到外部
  61. watch(visible, (newVal) => {
  62. emit('update:modelValue', newVal)
  63. })
  64. // 确认按钮点击事件
  65. const handleConfirm = () => {
  66. emit('confirm')
  67. visible.value = false
  68. }
  69. // 取消按钮点击事件
  70. const handleCancel = () => {
  71. emit('cancel')
  72. visible.value = false
  73. }
  74. // 对话框关闭事件
  75. const handleClose = () => {
  76. emit('close')
  77. visible.value = false
  78. }
  79. </script>
  80. <style scoped>
  81. /* 将要**的样式 */
  82. .confirm-content {
  83. text-align: center;
  84. font-size: 40px;
  85. font-weight: bold;
  86. color: #333;
  87. line-height: 1.5;
  88. padding: 20px;
  89. position: absolute;
  90. top: 57%;
  91. left: 53%;
  92. transform: translate(-50%, -50%);
  93. width: 100%;
  94. }
  95. /* 确认取消按钮组样式 */
  96. .dialog-footer-button {
  97. display: flex;
  98. justify-content: center;
  99. align-items: center;
  100. display: flex;
  101. justify-content: center;
  102. font-size: 50px;
  103. gap: 10px;
  104. height: 60px;
  105. margin-top: 20px;
  106. position: absolute;
  107. top: 70%;
  108. left: 30%;
  109. }
  110. /* 确认取消按钮样式 */
  111. .custom-large-button {
  112. font-size: 20px !important;
  113. height: 40px !important;
  114. min-width: 40px !important;
  115. padding: 0 40px !important;
  116. }
  117. </style>