修改初始化
This commit is contained in:
@@ -93,7 +93,7 @@ async function handleMounted() {
|
|||||||
map.set("equ_sensors", await loadModel("/devicesModel/sensors.obj"));
|
map.set("equ_sensors", await loadModel("/devicesModel/sensors.obj"));
|
||||||
// 给对象初加载设备模型
|
// 给对象初加载设备模型
|
||||||
demo.initDevicesModel(map);
|
demo.initDevicesModel(map);
|
||||||
demo.tunnelModeInit();
|
demo.previewtunnelModeInit();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@@ -248,9 +248,7 @@ function previewEquInfProcess() {
|
|||||||
console.log(equipmentName.value);
|
console.log(equipmentName.value);
|
||||||
console.log(equipmentValue.value);
|
console.log(equipmentValue.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// let equipmentType = reactive(previewEquInfProcess().equipmentType)
|
// let equipmentType = reactive(previewEquInfProcess().equipmentType)
|
||||||
@@ -279,16 +277,6 @@ const ThreeConfig = {
|
|||||||
},
|
},
|
||||||
msg: "dda"
|
msg: "dda"
|
||||||
}
|
}
|
||||||
//取值方便操作
|
|
||||||
// const tunnelConfigEquipment = ThreeConfig.data.tunnelThreeConfig
|
|
||||||
|
|
||||||
// function tunnelModeInit() {
|
|
||||||
// for (const item of tunnelConfigEquipment) {
|
|
||||||
// let pointmodel = demo.scene.getobjectByName(item.pointName)
|
|
||||||
// console.log(pointmodel);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// tunnelModeInit()
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ async function handleMounted() {
|
|||||||
// 给对象初加载设备模型
|
// 给对象初加载设备模型
|
||||||
demo.initDevicesModel(map);
|
demo.initDevicesModel(map);
|
||||||
await Promise.all([map.get("equ_fan"), map.get("equ_sensors")]);
|
await Promise.all([map.get("equ_fan"), map.get("equ_sensors")]);
|
||||||
demo.tunnelModeInit();
|
// demo.tunnelModeInit()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@@ -221,39 +221,7 @@ function handleCancel() {
|
|||||||
demo._resetState();
|
demo._resetState();
|
||||||
demo.clearTagsObj();
|
demo.clearTagsObj();
|
||||||
}
|
}
|
||||||
//现在首先有二种方案,是写在TunnelScene.vue中还是demo.js中呢?
|
|
||||||
//我认为可能看数据在哪获取?到时候看在哪里导入,首先我们放在TunnelScene里面吧
|
|
||||||
//因为没获取到接口,我们先写死!!!
|
|
||||||
//需要参考接口的数据结构!!!,主要是传入函数的参数应该是什么结构???
|
|
||||||
const ThreeConfig = {
|
|
||||||
code: 0,
|
|
||||||
data: {
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
//取值方便操作
|
|
||||||
// const tunnelConfigEquipment = ThreeConfig.data.tunnelThreeConfig
|
|
||||||
|
|
||||||
// function tunnelModeInit() {
|
|
||||||
// for (const item of tunnelConfigEquipment) {
|
|
||||||
// let pointmodel = demo.scene.getobjectByName(item.pointName)
|
|
||||||
// console.log(pointmodel);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// tunnelModeInit()
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
import { saveState, resetState } from "./viewBack";
|
import { saveState, resetState } from "./viewBack";
|
||||||
import addFunction from "./addEvent";
|
import addFunction from "./addEvent";
|
||||||
import { addEquipment, removeEquipment } from "./editEquipment";
|
import { addEquipment, removeEquipment } from "./editEquipment";
|
||||||
import tunnelModeInit from "./tunnelInit"
|
import previewtunnelModeInit from "./previewTunnelInit"
|
||||||
import { Group } from "three/examples/jsm/libs/tween.module";
|
import { Group } from "three/examples/jsm/libs/tween.module";
|
||||||
export default class Demo {
|
export default class Demo {
|
||||||
// 摄像机看向位置
|
// 摄像机看向位置
|
||||||
@@ -27,7 +27,7 @@ export default class Demo {
|
|||||||
this._resetState = resetState;
|
this._resetState = resetState;
|
||||||
this.addEquipment = addEquipment;
|
this.addEquipment = addEquipment;
|
||||||
this.removeEquipment = removeEquipment;
|
this.removeEquipment = removeEquipment;
|
||||||
this.tunnelModeInit = tunnelModeInit;
|
this.previewtunnelModeInit = previewtunnelModeInit;
|
||||||
|
|
||||||
// 外部可添加函数
|
// 外部可添加函数
|
||||||
this.addFunction = addFunction;
|
this.addFunction = addFunction;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default function tunnelModeInit() {
|
export default function previewtunnelModeInit() {
|
||||||
|
|
||||||
for (const item of this.tunnelConfigEquipment) {
|
for (const item of this.tunnelConfigEquipment) {
|
||||||
//使用api取拿到附着点
|
//使用api取拿到附着点
|
||||||
let pointmodel = this.scene.getObjectByName(item.pointName)
|
let pointmodel = this.scene.getObjectByName(item.pointName)
|
||||||
Reference in New Issue
Block a user