moduleBottom.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/11-1.png');
  36. // --image-model_original_border_bg: url('@/assets/images/themify/deepblue/home-container/configurable/gasInjection/11-2.png');
  37. }
  38. }
  39. .module-content {
  40. // --image-model_original_title_bg: url('@/assets/images/gasInjection/11-1.png');
  41. // --image-model_original_border_bg: url('@/assets/images/gasInjection/11-2.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: 75px;
  59. padding-right: 24px;
  60. padding-top: 2px;
  61. margin-bottom: 5px;
  62. font-family: 'douyuFont';
  63. line-height: var(--bg-height);
  64. }
  65. .module-slot {
  66. height: calc(100% - 33px);
  67. width: calc(100% - 15px);
  68. background: var(--image-model_original_border_bg) no-repeat;
  69. background-size: 100% 100%;
  70. // backdrop-filter: blur(5px);
  71. // background-color: var(--vent-configurable-original-module-bg);
  72. // margin-left: 5px;
  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: 0;
  86. transform: translateY(-33px);
  87. }
  88. </style>