|
|
@@ -60,7 +60,7 @@ import TechTabPane from '@/components/ui/TechTabPane.vue';
|
|
|
import TongzhouTrafficMap from '@/components/TongzhouTrafficMap.vue';
|
|
|
import MenuItem from '@/components/ui/MenuItem.vue';
|
|
|
import ButtonGroup from '@/components/ui/ButtonGroup.vue';
|
|
|
-import { getIntersectionData, makeTrafficTimeSpaceData } from '@/mock/data';
|
|
|
+import { makeTrafficTimeSpaceData } from '@/mock/data';
|
|
|
|
|
|
|
|
|
export default {
|
|
|
@@ -212,6 +212,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.showTopChartDalogs();
|
|
|
// this.$refs.layout.openDialog({
|
|
|
// id: 'test', // 这里的 ID 可以根据实际业务场景动态生成,例如 'dev-security-route' 代表特勤安保路线弹窗
|
|
|
// title: 'dddd',
|
|
|
@@ -244,27 +245,24 @@ export default {
|
|
|
showClose: true,
|
|
|
noPadding: false,
|
|
|
enableDblclickExpand: false,
|
|
|
- position: {x: 100, y:150},
|
|
|
+ position: { x: 100, y: 150 },
|
|
|
data: {
|
|
|
onViewDetail: (rowData) => this.handleCrossingViewDetail(rowData)
|
|
|
}
|
|
|
});
|
|
|
+ } else {
|
|
|
+ this.showCrossingTopDialogs();
|
|
|
}
|
|
|
},
|
|
|
// 处理tab点击
|
|
|
- handleTabClick(nodeData) {
|
|
|
- console.log('父组件接收到了tab点击事件:', nodeData);
|
|
|
+ handleTabClick(tabName) {
|
|
|
+ console.log('父组件接收到了tab点击事件:', tabName);
|
|
|
this.$refs.layout.clearDialogs(); // 清空全部弹窗
|
|
|
+ this.showTopChartDalogs(); // 根据当前Tab显示对应的顶部常驻图表
|
|
|
},
|
|
|
// 处理菜单点击
|
|
|
handleMenuClick(nodeData) {
|
|
|
console.log('父组件接收到了最底层路口点击事件:', nodeData);
|
|
|
- // 这里可以根据 nodeData 的经纬度来控制地图组件的视角
|
|
|
- // this.testOpenDeviceStatus();
|
|
|
- // this.testOpenSecurityRoute();
|
|
|
- // this.testOpenSecurityRoute2();
|
|
|
- // this.testOpenTrafficTimeSpace();
|
|
|
-
|
|
|
// 根据Tab来显示不同的弹窗内容
|
|
|
if (this.activeLeftTab === 'overview') { // 总览
|
|
|
this.showOverviewDalogs(nodeData);
|
|
|
@@ -284,57 +282,55 @@ export default {
|
|
|
this.showCrossingDetailDialogs(nodeData);
|
|
|
}
|
|
|
},
|
|
|
+ // 显示顶部常驻图表(根据当前Tab状态)
|
|
|
+ showTopChartDalogs() {
|
|
|
+ if (this.activeLeftTab === 'overview') { // 总览
|
|
|
+ this.showOverviewTopDialogs();
|
|
|
+ } else if (this.activeLeftTab === 'crossing') { // 路口
|
|
|
+ this.showCrossingTopDialogs();
|
|
|
+ } else if (this.activeLeftTab === 'trunkLine') { // 干线
|
|
|
+ // TODO: 干线Tab的顶部图表
|
|
|
+ } else if (this.activeLeftTab === 'specialDuty') { // 特勤
|
|
|
+ // TODO: 特勤Tab的顶部图表
|
|
|
+ }
|
|
|
+ },
|
|
|
// 显示总览弹窗组
|
|
|
showOverviewDalogs(nodeData) {
|
|
|
console.log('显示总览弹窗组', nodeData.id, nodeData.label);
|
|
|
},
|
|
|
- // 显示路口弹窗组
|
|
|
- showCrossingDalogs(nodeData) {
|
|
|
- console.log('显示路口弹窗组', nodeData.id, nodeData.label);
|
|
|
-
|
|
|
+ showOverviewTopDialogs() {
|
|
|
this.$refs.layout.openDialog({
|
|
|
- id: 'crossing_' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成
|
|
|
+ id: 'top-chart-overview-1',
|
|
|
title: '',
|
|
|
- component: 'RingDonutChart',
|
|
|
- width: 228,
|
|
|
- height: 124,
|
|
|
+ component: 'OnlineStatusTabs',
|
|
|
+ width: 300,
|
|
|
+ height: 160,
|
|
|
center: false,
|
|
|
showClose: false,
|
|
|
- position: { x: 730, y: 130 },
|
|
|
- noPadding: true,
|
|
|
+ draggable: false,
|
|
|
resizable: false,
|
|
|
- data: {
|
|
|
- chartData: [
|
|
|
- { name: '在线', value: 38, color: '#4DF5F8' },
|
|
|
- { name: '离线', value: 3, color: '#FFD369' }
|
|
|
- ],
|
|
|
- centerTitle: "98%",
|
|
|
- centerSubTitle: "38/41"
|
|
|
- }
|
|
|
+ position: { x: 630, y: 130 },
|
|
|
+ noPadding: true,
|
|
|
+ data: {}
|
|
|
});
|
|
|
-
|
|
|
this.$refs.layout.openDialog({
|
|
|
- id: 'crossing2_' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成
|
|
|
+ id: 'top-chart-overview-2',
|
|
|
title: '',
|
|
|
- component: 'RingDonutChart',
|
|
|
- width: 228,
|
|
|
- height: 124,
|
|
|
+ component: 'DeviceStatusTabs',
|
|
|
+ width: 300,
|
|
|
+ height: 160,
|
|
|
center: false,
|
|
|
showClose: false,
|
|
|
+ draggable: false,
|
|
|
+ resizable: false,
|
|
|
position: { x: 980, y: 130 },
|
|
|
noPadding: true,
|
|
|
- resizable: false,
|
|
|
- data: {
|
|
|
- chartData: [
|
|
|
- { name: '通信', value: 10, color: '#4DF5F8' },
|
|
|
- { name: '检测器', value: 8, color: '#FFA033' },
|
|
|
- { name: '灯控', value: 15, color: '#FFF587' },
|
|
|
- { name: '冲突', value: 5, color: '#FF4D4F' }
|
|
|
- ],
|
|
|
- centerTitle: "98%",
|
|
|
- centerSubTitle: "38/41"
|
|
|
- }
|
|
|
+ data: {}
|
|
|
});
|
|
|
+ },
|
|
|
+ // 显示路口弹窗组
|
|
|
+ showCrossingDalogs(nodeData) {
|
|
|
+ console.log('显示路口弹窗组', nodeData.id, nodeData.label);
|
|
|
|
|
|
// 路口弹窗
|
|
|
this.$refs.layout.openDialog({
|
|
|
@@ -352,8 +348,8 @@ export default {
|
|
|
onExpand: (data) => this.handleDoubleClickExpend(data)
|
|
|
},
|
|
|
onClose: () => {
|
|
|
- this.$refs.layout.handleDialogClose('crossing_' + nodeData.id);
|
|
|
- this.$refs.layout.handleDialogClose('crossing2_' + nodeData.id);
|
|
|
+ this.$refs.layout.handleDialogClose('top-chart-crossing-1');
|
|
|
+ this.$refs.layout.handleDialogClose('top-chart-crossing-2');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -376,6 +372,53 @@ export default {
|
|
|
data: nodeData
|
|
|
});
|
|
|
},
|
|
|
+ showCrossingTopDialogs() {
|
|
|
+ this.$refs.layout.openDialog({
|
|
|
+ id: 'top-chart-crossing-1',
|
|
|
+ title: '',
|
|
|
+ component: 'RingDonutChart',
|
|
|
+ width: 228,
|
|
|
+ height: 124,
|
|
|
+ center: false,
|
|
|
+ showClose: false,
|
|
|
+ draggable: false,
|
|
|
+ resizable: false,
|
|
|
+ position: { x: 730, y: 130 },
|
|
|
+ noPadding: true,
|
|
|
+ data: {
|
|
|
+ chartData: [
|
|
|
+ { name: '在线', value: 38, color: '#4DF5F8' },
|
|
|
+ { name: '离线', value: 3, color: '#FFD369' }
|
|
|
+ ],
|
|
|
+ centerTitle: "98%",
|
|
|
+ centerSubTitle: "38/41"
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$refs.layout.openDialog({
|
|
|
+ id: 'top-chart-crossing-2',
|
|
|
+ title: '',
|
|
|
+ component: 'RingDonutChart',
|
|
|
+ width: 228,
|
|
|
+ height: 124,
|
|
|
+ center: false,
|
|
|
+ showClose: false,
|
|
|
+ draggable: false,
|
|
|
+ resizable: false,
|
|
|
+ position: { x: 980, y: 130 },
|
|
|
+ noPadding: true,
|
|
|
+ data: {
|
|
|
+ chartData: [
|
|
|
+ { name: '通信', value: 10, color: '#4DF5F8' },
|
|
|
+ { name: '检测器', value: 8, color: '#FFA033' },
|
|
|
+ { name: '灯控', value: 15, color: '#FFF587' },
|
|
|
+ { name: '冲突', value: 5, color: '#FF4D4F' }
|
|
|
+ ],
|
|
|
+ centerTitle: "98%",
|
|
|
+ centerSubTitle: "38/41"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 路口列表模式下弹窗
|
|
|
handleCrossingViewDetail(rowData) {
|
|
|
console.log('显示路口列表查看', rowData);
|
|
|
@@ -402,99 +445,6 @@ export default {
|
|
|
console.log('显示干线弹窗组', nodeData.id, nodeData.label);
|
|
|
},
|
|
|
|
|
|
- // ================= 测试用例:模拟各种点击行为 =================
|
|
|
-
|
|
|
- // 模拟 1:打开设备状态面板
|
|
|
- testOpenDeviceStatus() {
|
|
|
- this.$refs.layout.openDialog({
|
|
|
- id: 'device-status-node-101', // 这里的 ID 可以根据实际业务场景动态生成,例如 'node-101' 代表某个路口
|
|
|
- title: '',
|
|
|
- component: 'DeviceStatusPanel', // 对应 components 里注册的名字
|
|
|
- width: 300,
|
|
|
- height: 240,
|
|
|
- center: false,
|
|
|
- position: { x: 400, y: 200 }, // 直接指定坐标,SmartDialog 内部会自动转换成 left/top
|
|
|
- showClose: false, // 是否显示关闭按钮
|
|
|
- });
|
|
|
-
|
|
|
- this.$refs.layout.openDialog({
|
|
|
- id: 'device-status-node-102', // 这里的 ID 可以根据实际业务场景动态生成,例如 'node-101' 代表某个路口
|
|
|
- title: '',
|
|
|
- component: 'DeviceStatusPanel', // 对应 components 里注册的名字
|
|
|
- width: 300,
|
|
|
- height: 240,
|
|
|
- center: false,
|
|
|
- position: { x: 1600, y: 100 }, // 直接指定坐标,SmartDialog 内部会自动转换成 left/top
|
|
|
- showClose: false, // 是否显示关闭按钮
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 模拟 2:打开特勤安保路线面板
|
|
|
- testOpenSecurityRoute() {
|
|
|
- this.$refs.layout.openDialog({
|
|
|
- id: 'dev-security-route', // 这里的 ID 可以根据实际业务场景动态生成,例如 'dev-security-route' 代表特勤安保路线弹窗
|
|
|
- title: '特勤安保路线 未开始 一级',
|
|
|
- component: 'SecurityRoutePanel',
|
|
|
- width: 540,
|
|
|
- height: 300,
|
|
|
- center: false,
|
|
|
- position: { x: 400, y: 450 },
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 模拟 3:打开本地协调控制面板
|
|
|
- testOpenSecurityRoute2() {
|
|
|
- const dialogId = 'dev-security-route2';
|
|
|
- this.$refs.layout.openDialog({
|
|
|
- id: dialogId,
|
|
|
- title: '长安街-府右街口 本地协调控制',
|
|
|
- component: 'IntersectionMapVideos',
|
|
|
- width: 300,
|
|
|
- height: 200,
|
|
|
- center: false,
|
|
|
- enableDblclickExpand: true,
|
|
|
- position: { x: 1100, y: 200 },
|
|
|
- data: {
|
|
|
- mapData: {},
|
|
|
- intersectionName: '长安街-府右街口',
|
|
|
- videos: [
|
|
|
- { id: 'cam-1', name: '信号机视频', url: 'https://example.com/video1' },
|
|
|
- { id: 'cam-2', name: '路口全景', url: 'https://example.com/video2' },
|
|
|
- { id: 'cam-3', name: '人行横道', url: 'https://example.com/video3' },
|
|
|
- ]
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // 异步获取数据后更新弹窗
|
|
|
- getIntersectionData().then(mapData => {
|
|
|
- const dialogs = this.$refs.layout.getDialogs();
|
|
|
- const dialog = dialogs.find(d => d.id === dialogId);
|
|
|
- if (dialog) {
|
|
|
- this.$set(dialog.data, 'mapData', mapData);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 模拟 4:打开新干线协调控制面板
|
|
|
- testOpenTrafficTimeSpace() {
|
|
|
- const tsData = makeTrafficTimeSpaceData();
|
|
|
- this.$refs.layout.openDialog({
|
|
|
- id: 'dev-traffic-time-space',
|
|
|
- title: '新干线协调控制 早高峰',
|
|
|
- component: 'TrafficTimeSpace',
|
|
|
- width: 300,
|
|
|
- height: 300,
|
|
|
- center: false,
|
|
|
- position: { x: 1400, y: 500 },
|
|
|
- data: {
|
|
|
- intersections: tsData.intersections,
|
|
|
- distances: tsData.distances,
|
|
|
- waveData: tsData.waveData,
|
|
|
- greenData: tsData.greenData,
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -504,6 +454,7 @@ export default {
|
|
|
flex-direction: row;
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
+
|
|
|
.mode-switch>div {
|
|
|
width: 200px;
|
|
|
}
|