|
@@ -348,23 +348,14 @@
|
|
|
<component v-if="view2" :is="view2" :key="view2"></component>
|
|
<component v-if="view2" :is="view2" :key="view2"></component>
|
|
|
|
|
|
|
|
<!-- 模型拆解弹框 -->
|
|
<!-- 模型拆解弹框 -->
|
|
|
- <teleport to="body">
|
|
|
|
|
- <el-dialog
|
|
|
|
|
- v-model="showModelDialog"
|
|
|
|
|
- title="模型拆解"
|
|
|
|
|
- width="70%"
|
|
|
|
|
- destroy-on-close
|
|
|
|
|
- style="top: 50% !important; left: 50% !important; transform: translate(-60%, -50%) !important;"
|
|
|
|
|
- >
|
|
|
|
|
- <div style="width: 100%; height: 600px;">
|
|
|
|
|
- <ThreeModelViewer
|
|
|
|
|
- :model-path="'/models/启闭机.glb'"
|
|
|
|
|
- :model-name="'启闭机模型'"
|
|
|
|
|
- :auto-load="true"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
- </teleport>
|
|
|
|
|
|
|
+ <ModelDisassemblyDialog
|
|
|
|
|
+ ref="modelDisassemblyDialog"
|
|
|
|
|
+ :visible="showModelDialog"
|
|
|
|
|
+ :model-path="'/models/启闭机.glb'"
|
|
|
|
|
+ :model-name="'启闭机模型'"
|
|
|
|
|
+ :icon-config="modelIconConfig"
|
|
|
|
|
+ @close="showModelDialog = false"
|
|
|
|
|
+ />
|
|
|
|
|
|
|
|
<!-- 鹰眼组件 -->
|
|
<!-- 鹰眼组件 -->
|
|
|
<Sm3dOverviewMap
|
|
<Sm3dOverviewMap
|
|
@@ -404,7 +395,7 @@ import camera from "../../js/common/camera.js"; //相机操作
|
|
|
import loadingBar from "../../components/loading.vue"; //加载动画
|
|
import loadingBar from "../../components/loading.vue"; //加载动画
|
|
|
import TyphoonVisualization from "../../components/typhoon-visualization/typhoon-visualization.vue"; //台风可视化组件
|
|
import TyphoonVisualization from "../../components/typhoon-visualization/typhoon-visualization.vue"; //台风可视化组件
|
|
|
import CesiumThreeFusion from "@/components/ThreeCesiumIntegration/CesiumThreeFusion.vue"; //Three.js与Cesium融合组件
|
|
import CesiumThreeFusion from "@/components/ThreeCesiumIntegration/CesiumThreeFusion.vue"; //Three.js与Cesium融合组件
|
|
|
-import ThreeModelViewer from "@/components/ThreeModelViewer/ModelViewer.vue"; //模型查看器组件
|
|
|
|
|
|
|
+import ModelDisassemblyDialog from "../../components/ModelDisassemblyDialog.vue"; //模型拆解弹框组件
|
|
|
import { CircleClose, Plus, CirclePlus, Setting, Delete } from '@element-plus/icons-vue'; //删除图标
|
|
import { CircleClose, Plus, CirclePlus, Setting, Delete } from '@element-plus/icons-vue'; //删除图标
|
|
|
import { listModel, getModel } from '@/api/watershed/model'; //模型API
|
|
import { listModel, getModel } from '@/api/watershed/model'; //模型API
|
|
|
import { getDefaultMapConfig, saveMapConfig } from '@/api/cesium/mapConfig'; //地图配置API
|
|
import { getDefaultMapConfig, saveMapConfig } from '@/api/cesium/mapConfig'; //地图配置API
|
|
@@ -428,7 +419,7 @@ export default {
|
|
|
CircleClose,
|
|
CircleClose,
|
|
|
TyphoonVisualization,
|
|
TyphoonVisualization,
|
|
|
CesiumThreeFusion,
|
|
CesiumThreeFusion,
|
|
|
- ThreeModelViewer,
|
|
|
|
|
|
|
+ ModelDisassemblyDialog,
|
|
|
MvtAttributePopup,
|
|
MvtAttributePopup,
|
|
|
GateControl
|
|
GateControl
|
|
|
},
|
|
},
|
|
@@ -483,9 +474,8 @@ export default {
|
|
|
// MVT点击处理器
|
|
// MVT点击处理器
|
|
|
mvtClickHandler: null, //MVT点击处理器实例
|
|
mvtClickHandler: null, //MVT点击处理器实例
|
|
|
_hasMvtLayer: false, //是否有MVT图层加载
|
|
_hasMvtLayer: false, //是否有MVT图层加载
|
|
|
- // 模型拆解图标相关
|
|
|
|
|
- sceneModelIconEntity: null, //场景模型拆解图标实体
|
|
|
|
|
- sceneModelIconHandler: null, //场景模型拆解图标点击处理器
|
|
|
|
|
|
|
+ // 模型拆解图标配置
|
|
|
|
|
+ modelIconConfig: null, //场景模型拆解图标配置
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -1532,7 +1522,7 @@ export default {
|
|
|
|
|
|
|
|
// 加载模型拆解图标
|
|
// 加载模型拆解图标
|
|
|
if (scene.modelDisassemblyIcon) {
|
|
if (scene.modelDisassemblyIcon) {
|
|
|
- this.addSceneModelIcon(scene.modelDisassemblyIcon)
|
|
|
|
|
|
|
+ this.modelIconConfig = scene.modelDisassemblyIcon
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ElMessage.success(`已加载固定场景:${scene.sceneName}`)
|
|
ElMessage.success(`已加载固定场景:${scene.sceneName}`)
|
|
@@ -1568,10 +1558,10 @@ export default {
|
|
|
// 关闭闸门控制面板
|
|
// 关闭闸门控制面板
|
|
|
this.showGateControl = false
|
|
this.showGateControl = false
|
|
|
this.gatePosition = 0
|
|
this.gatePosition = 0
|
|
|
-
|
|
|
|
|
- // 移除模型拆解图标
|
|
|
|
|
- this.removeSceneModelIcon()
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 清除模型拆解图标配置
|
|
|
|
|
+ this.modelIconConfig = null
|
|
|
|
|
+
|
|
|
// 清除当前场景ID
|
|
// 清除当前场景ID
|
|
|
this.currentSceneId = null
|
|
this.currentSceneId = null
|
|
|
|
|
|
|
@@ -2357,62 +2347,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- // 添加场景模型拆解图标
|
|
|
|
|
- addSceneModelIcon(config) {
|
|
|
|
|
- if (!window.viewer || !config) return
|
|
|
|
|
-
|
|
|
|
|
- const Cesium = window.Cesium
|
|
|
|
|
-
|
|
|
|
|
- // 如果已存在图标,先移除
|
|
|
|
|
- this.removeSceneModelIcon()
|
|
|
|
|
-
|
|
|
|
|
- // 创建图标实体
|
|
|
|
|
- const modelIcon = window.viewer.entities.add({
|
|
|
|
|
- name: '模型拆解',
|
|
|
|
|
- position: Cesium.Cartesian3.fromDegrees(config.longitude, config.latitude, config.height || 0),
|
|
|
|
|
- billboard: {
|
|
|
|
|
- image: config.image || '/img/svg/logo.svg',
|
|
|
|
|
- width: config.width || 32,
|
|
|
|
|
- height: config.height || 32,
|
|
|
|
|
- verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
|
|
- pixelOffset: new Cesium.Cartesian2(0, -16)
|
|
|
|
|
- },
|
|
|
|
|
- description: '点击查看模型拆解'
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- // 保存实体引用
|
|
|
|
|
- this.sceneModelIconEntity = modelIcon
|
|
|
|
|
-
|
|
|
|
|
- // 使用独立的点击处理器(避免覆盖全局点击事件)
|
|
|
|
|
- const handler = new Cesium.ScreenSpaceEventHandler(window.viewer.canvas)
|
|
|
|
|
- handler.setInputAction((movement) => {
|
|
|
|
|
- const pickedObject = window.viewer.scene.pick(movement.position)
|
|
|
|
|
- if (Cesium.defined(pickedObject) && pickedObject.id === modelIcon) {
|
|
|
|
|
- this.showModelDialog = true
|
|
|
|
|
- }
|
|
|
|
|
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
|
|
|
|
|
-
|
|
|
|
|
- // 保存处理器引用
|
|
|
|
|
- this.sceneModelIconHandler = handler
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 移除场景模型拆解图标
|
|
|
|
|
- removeSceneModelIcon() {
|
|
|
|
|
- // 移除实体
|
|
|
|
|
- if (this.sceneModelIconEntity) {
|
|
|
|
|
- if (window.viewer) {
|
|
|
|
|
- window.viewer.entities.remove(this.sceneModelIconEntity)
|
|
|
|
|
- }
|
|
|
|
|
- this.sceneModelIconEntity = null
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 销毁点击处理器
|
|
|
|
|
- if (this.sceneModelIconHandler) {
|
|
|
|
|
- this.sceneModelIconHandler.destroy()
|
|
|
|
|
- this.sceneModelIconHandler = null
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
|
|
|
// 删除场景公共服务
|
|
// 删除场景公共服务
|
|
|
DeleteDates(datatype, obj) {
|
|
DeleteDates(datatype, obj) {
|