moduleMini-warn.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <div v-if="visible" :class="deviceType === 'warnInfo' ? 'module-content1' : 'module-content'">
  3. <div v-if="title" class="module-content__title__expand">
  4. <span class="action-btn close-btn" @click="closeModel"></span>
  5. <span @click="clickHandler">{{ title }}</span>
  6. </div>
  7. <div class="module-slot">
  8. <slot></slot>
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. const props = defineProps<{
  14. deviceType: string;
  15. title: string;
  16. visible: boolean;
  17. }>();
  18. const emit = defineEmits(['close', 'click']);
  19. const deviceType = props.deviceType;
  20. function closeModel() {
  21. emit('close');
  22. }
  23. function clickHandler() {
  24. emit('click');
  25. }
  26. </script>
  27. <style lang="less" scoped>
  28. @import '/@/design/theme.less';
  29. @{theme-deepblue} {
  30. .module-content {
  31. --image-model_original_title_bg: url('@/assets/images/themify/deepblue/home-container/configurable/model_original_title_bg.png');
  32. }
  33. }
  34. .module-content1 {
  35. --bg-height: 28px;
  36. color: #fff;
  37. box-sizing: border-box;
  38. position: absolute;
  39. width: 100%;
  40. height: 100%;
  41. z-index: 999;
  42. padding: 15px 15px 0px 15px;
  43. }
  44. .module-content {
  45. --image-Content: url('/src/assets/images/fireNew/4-3.png');
  46. --bg-height: 28px;
  47. color: #fff;
  48. box-sizing: border-box;
  49. position: absolute;
  50. width: 100%;
  51. height: 100%;
  52. z-index: 999;
  53. background: var(--image-Content) no-repeat;
  54. background-size: 100% 100%;
  55. padding: 15px 15px 0px 15px;
  56. }
  57. .module-content__title__expand {
  58. width: 100%;
  59. text-align: center;
  60. font-weight: bold;
  61. font-size: 16px;
  62. line-height: 0px;
  63. }
  64. // .module-content__title {
  65. // width: 50%;
  66. // height: var(--bg-height);
  67. // background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
  68. // background-size: 100% 100%;
  69. // position: relative;
  70. // text-align: right;
  71. // padding: 4px 10% 0 0;
  72. // }
  73. // 固定在父容器右上角的按钮图标
  74. // .action-btn {
  75. // width: 18px;
  76. // height: 18px;
  77. // background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
  78. // position: absolute;
  79. // right: 0;
  80. // top: 0;
  81. // }
  82. // .close-btn {
  83. // transform: rotate(-90deg);
  84. // }
  85. .module-slot {
  86. // height: calc(100% - 46px);
  87. // width: 100%;
  88. // backdrop-filter: blur(5px);
  89. // margin-top: 26px;
  90. height: calc(100% - 54px);
  91. width: calc(100% - 30px);
  92. // backdrop-filter: blur(5px);
  93. margin:34px 15px 0px 15px;
  94. }
  95. // Transition动画相关
  96. .v-enter-active,
  97. .v-leave-active {
  98. transition: all 0.3s ease;
  99. }
  100. .v-enter-from,
  101. .v-leave-to {
  102. // opacity: 1;
  103. transform: translateX(-100%);
  104. // transform: scaleY(0);
  105. // transform-origin: center top;
  106. }
  107. </style>