|
@@ -10,10 +10,8 @@
|
|
|
|
|
|
|
|
<template #map>
|
|
<template #map>
|
|
|
<!-- 地图 -->
|
|
<!-- 地图 -->
|
|
|
- <TongzhouTrafficMap
|
|
|
|
|
- amapKey="db2da7e3e248c3b2077d53fc809be63f"
|
|
|
|
|
- securityJsCode="a7413c674852c5eaf01d90813c5b7ef6"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <TongzhouTrafficMap amapKey="db2da7e3e248c3b2077d53fc809be63f"
|
|
|
|
|
+ securityJsCode="a7413c674852c5eaf01d90813c5b7ef6" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #left>
|
|
<template #left>
|
|
@@ -41,18 +39,21 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #right>
|
|
<template #right>
|
|
|
-
|
|
|
|
|
|
|
+ <!-- 模式切换按钮组 -->
|
|
|
|
|
+ <div class="mode-switch" v-if="activeLeftTab === 'crossing'">
|
|
|
|
|
+ <ButtonGroup v-model="currentView" :options="viewOptions" @select="onViewSelect" />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #center>
|
|
<template #center>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #dialogs>
|
|
<template #dialogs>
|
|
|
<SmartDialog v-for="dialog in activeDialogs" :key="dialog.id" :id="dialog.id" :visible.sync="dialog.visible"
|
|
<SmartDialog 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"
|
|
: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"
|
|
|
|
|
-
|
|
|
|
|
|
|
+ :center="dialog.center !== false" :position="dialog.position" :showClose="dialog.showClose"
|
|
|
|
|
+ :enableDblclickExpand="dialog.enableDblclickExpand" :noPadding="dialog.noPadding"
|
|
|
@close="handleDialogClose(dialog.id)" @expand="handleDoubleClickExpend(dialog.data)">
|
|
@close="handleDialogClose(dialog.id)" @expand="handleDoubleClickExpend(dialog.data)">
|
|
|
|
|
|
|
|
<component :is="dialog.componentName" v-bind="dialog.data"></component>
|
|
<component :is="dialog.componentName" v-bind="dialog.data"></component>
|
|
@@ -78,6 +79,7 @@ import MenuItem from '@/components/ui/MenuItem.vue';
|
|
|
import RingDonutChart from '@/components/ui/RingDonutChart.vue';
|
|
import RingDonutChart from '@/components/ui/RingDonutChart.vue';
|
|
|
import CrossingPanel from '@/components/ui/CrossingPanel.vue';
|
|
import CrossingPanel from '@/components/ui/CrossingPanel.vue';
|
|
|
import CrossingDetailPanel from '@/components/ui/CrossingDetailPanel.vue';
|
|
import CrossingDetailPanel from '@/components/ui/CrossingDetailPanel.vue';
|
|
|
|
|
+import ButtonGroup from '@/components/ui/ButtonGroup.vue';
|
|
|
import { getIntersectionData, makeTrafficTimeSpaceData } from '@/mock/data';
|
|
import { getIntersectionData, makeTrafficTimeSpaceData } from '@/mock/data';
|
|
|
|
|
|
|
|
|
|
|
|
@@ -98,7 +100,8 @@ export default {
|
|
|
TrafficTimeSpace,
|
|
TrafficTimeSpace,
|
|
|
RingDonutChart,
|
|
RingDonutChart,
|
|
|
CrossingPanel,
|
|
CrossingPanel,
|
|
|
- CrossingDetailPanel
|
|
|
|
|
|
|
+ CrossingDetailPanel,
|
|
|
|
|
+ ButtonGroup
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -227,6 +230,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 地图模式切换数据
|
|
|
|
|
+ currentView: 'map-mode',
|
|
|
|
|
+ viewOptions: [
|
|
|
|
|
+ { label: '列表模式', value: 'list-mode' },
|
|
|
|
|
+ { label: '地图模式', value: 'map-mode' },
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -249,6 +258,11 @@ export default {
|
|
|
// });
|
|
// });
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 模式切换
|
|
|
|
|
+ onViewSelect(item) {
|
|
|
|
|
+ console.log('你点击了:', item.label);
|
|
|
|
|
+ this.currentView = item.value;
|
|
|
|
|
+ },
|
|
|
// 处理tab点击
|
|
// 处理tab点击
|
|
|
handleTabClick(nodeData) {
|
|
handleTabClick(nodeData) {
|
|
|
console.log('父组件接收到了tab点击事件:', nodeData);
|
|
console.log('父组件接收到了tab点击事件:', nodeData);
|
|
@@ -284,9 +298,9 @@ export default {
|
|
|
} else if (this.activeLeftTab === 'crossing') { // 路口
|
|
} else if (this.activeLeftTab === 'crossing') { // 路口
|
|
|
this.showCrossingDetailDialogs(nodeData);
|
|
this.showCrossingDetailDialogs(nodeData);
|
|
|
} else if (this.activeLeftTab === 'trunkLine') { // 干线
|
|
} else if (this.activeLeftTab === 'trunkLine') { // 干线
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
} else if (this.activeLeftTab === 'specialDuty') { // 特勤
|
|
} else if (this.activeLeftTab === 'specialDuty') { // 特勤
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
openDialog(config) {
|
|
openDialog(config) {
|
|
@@ -331,6 +345,12 @@ export default {
|
|
|
showCrossingDalogs(nodeData) {
|
|
showCrossingDalogs(nodeData) {
|
|
|
console.log('显示干线弹窗组', nodeData.id, nodeData.label);
|
|
console.log('显示干线弹窗组', nodeData.id, nodeData.label);
|
|
|
|
|
|
|
|
|
|
+ // 列表模式弹窗
|
|
|
|
|
+ if (this.currentView === 'list-mode') {
|
|
|
|
|
+
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.openDialog({
|
|
this.openDialog({
|
|
|
id: 'crossing_' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成
|
|
id: 'crossing_' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成
|
|
|
title: '',
|
|
title: '',
|
|
@@ -392,7 +412,7 @@ export default {
|
|
|
|
|
|
|
|
showCrossingDetailDialogs(nodeData) {
|
|
showCrossingDetailDialogs(nodeData) {
|
|
|
console.log('显示干线弹窗组', nodeData.id, nodeData.label);
|
|
console.log('显示干线弹窗组', nodeData.id, nodeData.label);
|
|
|
- this.openDialog({
|
|
|
|
|
|
|
+ this.openDialog({
|
|
|
id: 'crossing_detail' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成,例如 'dev-security-route' 代表特勤安保路线弹窗
|
|
id: 'crossing_detail' + nodeData.id, // 这里的 ID 可以根据实际业务场景动态生成,例如 'dev-security-route' 代表特勤安保路线弹窗
|
|
|
title: nodeData.label,
|
|
title: nodeData.label,
|
|
|
component: 'CrossingDetailPanel',
|
|
component: 'CrossingDetailPanel',
|
|
@@ -523,5 +543,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
-
|
|
|
|
|
|
|
+.mode-switch {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+}
|
|
|
|
|
+.mode-switch>div {
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|