confirm.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <el-dialog
  3. class="v-dialog"
  4. v-model="dialogVisibleShow"
  5. width="550"
  6. :show-close="false"
  7. >
  8. <template #header>
  9. <div class="dialog-header">
  10. <div class="">{{ title }}</div>
  11. <el-icon @click="close()" class="close-icon" color="#00FFF0" size="20px"><CircleCloseFilled /></el-icon>
  12. </div>
  13. </template>
  14. <div class="dialog-body">
  15. {{msg}}
  16. </div>
  17. <template #footer>
  18. <div class="dialog-footer">
  19. <div class="btn cancel-btn" @click="close()">
  20. 取消
  21. </div>
  22. <div class="btn confirm-btn" @click="confirm()">
  23. 确认
  24. </div>
  25. </div>
  26. </template>
  27. </el-dialog>
  28. </template>
  29. <script setup>
  30. import {toRefs} from "vue";
  31. let emit = defineEmits(["close","confirm"])
  32. let props = defineProps({
  33. dialogVisibleShow:{
  34. type: Boolean,
  35. required: true,
  36. },
  37. title: {
  38. type: String,
  39. required: true,
  40. },
  41. msg: {
  42. type: String,
  43. required: true,
  44. },
  45. })
  46. const {dialogVisibleShow,title,msg} = toRefs(props)
  47. function close(){
  48. emit("close")
  49. }
  50. function confirm(){
  51. emit("confirm")
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .v-dialog {
  56. .dialog-body {
  57. width: 100%;
  58. height: 120px;
  59. line-height: 120px;
  60. text-align: center;
  61. color: #fff;
  62. font-weight: bold;
  63. }
  64. .dialog-footer {
  65. color: #fff;
  66. display: flex;
  67. justify-content: flex-end;
  68. border-top: 1px solid rgba(6, 160, 194, 0.5);
  69. padding: 12px;
  70. .btn {
  71. padding: 8px 23px;
  72. font-weight: bold;
  73. cursor: pointer;
  74. }
  75. .cancel-btn {
  76. background: #052b33;
  77. border-radius: 5px;
  78. border: 1px solid #00fff0;
  79. }
  80. .confirm-btn {
  81. background: url("@/assets/img/znxy/ns_btn.png") no-repeat center center /
  82. 100% 100%;
  83. margin-left: 10px;
  84. }
  85. }
  86. }
  87. </style>