CommonDialog.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <Dialog
  3. v-bind="props"
  4. mask
  5. closeable
  6. closeIcon=""
  7. backgroundColor="transparent"
  8. contentScroll
  9. contentScrollMaxHeight="90vh"
  10. :contentPadding="0"
  11. width="auto"
  12. title=""
  13. @update:show="emit('update:show', $event)"
  14. >
  15. <template #content>
  16. <BackgroundBox
  17. backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxDialog.png"
  18. :backgroundCutBorder="48"
  19. :backgroundCutBorderSize="48"
  20. :padding="24"
  21. direction="column"
  22. gap="gap.md"
  23. >
  24. <template v-if="props.title">
  25. <Height :size="24" />
  26. <slot name="titlePre"></slot>
  27. <FlexCol center gap="gap.lg">
  28. <slot name="titleHeader"></slot>
  29. <H3 fontConfig="primaryTitle">{{ props.title }}</H3>
  30. <CommonDivider v-if="props.showDivider" />
  31. </FlexCol>
  32. </template>
  33. <slot></slot>
  34. <Height :size="24" />
  35. </BackgroundBox>
  36. <Height :size="24" />
  37. <ImageButton v-if="props.showCloseButton"
  38. src="https://xy.wenlvti.net/app_static/images/ButtonClose.png"
  39. :width="80"
  40. :height="80"
  41. @click="emit('update:show', false);emit('close')"
  42. />
  43. </template>
  44. </Dialog>
  45. </template>
  46. <script setup lang="ts">
  47. import Dialog, { type DialogProps } from '@/components/dialog/Dialog.vue';
  48. import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
  49. import FlexCol from '@/components/layout/FlexCol.vue';
  50. import Height from '@/components/layout/space/Height.vue';
  51. import H3 from '@/components/typography/H3.vue';
  52. import CommonDivider from './CommonDivider.vue';
  53. import ImageButton from '@/components/basic/ImageButton.vue';
  54. const props = withDefaults(defineProps<DialogProps & {
  55. title?: string;
  56. showCloseButton?: boolean;
  57. showDivider?: boolean;
  58. }>(), {
  59. showCloseButton: true,
  60. showDivider: true,
  61. });
  62. const emit = defineEmits<{
  63. (e: 'update:show', value: boolean): void;
  64. (e: 'close'): void;
  65. }>();
  66. </script>