初始化功能还在做

This commit is contained in:
Hcat1314
2023-12-17 00:25:10 +08:00
parent fdecc480ec
commit 907f4cc220
2 changed files with 71 additions and 63 deletions

View File

@@ -2,30 +2,16 @@
<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"
pointGap="500"
/>
<el-dialog
v-model="centerDialogVisible"
width="30%"
destroy-on-close
center
:show-close="false"
style="
<edit-dialog ref="edit" @addEquipment="handleAddEqu" @removeEquipment="handleRemoveEqu" @cancel="handleCancel"
:hasDev="hasDevice" :pointNum="pointNum" pointGap="500" />
<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>
@@ -108,7 +94,7 @@ function loadModel(path) {
(obj) => {
resolve(obj);
},
(xhr) => {},
(xhr) => { },
(err) => {
reject(err);
}
@@ -174,6 +160,8 @@ function rClickCallback(demo) {
demo.addFunction("editDev", editDev);
}
// 添加设备
function handleAddEqu(formInfo) {
if (!formInfo.equipmentType) {
@@ -221,6 +209,53 @@ function handleCancel() {
demo._resetState();
demo.clearTagsObj();
}
//现在首先有二种方案是写在TunnelScene.vue中还是demo.js中呢
//我认为可能看数据在哪获取到时候看在哪里导入首先我们放在TunnelScene里面吧
//因为没获取到接口,我们先写死!!!
//需要参考接口的数据结构!!!,主要是传入函数的参数应该是什么结构???
const ThreeConfig = {
code: 0,
data: {
tunnelThreeConfig: {
fan: ['point_005_tl', 'point_009_bl'],
sensors: ['point_018_br', 'point_021_bl'],
}
},
msg: "dda",
}
[{ type: 'fan', point: '' }, {}]
// fan: ['point_005_tl', 'point_009_bl'],
// sensors: ['point_018_br', 'point_021_bl'],
// }
const tunnelConfigEquipment = ThreeConfig.data.tunnelThreeConfig
const tunnelKeys = Object.keys(tunnelConfigEquipment);
console.log(tunnelKeys);
function tunnelModeInit() {
for (let key in ThreeConfig.data.tunnelThreeConfig) {
if (ThreeConfig.data.tunnelThreeConfig.hasOwnProperty(key)) {
switch (key) {
case 'fan':
ThreeConfig.data.tunnelThreeConfig.fan.forEach(fan => {
// 对 fan 进行操作
console.log(fan);
});
break;
case 'sensors':
ThreeConfig.data.tunnelThreeConfig.sensors.forEach(sensor => {
// 对 sensor 进行操作
console.log(sensor);
});
break;
default:
// 处理其他键值对
console.log(key, ThreeConfig.data.tunnelThreeConfig[key]);
}
}
}
}
tunnelModeInit()
</script>
<style lang="scss" scope>
@@ -228,10 +263,12 @@ function handleCancel() {
position: relative;
height: 100%;
width: 100%;
#cvs {
height: 100%;
}
}
#remove-title {
height: 42px;
font-size: 32px;
@@ -243,10 +280,12 @@ function handleCancel() {
text-align: center;
margin: 65px 0px 70px 0px;
}
.btn {
display: flex;
justify-content: center;
gap: 80px;
:nth-child(1) {
width: 190px;
height: 60px;
@@ -258,6 +297,7 @@ function handleCancel() {
line-height: 37px;
background: transparent;
}
:nth-child(2) {
width: 190px;
height: 60px;

View File

@@ -18,54 +18,21 @@
</div>
<tunnel-scene id="tunnel-box" />
<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"
>
<fan-info
v-if="showFan"
:list="socketData.leftData"
:fan-data="largeScreenData"
/>
<transducer-list
:list="socketData.leftData"
:transducer-data="largeScreenData"
/>
<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">
<fan-info v-if="showFan" :list="socketData.leftData" :fan-data="largeScreenData" />
<transducer-list :list="socketData.leftData" :transducer-data="largeScreenData" />
<used-ele :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"
/>
<air-info
v-if="showFan"
:list="socketData.sensor"
:air-data="largeScreenData"
/>
<bad-gas-info
v-if="showFan"
:list="socketData.sensor"
:bad-gas-data="largeScreenData"
/>
<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" />
<air-info v-if="showFan" :list="socketData.sensor" :air-data="largeScreenData" />
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" />
</el-drawer>
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
<div v-else class="shrink-right" @click="closeRight"></div>
@@ -99,7 +66,7 @@ import { onMounted } from "vue";
import { getToken } from "@/utils/auth";
import { useAuthStore } from "@/store/userstore.js";
import { getLargeScreen } from "@/api/largeScreen";
import {ElMessageBox} from "element-plus";
import { ElMessageBox } from "element-plus";
const authStore = useAuthStore();
const router = useRouter();
@@ -168,7 +135,7 @@ const manageSelect = (index) => {
console.log("首页点击-", index);
if (index === 0) {
router.push("/site");
}else if (index === 1){
} else if (index === 1) {
router.push("/tunnel/1");
}
};
@@ -245,6 +212,7 @@ initWebSocket();
height: 100%;
width: 100%;
background-color: #072348;
#tunnel-box {
height: 100%;
}