trp:隧道仿真页面,去除标签回显和隐藏附着点
This commit is contained in:
@@ -210,7 +210,6 @@ const getTunnel = () => {
|
||||
getTunnelDetail(params.tunnelId).then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
form.value = res.data;
|
||||
// console.log(form.value.tunnelAlias);
|
||||
tunnelAlias = form.value.tunnelAlias;
|
||||
}
|
||||
});
|
||||
@@ -346,6 +345,7 @@ async function handleMounted() {
|
||||
// console.log(modelList.value);
|
||||
// console.log("init", params.tunnelId);
|
||||
demo.previewtunnelModeInit(toRaw(modelList.value), fanData);
|
||||
console.log("prew",modelList.value,fanData)
|
||||
// setInterval("demo.previewtunnelModeInit(toRaw(modelList.value), fanData)", "1000")
|
||||
|
||||
demo.SignsInf(tunnelAlias, String(params.tunnelLen.value));
|
||||
|
||||
@@ -190,12 +190,15 @@ async function handleMounted() {
|
||||
? "frequency"
|
||||
: "sensor",
|
||||
}));
|
||||
demo.enableLeftBtn = false //关闭左键
|
||||
demo.pointsVisible(false);
|
||||
demo.editTunnelInit(modeData);
|
||||
// 初始化标牌信息
|
||||
demo.SignsInf("dsadsa", String(params.tunnelLength));
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
|
||||
// 从新渲染数据
|
||||
async function rerender() {
|
||||
try {
|
||||
@@ -294,9 +297,9 @@ function editDevInfo(
|
||||
|
||||
//左键/双击左键回调函数
|
||||
function lClickCallback(demo) {
|
||||
// console.log('左键点击查看信息');
|
||||
console.log('左键点击查看信息');
|
||||
|
||||
//demo动态添加函数,为操作组件内部
|
||||
// demo动态添加函数,为操作组件内部
|
||||
function displayDevInfo(targetPoint = null) {
|
||||
hasDevice.value = targetPoint.hasDevice;
|
||||
if (!targetPoint.info) {
|
||||
@@ -339,15 +342,15 @@ function rClickCallback(demo) {
|
||||
function handleAddEqu(formInfo) {
|
||||
demo.addEquipment(targetP.value, formInfo);
|
||||
// //将墙壁设置为可以穿透点击
|
||||
// for (let line = 1; line <= 20; line++) {
|
||||
// if (line < 10) {
|
||||
// let wall = 'wall_' + '0' + line
|
||||
// this.scene.getObjectByName(wall).layers.set(0)
|
||||
// } else if (line >= 10) {
|
||||
// let wall = 'wall_' + line
|
||||
// this.scene.getObjectByName(wall).layers.set(0)
|
||||
// }
|
||||
// }
|
||||
for (let line = 1; line <= 20; line++) {
|
||||
if (line < 10) {
|
||||
let wall = 'wall_' + '0' + line
|
||||
this.scene.getObjectByName(wall).layers.set(0)
|
||||
} else if (line >= 10) {
|
||||
let wall = 'wall_' + line
|
||||
this.scene.getObjectByName(wall).layers.set(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const centerDialogVisible = ref(false);
|
||||
|
||||
@@ -205,7 +205,12 @@ export default class Demo {
|
||||
// child.material.emissive = child.material.color
|
||||
// child.material.emissiveMap = child.material.map
|
||||
}
|
||||
|
||||
//是否显示附着点
|
||||
pointsVisible(isEnable = true) {
|
||||
this.points.forEach((element) => {
|
||||
element.material.visible = isEnable;
|
||||
});
|
||||
}
|
||||
// 添加轨道控制器
|
||||
/**
|
||||
* @param {Object} OrbitControls 轨道控制器
|
||||
@@ -328,6 +333,7 @@ export default class Demo {
|
||||
// 处理点击左右键触发的事件
|
||||
__handleListenerClickRLEvent(isClickModels, e) {
|
||||
e.preventDefault();
|
||||
if (!this.enableLeftBtn) return;
|
||||
clearTimeout(this.EventTimer);
|
||||
this.EventTimer = setTimeout(() => {
|
||||
const mouse = new this.THREE.Vector2();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import toImg from "../utils/EquipmentTag";
|
||||
export function handleRClick(targetPoint) {
|
||||
return;
|
||||
this.clearTagsObj();
|
||||
const worldPosition = new this.THREE.Vector3();
|
||||
//获取附着点的世界坐标系
|
||||
|
||||
Reference in New Issue
Block a user