解决隧道仿真数据在隧道中没有渲染问题
This commit is contained in:
@@ -315,7 +315,7 @@ async function handleMounted() {
|
|||||||
demo.isedit = params.isedit;
|
demo.isedit = params.isedit;
|
||||||
let tunnelasync = await demo.loadModel(
|
let tunnelasync = await demo.loadModel(
|
||||||
GLTFLoader,
|
GLTFLoader,
|
||||||
"/tunnelModel/chanel-have-wall-now-use.gltf"
|
"/tunnelModel/chanel-have-wall-now-use.gltf",
|
||||||
);
|
);
|
||||||
demo.addOrbitControls(OrbitControls);
|
demo.addOrbitControls(OrbitControls);
|
||||||
demo.addTween(TWEEN);
|
demo.addTween(TWEEN);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="scene">
|
<div id="scene">
|
||||||
<div id="cvs" ref="content"></div>
|
<div id="cvs" ref="content"></div>
|
||||||
<dev-info ref="info" :devInfo="devInfo"/>
|
<dev-info ref="info" :devInfo="devInfo" />
|
||||||
<!-- 这里的预览模式需要做成不能修改的模式 -->
|
<!-- 这里的预览模式需要做成不能修改的模式 -->
|
||||||
<edit-dialog
|
<edit-dialog
|
||||||
ref="edit"
|
ref="edit"
|
||||||
@@ -47,27 +47,30 @@ import DevInfo from "./displayInfoComp/DevInfo.vue";
|
|||||||
import EditDialog from "./editEquComp/editDialog.vue";
|
import EditDialog from "./editEquComp/editDialog.vue";
|
||||||
|
|
||||||
// 导入模模型加载器
|
// 导入模模型加载器
|
||||||
import {GLTFLoader} from "three/examples/jsm/loaders/GLTFLoader";
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
||||||
// import { DRACOLoader } from "three/examples/jsm/loaders/dracoloader";
|
// import { DRACOLoader } from "three/examples/jsm/loaders/dracoloader";
|
||||||
import {OrbitControls} from "three/examples/jsm/controls/OrbitControls";
|
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
||||||
import * as TWEEN from "three/examples/jsm/libs/tween.module";
|
import * as TWEEN from "three/examples/jsm/libs/tween.module";
|
||||||
import {
|
import {
|
||||||
CSS3DRenderer,
|
CSS3DRenderer,
|
||||||
CSS3DObject,
|
|
||||||
CSS3DSprite,
|
CSS3DSprite,
|
||||||
} from "three/addons/renderers/CSS3DRenderer.js";
|
} from "three/addons/renderers/CSS3DRenderer.js";
|
||||||
// 引入CSS2渲染器CSS2DRenderer和CSS2模型对象CSS2DObject
|
// 引入CSS2渲染器CSS2DRenderer和CSS2模型对象CSS2DObject
|
||||||
import {
|
|
||||||
CSS2DRenderer,
|
|
||||||
CSS2DObject,
|
|
||||||
} from "three/addons/renderers/CSS2DRenderer.js";
|
|
||||||
|
|
||||||
import {OBJLoader} from "three/examples/jsm/loaders/OBJLoader";
|
import { OBJLoader } from "three/examples/jsm/loaders/OBJLoader";
|
||||||
import {RGBELoader} from "three/examples/jsm/loaders/RGBELoader";
|
import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
|
||||||
import {onMounted, reactive, ref, toRaw, watch} from "vue";
|
import {
|
||||||
import {ElMessage} from "element-plus";
|
onMounted,
|
||||||
import {useModelSceneStore} from "@/store/modelSceneStore";
|
reactive,
|
||||||
import {LOD} from "three";
|
ref,
|
||||||
|
toRaw,
|
||||||
|
watch,
|
||||||
|
defineProps,
|
||||||
|
defineExpose,
|
||||||
|
} from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { useModelSceneStore } from "@/store/modelSceneStore";
|
||||||
|
import { getScreenSimulateTunnel } from "@/api/tunnelManage";
|
||||||
// 获取html标签跟随组件dom
|
// 获取html标签跟随组件dom
|
||||||
const content = ref(null);
|
const content = ref(null);
|
||||||
const info = ref(null);
|
const info = ref(null);
|
||||||
@@ -85,6 +88,7 @@ const params = defineProps([
|
|||||||
"form",
|
"form",
|
||||||
"deviceData",
|
"deviceData",
|
||||||
"devRealtimeData",
|
"devRealtimeData",
|
||||||
|
"simulateData",
|
||||||
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
||||||
|
|
||||||
let isedit = ref(params.isedit);
|
let isedit = ref(params.isedit);
|
||||||
@@ -98,7 +102,7 @@ watch(
|
|||||||
pointGap = now / 20;
|
pointGap = now / 20;
|
||||||
// console.log(params.form.tunnelName);
|
// console.log(params.form.tunnelName);
|
||||||
},
|
},
|
||||||
{deep: true}
|
{ deep: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
let pointGap = reactive(params.tunnelLength);
|
let pointGap = reactive(params.tunnelLength);
|
||||||
@@ -110,12 +114,12 @@ async function handleMounted() {
|
|||||||
const doms = [info.value.$el, edit.value.$el];
|
const doms = [info.value.$el, edit.value.$el];
|
||||||
demo = new ThreeDScene(three, content.value);
|
demo = new ThreeDScene(three, content.value);
|
||||||
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
|
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
|
||||||
demo.isedit = params.isedit;
|
|
||||||
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
|
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
|
||||||
|
demo.isedit =false;
|
||||||
const loaded = await demo.loadModel(
|
const loaded = await demo.loadModel(
|
||||||
GLTFLoader,
|
GLTFLoader,
|
||||||
"/tunnelModel/chanel-have-wall-now-use.gltf",
|
"/tunnelModel/chanel-have-wall-now-use.gltf",
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
demo.addOrbitControls(OrbitControls, true);
|
demo.addOrbitControls(OrbitControls, true);
|
||||||
demo.addTween(TWEEN);
|
demo.addTween(TWEEN);
|
||||||
@@ -153,28 +157,101 @@ async function handleMounted() {
|
|||||||
// console.log('parmas',newModelList)
|
// console.log('parmas',newModelList)
|
||||||
modelList.value = [
|
modelList.value = [
|
||||||
{
|
{
|
||||||
"typeKey": "frequency",
|
typeKey: "frequency",
|
||||||
"position": "point_001_tr",
|
position: "point_001_tr",
|
||||||
"threshold": "",
|
threshold: "",
|
||||||
"equipmentId": 3048,
|
equipmentId: 3048,
|
||||||
"equipmentName": "温度传感器",
|
equipmentName: "温度传感器",
|
||||||
"equipmentType": "sensor"
|
equipmentType: "sensor",
|
||||||
}, {
|
data: 100, //实时数据
|
||||||
"typeKey": "temperature",
|
unit: "℃", //单位
|
||||||
"position": "point_020_tr",
|
},
|
||||||
"threshold": "",
|
{
|
||||||
"equipmentId": 10,
|
typeKey: "temperature",
|
||||||
"equipmentName": "1度传感器",
|
position: "point_020_tr",
|
||||||
"equipmentType": "sensor"
|
threshold: "",
|
||||||
}
|
equipmentId: 10,
|
||||||
]
|
equipmentName: "1度传感器",
|
||||||
// modelList.value = await initData(params.tunnelId, params.form);
|
equipmentType: "sensor",
|
||||||
// console.log("test", modelList.value);
|
data: 10, //实时参数
|
||||||
demo.editTunnelInit(toRaw(modelList.value));
|
unit: "%", //单位
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 初始化仿真參數
|
||||||
|
const { data } = await getScreenSimulateTunnel(params.tunnelId);
|
||||||
|
const modeData = randomPosition([
|
||||||
|
...data.frequencyChangerList,
|
||||||
|
...data.windPressureSensorList,
|
||||||
|
...data.sensorList,
|
||||||
|
]).map((item) => ({
|
||||||
|
...item,
|
||||||
|
equipmentType: item.equipmentType.startsWith("frequency")
|
||||||
|
? "frequency"
|
||||||
|
: "sensor",
|
||||||
|
}));
|
||||||
|
demo.editTunnelInit(modeData);
|
||||||
|
// 初始化标牌信息
|
||||||
|
demo.SignsInf("dsadsa", String(params.tunnelLength));
|
||||||
|
} catch (err) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从新渲染数据
|
||||||
|
async function rerender() {
|
||||||
|
try {
|
||||||
|
// 初始化仿真參數
|
||||||
|
const { data } = await getScreenSimulateTunnel(params.tunnelId);
|
||||||
|
console.log(data);
|
||||||
|
const modeData = randomPosition([
|
||||||
|
...data.frequencyChangerList,
|
||||||
|
...data.windPressureSensorList,
|
||||||
|
...data.sensorList,
|
||||||
|
]).map((item) => ({
|
||||||
|
...item,
|
||||||
|
equipmentType: item.equipmentType.startsWith("frequency")
|
||||||
|
? "frequency"
|
||||||
|
: "sensor",
|
||||||
|
}));
|
||||||
|
demo.editTunnelInit(modeData);
|
||||||
demo.SignsInf(params.form.tunnelAlias, String(params.tunnelLength));
|
demo.SignsInf(params.form.tunnelAlias, String(params.tunnelLength));
|
||||||
} catch (err) {
|
} catch (error) {
|
||||||
|
ElMessage({
|
||||||
|
message: "获取仿真数据异常!",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 随机生成1-20的随机数
|
||||||
|
function randomNum(max = 20) {
|
||||||
|
const nums = new Set();
|
||||||
|
while (nums.size < max) {
|
||||||
|
nums.add(Math.floor(Math.random() * max + 1).toString());
|
||||||
|
}
|
||||||
|
return [...nums];
|
||||||
|
}
|
||||||
|
//随机定位
|
||||||
|
function randomPosition(simulateData) {
|
||||||
|
const mid = Math.floor(simulateData.length / 2);
|
||||||
|
const lrIndex = Math.floor(Math.random() * 2);
|
||||||
|
const lr_position = ["tl", "tr"];
|
||||||
|
const leftPosition = randomNum();
|
||||||
|
const rightPosition = randomNum();
|
||||||
|
const leftData = simulateData.slice(0, mid).map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
position: `point_0${leftPosition[index].padStart(2, 0)}_${
|
||||||
|
lr_position[lrIndex]
|
||||||
|
}`,
|
||||||
|
}));
|
||||||
|
const rightData = simulateData
|
||||||
|
.slice(mid, simulateData.length)
|
||||||
|
.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
position: `point_0${rightPosition[index].padStart(2, 0)}_${
|
||||||
|
lr_position[1 - lrIndex]
|
||||||
|
}`,
|
||||||
|
}));
|
||||||
|
return [...leftData, ...rightData];
|
||||||
|
}
|
||||||
|
|
||||||
// 每个模型加载回调
|
// 每个模型加载回调
|
||||||
function loadModel(path) {
|
function loadModel(path) {
|
||||||
@@ -184,8 +261,7 @@ function loadModel(path) {
|
|||||||
(obj) => {
|
(obj) => {
|
||||||
resolve(obj);
|
resolve(obj);
|
||||||
},
|
},
|
||||||
(xhr) => {
|
(xhr) => {},
|
||||||
},
|
|
||||||
(err) => {
|
(err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
@@ -351,6 +427,9 @@ const ThreeConfig = {
|
|||||||
watch(params.devRealtimeData, () => {
|
watch(params.devRealtimeData, () => {
|
||||||
// console.log("devRealtimeData:", params.devRealtimeData);
|
// console.log("devRealtimeData:", params.devRealtimeData);
|
||||||
});
|
});
|
||||||
|
defineExpose({
|
||||||
|
rerender,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function addEquipment(targetPoint, formInfo, fanData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//判断墙是否已经存在,如果存在的话,就不管,添加则无效嘛(就是说只能添加一面墙,如果存在一面墙,则不管了)
|
//判断墙是否已经存在,如果存在的话,就不管,添加则无效嘛(就是说只能添加一面墙,如果存在一面墙,则不管了)
|
||||||
let hasWall = false
|
let hasWall = false;
|
||||||
let wallHang = 0;
|
let wallHang = 0;
|
||||||
|
|
||||||
// function handleValveEqu(targetPoint, equipmentInfo) {
|
// function handleValveEqu(targetPoint, equipmentInfo) {
|
||||||
@@ -49,7 +49,8 @@ function handleOtherEqu(targetPoint, equipmentInfo) {
|
|||||||
equMesh.position.copy(worldP);
|
equMesh.position.copy(worldP);
|
||||||
|
|
||||||
//设备添加标签
|
//设备添加标签
|
||||||
const tag = EquipmentTag(equipmentInfo.equipmentName);
|
const param = `${equipmentInfo.data || "--"} ${equipmentInfo.unit || "-"}`; //渲染设备参数(data)和单位(unit)
|
||||||
|
const tag = EquipmentTag(equipmentInfo.equipmentName,param);
|
||||||
equMesh.getObjectByName("tag").material = tag;
|
equMesh.getObjectByName("tag").material = tag;
|
||||||
if (/tr$/.test(targetPoint.name)) {
|
if (/tr$/.test(targetPoint.name)) {
|
||||||
equMesh.rotation.z = -Math.PI / 2;
|
equMesh.rotation.z = -Math.PI / 2;
|
||||||
@@ -195,11 +196,10 @@ function handleFanEqu(
|
|||||||
if (item.isMesh) {
|
if (item.isMesh) {
|
||||||
item.material = item.material.clone();
|
item.material = item.material.clone();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
// equMesh.geometry = this.equMap.get("equ_fan").geometry.clone();
|
// equMesh.geometry = this.equMap.get("equ_fan").geometry.clone();
|
||||||
// console.log(equMesh);
|
// console.log(equMesh);
|
||||||
|
|
||||||
|
|
||||||
const worldP = targetPoint.getWorldPosition(new this.THREE.Vector3());
|
const worldP = targetPoint.getWorldPosition(new this.THREE.Vector3());
|
||||||
equMesh.position.copy(worldP);
|
equMesh.position.copy(worldP);
|
||||||
equMesh.translateY(-0.6);
|
equMesh.translateY(-0.6);
|
||||||
@@ -213,15 +213,13 @@ function handleFanEqu(
|
|||||||
...equipmentInfo,
|
...equipmentInfo,
|
||||||
};
|
};
|
||||||
//我们把风机的附着点挂在原型上,这样应该可以进行处理
|
//我们把风机的附着点挂在原型上,这样应该可以进行处理
|
||||||
if (targetPoint.info.equipmentName.slice(0, 1) == '1') {
|
if (targetPoint.info.equipmentName.slice(0, 1) == "1") {
|
||||||
this.scene.Fan1targetPoint = targetPoint
|
this.scene.Fan1targetPoint = targetPoint;
|
||||||
} else {
|
} else {
|
||||||
this.scene.Fan2targetPoint = targetPoint
|
this.scene.Fan2targetPoint = targetPoint;
|
||||||
}
|
}
|
||||||
//这里感觉情况改变风机的颜色
|
//这里感觉情况改变风机的颜色
|
||||||
changeFanColor(fanData, targetPoint, this.scene)
|
changeFanColor(fanData, targetPoint, this.scene);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 定义风机旋转
|
// 定义风机旋转
|
||||||
const fanLeaf = equMesh.getObjectByName("fan_leafs");
|
const fanLeaf = equMesh.getObjectByName("fan_leafs");
|
||||||
@@ -240,7 +238,6 @@ function removeEquipment(targetPoint) {
|
|||||||
//删除设备这里需要再进行处理,就是根据附着点(附着点一定保存了当前添加设备的信息了)判断是不是分压阀,然后继续一样的隐藏
|
//删除设备这里需要再进行处理,就是根据附着点(附着点一定保存了当前添加设备的信息了)判断是不是分压阀,然后继续一样的隐藏
|
||||||
if (!targetPoint.hasDevice) return;
|
if (!targetPoint.hasDevice) return;
|
||||||
|
|
||||||
|
|
||||||
//删除我们这里使用行数来判断,即是不是删除到了我们的那一行呢?
|
//删除我们这里使用行数来判断,即是不是删除到了我们的那一行呢?
|
||||||
//如果删除到了我们那行的话,我们必须将行的数组从中去掉已存在的数据,然后将附着点列表中也去除这个点,然后将墙设置为false来让下次使用
|
//如果删除到了我们那行的话,我们必须将行的数组从中去掉已存在的数据,然后将附着点列表中也去除这个点,然后将墙设置为false来让下次使用
|
||||||
|
|
||||||
@@ -286,8 +283,6 @@ function removeEquipment(targetPoint) {
|
|||||||
// }
|
// }
|
||||||
// deleteItem(Allhang, Number(lineIndex))
|
// deleteItem(Allhang, Number(lineIndex))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log("测试是不是删除了");
|
console.log("测试是不是删除了");
|
||||||
const mesh = this.scene.getObjectById(targetPoint.info.id);
|
const mesh = this.scene.getObjectById(targetPoint.info.id);
|
||||||
this.scene.remove(mesh);
|
this.scene.remove(mesh);
|
||||||
@@ -298,13 +293,12 @@ function removeEquipment(targetPoint) {
|
|||||||
}
|
}
|
||||||
export { addEquipment, removeEquipment };
|
export { addEquipment, removeEquipment };
|
||||||
|
|
||||||
|
|
||||||
function deleteItem(array, item) {
|
function deleteItem(array, item) {
|
||||||
let index = array.indexOf(item);
|
let index = array.indexOf(item);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
array.splice(index, 1);
|
array.splice(index, 1);
|
||||||
}
|
}
|
||||||
return array
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 这里是改变风机颜色的代码
|
// 这里是改变风机颜色的代码
|
||||||
@@ -315,7 +309,7 @@ function changeFanColor(fanData, targetPoint, scene) {
|
|||||||
//if保证存在风机(即有长度再进行遍历)
|
//if保证存在风机(即有长度再进行遍历)
|
||||||
for (let i = 0; i < fanData.length; i++) {
|
for (let i = 0; i < fanData.length; i++) {
|
||||||
//先做匹配操作
|
//先做匹配操作
|
||||||
let fanType = fanData[i].equipmentType
|
let fanType = fanData[i].equipmentType;
|
||||||
//有符合条件的风机进来了
|
//有符合条件的风机进来了
|
||||||
if (targetPoint.info.typeKey == fanType) {
|
if (targetPoint.info.typeKey == fanType) {
|
||||||
//下面进行变色需要的逻辑判断了
|
//下面进行变色需要的逻辑判断了
|
||||||
@@ -327,9 +321,9 @@ function changeFanColor(fanData, targetPoint, scene) {
|
|||||||
// console.log(obj);
|
// console.log(obj);
|
||||||
// 判断子对象是否是物体,如果是,更改其颜色
|
// 判断子对象是否是物体,如果是,更改其颜色
|
||||||
if (obj.isMesh) {
|
if (obj.isMesh) {
|
||||||
obj.material.color.set(0xFF0000)
|
obj.material.color.set(0xff0000);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -342,9 +336,9 @@ function changeFanColor(fanData, targetPoint, scene) {
|
|||||||
// console.log(obj);
|
// console.log(obj);
|
||||||
// 判断子对象是否是物体,如果是,更改其颜色
|
// 判断子对象是否是物体,如果是,更改其颜色
|
||||||
if (obj.isMesh) {
|
if (obj.isMesh) {
|
||||||
obj.material.color.set(0x008000)
|
obj.material.color.set(0x008000);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
<div class="top-length">
|
<div class="top-length">
|
||||||
<span>隧道总长度: {{ tunnelLength }}米</span>
|
<span>隧道总长度: {{ tunnelLength }}米</span>
|
||||||
<span class="all-btn" @click="startSimulate" v-if="isStartSimulate"
|
<span class="all-btn" @click="startSimulate" v-if="isStartSimulate"
|
||||||
>开始模拟</span>
|
>开始模拟</span
|
||||||
|
>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<span class="all-btn" @click="simulatedBlasting">模拟爆破</span>
|
<span class="all-btn" @click="simulatedBlasting">模拟爆破</span>
|
||||||
<span class="all-btn" @click="endSimulate">结束模拟</span>
|
<span class="all-btn" @click="endSimulate">结束模拟</span>
|
||||||
@@ -14,19 +15,19 @@
|
|||||||
<!-- <span class="all-btn" :style="{color:!isPreview?'#f7b500':'#0BE9FA'}" @click="changeTunnelSimulateMode(false)">编辑模式</span>-->
|
<!-- <span class="all-btn" :style="{color:!isPreview?'#f7b500':'#0BE9FA'}" @click="changeTunnelSimulateMode(false)">编辑模式</span>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="top-right" v-if="isPreview">
|
<div class="top-right" v-if="isPreview">
|
||||||
<!-- <div class="current-site">-->
|
<!-- <div class="current-site">-->
|
||||||
<!-- <el-icon-->
|
<!-- <el-icon-->
|
||||||
<!-- size="50"-->
|
<!-- size="50"-->
|
||||||
<!-- color="#0BE9FA"-->
|
<!-- color="#0BE9FA"-->
|
||||||
<!-- style="margin-left: 50px; cursor: pointer"-->
|
<!-- style="margin-left: 50px; cursor: pointer"-->
|
||||||
<!-- @click="-->
|
<!-- @click="-->
|
||||||
<!-- isVisited = true;-->
|
<!-- isVisited = true;-->
|
||||||
<!-- getAlarmList();-->
|
<!-- getAlarmList();-->
|
||||||
<!-- "-->
|
<!-- "-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
<!-- <Bell/>-->
|
<!-- <Bell/>-->
|
||||||
<!-- </el-icon>-->
|
<!-- </el-icon>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div class="current-user">
|
<div class="current-user">
|
||||||
你好!<span>{{ currentUser }}</span>
|
你好!<span>{{ currentUser }}</span>
|
||||||
<span>今天是:{{ currentDate }}</span>
|
<span>今天是:{{ currentDate }}</span>
|
||||||
@@ -34,19 +35,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<device-manage v-if="showDevice" @cancel="cancelDeviceManage" @submit="submitDevice"/>
|
<device-manage
|
||||||
|
v-if="showDevice"
|
||||||
|
@cancel="cancelDeviceManage"
|
||||||
|
@submit="submitDevice"
|
||||||
|
/>
|
||||||
<!-- 模拟隧道模式-->
|
<!-- 模拟隧道模式-->
|
||||||
<preview-scene-simulate id="tunnel-box" :isedit="false" :device-data="largeScreenData" :tunnelLength="100"></preview-scene-simulate>
|
<preview-scene-simulate
|
||||||
|
id="tunnel-box"
|
||||||
|
:isedit="false"
|
||||||
|
:device-data="largeScreenData"
|
||||||
|
:tunnelLength="100"
|
||||||
|
:tunnelId="tunnelId"
|
||||||
|
></preview-scene-simulate>
|
||||||
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
||||||
<!-- <preview-scene-->
|
<!-- <preview-scene-->
|
||||||
<!-- id="tunnel-box"-->
|
<!-- id="tunnel-box"-->
|
||||||
<!-- :isedit="false"-->
|
<!-- :isedit="false"-->
|
||||||
<!-- :tunnelId="tunnelId"-->
|
<!-- :tunnelId="tunnelId"-->
|
||||||
<!-- :key="tunnelId"-->
|
<!-- :key="tunnelId"-->
|
||||||
<!-- :tunnelLen="tunnelLen"-->
|
<!-- :tunnelLen="tunnelLen"-->
|
||||||
<!-- :largeScreen="largeScreen"-->
|
<!-- :largeScreen="largeScreen"-->
|
||||||
<!-- :fanList="socketData.leftData"-->
|
<!-- :fanList="socketData.leftData"-->
|
||||||
<!-- ></preview-scene>-->
|
<!-- ></preview-scene>-->
|
||||||
<div class="left" v-if="isPreview">
|
<div class="left" v-if="isPreview">
|
||||||
<el-drawer
|
<el-drawer
|
||||||
v-model="drawerLeft"
|
v-model="drawerLeft"
|
||||||
@@ -66,12 +77,12 @@
|
|||||||
:loading="showFanLoading"
|
:loading="showFanLoading"
|
||||||
:tunnel-id="tunnelId"
|
:tunnel-id="tunnelId"
|
||||||
/>
|
/>
|
||||||
<!-- <used-ele-->
|
<!-- <used-ele-->
|
||||||
<!-- v-if="showFan"-->
|
<!-- v-if="showFan"-->
|
||||||
<!-- :list="socketData.leftData"-->
|
<!-- :list="socketData.leftData"-->
|
||||||
<!-- :loading="showUsedLoading"-->
|
<!-- :loading="showUsedLoading"-->
|
||||||
<!-- :ele-data="largeScreenData"-->
|
<!-- :ele-data="largeScreenData"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<div v-if="drawerLeft" class="left-arrow" @click="closeLeft"></div>
|
<div v-if="drawerLeft" class="left-arrow" @click="closeLeft"></div>
|
||||||
<div v-else class="shrink-left" @click="closeLeft"></div>
|
<div v-else class="shrink-left" @click="closeLeft"></div>
|
||||||
@@ -157,8 +168,8 @@
|
|||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
>
|
>
|
||||||
<el-option label="已读" :value="true"/>
|
<el-option label="已读" :value="true" />
|
||||||
<el-option label="未读" :value="false"/>
|
<el-option label="未读" :value="false" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -267,9 +278,9 @@ import AirInfo from "@/components/content/airInfo/AirInfo.vue";
|
|||||||
import BadGasInfo from "@/components/content/badGasInfo/BadGasInfo.vue";
|
import BadGasInfo from "@/components/content/badGasInfo/BadGasInfo.vue";
|
||||||
import ManageBtn from "@/components/manageBtn/index.vue";
|
import ManageBtn from "@/components/manageBtn/index.vue";
|
||||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||||
import {dateFormat} from "@/utils/date.js";
|
import { dateFormat } from "@/utils/date.js";
|
||||||
import {getToken} from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import {useAuthStore} from "@/store/userstore.js";
|
import { useAuthStore } from "@/store/userstore.js";
|
||||||
import {
|
import {
|
||||||
getLargeScreen,
|
getLargeScreen,
|
||||||
getLargeScreenInfo,
|
getLargeScreenInfo,
|
||||||
@@ -277,13 +288,19 @@ import {
|
|||||||
getAlarmInfo,
|
getAlarmInfo,
|
||||||
deleteAlarmSate,
|
deleteAlarmSate,
|
||||||
getAlarmDetail,
|
getAlarmDetail,
|
||||||
updateAlarmState, endSimulation, blastingSimulation,
|
updateAlarmState,
|
||||||
|
endSimulation,
|
||||||
|
blastingSimulation,
|
||||||
} from "@/api/largeScreen";
|
} from "@/api/largeScreen";
|
||||||
import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
|
import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
|
||||||
import {getUserInfo} from "@/api/login";
|
import { getUserInfo } from "@/api/login";
|
||||||
import {initSceneData} from "@/api/tunnelScene";
|
import { initSceneData } from "@/api/tunnelScene";
|
||||||
import {getScreenSimulateTunnel, getSimulateTunnelDetail, getTunnelList} from "@/api/tunnelManage";
|
import {
|
||||||
import {debounce} from "lodash";
|
getScreenSimulateTunnel,
|
||||||
|
getSimulateTunnelDetail,
|
||||||
|
getTunnelList,
|
||||||
|
} from "@/api/tunnelManage";
|
||||||
|
import { debounce } from "lodash";
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -382,9 +399,9 @@ const queryParams = reactive({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getUser();
|
getUser();
|
||||||
// getOtherInfo();
|
// getOtherInfo();
|
||||||
getScreenInfo(previewId)
|
getScreenInfo(previewId);
|
||||||
|
|
||||||
getBasicData(previewId)
|
getBasicData(previewId);
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
showFan.value = true;
|
showFan.value = true;
|
||||||
});
|
});
|
||||||
@@ -400,15 +417,15 @@ const cancelDeviceManage = () => {
|
|||||||
const submitDevice = () => {
|
const submitDevice = () => {
|
||||||
isStartSimulate.value = false;
|
isStartSimulate.value = false;
|
||||||
showDevice.value = false;
|
showDevice.value = false;
|
||||||
getScreenInfo(previewId)
|
getScreenInfo(previewId);
|
||||||
// initWebSocket()
|
// initWebSocket()
|
||||||
};
|
};
|
||||||
const simulatedBlasting =async () => {
|
const simulatedBlasting = async () => {
|
||||||
await blastingSimulation(previewId,10)
|
await blastingSimulation(previewId, 10);
|
||||||
};
|
};
|
||||||
const endSimulate =async () => {
|
const endSimulate = async () => {
|
||||||
isStartSimulate.value = true;
|
isStartSimulate.value = true;
|
||||||
await endSimulation(previewId)
|
await endSimulation(previewId);
|
||||||
};
|
};
|
||||||
const changeName = (id) => {
|
const changeName = (id) => {
|
||||||
for (let item of equipmentOption.value) {
|
for (let item of equipmentOption.value) {
|
||||||
@@ -540,12 +557,12 @@ const getBasicData = (id) => {
|
|||||||
tunnelLength.value = res.data.totalLength;
|
tunnelLength.value = res.data.totalLength;
|
||||||
serialNumber.value = res.data.serialNumber;
|
serialNumber.value = res.data.serialNumber;
|
||||||
constructionLength.value = res.data.constructionLength;
|
constructionLength.value = res.data.constructionLength;
|
||||||
initWebSocket()
|
initWebSocket();
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning(res.msg);
|
ElMessage.warning(res.msg);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const getScreenInfo = (id) => {
|
const getScreenInfo = (id) => {
|
||||||
if (id) {
|
if (id) {
|
||||||
@@ -590,7 +607,7 @@ const getScreenInfo = (id) => {
|
|||||||
showBadLoading.value = 1;
|
showBadLoading.value = 1;
|
||||||
}
|
}
|
||||||
largeScreenData.value = res.data;
|
largeScreenData.value = res.data;
|
||||||
console.log('largeScreenData.value', largeScreenData.value)
|
console.log("largeScreenData.value", largeScreenData.value);
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning(res.msg);
|
ElMessage.warning(res.msg);
|
||||||
}
|
}
|
||||||
@@ -631,7 +648,7 @@ const getTunnel = (id) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
const closeLeft = () => {
|
const closeLeft = () => {
|
||||||
drawerLeft.value = !drawerLeft.value;
|
drawerLeft.value = !drawerLeft.value;
|
||||||
};
|
};
|
||||||
@@ -650,7 +667,7 @@ const handleLogout = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const initWebSocket = () => {
|
const initWebSocket = () => {
|
||||||
let wsUrl = `ws://192.168.31.175:8000/wstunnel/websocket/simulate/${token}/123`
|
let wsUrl = `ws://192.168.31.175:8000/wstunnel/websocket/simulate/${token}/123`;
|
||||||
// let wsUrl = `ws://tunnel.feashow.com/api/websocket/simulate/${token}/${serialNumber.value}`;
|
// let wsUrl = `ws://tunnel.feashow.com/api/websocket/simulate/${token}/${serialNumber.value}`;
|
||||||
// let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
|
// let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
|
||||||
// let wsUrl = `ws://clay.frp.feashow.cn/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
|
// let wsUrl = `ws://clay.frp.feashow.cn/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export default defineConfig({
|
|||||||
// rewrite: (path) => path.replace(/^\/api/, ''),
|
// rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
// },
|
// },
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://web-tunnel.feashow.com/api',
|
target: 'http://frp.toomewhy.top:38000',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user