初始化功能还在做
This commit is contained in:
@@ -2,30 +2,16 @@
|
|||||||
<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" @addEquipment="handleAddEqu" @removeEquipment="handleRemoveEqu" @cancel="handleCancel"
|
||||||
ref="edit"
|
:hasDev="hasDevice" :pointNum="pointNum" pointGap="500" />
|
||||||
@addEquipment="handleAddEqu"
|
<el-dialog v-model="centerDialogVisible" width="30%" destroy-on-close center :show-close="false" style="
|
||||||
@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;
|
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>
|
||||||
@@ -108,7 +94,7 @@ function loadModel(path) {
|
|||||||
(obj) => {
|
(obj) => {
|
||||||
resolve(obj);
|
resolve(obj);
|
||||||
},
|
},
|
||||||
(xhr) => {},
|
(xhr) => { },
|
||||||
(err) => {
|
(err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
@@ -174,6 +160,8 @@ function rClickCallback(demo) {
|
|||||||
demo.addFunction("editDev", editDev);
|
demo.addFunction("editDev", editDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 添加设备
|
// 添加设备
|
||||||
function handleAddEqu(formInfo) {
|
function handleAddEqu(formInfo) {
|
||||||
if (!formInfo.equipmentType) {
|
if (!formInfo.equipmentType) {
|
||||||
@@ -221,6 +209,53 @@ function handleCancel() {
|
|||||||
demo._resetState();
|
demo._resetState();
|
||||||
demo.clearTagsObj();
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
@@ -228,10 +263,12 @@ function handleCancel() {
|
|||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
#cvs {
|
#cvs {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#remove-title {
|
#remove-title {
|
||||||
height: 42px;
|
height: 42px;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
@@ -243,10 +280,12 @@ function handleCancel() {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 65px 0px 70px 0px;
|
margin: 65px 0px 70px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 80px;
|
gap: 80px;
|
||||||
|
|
||||||
:nth-child(1) {
|
:nth-child(1) {
|
||||||
width: 190px;
|
width: 190px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
@@ -258,6 +297,7 @@ function handleCancel() {
|
|||||||
line-height: 37px;
|
line-height: 37px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
:nth-child(2) {
|
:nth-child(2) {
|
||||||
width: 190px;
|
width: 190px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
|||||||
@@ -18,54 +18,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<tunnel-scene id="tunnel-box" />
|
<tunnel-scene id="tunnel-box" />
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<el-drawer
|
<el-drawer v-model="drawerLeft" direction="ltr" modal-class="modal-box" :modal="false" :show-close="false"
|
||||||
v-model="drawerLeft"
|
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
direction="ltr"
|
<fan-info v-if="showFan" :list="socketData.leftData" :fan-data="largeScreenData" />
|
||||||
modal-class="modal-box"
|
<transducer-list :list="socketData.leftData" :transducer-data="largeScreenData" />
|
||||||
: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" />
|
<used-ele :list="socketData.leftData" :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>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<el-drawer
|
<el-drawer v-model="drawerRight" direction="rtl" modal-class="modal-box" :modal="false" :show-close="false"
|
||||||
v-model="drawerRight"
|
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
direction="rtl"
|
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData" />
|
||||||
modal-class="modal-box"
|
<air-info v-if="showFan" :list="socketData.sensor" :air-data="largeScreenData" />
|
||||||
:modal="false"
|
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" />
|
||||||
: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>
|
</el-drawer>
|
||||||
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
|
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
|
||||||
<div v-else class="shrink-right" @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 { getToken } from "@/utils/auth";
|
||||||
import { useAuthStore } from "@/store/userstore.js";
|
import { useAuthStore } from "@/store/userstore.js";
|
||||||
import { getLargeScreen } from "@/api/largeScreen";
|
import { getLargeScreen } from "@/api/largeScreen";
|
||||||
import {ElMessageBox} from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -168,7 +135,7 @@ const manageSelect = (index) => {
|
|||||||
console.log("首页点击-", index);
|
console.log("首页点击-", index);
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
router.push("/site");
|
router.push("/site");
|
||||||
}else if (index === 1){
|
} else if (index === 1) {
|
||||||
router.push("/tunnel/1");
|
router.push("/tunnel/1");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -245,6 +212,7 @@ initWebSocket();
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #072348;
|
background-color: #072348;
|
||||||
|
|
||||||
#tunnel-box {
|
#tunnel-box {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user