廖杰:更新了隧道简称,和昨天的编辑模式bug
This commit is contained in:
@@ -69,9 +69,9 @@ watch(
|
||||
() => params.tunnelLength,
|
||||
(now) => {
|
||||
params.tunnelLength = now;
|
||||
console.log(params.tunnelLength);
|
||||
// console.log(params.tunnelLength);
|
||||
pointGap = now / 20;
|
||||
console.log(params.form.tunnelName);
|
||||
// console.log(params.form.tunnelName);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
@@ -114,7 +114,7 @@ async function handleMounted() {
|
||||
// modelList.value = await initData(params.tunnelId, params.form);
|
||||
console.log("test", modelList.value);
|
||||
demo.editTunnelInit(toRaw(modelList.value));
|
||||
demo.SignsInf(params.form.tunnelName, String(params.tunnelLength))
|
||||
demo.SignsInf(params.form.tunnelAlias, String(params.tunnelLength))
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
ElMessage({
|
||||
|
||||
@@ -199,35 +199,37 @@ function handleFanEqu(
|
||||
};
|
||||
// console.log(targetPoint.info);
|
||||
//风机颜色重新命名
|
||||
let fan1 = fanData[0].equipmentType
|
||||
let fan2 = fanData[1].equipmentType
|
||||
if (targetPoint.info.typeKey == fan1) {
|
||||
if (fanData[0].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (fanData[1].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
if (fanData != 1) {
|
||||
let fan1 = fanData[0].equipmentType
|
||||
let fan2 = fanData[1].equipmentType
|
||||
if (targetPoint.info.typeKey == fan1) {
|
||||
if (fanData[0].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (fanData[1].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(fanData);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export function editTunnelInit(equipmentList) {
|
||||
//初始化将墙壁隐藏起来
|
||||
equipmentList.forEach((item) => {
|
||||
this.addEquipment(this.scene.getObjectByName(item.position), item);
|
||||
this.addEquipment(this.scene.getObjectByName(item.position), item, 1);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -263,10 +263,19 @@ const getScreenInfo = (id) => {
|
||||
})
|
||||
}
|
||||
};
|
||||
//这里可以获取隧道简称
|
||||
const getList = () => {
|
||||
getTunnelList({
|
||||
siteId: siteId
|
||||
}).then(res => {
|
||||
console.log(siteId);
|
||||
console.log(res.data.rows);
|
||||
//这里拿到我们的隧道简称
|
||||
for (let i = 0; i < res.data.rows.length; i++) {
|
||||
if (siteId == res.data.rows[i].tunnelId) {
|
||||
tunnelName = res.data.rows[i].tunnelAlias;
|
||||
}
|
||||
}
|
||||
if (res.code === 1000) {
|
||||
if (res.data.rows.length !== 0) {
|
||||
isTunnel = true;
|
||||
@@ -294,7 +303,8 @@ const getTunnel = (id) => {
|
||||
getScreenInfo(previewId)
|
||||
} else {
|
||||
getScreenInfo(res.data[0]?.value)
|
||||
tunnelName = res.data[0].label
|
||||
console.log(res);
|
||||
//tunnelName = res.data[0].label
|
||||
}
|
||||
tunnelList.value = res.data
|
||||
tunnelList.value.forEach((item, index) => {
|
||||
|
||||
Reference in New Issue
Block a user