| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <template>
- <div class="fluid-dashboard">
- <div class="frame-top">
- <div class="title">{{ title }}</div>
- </div>
- <div class="frame-left"></div>
- <div class="frame-right"></div>
- <div class="frame-bottom"></div>
- <slot name="map"></slot>
- <div class="ui-layer">
- <header class="top-header">
- <div class="header-left">
- <slot name="header-left"></slot>
- </div>
- <div class="header-right">
- <slot name="header-right"></slot>
- </div>
- </header>
- <main class="main-layout" :class="layoutClass">
- <aside class="left-sidebar">
- <slot name="left"></slot>
- </aside>
- <section class="center-area">
- <slot name="center"></slot>
- <!-- 底部dock菜单-->
- <BottomDock />
- </section>
- <aside class="right-sidebar">
- <slot name="right"></slot>
- </aside>
- </main>
- </div>
- <!-- 弹窗层:由 Layout 统一渲染 -->
- <SmartDialog
- ref="dialogs"
- v-for="dialog in activeDialogs"
- :key="dialog.id"
- :id="dialog.id"
- :visible.sync="dialog.visible"
- :title="dialog.title"
- :defaultWidth="dialog.width || 400"
- :defaultHeight="dialog.height || 300"
- :center="dialog.center !== false"
- :position="dialog.position"
- :showClose="dialog.showClose"
- :enableDblclickExpand="dialog.enableDblclickExpand"
- :noPadding="dialog.noPadding"
- :draggable="dialog.draggable"
- :resizable="dialog.resizable"
- :minWidth="dialog.minWidth"
- :minHeight="dialog.minHeight"
- @close="handleDialogClose(dialog.id)"
- @expand="handleDialogExpand(dialog)">
- <template #header v-if="dialog.headerComponent">
- <component :is="dialog.headerComponent" v-bind="dialog.headerProps" />
- </template>
- <component :is="dialog.componentName" v-bind="dialog.data" />
- </SmartDialog>
- </div>
- </template>
- <script>
- import BottomDock from '@/components/ui/BottomDock.vue';
- import SmartDialog from '@/components/ui/SmartDialog.vue';
- import dialogManager from '@/mixins/dialogManager';
- // 注册所有可能在弹窗中使用的内容组件
- import DeviceStatusPanel from '@/components/ui/DeviceStatusPanel.vue';
- import SecurityRoutePanel from '@/components/ui/SecurityRoutePanel.vue';
- import IntersectionMapVideos from '@/components/ui/IntersectionMapVideos.vue';
- import TrafficTimeSpace from '@/components/ui/TrafficTimeSpace.vue';
- import RingDonutChart from '@/components/ui/RingDonutChart.vue';
- import CrossingPanel from '@/components/ui/CrossingPanel.vue';
- import CrossingDetailPanel from '@/components/ui/CrossingDetailPanel.vue';
- import CrossingListPanel from '@/components/ui/CrossingListPanel.vue';
- import SecurityRoutePanelSwitch from '@/components/ui/SecurityRoutePanelSwitch.vue';
- import SecurityRoutePanelSwitchSmall from '@/components/ui/SecurityRoutePanelSwitchSmall.vue';
- import DeviceRestart from '@/components/ui/DeviceRestart.vue';
- import DeviceUpgrade from '@/components/ui/DeviceUpgrade.vue';
- import OnlineStatusTabs from '@/components/ui/OnlineStatusTabs.vue';
- import DeviceStatusTabs from '@/components/ui/DeviceStatusTabs.vue';
- import TaskMonitorHeader from '@/components/ui/TaskMonitorHeader.vue';
- import SpecialTaskMonitorPanel from '@/components/ui/SpecialTaskMonitorPanel.vue';
- export default {
- name: 'DashboardLayout',
- mixins: [dialogManager],
- components: {
- BottomDock,
- SmartDialog,
- DeviceStatusPanel,
- SecurityRoutePanel,
- IntersectionMapVideos,
- TrafficTimeSpace,
- RingDonutChart,
- CrossingPanel,
- CrossingDetailPanel,
- CrossingListPanel,
- SecurityRoutePanelSwitch,
- SecurityRoutePanelSwitchSmall,
- DeviceRestart,
- DeviceUpgrade,
- OnlineStatusTabs,
- DeviceStatusTabs,
- TaskMonitorHeader,
- SpecialTaskMonitorPanel
- },
- provide() {
- return {
- dialogManager: {
- openDialog: this.openDialog,
- closeDialog: this.handleDialogClose,
- clearDialogs: this.clearDialogs,
- getDialogs: () => this.activeDialogs,
- }
- };
- },
- props: {
- // 接收外部传入的 class,用于动态切换 CSS 网格布局
- // 例如传入 "special-situation-monitoring"
- layoutClass: {
- type: String,
- default: ''
- }
- },
- data() {
- return {
- title: '交通信号控制平台',
- }
- },
- methods: {
- handleDialogExpand(dialog) {
- if (dialog.data && typeof dialog.data.onExpand === 'function') {
- dialog.data.onExpand(dialog.data);
- }
- }
- }
- }
- </script>
- <style scoped>
- /* ================= 根容器 ================= */
- .fluid-dashboard {
- width: 100vw;
- height: 100vh;
- position: relative;
- overflow: hidden;
- background: #050a17;
- /* 兜底深色背景 */
- }
- /* ================= 大屏装饰边框 ================= */
- .frame-top,
- .frame-left,
- .frame-right,
- .frame-bottom {
- position: absolute;
- pointer-events: none;
- /* 【核心】鼠标事件穿透,不挡底层交互 */
- z-index: 50;
- /* 层级高于 UI,低于弹窗 */
- }
- .frame-top {
- top: 0;
- left: 0;
- width: 100%;
- height: 100px;
- background: url('@/assets/images/layout-top.png') no-repeat center top;
- background-size: 100% 100%;
- }
- .frame-top .title {
- font-family: var(--title-font-family);
- font-size: 48px;
- color: #707070;
- line-height: 63px;
- text-align: center;
- font-style: normal;
- text-transform: none;
- background: linear-gradient(90deg, #9ED3FD 0%, #FFFFFF 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- .frame-left {
- top: 10px;
- left: 0;
- width: 16px;
- height: calc(100% - 10px - 40px);
- background: url('@/assets/images/layout-left.png') no-repeat left center;
- background-size: 100% 100%;
- }
- .frame-right {
- top: 10px;
- right: 0;
- width: 16px;
- height: calc(100% - 10px - 40px);
- background: url('@/assets/images/layout-right.png') no-repeat right center;
- background-size: 100% 100%;
- }
- .frame-bottom {
- bottom: 0;
- left: 0;
- width: 100%;
- height: 17px;
- /* background: url('@/assets/images/layout-bottom.png') no-repeat center bottom; */
- background-size: 100% 100%;
- }
- /* ================= UI 层与网格布局 ================= */
- .ui-layer {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- pointer-events: none;
- /* 让鼠标穿透点到下层的地图 */
- display: grid;
- grid-template-rows: 80px 1fr;
- /* 头部 80px,其余给主体 */
- }
- /* 恢复具体功能区域的鼠标交互 */
- .top-header,
- .left-sidebar,
- .center-area,
- .right-sidebar {
- pointer-events: auto;
- }
- /* --- 头部 --- */
- .top-header {
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- padding: 0 50px;
- /* 左右内边距,避开边框图片 */
- position: relative;
- }
- .header-right {
- position: absolute;
- right: 50px;
- bottom: 0;
- }
- /* --- 主体网格 --- */
- .main-layout {
- display: grid;
- /* 默认网格:左400,中间自适应,右400 */
- grid-template-columns: 400px 1fr 400px;
- gap: 20px;
- /* 【关键】给四周留出 padding,防止里面的图表被外围的装饰边框挡住! */
- padding: 20px 50px 60px 50px;
- height: 100%;
- box-sizing: border-box;
- }
- /* 特殊模式下的网格变体 (通过 layoutClass 触发) */
- .main-layout.special-situation-monitoring {
- grid-template-columns: 500px 1fr 480px;
- }
- /* --- 区域容器设定 --- */
- .left-sidebar,
- .right-sidebar {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- /* --- 中心区域保持事件穿透,让出地图的拖拽控制权 --- */
- .center-area {
- position: relative;
- height: 100%;
- pointer-events: none;
- }
- /* --- 恢复中心区域内部具体组件(如 BottomDock 和 slot 里的内容)的交互 --- */
- .center-area > * {
- pointer-events: auto;
- }
- </style>
|