Browse Source

1. 新增公司端首页风量预警功能
2. 保德火灾、粉尘添加接入三维巷道模型的组件

hongrunxia 7 months ago
parent
commit
17550bfccc

+ 34 - 2
src/views/vent/home/clique/components/icon-light.vue

@@ -12,12 +12,20 @@
 </template>
 
 <script setup lang="ts">
-  import { ref, defineEmits, inject } from 'vue';
+  import { ref, defineEmits, inject, watch, nextTick } from 'vue';
   import { getAssetURL } from '/@/utils/ui';
 
   const emit = defineEmits(['showDetail']);
   const globalConfig = inject('globalConfig');
-
+  let props = defineProps({
+    warningList: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+  });
+  // const iconWarningList = ref([]);
   const warningLevel1 = getAssetURL('company/home/point1.png'); // 低风险
   const warningLevel2 = getAssetURL('company/home/point2.png'); // 中风险
   const warningLevel3 = getAssetURL('company/home/point3.png'); // 高风险
@@ -156,6 +164,30 @@
   function openModal(code, label, leftV, topV) {
     emit('showDetail', code, label, leftV, topV);
   }
+  watch(
+    () => props.warningList,
+    (newVal: any, oldVal: any) => {
+      let newPointList;
+      if (newVal && oldVal && newVal.length == oldVal.length) {
+        for (let i = 0; i < newVal.length; i++) {
+          if (newVal[i].isWarning !== oldVal[i].isWarning) {
+            if (!newPointList) newPointList = [...pointList.value];
+            const index = (newPointList as []).findIndex((item) => item['code'] === newVal[i]['orgcode']);
+            newPointList[index]['imgSrc'] = newVal[i].isWarning ? warningLevel4 : warningLevel1;
+          }
+        }
+      } else {
+        newPointList = [...pointList.value];
+        for (let i = 0; i < newVal.length; i++) {
+          const index = (newPointList as []).findIndex((item) => item['code'] === newVal[i]['orgcode']);
+          newPointList[index]['imgSrc'] = newVal[i].isWarning ? warningLevel4 : warningLevel1;
+        }
+      }
+      if (newPointList) {
+        pointList.value = newPointList;
+      }
+    }
+  );
 </script>
 
 <style lang="less" scoped>

+ 12 - 2
src/views/vent/home/clique/index.vue

@@ -19,7 +19,7 @@
           <!-- 地图底图 -->
           <div class="center-bg">
             <div class="bg-map">
-              <iconLight @show-detail="showDetail" />
+              <iconLight @show-detail="showDetail" :warningList="warningList" />
             </div>
           </div>
           <!-- 榆家梁矿 -->
@@ -83,7 +83,7 @@
   //文件共享中心数据
   let shareData = reactive<any[]>([]);
 
-  // let isWarnign = ref(false)
+  let warningList = ref([]);
 
   //通风巷道长度统计数据
   let roadData = reactive({
@@ -119,6 +119,7 @@
       roadData.data.length = 0;
       roadData.data1.length = 0;
       airKjStatus.length = 0;
+      const warningListTemp: { orgcode: string; isWarning: boolean }[] = [];
       res.forEach((el) => {
         airKjStatus.push({
           deviceName: el.sys_data.deviceName,
@@ -126,9 +127,18 @@
           xf: el.sys_data.xufengliang,
           hf: el.sys_data.zonghuifeng,
         });
+
+        //临时添加,前端判断,后期后端加上预警再处理
+        if (el.sys_data.zongjinfeng < el.sys_data.xufengliang) {
+          warningListTemp.push({ orgcode: el.orgcode, isWarning: true });
+        } else {
+          warningListTemp.push({ orgcode: el.orgcode, isWarning: false });
+        }
+
         roadData.data.push(el.sys_data.totallength);
         roadData.data1.push(el.sys_data.deviceName);
       });
+      warningList.value = warningListTemp;
       compositeData.value = res.reduce((arr, e) => {
         return [...arr, ...e.majorpath_data];
       }, []);

+ 2 - 0
src/views/vent/home/configurable/dustBD.vue

@@ -93,6 +93,7 @@
         </div>
       </div>
     </template>
+    <VentModal style="width: 100%; height: 100%; position: absolute" />
   </div>
 </template>
 <script lang="ts" setup>
@@ -106,6 +107,7 @@
   import ModuleCommon from './components/ModuleCommon.vue';
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDDust } from './configurable.data';
+  import VentModal from '/@/components/vent/micro/ventModal.vue';
 
   interface EnhancedConfig extends Config {
     visible: boolean;

+ 2 - 0
src/views/vent/home/configurable/fireBD.vue

@@ -93,6 +93,7 @@
         </div>
       </div>
     </template>
+    <VentModal style="width: 100%; height: 100%; position: absolute" />
   </div>
 </template>
 <script lang="ts" setup>
@@ -106,6 +107,7 @@
   import ModuleCommon from './components/ModuleCommon.vue';
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDFire } from './configurable.data';
+  import VentModal from '/@/components/vent/micro/ventModal.vue';
 
   interface EnhancedConfig extends Config {
     visible: boolean;