From 946fe551a17da7ed5b359eaa52c2871d5e841a04 Mon Sep 17 00:00:00 2001
From: Hcat1314 <2768237203@qq.com>
Date: Sun, 17 Dec 2023 18:20:07 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=A4=A7=E8=87=B4=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../content/tunnelScene/TunnelScene.vue | 62 ++++++++----------
.../editEquComp/childComps/InputNum.vue | 10 ++-
.../tunnelScene/editEquComp/editDialog.vue | 64 ++++++++-----------
.../content/tunnelScene/sceneClass/demo.js | 34 ++++++++++
.../sceneClass/editEquipment/index.js | 3 +
5 files changed, 92 insertions(+), 81 deletions(-)
diff --git a/src/components/content/tunnelScene/TunnelScene.vue b/src/components/content/tunnelScene/TunnelScene.vue
index 7492e92..cf32d85 100644
--- a/src/components/content/tunnelScene/TunnelScene.vue
+++ b/src/components/content/tunnelScene/TunnelScene.vue
@@ -84,6 +84,9 @@ async function handleMounted() {
} catch (err) {
console.log(err);
}
+
+ demo.tunnelModeInit();
+
}
// 每个模型加载回调
@@ -216,45 +219,32 @@ function handleCancel() {
const ThreeConfig = {
code: 0,
data: {
- tunnelThreeConfig: {
- fan: ['point_005_tl', 'point_009_bl'],
- sensors: ['point_018_br', 'point_021_bl'],
- }
+ tunnelThreeConfig: [{
+ equipmentId: 'fan_01',//传感器id
+ equipmentName: '01',//设备名称
+ pointName: 'point_005_tl',//附着点名称(定位)
+ equipmentType: 'fan',//设备类型(类型可根据后端
+ equipmentValue: 23, //设备存的值
+ }, {
+ equipmentId: 'sensors_01',//传感器id
+ equipmentName: '01',//设备名称
+ pointName: 'point_009_bl',//附着点名称(定位)
+ equipmentType: 'sensors',//设备类型(类型可根据后端
+ equipmentValue: 67, //设备存的值
+ }],
},
- msg: "dda",
+ msg: "dda"
}
-[{ type: 'fan', point: '' }, {}]
-// fan: ['point_005_tl', 'point_009_bl'],
-// sensors: ['point_018_br', 'point_021_bl'],
-// }
-const tunnelConfigEquipment = ThreeConfig.data.tunnelThreeConfig
-const tunnelKeys = Object.keys(tunnelConfigEquipment);
-console.log(tunnelKeys);
+//取值方便操作
+// const tunnelConfigEquipment = ThreeConfig.data.tunnelThreeConfig
-function tunnelModeInit() {
- for (let key in ThreeConfig.data.tunnelThreeConfig) {
- if (ThreeConfig.data.tunnelThreeConfig.hasOwnProperty(key)) {
- switch (key) {
- case 'fan':
- ThreeConfig.data.tunnelThreeConfig.fan.forEach(fan => {
- // 对 fan 进行操作
- console.log(fan);
- });
- break;
- case 'sensors':
- ThreeConfig.data.tunnelThreeConfig.sensors.forEach(sensor => {
- // 对 sensor 进行操作
- console.log(sensor);
- });
- break;
- default:
- // 处理其他键值对
- console.log(key, ThreeConfig.data.tunnelThreeConfig[key]);
- }
- }
- }
-}
-tunnelModeInit()
+// function tunnelModeInit() {
+// for (const item of tunnelConfigEquipment) {
+// let pointmodel = demo.scene.getobjectByName(item.pointName)
+// console.log(pointmodel);
+// }
+// }
+// tunnelModeInit()
diff --git a/src/components/content/tunnelScene/editEquComp/childComps/InputNum.vue b/src/components/content/tunnelScene/editEquComp/childComps/InputNum.vue
index 0ad46f4..987e5c9 100644
--- a/src/components/content/tunnelScene/editEquComp/childComps/InputNum.vue
+++ b/src/components/content/tunnelScene/editEquComp/childComps/InputNum.vue
@@ -1,12 +1,7 @@
@@ -34,6 +29,7 @@ function handleUnmounted() {