修改隧道颜色+预览模式的附着点距离显示
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div id="cvs" ref="content"></div>
|
||||
<dev-info ref="info" :devInfo="devInfo" />
|
||||
<pre-dialog ref="edit" @addEquipment="handleAddEqu" @removeEquipment="handleRemoveEqu" @cancel="handleCancel"
|
||||
:hasDev="hasDevice" :pointNum="pointNum" pointGap="500" :equipmentType="equipmentType"
|
||||
:hasDev="hasDevice" :pointNum="pointNum" :pointGap="pointGap" :equipmentType="equipmentType"
|
||||
:equipmentName="equipmentName" :equipmentValue="equipmentValue" />
|
||||
<el-dialog v-model="centerDialogVisible" width="30%" destroy-on-close center :show-close="false" style="
|
||||
margin: 20% auto;
|
||||
@@ -63,7 +63,7 @@ const loader = new OBJLoader();
|
||||
let hdrLoader = new RGBELoader();
|
||||
let backColorSet = three.sRGBEncoding;
|
||||
const modelStore = useModelSceneStore();
|
||||
const params = defineProps(["isedit", "tunnelId"]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
||||
const params = defineProps(["isedit", "tunnelId", "tunnelLen"]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
|
||||
|
||||
|
||||
|
||||
@@ -84,6 +84,16 @@ let isedit = ref(params.isedit)
|
||||
// });
|
||||
// };
|
||||
|
||||
let pointGap = reactive(params.tunnelLen.value);
|
||||
watch(
|
||||
() => params.tunnelLen,
|
||||
(now) => {
|
||||
params.tunnelLen = now;
|
||||
console.log(params.tunnelLen);
|
||||
pointGap = params.tunnelLen.value / 20;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
|
||||
watch(
|
||||
@@ -250,6 +260,16 @@ 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)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
const centerDialogVisible = ref(false);
|
||||
|
||||
@@ -200,6 +200,16 @@ 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)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
const centerDialogVisible = ref(false);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div id="main">
|
||||
<div class="box-top">
|
||||
<manage-btn v-model="selectIndex" @select="manageSelect" :list="routeList" v-if="showMenu"/>
|
||||
<manage-btn v-model="selectIndex" @select="manageSelect" :list="routeList" v-if="showMenu" />
|
||||
<div class="tunnel-title"></div>
|
||||
<!-- <manage-length class="tunnel-length"></manage-length>-->
|
||||
<div class="top-length">
|
||||
@@ -16,8 +16,8 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="item in siteList" :key="item.value" :command="item">{{
|
||||
item.label
|
||||
}}
|
||||
item.label
|
||||
}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
@@ -33,30 +33,34 @@
|
||||
<!-- <tunnel-scene id="tunnel-box" :isedit="false" /> -->
|
||||
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
||||
|
||||
<preview-scene id="tunnel-box" :isedit="false" :tunnelId="tunnelId" :key="tunnelId"></preview-scene>
|
||||
<preview-scene id="tunnel-box" :isedit="false" :tunnelId="tunnelId" :key="tunnelId"
|
||||
:tunnelLen="tunnelLen"></preview-scene>
|
||||
<div class="left">
|
||||
<el-drawer v-model="drawerLeft" direction="ltr" modal-class="modal-box" :modal="false" :show-close="false"
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<fan-info v-if="showFan" :list="socketData.leftData" :fan-data="largeScreenData"
|
||||
:transducer-data="largeScreenData" :loading="showFanLoading"/>
|
||||
<used-ele v-if="showFan" :list="socketData.leftData" :ele-data="largeScreenData"/>
|
||||
:transducer-data="largeScreenData" :loading="showFanLoading" />
|
||||
<used-ele v-if="showFan" :list="socketData.leftData" :ele-data="largeScreenData" />
|
||||
</el-drawer>
|
||||
<div v-if="drawerLeft" class="left-arrow" @click="closeLeft"></div>
|
||||
<div v-else class="shrink-left" @click="closeLeft"></div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-drawer v-model="drawerRight" direction="rtl" modal-class="modal-box" :modal="false" :show-close="false"
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData" :loading="showWindLoading"/>
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData"
|
||||
:loading="showWindLoading" />
|
||||
<air-info v-if="showFan" :list="socketData.sensor" :air-data="largeScreenData" />
|
||||
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" :tunnelId="tunnelId" :loading="showBadLoading"/>
|
||||
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" :tunnelId="tunnelId"
|
||||
:loading="showBadLoading" />
|
||||
</el-drawer>
|
||||
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
|
||||
<div v-else class="shrink-right" @click="closeRight"></div>
|
||||
</div>
|
||||
<div class="switch-btn">
|
||||
<div class="arrow" @click="previousBtn"></div>
|
||||
<el-carousel height="150px" type="card" ref="tunnelBtn" :autoplay="false" :initial-index="initialIndex" @change="changeTunnel" >
|
||||
<el-carousel height="150px" type="card" ref="tunnelBtn" :autoplay="false" :initial-index="initialIndex"
|
||||
@change="changeTunnel">
|
||||
<div class="btn">
|
||||
<el-carousel-item v-for="item in tunnelList" :key="item.value">
|
||||
{{ item.label }}
|
||||
@@ -76,13 +80,13 @@ import WindPressureList from "@/components/content/windPressure/WindPressureList
|
||||
import AirInfo from "@/components/content/airInfo/AirInfo.vue";
|
||||
import BadGasInfo from "@/components/content/badGasInfo/BadGasInfo.vue";
|
||||
import ManageBtn from "@/components/manageBtn/index.vue";
|
||||
import {dateFormat} from "@/utils/date.js";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {useAuthStore} from "@/store/userstore.js";
|
||||
import {getLargeScreen, getLargeScreenInfo, getTunnelBySiteId} from "@/api/largeScreen";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {getUserInfo} from "@/api/login";
|
||||
import {initSceneData} from "@/api/tunnelScene";
|
||||
import { dateFormat } from "@/utils/date.js";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { useAuthStore } from "@/store/userstore.js";
|
||||
import { getLargeScreen, getLargeScreenInfo, getTunnelBySiteId } from "@/api/largeScreen";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { getUserInfo } from "@/api/login";
|
||||
import { initSceneData } from "@/api/tunnelScene";
|
||||
const authStore = useAuthStore();
|
||||
const router = useRouter();
|
||||
const previewId = reactive(router.currentRoute.value.params.tunnelId)
|
||||
@@ -154,7 +158,7 @@ const socketData = reactive({
|
||||
sensor: [],
|
||||
});
|
||||
onMounted(() => {
|
||||
if(previewId){
|
||||
if (previewId) {
|
||||
getScreenInfo(previewId)
|
||||
|
||||
}
|
||||
@@ -191,13 +195,13 @@ const getOtherInfo = () => {
|
||||
currentSite.value = res.data.siteOption[0].label
|
||||
localStorage.setItem('site', currentSite.value)
|
||||
tunnelList.value = res.data.tunnelOption
|
||||
if(previewId){
|
||||
if (previewId) {
|
||||
tunnelList.value.forEach((item, index) => {
|
||||
if(item.value == previewId){
|
||||
if (item.value == previewId) {
|
||||
initialIndex.value = index
|
||||
}
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
getTunnel(res.data.siteOption[0].value)
|
||||
}
|
||||
}
|
||||
@@ -208,33 +212,33 @@ const getScreenInfo = (id) => {
|
||||
tunnelId.value = id
|
||||
getLargeScreen(id).then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
if(res.data.frequencyChangerList.length!==0){
|
||||
showFanLoading.value=0
|
||||
}else {
|
||||
showFanLoading.value=1
|
||||
if (res.data.frequencyChangerList.length !== 0) {
|
||||
showFanLoading.value = 0
|
||||
} else {
|
||||
showFanLoading.value = 1
|
||||
}
|
||||
if(res.data.windPressureSensorList.length!==0){
|
||||
showWindLoading.value=0
|
||||
}else {
|
||||
showWindLoading.value=1
|
||||
if (res.data.windPressureSensorList.length !== 0) {
|
||||
showWindLoading.value = 0
|
||||
} else {
|
||||
showWindLoading.value = 1
|
||||
}
|
||||
if(res.data.sensorList.length!==0){
|
||||
res.data.sensorList.forEach((item,index)=>{
|
||||
if (res.data.sensorList.length !== 0) {
|
||||
res.data.sensorList.forEach((item, index) => {
|
||||
if (
|
||||
item.equipmentType === "carbonDioxide" ||
|
||||
item.equipmentType === "carbonMonoxide" ||
|
||||
item.equipmentType === "hydrogenSulfide" ||
|
||||
item.equipmentType === "sulfurDioxide" ||
|
||||
item.equipmentType === "sulfurMonoxide" ||
|
||||
item.equipmentType === "nitrogenDioxide"
|
||||
item.equipmentType === "carbonDioxide" ||
|
||||
item.equipmentType === "carbonMonoxide" ||
|
||||
item.equipmentType === "hydrogenSulfide" ||
|
||||
item.equipmentType === "sulfurDioxide" ||
|
||||
item.equipmentType === "sulfurMonoxide" ||
|
||||
item.equipmentType === "nitrogenDioxide"
|
||||
) {
|
||||
showBadLoading.value=0
|
||||
}else {
|
||||
showBadLoading.value=1
|
||||
showBadLoading.value = 0
|
||||
} else {
|
||||
showBadLoading.value = 1
|
||||
}
|
||||
})
|
||||
}else {
|
||||
showBadLoading.value=1
|
||||
} else {
|
||||
showBadLoading.value = 1
|
||||
}
|
||||
largeScreenData.value = res.data;
|
||||
} else {
|
||||
@@ -262,9 +266,9 @@ const changeTunnel = (e) => {
|
||||
newObj = item
|
||||
}
|
||||
})
|
||||
showBadLoading.value=0
|
||||
showWindLoading.value=0
|
||||
showFanLoading.value=0
|
||||
showBadLoading.value = 0
|
||||
showWindLoading.value = 0
|
||||
showFanLoading.value = 0
|
||||
getScreenInfo(newObj.value)
|
||||
nextTick(() => {
|
||||
showFan.value = true;
|
||||
@@ -358,6 +362,9 @@ const initWebSocket = () => {
|
||||
}, 30000);
|
||||
};
|
||||
initWebSocket();
|
||||
|
||||
let tunnelLen = computed(() => tunnelLength);
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.el-drawer__header {
|
||||
|
||||
Reference in New Issue
Block a user