初始化功能大致完成
This commit is contained in:
@@ -487,4 +487,38 @@ export default class Demo {
|
||||
opacityTween(0.1, 0.5, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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"
|
||||
}
|
||||
tunnelConfigEquipment = this.ThreeConfig.data.tunnelThreeConfig
|
||||
tunnelModeInit() {
|
||||
for (const item of this.tunnelConfigEquipment) {
|
||||
//使用api取拿到附着点
|
||||
let pointmodel = this.scene.getObjectByName(item.pointName)
|
||||
let formInfo = {
|
||||
equipmentType: item.equipmentType, //设备类型
|
||||
chooseEquipment: item.equipmentName, //设备选择(设备名称)
|
||||
threshold: item.equipmentValue, //阈值
|
||||
}
|
||||
this.addEquipment(pointmodel, formInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import EquipmentTag from "../utils/EquipmentTag";
|
||||
* @param {Mesh} targetPoint
|
||||
* @param {String} equType "fan" "sensors"
|
||||
*/
|
||||
//formInfo需要的信息这里包括了
|
||||
//equipmentType、
|
||||
|
||||
function addEquipment(targetPoint, formInfo) {
|
||||
if (targetPoint.hasDevice) {
|
||||
alert("已添加设备");
|
||||
|
||||
Reference in New Issue
Block a user