|
|
@@ -1,67 +1,71 @@
|
|
|
<template>
|
|
|
<div class="fire-green">
|
|
|
- <div class="top-bg">
|
|
|
- <greenNav :activeIndex="activeIndex" />
|
|
|
- </div>
|
|
|
- <div class="main-container">
|
|
|
- <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
|
|
|
- <div class="left-t">
|
|
|
- <div class="tcontent-area">
|
|
|
- <div class="tcontent-l">
|
|
|
- <div>监测</div>
|
|
|
- <div>区域</div>
|
|
|
- </div>
|
|
|
- <div class="tcontent-c">
|
|
|
- <div style="margin-bottom: -4px; color: #3afde7; font-size: 24px; font-weight: bolder; letter-spacing: 10px">
|
|
|
- {{ data.fireAllMineWarn }}
|
|
|
+ <!-- 有 deviceType query 时视为详情页,只展示中心模型 -->
|
|
|
+ <template v-if="!route.query.deviceType">
|
|
|
+ <div class="top-bg">
|
|
|
+ <greenNav :activeIndex="activeIndex" />
|
|
|
+ </div>
|
|
|
+ <div class="main-container">
|
|
|
+ <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
|
|
|
+ <div class="left-t">
|
|
|
+ <div class="tcontent-area">
|
|
|
+ <div class="tcontent-l">
|
|
|
+ <div>监测</div>
|
|
|
+ <div>区域</div>
|
|
|
+ </div>
|
|
|
+ <div class="tcontent-c">
|
|
|
+ <div class="risk-value">
|
|
|
+ {{ data.fireAllMineWarn }}
|
|
|
+ </div>
|
|
|
+ <div class="risk-label">自燃倾向性等级 : 自燃</div>
|
|
|
+ </div>
|
|
|
+ <div class="tcontent-r">
|
|
|
+ <div>火灾</div>
|
|
|
+ <div>风险</div>
|
|
|
</div>
|
|
|
- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 自燃</div>
|
|
|
- </div>
|
|
|
- <div class="tcontent-r">
|
|
|
- <div>火灾</div>
|
|
|
- <div>风险</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="right-t">
|
|
|
- <div class="tcontent-l" @click="redirectTo('/grout-home?mock-login=1')">
|
|
|
- <div>智能注浆系统</div>
|
|
|
- </div>
|
|
|
- <div class="tcontent-r" @click="redirectTo('/nitrogen-home?mock-login=1')">
|
|
|
- <div>智能注氮系统</div>
|
|
|
+ <div class="right-t">
|
|
|
+ <div class="tcontent-l" @click="redirectTo('/grout-home?mock-login=1')">
|
|
|
+ <div>智能注浆系统</div>
|
|
|
+ </div>
|
|
|
+ <div class="tcontent-r" @click="redirectTo('/nitrogen-home?mock-login=1')">
|
|
|
+ <div>智能注氮系统</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <ModuleGreen
|
|
|
+ v-for="(cfg, index) in cfgs"
|
|
|
+ :key="`${cfg.deviceType}_${cfg.moduleName}_${index}`"
|
|
|
+ :show-style="cfg.showStyle"
|
|
|
+ :module-data="cfg.moduleData"
|
|
|
+ :module-name="cfg.moduleName"
|
|
|
+ :device-type="cfg.deviceType"
|
|
|
+ :data="data"
|
|
|
+ :visible="true"
|
|
|
+ />
|
|
|
+ <ModuleDual
|
|
|
+ v-if="cfgA && cfgB"
|
|
|
+ :show-style="cfgA.showStyle"
|
|
|
+ :module-data-a="cfgA.moduleData"
|
|
|
+ :module-name-a="cfgA.moduleName"
|
|
|
+ :device-type-a="cfgA.deviceType"
|
|
|
+ :module-data-b="cfgB.moduleData"
|
|
|
+ :module-name-b="cfgB.moduleName"
|
|
|
+ :device-type-b="cfgB.deviceType"
|
|
|
+ :data="data"
|
|
|
+ :visible="true"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <ModuleGreen
|
|
|
- v-for="cfg in cfgs"
|
|
|
- :key="cfg.deviceType"
|
|
|
- :show-style="cfg.showStyle"
|
|
|
- :module-data="cfg.moduleData"
|
|
|
- :module-name="cfg.moduleName"
|
|
|
- :device-type="cfg.deviceType"
|
|
|
- :data="data"
|
|
|
- :visible="true"
|
|
|
- />
|
|
|
- <ModuleDual
|
|
|
- v-if="cfgA && cfgB"
|
|
|
- :show-style="cfgA.showStyle"
|
|
|
- :module-data-a="cfgA.moduleData"
|
|
|
- :module-name-a="cfgA.moduleName"
|
|
|
- :device-type-a="cfgA.deviceType"
|
|
|
- :module-data-b="cfgB.moduleData"
|
|
|
- :module-name-b="cfgB.moduleName"
|
|
|
- :device-type-b="cfgB.deviceType"
|
|
|
- :data="data"
|
|
|
- :visible="true"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
|
|
|
- <div style="width: 998px; height: 550px; position: absolute; left: calc(50% - 500px); top: 60px">
|
|
|
+ <div class="center-model">
|
|
|
<SubApp />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { ref, computed, onMounted, onUnmounted } from 'vue';
|
|
|
+ import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
|
|
|
+ import { useRoute } from 'vue-router';
|
|
|
import { useInitConfigs, useInitPage } from '../hooks/useInit';
|
|
|
import greenNav from './components/green-nav.vue';
|
|
|
import ModuleGreen from './components/module-green.vue';
|
|
|
@@ -69,45 +73,82 @@
|
|
|
import SubApp from '/@/components/vent/micro/createSubApp.vue';
|
|
|
import { getDisHome } from '../configurable.api';
|
|
|
import { testConfigBDFire } from '../configurable.data';
|
|
|
- // import { getToken } from '/@/utils/auth';
|
|
|
- let activeIndex = ref(2);
|
|
|
+ import { useGlobSetting } from '/@/hooks/setting';
|
|
|
|
|
|
- const cfgs = computed(() =>
|
|
|
- configs.value.filter((_, index) => {
|
|
|
- return index !== 4 && index !== 3;
|
|
|
- })
|
|
|
- );
|
|
|
- const cfgA = computed<any>(() =>
|
|
|
- configs.value.find((_, index) => {
|
|
|
- return index === 3;
|
|
|
- })
|
|
|
- );
|
|
|
- const cfgB = computed<any>(() =>
|
|
|
- configs.value.find((_, index) => {
|
|
|
- return index === 4;
|
|
|
- })
|
|
|
- );
|
|
|
+ const DUAL_MODULE_A = '工作面束管监测';
|
|
|
+ const DUAL_MODULE_B = '工作面光纤监测';
|
|
|
+
|
|
|
+ const { title = '智能通风管控系统' } = useGlobSetting();
|
|
|
+ const route = useRoute();
|
|
|
+ const activeIndex = ref(2);
|
|
|
const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
|
|
|
- const { mainTitle, data, updateData } = useInitPage('');
|
|
|
+ const { data, updateData } = useInitPage(title);
|
|
|
let interval: number | undefined;
|
|
|
+ let unmounted = false;
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- fetchConfigs('BD_fire').then(() => {
|
|
|
- configs.value = testConfigBDFire;
|
|
|
- getDisHome({
|
|
|
- dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
|
|
|
- }).then(updateData);
|
|
|
+ const cfgs = computed(() =>
|
|
|
+ configs.value.filter((cfg) => cfg.moduleName !== DUAL_MODULE_A && cfg.moduleName !== DUAL_MODULE_B)
|
|
|
+ );
|
|
|
+ const cfgA = computed<any>(() => configs.value.find((cfg) => cfg.moduleName === DUAL_MODULE_A));
|
|
|
+ const cfgB = computed<any>(() => configs.value.find((cfg) => cfg.moduleName === DUAL_MODULE_B));
|
|
|
+
|
|
|
+ function fetchListData() {
|
|
|
+ if (unmounted) return Promise.resolve();
|
|
|
+ const dataList = devicesTypes.value.concat('fireAllMineWarn').join(',');
|
|
|
+ if (!dataList) return Promise.resolve();
|
|
|
+ return getDisHome({ dataList }).then((res) => {
|
|
|
+ if (!unmounted) updateData(res);
|
|
|
});
|
|
|
- // [perf-base-v1] 定时器句柄赋值给 interval,修复卸载时清理无效的泄漏
|
|
|
- interval = setInterval(() => {
|
|
|
- getDisHome({
|
|
|
- dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
|
|
|
- }).then(updateData);
|
|
|
+ }
|
|
|
+
|
|
|
+ function stopInterval() {
|
|
|
+ if (interval !== undefined) {
|
|
|
+ clearInterval(interval);
|
|
|
+ interval = undefined;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function initInterval() {
|
|
|
+ stopInterval();
|
|
|
+ interval = window.setInterval(() => {
|
|
|
+ fetchListData();
|
|
|
}, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+ function refresh() {
|
|
|
+ return fetchConfigs('BD_fire').then(() => {
|
|
|
+ if (unmounted) return;
|
|
|
+ configs.value = testConfigBDFire;
|
|
|
+ return fetchListData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function setupPage() {
|
|
|
+ if (route.query.deviceType) {
|
|
|
+ stopInterval();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ refresh().then(() => {
|
|
|
+ if (!unmounted && !route.query.deviceType) {
|
|
|
+ initInterval();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => route.query,
|
|
|
+ () => {
|
|
|
+ setupPage();
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ setupPage();
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
- clearInterval(interval);
|
|
|
+ unmounted = true;
|
|
|
+ stopInterval();
|
|
|
});
|
|
|
|
|
|
function redirectTo(url) {
|
|
|
@@ -119,7 +160,7 @@
|
|
|
|
|
|
@font-face {
|
|
|
font-family: 'douyuFont';
|
|
|
- src: url('../../../../assets/font/douyuFont.otf');
|
|
|
+ src: url('/@/assets/font/douyuFont.otf');
|
|
|
}
|
|
|
|
|
|
@{theme-deepblue} {
|
|
|
@@ -151,47 +192,31 @@
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
}
|
|
|
+
|
|
|
.main-container {
|
|
|
position: absolute;
|
|
|
top: 96px;
|
|
|
width: calc(100% - 30px);
|
|
|
height: calc(100% - 96px);
|
|
|
- margin: 0px 15px;
|
|
|
+ margin: 0 15px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
- .module-dropdown {
|
|
|
- padding: 10px;
|
|
|
- background-image: linear-gradient(to bottom, #036886, #072a40);
|
|
|
- border-bottom: 2px solid #3df6ff;
|
|
|
- color: @vent-font-color;
|
|
|
+ .center-model {
|
|
|
+ width: 998px;
|
|
|
+ height: 550px;
|
|
|
position: absolute;
|
|
|
- top: 70px;
|
|
|
- right: 460px;
|
|
|
- }
|
|
|
-
|
|
|
- .module-dropdown-original {
|
|
|
- padding: 10px;
|
|
|
- background-image: linear-gradient(to bottom, #036886, #072a40);
|
|
|
- border-bottom: 2px solid #3df6ff;
|
|
|
- color: @vent-font-color;
|
|
|
- position: absolute;
|
|
|
- top: 70px;
|
|
|
- right: 460px;
|
|
|
- }
|
|
|
-
|
|
|
- .module-trigger-button {
|
|
|
- color: @vent-font-color;
|
|
|
- background-image: linear-gradient(to bottom, #036886, #072a40);
|
|
|
- border: none;
|
|
|
- border-bottom: 2px solid #3df6ff;
|
|
|
+ left: calc(50% - 500px);
|
|
|
+ top: 60px;
|
|
|
+ z-index: 0;
|
|
|
+ pointer-events: auto;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.left-t {
|
|
|
position: absolute;
|
|
|
height: 90px;
|
|
|
- top: 0px;
|
|
|
+ top: 0;
|
|
|
left: 10px;
|
|
|
width: 420px;
|
|
|
background-image: var(--image-qkjaq);
|
|
|
@@ -232,6 +257,19 @@
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
height: 100%;
|
|
|
+
|
|
|
+ .risk-value {
|
|
|
+ margin-bottom: -4px;
|
|
|
+ color: #3afde7;
|
|
|
+ font-size: 24px;
|
|
|
+ font-weight: bolder;
|
|
|
+ letter-spacing: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .risk-label {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.tcontent-r {
|
|
|
@@ -253,7 +291,7 @@
|
|
|
position: absolute;
|
|
|
height: 90px;
|
|
|
right: 10px;
|
|
|
- top: 0px;
|
|
|
+ top: 0;
|
|
|
width: 420px;
|
|
|
background-image: var(--image-common-border2);
|
|
|
background-repeat: no-repeat;
|
|
|
@@ -263,30 +301,27 @@
|
|
|
align-items: center;
|
|
|
justify-content: space-around;
|
|
|
color: #fff;
|
|
|
- .tcontent-l {
|
|
|
+
|
|
|
+ .tcontent-l,
|
|
|
+ .tcontent-r {
|
|
|
flex: 1;
|
|
|
height: 100%;
|
|
|
font-size: 14px;
|
|
|
font-weight: bold;
|
|
|
- background-image: var(--image-znzjxt);
|
|
|
background-size: 75% 80%;
|
|
|
background-repeat: no-repeat;
|
|
|
background-position: center;
|
|
|
text-align: center;
|
|
|
padding-top: 70px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tcontent-l {
|
|
|
+ background-image: var(--image-znzjxt);
|
|
|
}
|
|
|
|
|
|
.tcontent-r {
|
|
|
- flex: 1;
|
|
|
- height: 100%;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: bold;
|
|
|
background-image: var(--image-znzdxt);
|
|
|
- background-size: 75% 80%;
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-position: center;
|
|
|
- text-align: center;
|
|
|
- padding-top: 70px;
|
|
|
}
|
|
|
}
|
|
|
|