DashboardLayout.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="fluid-dashboard">
  3. <div class="frame-top">
  4. <div class="title">{{ title }}</div>
  5. </div>
  6. <div class="frame-left"></div>
  7. <div class="frame-right"></div>
  8. <div class="frame-bottom"></div>
  9. <slot name="map"></slot>
  10. <div class="ui-layer">
  11. <header class="top-header">
  12. <div class="header-left">
  13. <slot name="header-left"></slot>
  14. </div>
  15. <div class="header-right">
  16. <slot name="header-right"></slot>
  17. </div>
  18. </header>
  19. <main class="main-layout" :class="layoutClass">
  20. <aside class="left-sidebar">
  21. <slot name="left"></slot>
  22. </aside>
  23. <section class="center-area">
  24. <slot name="center"></slot>
  25. <!-- 底部dock菜单-->
  26. <BottomDock />
  27. </section>
  28. <aside class="right-sidebar">
  29. <slot name="right"></slot>
  30. </aside>
  31. </main>
  32. </div>
  33. <slot name="dialogs"></slot>
  34. </div>
  35. </template>
  36. <script>
  37. import BottomDock from '@/components/ui/BottomDock.vue';
  38. export default {
  39. name: 'DashboardLayout',
  40. components: {
  41. BottomDock,
  42. },
  43. props: {
  44. // 接收外部传入的 class,用于动态切换 CSS 网格布局
  45. // 例如传入 "special-situation-monitoring"
  46. layoutClass: {
  47. type: String,
  48. default: ''
  49. }
  50. },
  51. data() {
  52. return {
  53. title: '交通型号控制平台',
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. /* ================= 根容器 ================= */
  60. .fluid-dashboard {
  61. width: 100vw;
  62. height: 100vh;
  63. position: relative;
  64. overflow: hidden;
  65. background: #050a17;
  66. /* 兜底深色背景 */
  67. }
  68. /* ================= 大屏装饰边框 ================= */
  69. .frame-top,
  70. .frame-left,
  71. .frame-right,
  72. .frame-bottom {
  73. position: absolute;
  74. pointer-events: none;
  75. /* 【核心】鼠标事件穿透,不挡底层交互 */
  76. z-index: 50;
  77. /* 层级高于 UI,低于弹窗 */
  78. }
  79. .frame-top {
  80. top: 0;
  81. left: 0;
  82. width: 100%;
  83. height: 100px;
  84. background: url('@/assets/images/layout-top.png') no-repeat center top;
  85. background-size: 100% 100%;
  86. }
  87. .frame-top .title {
  88. font-family: var(--title-font-family);
  89. font-size: 48px;
  90. color: #707070;
  91. line-height: 63px;
  92. text-align: center;
  93. font-style: normal;
  94. text-transform: none;
  95. background: linear-gradient(90deg, #9ED3FD 0%, #FFFFFF 100%);
  96. -webkit-background-clip: text;
  97. -webkit-text-fill-color: transparent;
  98. }
  99. .frame-left {
  100. top: 10px;
  101. left: 0;
  102. width: 16px;
  103. height: calc(100% - 10px - 40px);
  104. background: url('@/assets/images/layout-left.png') no-repeat left center;
  105. background-size: 100% 100%;
  106. }
  107. .frame-right {
  108. top: 10px;
  109. right: 0;
  110. width: 16px;
  111. height: calc(100% - 10px - 40px);
  112. background: url('@/assets/images/layout-right.png') no-repeat right center;
  113. background-size: 100% 100%;
  114. }
  115. .frame-bottom {
  116. bottom: 0;
  117. left: 0;
  118. width: 100%;
  119. height: 17px;
  120. /* background: url('@/assets/images/layout-bottom.png') no-repeat center bottom; */
  121. background-size: 100% 100%;
  122. }
  123. /* ================= UI 层与网格布局 ================= */
  124. .ui-layer {
  125. position: absolute;
  126. top: 0;
  127. left: 0;
  128. width: 100%;
  129. height: 100%;
  130. z-index: 2;
  131. pointer-events: none;
  132. /* 让鼠标穿透点到下层的地图 */
  133. display: grid;
  134. grid-template-rows: 80px 1fr;
  135. /* 头部 80px,其余给主体 */
  136. }
  137. /* 恢复具体功能区域的鼠标交互 */
  138. .top-header,
  139. .left-sidebar,
  140. .center-area,
  141. .right-sidebar {
  142. pointer-events: auto;
  143. }
  144. /* --- 头部 --- */
  145. .top-header {
  146. display: flex;
  147. justify-content: space-between;
  148. align-items: flex-end;
  149. padding: 0 50px;
  150. /* 左右内边距,避开边框图片 */
  151. position: relative;
  152. }
  153. .header-right {
  154. position: absolute;
  155. right: 50px;
  156. bottom: 0;
  157. }
  158. /* --- 主体网格 --- */
  159. .main-layout {
  160. display: grid;
  161. /* 默认网格:左400,中间自适应,右400 */
  162. grid-template-columns: 400px 1fr 400px;
  163. gap: 20px;
  164. /* 【关键】给四周留出 padding,防止里面的图表被外围的装饰边框挡住! */
  165. padding: 20px 50px 60px 50px;
  166. height: 100%;
  167. box-sizing: border-box;
  168. }
  169. /* 特殊模式下的网格变体 (通过 layoutClass 触发) */
  170. .main-layout.special-situation-monitoring {
  171. grid-template-columns: 500px 1fr 480px;
  172. }
  173. /* --- 区域容器设定 --- */
  174. .left-sidebar,
  175. .right-sidebar {
  176. height: 100%;
  177. display: flex;
  178. flex-direction: column;
  179. }
  180. .center-area {
  181. position: relative;
  182. height: 100%;
  183. }
  184. </style>