moduleLeft.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <Transition>
  3. <div v-if="visible" class="module-content">
  4. <div v-if="title" class="module-content__title__expand">
  5. <div>
  6. <span class="action-btn close-btn" @click="closeModel"></span>
  7. <span @click="clickHandler">{{ title }}</span>
  8. </div>
  9. <span v-if="visibleDetail" class="detail-text" @click="handleClickDetail">详情</span>
  10. </div>
  11. <div class="module-slot">
  12. <slot></slot>
  13. </div>
  14. </div>
  15. </Transition>
  16. </template>
  17. <script lang="ts" setup>
  18. defineProps<{ title: string; visible: boolean, visibleDetail: boolean }>();
  19. const emit = defineEmits(['close', 'click', 'handleClickDetail']);
  20. function closeModel() {
  21. emit('close');
  22. }
  23. function clickHandler() {
  24. emit('click');
  25. }
  26. //详情点击
  27. function handleClickDetail() {
  28. emit('handleClickDetail')
  29. }
  30. </script>
  31. <style lang="less" scoped>
  32. @import '/@/design/theme.less';
  33. @{theme-deepblue} {
  34. .module-content {
  35. --image-model_original_title_bg: url('@/assets/images/themify/deepblue/home-container/configurable/gasInjection/2-1.png');
  36. --image-model_original_border_bg: url('@/assets/images/themify/deepblue/home-container/configurable/gasInjection/2-4.png');
  37. }
  38. }
  39. .module-content {
  40. --image-model_original_title_bg: url('@/assets/images/gasInjection/2-1.png');
  41. --image-model_original_border_bg: url('@/assets/images/gasInjection/2-4.png');
  42. --bg-height: 40px;
  43. color: #fff;
  44. box-sizing: border-box;
  45. position: absolute;
  46. width: 100%;
  47. height: 100%;
  48. }
  49. .module-content__title__expand {
  50. display: flex;
  51. justify-content: space-between;
  52. align-items: center;
  53. width: 100%;
  54. height: var(--bg-height);
  55. background: var(--image-model_original_title_bg) no-repeat;
  56. background-size: 100% 100%;
  57. position: relative;
  58. padding-left: 45px;
  59. padding-top: 2px;
  60. margin-bottom: 5px;
  61. font-family: 'douyuFont';
  62. line-height: var(--bg-height);
  63. }
  64. .module-slot {
  65. height: calc(100% - 33px);
  66. width: 100%;
  67. // width: calc(100% - 20px);
  68. // backdrop-filter: blur(5px);
  69. // #182d47
  70. background: var(--image-model_original_border_bg) no-repeat;
  71. background-size: 100% 100%;
  72. // margin-left: 10px;
  73. }
  74. .detail-text {
  75. color: #2cb6ff;
  76. cursor: pointer;
  77. }
  78. // Transition动画相关
  79. .v-enter-active,
  80. .v-leave-active {
  81. transition: all 0.3s ease;
  82. }
  83. .v-enter-from,
  84. .v-leave-to {
  85. // opacity: 1;
  86. transform: translateX(-100%);
  87. // transform: scaleY(0);
  88. // transform-origin: center top;
  89. }
  90. </style>