fix : 优化隧道模拟首页的隧道预览模式
This commit is contained in:
477
src/components/content/tunnelScene/TunnelSceneSimulate-back.vue
Normal file
477
src/components/content/tunnelScene/TunnelSceneSimulate-back.vue
Normal file
@@ -0,0 +1,477 @@
|
|||||||
|
<template>
|
||||||
|
<div id="scene">
|
||||||
|
<div id="cvs" ref="content"></div>
|
||||||
|
<dev-info ref="info" :devInfo="devInfo" />
|
||||||
|
<!-- 这里的预览模式需要做成不能修改的模式 -->
|
||||||
|
<!-- <edit-dialog-->
|
||||||
|
<!-- ref="edit"-->
|
||||||
|
<!-- @addEquipment="handleAddEqu"-->
|
||||||
|
<!-- @removeEquipment="handleRemoveEqu"-->
|
||||||
|
<!-- @cancel="handleCancel"-->
|
||||||
|
<!-- :hasDev="hasDevice"-->
|
||||||
|
<!-- :pointNum="pointNum"-->
|
||||||
|
<!-- :tunnelId="params.tunnelId"-->
|
||||||
|
<!-- :position="targetP?.name"-->
|
||||||
|
<!-- :hasEquipment="hasDevice"-->
|
||||||
|
<!-- :pointGap="pointGap"-->
|
||||||
|
<!-- :form="params.form"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- <el-dialog-->
|
||||||
|
<!-- v-model="centerDialogVisible"-->
|
||||||
|
<!-- width="30%"-->
|
||||||
|
<!-- destroy-on-close-->
|
||||||
|
<!-- center-->
|
||||||
|
<!-- :show-close="false"-->
|
||||||
|
<!-- style="-->
|
||||||
|
<!-- margin: 20% auto;-->
|
||||||
|
<!-- width: 569px;-->
|
||||||
|
<!-- height: 330px;-->
|
||||||
|
<!-- background: rgba(7, 35, 72, 0.79);-->
|
||||||
|
<!-- border-radius: 20px;-->
|
||||||
|
<!-- border: 2px solid #0f82af;-->
|
||||||
|
<!-- "-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <p id="remove-title">是否确定删除该设备</p>-->
|
||||||
|
<!-- <div class="btn">-->
|
||||||
|
<!-- <button @click="centerDialogVisible = false">取消</button>-->
|
||||||
|
<!-- <button @click="handleConfirmAddEqu">确定</button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </el-dialog>-->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import * as three from "three";
|
||||||
|
import ThreeDScene from "./sceneClass/demo.js";
|
||||||
|
import DevInfo from "./displayInfoComp/DevInfo.vue";
|
||||||
|
import EditDialog from "./editEquComp/editDialog.vue";
|
||||||
|
|
||||||
|
// 导入模模型加载器
|
||||||
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
||||||
|
// import { DRACOLoader } from "three/examples/jsm/loaders/dracoloader";
|
||||||
|
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
||||||
|
import * as TWEEN from "three/examples/jsm/libs/tween.module";
|
||||||
|
import {
|
||||||
|
CSS3DRenderer,
|
||||||
|
CSS3DSprite,
|
||||||
|
} from "three/addons/renderers/CSS3DRenderer.js";
|
||||||
|
// 引入CSS2渲染器CSS2DRenderer和CSS2模型对象CSS2DObject
|
||||||
|
|
||||||
|
import { OBJLoader } from "three/examples/jsm/loaders/OBJLoader";
|
||||||
|
import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
|
||||||
|
import {
|
||||||
|
onMounted,
|
||||||
|
reactive,
|
||||||
|
ref,
|
||||||
|
toRaw,
|
||||||
|
watch,
|
||||||
|
defineProps,
|
||||||
|
defineExpose,
|
||||||
|
} from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { useModelSceneStore } from "@/store/modelSceneStore";
|
||||||
|
import { getScreenSimulateTunnel } from "@/api/tunnelManage";
|
||||||
|
// 获取html标签跟随组件dom
|
||||||
|
const content = ref(null);
|
||||||
|
const info = ref(null);
|
||||||
|
const edit = ref(null);
|
||||||
|
let modelList = ref(null);
|
||||||
|
let demo; //定义demo对象
|
||||||
|
const loader = new OBJLoader();
|
||||||
|
let hdrLoader = new RGBELoader();
|
||||||
|
let backColorSet = three.sRGBEncoding;
|
||||||
|
const modelStore = useModelSceneStore();
|
||||||
|
const params = defineProps([
|
||||||
|
"isedit",
|
||||||
|
"tunnelId",
|
||||||
|
"tunnelLength",
|
||||||
|
"form",
|
||||||
|
"deviceData",
|
||||||
|
"devRealtimeData",
|
||||||
|
"simulateData",
|
||||||
|
"tunnelAlias",
|
||||||
|
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
||||||
|
|
||||||
|
let isedit = ref(params.isedit);
|
||||||
|
let tunnelId = reactive(params.tunnelId);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => params.tunnelLength,
|
||||||
|
(now) => {
|
||||||
|
params.tunnelLength = now;
|
||||||
|
// console.log(params.tunnelLength);
|
||||||
|
pointGap = now / 20;
|
||||||
|
// console.log(params.form.tunnelName);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
let pointGap = reactive(params.tunnelLength);
|
||||||
|
|
||||||
|
onMounted(handleMounted);
|
||||||
|
|
||||||
|
// 挂载后回调
|
||||||
|
async function handleMounted() {
|
||||||
|
const doms = [info.value.$el];//edit.value.$el
|
||||||
|
demo = new ThreeDScene(three, content.value);
|
||||||
|
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
|
||||||
|
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
|
||||||
|
demo.isedit =false;
|
||||||
|
const loaded = await demo.loadModel(
|
||||||
|
GLTFLoader,
|
||||||
|
"/tunnelModel/chanel-have-wall-now-use.gltf",
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
demo.addOrbitControls(OrbitControls, true);
|
||||||
|
demo.addTween(TWEEN);
|
||||||
|
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
|
||||||
|
demo.setDistance(10);
|
||||||
|
// lClickCallback(demo); //绑定左键回调
|
||||||
|
// rClickCallback(demo); //绑定右键回调
|
||||||
|
|
||||||
|
//加载HDR背景图片
|
||||||
|
demo.loadBackground(hdrLoader, backColorSet);
|
||||||
|
|
||||||
|
// 初始化设备模型
|
||||||
|
try {
|
||||||
|
const map = new Map();
|
||||||
|
map.set("equ_fan", await loadModel("/devicesModel/model2.obj"));
|
||||||
|
map.set("equ_sensors", await loadModel("/devicesModel/sensors.obj"));
|
||||||
|
demo.initDevicesModel(map);
|
||||||
|
// 初始化渲染设备
|
||||||
|
// modelList.value = await modelStore.initModelData(
|
||||||
|
// params.tunnelId,
|
||||||
|
// params.form
|
||||||
|
// );
|
||||||
|
modelList.value = [
|
||||||
|
{
|
||||||
|
typeKey: "frequency",
|
||||||
|
position: "point_001_tr",
|
||||||
|
threshold: "",
|
||||||
|
equipmentId: 3048,
|
||||||
|
equipmentName: "温度传感器",
|
||||||
|
equipmentType: "sensor",
|
||||||
|
data: 100, //实时数据
|
||||||
|
unit: "℃", //单位
|
||||||
|
},
|
||||||
|
{
|
||||||
|
typeKey: "temperature",
|
||||||
|
position: "point_020_tr",
|
||||||
|
threshold: "",
|
||||||
|
equipmentId: 10,
|
||||||
|
equipmentName: "1度传感器",
|
||||||
|
equipmentType: "sensor",
|
||||||
|
data: 10, //实时参数
|
||||||
|
unit: "%", //单位
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 初始化仿真參數
|
||||||
|
const { data } = await getScreenSimulateTunnel(params.tunnelId);
|
||||||
|
const modeData = randomPosition([
|
||||||
|
...data.frequencyChangerList,
|
||||||
|
...data.windPressureSensorList,
|
||||||
|
...data.sensorList,
|
||||||
|
]).map((item) => ({
|
||||||
|
...item,
|
||||||
|
data:'10',
|
||||||
|
equipmentType: item.equipmentType.startsWith("frequency")
|
||||||
|
? "frequency"
|
||||||
|
: "sensor",
|
||||||
|
}));
|
||||||
|
console.log('modeData',modeData)
|
||||||
|
demo.editTunnelInit(modeData);
|
||||||
|
// 初始化标牌信息
|
||||||
|
demo.SignsInf(params.tunnelAlias, 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));
|
||||||
|
} 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) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
loader.load(
|
||||||
|
path,
|
||||||
|
(obj) => {
|
||||||
|
resolve(obj);
|
||||||
|
},
|
||||||
|
(xhr) => {},
|
||||||
|
(err) => {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let hasDevice = ref(true);
|
||||||
|
let devInfo = reactive({
|
||||||
|
meshId: null,
|
||||||
|
name: "无",
|
||||||
|
state: "无",
|
||||||
|
position: "无",
|
||||||
|
});
|
||||||
|
|
||||||
|
// 对象建构赋值功能
|
||||||
|
function editDevInfo(
|
||||||
|
value = {
|
||||||
|
meshId: null,
|
||||||
|
name: "无",
|
||||||
|
state: "无",
|
||||||
|
position: "无",
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
devInfo.meshId = value.meshId;
|
||||||
|
devInfo.name = value.name;
|
||||||
|
devInfo.state = value.state;
|
||||||
|
devInfo.position = value.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
//左键/双击左键回调函数
|
||||||
|
function lClickCallback(demo) {
|
||||||
|
// console.log('左键点击查看信息');
|
||||||
|
|
||||||
|
//demo动态添加函数,为操作组件内部
|
||||||
|
function displayDevInfo(targetPoint = null) {
|
||||||
|
hasDevice.value = targetPoint.hasDevice;
|
||||||
|
if (!targetPoint.info) {
|
||||||
|
editDevInfo();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
editDevInfo(targetPoint.info);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 传给内部使用
|
||||||
|
demo.addFunction("displayDevInfo", displayDevInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
let pointNum = ref(0);
|
||||||
|
let targetP = ref({});
|
||||||
|
|
||||||
|
// 右键点击附着点后调函数
|
||||||
|
function rClickCallback(demo) {
|
||||||
|
function editDev(targetPoint = null) {
|
||||||
|
hasDevice.value = targetPoint.hasDevice;
|
||||||
|
targetP.value = targetPoint;
|
||||||
|
pointNum.value = Number(
|
||||||
|
targetPoint.name.substring(
|
||||||
|
targetPoint.name.indexOf("_") + 1,
|
||||||
|
targetPoint.name.lastIndexOf("_")
|
||||||
|
) - 1
|
||||||
|
);
|
||||||
|
if (!targetPoint.info) return;
|
||||||
|
editDevInfo(targetPoint.info);
|
||||||
|
}
|
||||||
|
|
||||||
|
demo.addFunction("editDev", editDev);
|
||||||
|
}
|
||||||
|
|
||||||
|
// function streetSigns(){
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 场景添加设备
|
||||||
|
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)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
const centerDialogVisible = ref(false);
|
||||||
|
|
||||||
|
// 删除设备
|
||||||
|
function handleRemoveEqu() {
|
||||||
|
if (!targetP.value.hasDevice) {
|
||||||
|
ElMessage({
|
||||||
|
message: "该点位不存在设备!",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
centerDialogVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对话框确认删除
|
||||||
|
function handleConfirmAddEqu() {
|
||||||
|
console.log("target:", targetP.value.info);
|
||||||
|
modelStore
|
||||||
|
.deleteEquipment(targetP.value.info.equipmentId, pointGap)
|
||||||
|
.then((res) => {
|
||||||
|
demo.removeEquipment(targetP.value);
|
||||||
|
centerDialogVisible.value = false;
|
||||||
|
handleCancel();
|
||||||
|
ElMessage({
|
||||||
|
message: "删除成功!",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
console.log(res);
|
||||||
|
ElMessage({
|
||||||
|
message: "删除失败!",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理取消关闭编辑框事件
|
||||||
|
function handleCancel() {
|
||||||
|
if (!demo) return;
|
||||||
|
// 关闭标签
|
||||||
|
demo.isControlOrbit(true);
|
||||||
|
demo._resetState();
|
||||||
|
demo.clearTagsObj();
|
||||||
|
}
|
||||||
|
|
||||||
|
//现在首先有二种方案,是写在TunnelScene.vue中还是demo.js中呢?
|
||||||
|
//我认为可能看数据在哪获取?到时候看在哪里导入,首先我们放在TunnelScene里面吧
|
||||||
|
//因为没获取到接口,我们先写死!!!
|
||||||
|
//需要参考接口的数据结构!!!,主要是传入函数的参数应该是什么结构???
|
||||||
|
const ThreeConfig = {
|
||||||
|
code: 0,
|
||||||
|
data: {
|
||||||
|
tunnelThreeConfig: [
|
||||||
|
{
|
||||||
|
equipmentId: "fan_01", //传感器id
|
||||||
|
equipmentName: "01", //设备名称
|
||||||
|
pointName: "point_005_tl", //附着点名称(定位)
|
||||||
|
equipmentType: "fan", //设备类型(类型可根据后端
|
||||||
|
equipmentValue: 23, //设备存的值
|
||||||
|
},
|
||||||
|
{
|
||||||
|
equipmentId: "sensors_01", //传感器id
|
||||||
|
equipmentName: "01", //设备名称
|
||||||
|
pointName: "point_009_bl", //附着点名称(定位)
|
||||||
|
equipmentType: "sensors", //设备类型(类型可根据后端
|
||||||
|
equipmentValue: 67, //设备存的值
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
msg: "dda",
|
||||||
|
};
|
||||||
|
|
||||||
|
//=================实时更新数据
|
||||||
|
watch(params.devRealtimeData, () => {
|
||||||
|
// console.log("devRealtimeData:", params.devRealtimeData);
|
||||||
|
});
|
||||||
|
defineExpose({
|
||||||
|
rerender,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
#scene {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
#cvs {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#remove-title {
|
||||||
|
height: 42px;
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: MicrosoftYaHei, MicrosoftYaHei;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #08b7b8;
|
||||||
|
line-height: 42px;
|
||||||
|
letter-spacing: 3px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 65px 0px 70px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 80px;
|
||||||
|
|
||||||
|
:nth-child(1) {
|
||||||
|
width: 190px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 11px;
|
||||||
|
border: 2px solid #0f82af;
|
||||||
|
font-size: 28px;
|
||||||
|
font-family: MicrosoftYaHei;
|
||||||
|
color: #08b7b8;
|
||||||
|
line-height: 37px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
:nth-child(2) {
|
||||||
|
width: 190px;
|
||||||
|
height: 60px;
|
||||||
|
background: #08b7b8;
|
||||||
|
border-radius: 11px;
|
||||||
|
font-size: 28px;
|
||||||
|
font-family: MicrosoftYaHei, MicrosoftYaHei;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
line-height: 37px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,40 +3,40 @@
|
|||||||
<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"-->
|
||||||
@addEquipment="handleAddEqu"
|
<!-- @addEquipment="handleAddEqu"-->
|
||||||
@removeEquipment="handleRemoveEqu"
|
<!-- @removeEquipment="handleRemoveEqu"-->
|
||||||
@cancel="handleCancel"
|
<!-- @cancel="handleCancel"-->
|
||||||
:hasDev="hasDevice"
|
<!-- :hasDev="hasDevice"-->
|
||||||
:pointNum="pointNum"
|
<!-- :pointNum="pointNum"-->
|
||||||
:tunnelId="params.tunnelId"
|
<!-- :tunnelId="params.tunnelId"-->
|
||||||
:position="targetP?.name"
|
<!-- :position="targetP?.name"-->
|
||||||
:hasEquipment="hasDevice"
|
<!-- :hasEquipment="hasDevice"-->
|
||||||
:pointGap="pointGap"
|
<!-- :pointGap="pointGap"-->
|
||||||
:form="params.form"
|
<!-- :form="params.form"-->
|
||||||
/>
|
<!-- />-->
|
||||||
<el-dialog
|
<!-- <el-dialog-->
|
||||||
v-model="centerDialogVisible"
|
<!-- v-model="centerDialogVisible"-->
|
||||||
width="30%"
|
<!-- width="30%"-->
|
||||||
destroy-on-close
|
<!-- destroy-on-close-->
|
||||||
center
|
<!-- center-->
|
||||||
:show-close="false"
|
<!-- :show-close="false"-->
|
||||||
style="
|
<!-- style="-->
|
||||||
margin: 20% auto;
|
<!-- margin: 20% auto;-->
|
||||||
width: 569px;
|
<!-- width: 569px;-->
|
||||||
height: 330px;
|
<!-- height: 330px;-->
|
||||||
background: rgba(7, 35, 72, 0.79);
|
<!-- background: rgba(7, 35, 72, 0.79);-->
|
||||||
border-radius: 20px;
|
<!-- border-radius: 20px;-->
|
||||||
border: 2px solid #0f82af;
|
<!-- border: 2px solid #0f82af;-->
|
||||||
"
|
<!-- "-->
|
||||||
>
|
<!-- >-->
|
||||||
<p id="remove-title">是否确定删除该设备</p>
|
<!-- <p id="remove-title">是否确定删除该设备</p>-->
|
||||||
<div class="btn">
|
<!-- <div class="btn">-->
|
||||||
<button @click="centerDialogVisible = false">取消</button>
|
<!-- <button @click="centerDialogVisible = false">取消</button>-->
|
||||||
<button @click="handleConfirmAddEqu">确定</button>
|
<!-- <button @click="handleConfirmAddEqu">确定</button>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-dialog>
|
<!-- </el-dialog>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -89,6 +89,7 @@ const params = defineProps([
|
|||||||
"deviceData",
|
"deviceData",
|
||||||
"devRealtimeData",
|
"devRealtimeData",
|
||||||
"simulateData",
|
"simulateData",
|
||||||
|
"tunnelAlias",
|
||||||
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
||||||
|
|
||||||
let isedit = ref(params.isedit);
|
let isedit = ref(params.isedit);
|
||||||
@@ -111,7 +112,7 @@ onMounted(handleMounted);
|
|||||||
|
|
||||||
// 挂载后回调
|
// 挂载后回调
|
||||||
async function handleMounted() {
|
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中的初始化中进行)
|
||||||
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
|
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
|
||||||
@@ -125,8 +126,8 @@ async function handleMounted() {
|
|||||||
demo.addTween(TWEEN);
|
demo.addTween(TWEEN);
|
||||||
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
|
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
|
||||||
demo.setDistance(10);
|
demo.setDistance(10);
|
||||||
lClickCallback(demo); //绑定左键回调
|
// lClickCallback(demo); //绑定左键回调
|
||||||
rClickCallback(demo); //绑定右键回调
|
// rClickCallback(demo); //绑定右键回调
|
||||||
|
|
||||||
//加载HDR背景图片
|
//加载HDR背景图片
|
||||||
demo.loadBackground(hdrLoader, backColorSet);
|
demo.loadBackground(hdrLoader, backColorSet);
|
||||||
@@ -142,19 +143,6 @@ async function handleMounted() {
|
|||||||
// params.tunnelId,
|
// params.tunnelId,
|
||||||
// params.form
|
// params.form
|
||||||
// );
|
// );
|
||||||
//todo 父组件传的设备数据params.deviceData
|
|
||||||
// const newModelList=[...params.deviceData.frequencyChangerList,...params.deviceData.windPressureSensorList, ...params.deviceData.sensorList]
|
|
||||||
// newModelList.map((item,index1)=>{
|
|
||||||
// const index=index1+1
|
|
||||||
// item.threshold=""
|
|
||||||
// if(index<newModelList.length/2){
|
|
||||||
// item.position="point_0"+(index<10?"0"+index:index)+"_tr"
|
|
||||||
// }else{
|
|
||||||
// item.position="point_0"+(index<10?"0"+index:index)+"_tl"
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
//
|
|
||||||
// console.log('parmas',newModelList)
|
|
||||||
modelList.value = [
|
modelList.value = [
|
||||||
{
|
{
|
||||||
typeKey: "frequency",
|
typeKey: "frequency",
|
||||||
@@ -186,13 +174,15 @@ async function handleMounted() {
|
|||||||
...data.sensorList,
|
...data.sensorList,
|
||||||
]).map((item) => ({
|
]).map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
|
data:'10',
|
||||||
equipmentType: item.equipmentType.startsWith("frequency")
|
equipmentType: item.equipmentType.startsWith("frequency")
|
||||||
? "frequency"
|
? "frequency"
|
||||||
: "sensor",
|
: "sensor",
|
||||||
}));
|
}));
|
||||||
|
console.log('modeData',modeData)
|
||||||
demo.editTunnelInit(modeData);
|
demo.editTunnelInit(modeData);
|
||||||
// 初始化标牌信息
|
// 初始化标牌信息
|
||||||
demo.SignsInf("dsadsa", String(params.tunnelLength));
|
demo.SignsInf(params.tunnelAlias, String(params.tunnelLength));
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<div id="main">
|
<div id="main">
|
||||||
<div class="box-top">
|
<div class="box-top">
|
||||||
<!-- <manage-btn v-model="selectIndex" @select="manageSelect" :list="routeList" v-if="showMenu&&isPreview" />-->
|
<!-- <manage-btn v-model="selectIndex" @select="manageSelect" :list="routeList" v-if="showMenu&&isPreview" />-->
|
||||||
<tunnel-title v-if="showTunnelTitle" />
|
<tunnel-title v-if="showTunnelTitle"/>
|
||||||
<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>
|
||||||
@@ -36,17 +36,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<device-manage
|
<device-manage
|
||||||
v-if="showDevice"
|
v-if="showDevice"
|
||||||
@cancel="cancelDeviceManage"
|
@cancel="cancelDeviceManage"
|
||||||
@submit="submitDevice"
|
@submit="submitDevice"
|
||||||
/>
|
/>
|
||||||
<!-- 模拟隧道模式-->
|
<!-- 模拟隧道模式-->
|
||||||
<preview-scene-simulate
|
<preview-scene-simulate
|
||||||
id="tunnel-box"
|
ref="previewRef"
|
||||||
:isedit="false"
|
id="tunnel-box"
|
||||||
:device-data="largeScreenData"
|
:isedit="false"
|
||||||
:tunnelLength="100"
|
:device-data="largeScreenData"
|
||||||
:tunnelId="tunnelId"
|
:tunnelLength="tunnelLength"
|
||||||
|
:tunnelId="tunnelId"
|
||||||
|
:tunnelAlias="tunnelAlias"
|
||||||
></preview-scene-simulate>
|
></preview-scene-simulate>
|
||||||
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
||||||
<!-- <preview-scene-->
|
<!-- <preview-scene-->
|
||||||
@@ -60,22 +62,22 @@
|
|||||||
<!-- ></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"
|
||||||
direction="ltr"
|
direction="ltr"
|
||||||
modal-class="modal-box"
|
modal-class="modal-box"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
>
|
>
|
||||||
<fan-info
|
<fan-info
|
||||||
v-if="showFan"
|
v-if="showFan"
|
||||||
:list="socketData.leftData"
|
:list="socketData.leftData"
|
||||||
:isSimulate="true"
|
:isSimulate="true"
|
||||||
:fan-data="largeScreenData"
|
:fan-data="largeScreenData"
|
||||||
:transducer-data="largeScreenData"
|
:transducer-data="largeScreenData"
|
||||||
:loading="showFanLoading"
|
:loading="showFanLoading"
|
||||||
:tunnel-id="tunnelId"
|
:tunnel-id="tunnelId"
|
||||||
/>
|
/>
|
||||||
<!-- <used-ele-->
|
<!-- <used-ele-->
|
||||||
<!-- v-if="showFan"-->
|
<!-- v-if="showFan"-->
|
||||||
@@ -89,35 +91,35 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right" v-if="isPreview">
|
<div class="right" v-if="isPreview">
|
||||||
<el-drawer
|
<el-drawer
|
||||||
v-model="drawerRight"
|
v-model="drawerRight"
|
||||||
direction="rtl"
|
direction="rtl"
|
||||||
modal-class="modal-box"
|
modal-class="modal-box"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
>
|
>
|
||||||
<wind-pressure-list
|
<wind-pressure-list
|
||||||
v-if="showFan"
|
v-if="showFan"
|
||||||
:list="socketData.windPressure"
|
:list="socketData.windPressure"
|
||||||
:isSimulate="true"
|
:isSimulate="true"
|
||||||
:win-data="largeScreenData"
|
:win-data="largeScreenData"
|
||||||
:loading="showWindLoading"
|
:loading="showWindLoading"
|
||||||
/>
|
/>
|
||||||
<air-info
|
<air-info
|
||||||
v-if="showFan"
|
v-if="showFan"
|
||||||
:list="socketData.sensor"
|
:list="socketData.sensor"
|
||||||
:windSpeed="socketData.windSpeed"
|
:windSpeed="socketData.windSpeed"
|
||||||
:isSimulate="true"
|
:isSimulate="true"
|
||||||
:air-data="largeScreenData"
|
:air-data="largeScreenData"
|
||||||
/>
|
/>
|
||||||
<bad-gas-info
|
<bad-gas-info
|
||||||
v-if="showFan"
|
v-if="showFan"
|
||||||
:list="socketData.sensor"
|
:list="socketData.sensor"
|
||||||
:bad-gas-data="largeScreenData"
|
:bad-gas-data="largeScreenData"
|
||||||
:isSimulate="true"
|
:isSimulate="true"
|
||||||
:tunnelId="tunnelId"
|
:tunnelId="tunnelId"
|
||||||
:loading="showBadLoading"
|
:loading="showBadLoading"
|
||||||
/>
|
/>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
|
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
|
||||||
@@ -126,10 +128,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="alarm-dialog alarm-tunnel">
|
<div class="alarm-dialog alarm-tunnel">
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
v-model="isDetailVisited"
|
v-model="isDetailVisited"
|
||||||
title="报警信息详情"
|
title="报警信息详情"
|
||||||
width="1500px"
|
width="1500px"
|
||||||
>
|
>
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
<div>报警时间:</div>
|
<div>报警时间:</div>
|
||||||
@@ -143,33 +145,33 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="alarm-tunnel">
|
<div class="alarm-tunnel">
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
v-model="isVisited"
|
v-model="isVisited"
|
||||||
title="报警信息"
|
title="报警信息"
|
||||||
width="2175px"
|
width="2175px"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
>
|
>
|
||||||
<div class="left-top-icon"></div>
|
<div class="left-top-icon"></div>
|
||||||
<div class="right-top-icon"></div>
|
<div class="right-top-icon"></div>
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
inline
|
inline
|
||||||
class="query-form"
|
class="query-form"
|
||||||
ref="queryForm"
|
ref="queryForm"
|
||||||
@submit.prevent="getAlarmList"
|
@submit.prevent="getAlarmList"
|
||||||
v-if="roleKey !== 'administrator'"
|
v-if="roleKey !== 'administrator'"
|
||||||
>
|
>
|
||||||
<el-form-item label="查阅状态" prop="lookupStatus">
|
<el-form-item label="查阅状态" prop="lookupStatus">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.lookupStatus"
|
v-model="queryParams.lookupStatus"
|
||||||
placeholder="请选择查阅状态"
|
placeholder="请选择查阅状态"
|
||||||
:fit-input-width="true"
|
:fit-input-width="true"
|
||||||
:teleported="false"
|
:teleported="false"
|
||||||
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>
|
||||||
@@ -178,87 +180,87 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div
|
<div
|
||||||
class="device-table"
|
class="device-table"
|
||||||
:style="{ marginTop: roleKey === 'administrator' ? '40px' : '0' }"
|
:style="{ marginTop: roleKey === 'administrator' ? '40px' : '0' }"
|
||||||
>
|
>
|
||||||
<el-table
|
<el-table
|
||||||
stripe
|
stripe
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:empty-text="tableEmptyText"
|
:empty-text="tableEmptyText"
|
||||||
style="background-color: #011c29; --el-table-border-color: none"
|
style="background-color: #011c29; --el-table-border-color: none"
|
||||||
:header-cell-style="{
|
:header-cell-style="{
|
||||||
backgroundColor: '#064B66',
|
backgroundColor: '#064B66',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontSize: '40px',
|
fontSize: '40px',
|
||||||
borderBottom: 'none',
|
borderBottom: 'none',
|
||||||
}"
|
}"
|
||||||
:data="alarmList"
|
:data="alarmList"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="tunnelName"
|
prop="tunnelName"
|
||||||
label="隧道名称"
|
label="隧道名称"
|
||||||
align="center"
|
align="center"
|
||||||
width="400px"
|
width="400px"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="alarmContent"
|
prop="alarmContent"
|
||||||
label="告警信息"
|
label="告警信息"
|
||||||
align="center"
|
align="center"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="alarmTime"
|
prop="alarmTime"
|
||||||
label="告警时间"
|
label="告警时间"
|
||||||
align="center"
|
align="center"
|
||||||
width="480px"
|
width="480px"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="lookupStatus"
|
prop="lookupStatus"
|
||||||
label="查阅状态"
|
label="查阅状态"
|
||||||
align="center"
|
align="center"
|
||||||
width="200px"
|
width="200px"
|
||||||
v-if="roleKey !== 'administrator'"
|
v-if="roleKey !== 'administrator'"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag :type="scope.row.lookupStatus ? 'success' : 'warning'"
|
<el-tag :type="scope.row.lookupStatus ? 'success' : 'warning'"
|
||||||
>{{ scope.row.lookupStatus ? "已读" : "未读" }}
|
>{{ scope.row.lookupStatus ? "已读" : "未读" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="300px">
|
<el-table-column label="操作" align="center" width="300px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="mini"
|
size="mini"
|
||||||
style="font-weight: bold"
|
style="font-weight: bold"
|
||||||
@click="handleView(scope.row)"
|
@click="handleView(scope.row)"
|
||||||
link
|
link
|
||||||
>详情
|
>详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-if="roleKey !== 'administrator'"
|
v-if="roleKey !== 'administrator'"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
link
|
link
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div
|
<div
|
||||||
class="pagination"
|
class="pagination"
|
||||||
:style="{ bottom: roleKey === 'administrator' ? '40px' : '0' }"
|
:style="{ bottom: roleKey === 'administrator' ? '40px' : '0' }"
|
||||||
>
|
>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
background
|
background
|
||||||
v-model:current-page="pageInfo.pageNum"
|
v-model:current-page="pageInfo.pageNum"
|
||||||
v-model:page-size="pageInfo.pageSize"
|
v-model:page-size="pageInfo.pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
prev-text="上一页"
|
prev-text="上一页"
|
||||||
next-text="下一页"
|
next-text="下一页"
|
||||||
layout="prev, pager, next"
|
layout="prev, pager, next"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:hide-on-single-page="true"
|
:hide-on-single-page="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -278,9 +280,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,
|
||||||
@@ -292,15 +294,15 @@ import {
|
|||||||
endSimulation,
|
endSimulation,
|
||||||
blastingSimulation,
|
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 {
|
import {
|
||||||
getScreenSimulateTunnel,
|
getScreenSimulateTunnel,
|
||||||
getSimulateTunnelDetail,
|
getSimulateTunnelDetail,
|
||||||
getTunnelList,
|
getTunnelList,
|
||||||
} from "@/api/tunnelManage";
|
} from "@/api/tunnelManage";
|
||||||
import { debounce } from "lodash";
|
import {debounce} from "lodash";
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -308,6 +310,7 @@ const previewId = reactive(router.currentRoute.value.params.tunnelId);
|
|||||||
const siteId = reactive(router.currentRoute.value.params.siteId);
|
const siteId = reactive(router.currentRoute.value.params.siteId);
|
||||||
const tunnelIdFlag = reactive(router.currentRoute.value.params.tunnelId);
|
const tunnelIdFlag = reactive(router.currentRoute.value.params.tunnelId);
|
||||||
const selectIndex = ref(-1);
|
const selectIndex = ref(-1);
|
||||||
|
const previewRef = ref();
|
||||||
const isVisited = ref(false);
|
const isVisited = ref(false);
|
||||||
const isDetailVisited = ref(false);
|
const isDetailVisited = ref(false);
|
||||||
const showFan = ref(false);
|
const showFan = ref(false);
|
||||||
@@ -338,6 +341,7 @@ const tunnelBtn = ref();
|
|||||||
const tunnelList = ref([]);
|
const tunnelList = ref([]);
|
||||||
const tunnelId = ref(0);
|
const tunnelId = ref(0);
|
||||||
const tunnelLength = ref(0);
|
const tunnelLength = ref(0);
|
||||||
|
const tunnelAlias = ref('');
|
||||||
const constructionLength = ref(0);
|
const constructionLength = ref(0);
|
||||||
const routeList = ref([]);
|
const routeList = ref([]);
|
||||||
let socket = reactive("");
|
let socket = reactive("");
|
||||||
@@ -419,6 +423,9 @@ const submitDevice = () => {
|
|||||||
showDevice.value = false;
|
showDevice.value = false;
|
||||||
getScreenInfo(previewId);
|
getScreenInfo(previewId);
|
||||||
// initWebSocket()
|
// initWebSocket()
|
||||||
|
nextTick(() => {
|
||||||
|
previewRef.value.rerender()
|
||||||
|
})
|
||||||
};
|
};
|
||||||
const simulatedBlasting = async () => {
|
const simulatedBlasting = async () => {
|
||||||
await blastingSimulation(previewId, 10);
|
await blastingSimulation(previewId, 10);
|
||||||
@@ -555,6 +562,7 @@ const getBasicData = (id) => {
|
|||||||
getSimulateTunnelDetail(id).then((res) => {
|
getSimulateTunnelDetail(id).then((res) => {
|
||||||
if (res?.code === 1000) {
|
if (res?.code === 1000) {
|
||||||
tunnelLength.value = res.data.totalLength;
|
tunnelLength.value = res.data.totalLength;
|
||||||
|
tunnelAlias.value = res.data.tunnelAlias;
|
||||||
serialNumber.value = res.data.serialNumber;
|
serialNumber.value = res.data.serialNumber;
|
||||||
constructionLength.value = res.data.constructionLength;
|
constructionLength.value = res.data.constructionLength;
|
||||||
initWebSocket();
|
initWebSocket();
|
||||||
@@ -590,13 +598,13 @@ const getScreenInfo = (id) => {
|
|||||||
// })
|
// })
|
||||||
res.data.sensorList.forEach((item) => {
|
res.data.sensorList.forEach((item) => {
|
||||||
if (
|
if (
|
||||||
item.equipmentType === "dust" ||
|
item.equipmentType === "dust" ||
|
||||||
item.equipmentType === "carbonDioxide" ||
|
item.equipmentType === "carbonDioxide" ||
|
||||||
item.equipmentType === "carbonMonoxide" ||
|
item.equipmentType === "carbonMonoxide" ||
|
||||||
item.equipmentType === "hydrogenSulfide" ||
|
item.equipmentType === "hydrogenSulfide" ||
|
||||||
item.equipmentType === "sulfurDioxide" ||
|
item.equipmentType === "sulfurDioxide" ||
|
||||||
item.equipmentType === "sulfurMonoxide" ||
|
item.equipmentType === "sulfurMonoxide" ||
|
||||||
item.equipmentType === "nitrogenDioxide"
|
item.equipmentType === "nitrogenDioxide"
|
||||||
) {
|
) {
|
||||||
showBadLoading.value = 0;
|
showBadLoading.value = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user