confirmModal.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <Modal v-bind="props" @change="$emit('change', $event)">
  3. <slot></slot>
  4. <template #footer>
  5. <slot name="footer">
  6. <Button class="mr-20px" ghost @click="cancelHandler">{{ cancelText }}</Button>
  7. <Button type="primary" @click="okHandler">{{ okText }}</Button>
  8. </slot>
  9. </template>
  10. </Modal>
  11. </template>
  12. <script setup lang="ts">
  13. import { Modal, Button, ModalProps } from 'ant-design-vue';
  14. // const props = withDefaults(defineProps<ModalProps>(), {
  15. // context: '确认操作?',
  16. // cancelText: '取消',
  17. // okText: '确认',
  18. // centered: true,
  19. // wrapClassName: 'gas-confirm-modal',
  20. // });
  21. const emit = defineEmits(['ok', 'cancel', 'update:visible', 'change']);
  22. function cancelHandler() {
  23. emit('update:visible', false);
  24. emit('cancel');
  25. }
  26. function okHandler() {
  27. emit('update:visible', false);
  28. emit('ok');
  29. }
  30. </script>
  31. <style lang="less">
  32. @import '@/design/theme.less';
  33. @{theme-deepblue} {
  34. .gas-confirm-modal {
  35. --image-confirm-modal: url('@/assets/images/themify/deepblue/vent/gas/confirm-modal.png');
  36. }
  37. }
  38. .gas-confirm-modal {
  39. --image-confirm-modal: url('@/assets/images/vent/gas/confirm-modal.png');
  40. .zxm-modal-content {
  41. width: 410px;
  42. height: 300px;
  43. border: none !important;
  44. box-shadow: none !important;
  45. background-color: transparent !important;
  46. background-image: var(--image-confirm-modal);
  47. background-size: 100% auto;
  48. background-repeat: no-repeat;
  49. .zxm-modal-body {
  50. font-size: 32px;
  51. padding-top: 70px;
  52. height: 210px;
  53. text-align: center;
  54. }
  55. .zxm-modal-footer {
  56. text-align: center;
  57. }
  58. }
  59. }
  60. </style>