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