拉杆箱消毒机
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.

132 lines
3.4 KiB

  1. <template>
  2. <div v-if="visible" class="clear_record_modal_container">
  3. <div class="modal_content">
  4. <div v-if="'warning' === props.icon">
  5. <img src="@/assets/img/icon/exclamation-cricle-red-fill.svg " />
  6. </div>
  7. <template v-if="'' === props.content">
  8. <slot></slot>
  9. </template>
  10. <p v-else class="tips">
  11. <span>{{ props.content }}</span>
  12. </p>
  13. <div v-if="'confirm' === props.type" class="btns">
  14. <div class="cancel" @click="actionCancel">取消</div>
  15. <div class="ok" @click="actionOk">确定</div>
  16. </div>
  17. <div v-else-if="'info' === props.type" class="btns" style="justify-content: center;">
  18. <div class="ok" @click="actionOk">确定</div>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <script setup>
  24. import { ref, watch } from 'vue'
  25. /** @var {Function} */
  26. const emits = defineEmits(['update:visible', 'ok', 'cancel']);
  27. /** @var {Object} */
  28. const props = defineProps({
  29. visible: {type:Boolean, default:false}, // 是否显示
  30. content : {type:String, default:''}, // 提示内容
  31. type : {type:String, default:'confirm'}, // 类型
  32. icon : {type:String, default:''} // 图标
  33. });
  34. /** @var {Boolean} */
  35. const visible = ref(props.visible);
  36. // watch visible
  37. watch(() => props.visible, val => visible.value = val);
  38. // expose public functions
  39. defineExpose({show});
  40. // show dialog
  41. function show() {
  42. emits('update:visible', true);
  43. visible.value = true;
  44. }
  45. // action ok
  46. function actionOk() {
  47. emits('ok');
  48. emits('update:visible', false);
  49. visible.value = false;
  50. }
  51. // action cancel
  52. function actionCancel() {
  53. emits('cancel');
  54. emits('update:visible', false);
  55. visible.value = false;
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .clear_record_modal_container {
  60. position: fixed;
  61. top: 0;
  62. left: 0;
  63. right: 0;
  64. bottom: 0;
  65. background: rgba(0, 0, 0, 0.5);
  66. z-index: 2;
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. .modal_content {
  71. width: 476px;
  72. height: 350px;
  73. border-radius: 16px;
  74. background: #ffffff;
  75. padding: 52px 37px 55px 37px;
  76. box-sizing: border-box;
  77. display: flex;
  78. flex-direction: column;
  79. align-items: center;
  80. .tips {
  81. margin-top: 33px;
  82. margin-bottom: 50px;
  83. font-family: Source Han Sans CN;
  84. font-size: 21px;
  85. font-weight: normal;
  86. letter-spacing: 0.04em;
  87. color: #000000;
  88. .red {
  89. color: #fa1c1c;
  90. }
  91. }
  92. .btns {
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. width: 362px;
  97. .cancel {
  98. width: 173px;
  99. height: 68px;
  100. border-radius: 34px;
  101. background: #06518b;
  102. font-family: Source Han Sans CN;
  103. font-size: 23px;
  104. font-weight: 350;
  105. letter-spacing: 0em;
  106. color: #ffffff;
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. }
  111. .ok {
  112. width: 173px;
  113. height: 68px;
  114. border-radius: 34px;
  115. background: #1f6397;
  116. font-family: Source Han Sans CN;
  117. font-size: 23px;
  118. font-weight: 350;
  119. letter-spacing: 0em;
  120. color: #ffffff;
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. }
  125. }
  126. }
  127. }
  128. </style>