|
@@ -14,7 +14,7 @@
|
|
|
<div class="left-content">
|
|
|
<!-- 局部通风机 -->
|
|
|
<div class="monitor-box">
|
|
|
- <fanMonitor @goDetail="goDetail"/>
|
|
|
+ <fanMonitor @goDetail="goDetail":fandata="fanLocalList" />
|
|
|
</div>
|
|
|
<!-- 主通风机 -->
|
|
|
<div class="monitor-box monitor-box1">
|
|
@@ -84,6 +84,8 @@
|
|
|
import { onUnmounted } from 'vue';
|
|
|
import DeviceMonitor from '../../monitorManager/deviceMonitor/index.vue'
|
|
|
|
|
|
+ let timer: NodeJS.Timeout | null = null;
|
|
|
+ let fanLocalList = reactive<any[]>([]); //局部风机数据
|
|
|
let navList = reactive([
|
|
|
{ name: '总风量(m³/min)', isShow: true, valList: [{ val: '2' }, { val: '1' }, { val: '3' }, { val: '3' }, { val: '0' }] },
|
|
|
{ name: '总阻力(Pa)', isShow: true, valList: [{ val: '0' }, { val: '2' }, { val: '4' }, { val: '6' }, { val: '3' }] },
|
|
@@ -95,36 +97,42 @@
|
|
|
const globSetting = useGlobSetting();
|
|
|
const openQianKun = globSetting.openQianKun;
|
|
|
let actions;
|
|
|
-
|
|
|
const pageType = ref('home')
|
|
|
-
|
|
|
- function goDetail(deviceType) {
|
|
|
- pageType.value = deviceType
|
|
|
+
|
|
|
+function goDetail(deviceType) {
|
|
|
+ pageType.value = deviceType
|
|
|
+ changeModalBox()
|
|
|
+}
|
|
|
+function goHome() {
|
|
|
+ pageType.value = 'home'
|
|
|
+ nextTick(() => {
|
|
|
changeModalBox()
|
|
|
- }
|
|
|
- function goHome() {
|
|
|
- pageType.value = 'home'
|
|
|
- nextTick(() => {
|
|
|
- changeModalBox()
|
|
|
- })
|
|
|
- }
|
|
|
- function changeModalBox() {
|
|
|
- if(pageType.value === 'home'){
|
|
|
- const dom = document.getElementById('modalBox') as HTMLElement
|
|
|
- if (dom && dom.parentElement) {
|
|
|
- const contentDom = document.getElementById('content') as HTMLElement
|
|
|
- contentDom?.setAttribute('style', `top: ${dom.parentElement.offsetTop + 20}px; left: ${dom.parentElement.offsetLeft + 20}px; width: ${dom.offsetWidth - 40}px; height: ${dom.offsetHeight - 40}px; position: fixed;`)
|
|
|
- }
|
|
|
- }else{
|
|
|
- const dom = document.getElementById('modalBox') as HTMLElement
|
|
|
- if (dom && dom.parentElement) {
|
|
|
- const contentDom = document.getElementById('content') as HTMLElement
|
|
|
- contentDom?.setAttribute('style', `top:0px; left: 0px; width: 100%; height: 100%; position: fixed;`)
|
|
|
- }
|
|
|
+ })
|
|
|
+}
|
|
|
+function changeModalBox() {
|
|
|
+ if (pageType.value === 'home') {
|
|
|
+ const dom = document.getElementById('modalBox') as HTMLElement
|
|
|
+ if (dom && dom.parentElement) {
|
|
|
+ const contentDom = document.getElementById('content') as HTMLElement
|
|
|
+ contentDom?.setAttribute('style', `top: ${dom.parentElement.offsetTop + 20}px; left: ${dom.parentElement.offsetLeft + 20}px; width: ${dom.offsetWidth - 40}px; height: ${dom.offsetHeight - 40}px; position: fixed;`)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const dom = document.getElementById('modalBox') as HTMLElement
|
|
|
+ if (dom && dom.parentElement) {
|
|
|
+ const contentDom = document.getElementById('content') as HTMLElement
|
|
|
+ contentDom?.setAttribute('style', `top:0px; left: 0px; width: 100%; height: 100%; position: fixed;`)
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+function getList() {
|
|
|
+ list({}).then((res) => {
|
|
|
+ console.log(res, 'res-----------');
|
|
|
+ fanLocalList.length = 0
|
|
|
+ fanLocalList.push(res.fanlocal)
|
|
|
+ console.log(fanLocalList, '---------');
|
|
|
+ });
|
|
|
+}
|
|
|
onMounted(() => {
|
|
|
- changeModalBox()
|
|
|
const renderModal = () => {
|
|
|
const element = document.getElementById('__qiankun_microapp_wrapper_for_micro_vent_3_d_modal__')
|
|
|
if(element){
|
|
@@ -136,8 +144,11 @@
|
|
|
}
|
|
|
}
|
|
|
renderModal()
|
|
|
- })
|
|
|
- onUnmounted(() => {
|
|
|
+ timer = Number(
|
|
|
+ setInterval(() => {
|
|
|
+ getList();
|
|
|
+ }, 3000)
|
|
|
+ );
|
|
|
})
|
|
|
</script>
|
|
|
|
|
@@ -289,7 +300,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .three-modal{
|
|
|
+ .three-modal {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
padding: 20px 17px 20px 15px;
|