moduleLeft-warn.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. --bg-height: 28px;
  46. color: #fff;
  47. box-sizing: border-box;
  48. position: absolute;
  49. width: 100%;
  50. height: 100%;
  51. z-index: 999;
  52. background: url('@/assets/images/home-warn/2-1.png') no-repeat;
  53. background-size: 100% 100%;
  54. padding: 15px 15px 0px 15px;
  55. }
  56. .module-content__title__expand {
  57. width: 100%;
  58. text-align: center;
  59. font-weight: bold;
  60. font-size: 16px;
  61. line-height: 0px;
  62. }
  63. // .module-content__title {
  64. // width: 50%;
  65. // height: var(--bg-height);
  66. // background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
  67. // background-size: 100% 100%;
  68. // position: relative;
  69. // text-align: right;
  70. // padding: 4px 10% 0 0;
  71. // }
  72. // 固定在父容器右上角的按钮图标
  73. // .action-btn {
  74. // width: 18px;
  75. // height: 18px;
  76. // background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
  77. // position: absolute;
  78. // right: 0;
  79. // top: 0;
  80. // }
  81. // .close-btn {
  82. // transform: rotate(-90deg);
  83. // }
  84. .module-slot {
  85. height: calc(100% - 46px);
  86. width: 100%;
  87. backdrop-filter: blur(5px);
  88. margin-top: 26px;
  89. }
  90. // Transition动画相关
  91. .v-enter-active,
  92. .v-leave-active {
  93. transition: all 0.3s ease;
  94. }
  95. .v-enter-from,
  96. .v-leave-to {
  97. // opacity: 1;
  98. transform: translateX(-100%);
  99. // transform: scaleY(0);
  100. // transform-origin: center top;
  101. }
  102. </style>