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