Browse Source

Fix: 大屏地图优化和代码优化

luoyujia 1 year ago
parent
commit
3daac79d0c

+ 5 - 1
src/views/lifeline/bigscreen/Map/tiandituMap.vue

@@ -57,6 +57,7 @@
       }),
     });
     const layerOrigin = new TileLayer({
+      preload: 6,
       source: new XYZ({
         url: tiandituVecUrl + '&tk=' + tiandituKey,
         tileLoadFunction: (imageTile, src) => tileLoadFunction(imageTile, src) as any,
@@ -64,13 +65,16 @@
       // Opacity: 1,
       // format: new parseGeoJson(),
       zIndex: -1,
-      preload: 4, //预加载
+      // preload: 4, //预加载
     });
     const textLayer = new TileLayer({
+      preload: 6,
       source: new XYZ({
         url: textVecUrl + '&tk=' + tiandituKey,
         tileLoadFunction: (imageTile, src) => tileLoadFunction(imageTile, src) as any,
       }),
+      // preload: 4, //预加载
+
       // Opacity: 1,
       // format: new parseGeoJson(),
       zIndex: -1,

+ 0 - 29
src/views/lifeline/bigscreen/Map/utils/mapUtils.ts

@@ -28,33 +28,18 @@ export function clearVectorLayerById(map, layerId) {
     source.refresh();
   }
 }
-// 判断图层是否已加载
-// function layerAdded(map: any, layerId: string) {
-//   const layers = map.getAllLayers();
-//   //。。。
-// }
-
-// const industry = mapStore.getIndustry();
 /**
  * 以图层的方式添加模块的标注数据
  */
-// let vectorLayer;
 export function addModuleData(
   data: Array<Object>,
   iconScale?: number,
   layerId?: string,
   featureIdField?: string,
   showText?: boolean
-  // showText?: boolean,
-  // nameField?: string,
-  // resolution?: number
 ) {
   const mapStore = useMapStore();
   const map = mapStore.getMap;
-  // if (vectorLayer) {
-  //   vectorLayer.getSource().clear();
-  //   map.removeLayer(vectorLayer);
-  // }
   const features = data.map((item: any) => {
     const feature = new Feature({
       ...item,
@@ -68,21 +53,8 @@ export function addModuleData(
         src: getIcon(item.type),
         // 对图标进行偏移
         scale: iconScale || 1,
-        // offset: [-10, -40],
-        // offsetOrigin: 'bottom-right',
-        // size: [100, 100],
-        // anchorYUnits: 'pixels',
         anchor: [0.5, 1],
       }),
-      // image: new Circle({
-      //   radius: 2,
-      //   fill: new Fill({
-      //     color: 'red',
-      //   }),
-      //   stroke: new Stroke({
-      //     color: 'red',
-      //   }),
-      // }),
       text: new Text({
         font: '12px sans-serif',
         offsetX: 0,
@@ -143,7 +115,6 @@ export function getFeatureById(map: any, id: string, layerId: string) {
 }
 
 export function getFeatureByPoint(map, point: PointType, layerId: string) {
-  // source.getClosestFeatureToCoordinate(point)
   const layerList = map.getAllLayers();
   let layer;
   // 如果传了layerid直接获取对应图层的数据

+ 32 - 37
src/views/lifeline/bigscreen/common/listCycleScroll.vue

@@ -32,6 +32,10 @@
     },
   });
   const dataSource = ref<any[]>([]);
+  const requestId = ref<any>(null);
+  let start = null as any;
+  let frameStartIdx = 0;
+
   watch(
     () => props.dataSource,
     () => {
@@ -55,10 +59,10 @@
     () => {
       if (viewContain.value) {
         viewContain.value.onmouseover = function () {
-          pause = true;
+          cancelAnimationFrame(requestId.value);
         };
         viewContain.value.onmouseout = function () {
-          pause = false;
+          requestId.value = requestAnimationFrame(step);
         };
       }
     }
@@ -85,45 +89,36 @@
         .concat(dataSource.value.slice(0, endIndex.value - (dataSource.value.length - 1)));
     }
   });
-  let pause = false;
-  let frameStartIdx = 0;
   onMounted(() => {
-    let start = null;
-    // 当前的起始索引
-    // let frameStartIdx = 0;
-    function step(timestamp) {
-      if (pause) {
-        requestAnimationFrame(step);
-        return;
-      }
-      if (start === null) {
-        start = timestamp;
-      }
-      const elapsed = timestamp - start!;
-      // elapsed为起始帧和当前帧差值,由于我们想的是每1s滚动过一条,因此每1ms运动的距离为0.03px
-      const count = Math.min(0.03 * elapsed, props.itemHeight * props.itemNum);
-      startIndex.value = frameStartIdx;
-      showContain.value!.style.top = `-${count}px`;
-      if (count === props.itemHeight * props.itemNum) {
-        // 当运动了120px后,重置我们的showContain位置
-        showContain.value!.style.top = '0';
-        if (frameStartIdx >= dataSource.value.length - 1) {
-          // 起始帧数大于原数据最大索引后重置
-          setTimeout(() => {
-            frameStartIdx = 0;
-            startIndex.value = frameStartIdx;
-          }, 3000);
-        } else {
-          frameStartIdx += props.itemNum;
+    requestId.value = requestAnimationFrame(step);
+  });
+  function step() {
+    if (start === null) {
+      start = performance.now();
+    }
+    const elapsed = performance.now() - start!;
+    // elapsed为起始帧和当前帧差值,由于我们想的是每1s滚动过一条,因此每1ms运动的距离为0.03px
+    const count = Math.min(0.03 * elapsed, props.itemHeight * props.itemNum);
+    startIndex.value = frameStartIdx;
+    showContain.value!.style.top = `-${count}px`;
+    if (count === props.itemHeight * props.itemNum) {
+      // 当运动了120px后,重置我们的showContain位置
+      showContain.value!.style.top = '0';
+      if (frameStartIdx >= dataSource.value.length - 1) {
+        // 起始帧数大于原数据最大索引后重置
+        setTimeout(() => {
+          frameStartIdx = 0;
           startIndex.value = frameStartIdx;
-        }
-        start = null;
+        }, 3000);
+      } else {
+        frameStartIdx += props.itemNum;
+        startIndex.value = frameStartIdx;
       }
-      // 递归调用,实现无限滚动
-      requestAnimationFrame(step);
+      start = null;
     }
-    requestAnimationFrame(step);
-  });
+    // 递归调用,实现无限滚动
+    requestId.value = requestAnimationFrame(step);
+  }
 </script>
 
 <style scoped lang="less">

+ 2 - 278
src/views/lifeline/bigscreen/components/layout/DeviceBaseInfo.vue

@@ -145,35 +145,7 @@
 <script lang="ts" setup>
   import { ref, onMounted, watch, reactive } from 'vue';
   import DeviceEevntBaseInfo from '/@/views/lifeline/bigscreen/components/layout/DeviceEevntBaseInfo.vue';
-  //
-  // import dialogFormHandle from './dialogFormHandle.vue';
-  // 获取事件等级码表
-  import { findDictItemByCode } from '/@/api/system/dict';
-
-  // 获取区域
-  import { getAreaList } from '/@/api/oem/index';
-  // 获取事件类型
-  import { getTableList } from '/@/views/lifeline/api/riskLinkageSystemApi/configManage/eventTypeApi/index';
-  // 获取知识库列表
-  import { rescueCarPage as getKnowledge } from '/@/views/lifeline/api/riskLinkageSystemApi/baseManage/nxKnowledgeDatabase/index';
-  //获取专家库
-  import { rescueCarPage as getExperts } from '/@/views/lifeline/api/riskLinkageSystemApi/baseManage/nxExpertDatabase/index';
-  import { reservePlanPage } from '/@/api/emergencyLinkage/reservePlanManage';
-  import { rescueCarPage as warningType } from '/@/views/lifeline/api/riskLinkageSystemApi/configManage/warningTypeManage/index';
-  // 查询预警详情
-  // import { getWarningInfoById } from '/@/views/lifeline/api/riskLinkageSystemApi/warningManage/index';
-  //查询报警详情
-  // import { getWarningInfoById as getReportInfoById } from '/@/views/lifeline/api/riskMonitorSystemApi/monitorReportApi/reportHandle/index';
-  // 获取单位
-  import { screenLinkOrganizationGetApi } from '/@/api/ruleengine/ruleengineApi';
-
-  // 获取用户树形结构
-  import { getUserTree } from '/@/views/lifeline/api/common/userInfosTree';
-
-  // import { getAllById } from '/@/views/lifeline/api/riskLinkageSystemApi/eventManage/index';
-  // import { BasicVideoPlay } from '/@/components/Video';
   import { VideoJsPlayerOptions } from 'video.js';
-  // import flvVideoPlay from '/@/components/FlvVideo/flvVideoPlay.vue';
   import hlsVideoPlay from '/@/components/FlvVideo/hlsVideoPlay.vue';
   // 维小保视频
   import {
@@ -186,12 +158,6 @@
 
   const activeKey = ref(0);
   const myvideo = ref('');
-  /**
-   * 点击详情
-   */
-  // const handleDialog = ref();
-  // const title = ref('①预警信息');
-  // const isDetail = ref(true);
   const videoOptions = reactive<VideoJsPlayerOptions>({
     autoplay: 'muted', //自动播放
     controls: true, //交互控件
@@ -209,236 +175,9 @@
     },
     sources: [{ src: '', type: '' }], //根据需求填入
   });
-
   function handleItem(i) {
-    // showEeventDetail.value = true;
-    // isDetail.value = true;
-    // getAllById({ id: i.id }).then((res) => {
-    //   if (res.code == '200') {
-    //     if (res.data.dataSource == '2') {
-    //       getWarningInfoById(res.data.warningId).then((receive) => {
-    //         addFormData.value = { ...receive.data, ...res.data };
-    //       });
-    //     } else if (res.data.dataSource == '3') {
-    //       getReportInfoById(res.data.warningId).then((receive) => {
-    //         addFormData.value = { ...receive.data.monitorWarnData, ...res.data };
-    //       });
-    //     } else {
-    //       addFormData.value = res.data;
-    //     }
-    //   }
-    // });
-    // if (i.dataSource == '3') {
-    //   title.value = '①报警信息';
-    // } else if (i.dataSource == '2') {
-    //   title.value = '①预警信息';
-    // } else if (i.dataSource == '1') {
-    //   title.value = '①事件信息';
-    // }
-    // handleDialog.value.show();
     bus.emit('eventDetailButton', i);
   }
-
-  // 添加事件数据
-  // const addFormData = ref({});
-  //
-  const dictData = reactive({
-    domainId: [] as any,
-    industryId: [] as any,
-    areaCode: [] as any,
-    eventType: [] as any,
-    eventLevelCode: [] as any,
-    // 知识库列表
-    knowledgeList: [] as any,
-    expertsList: [] as any,
-    //
-    personList: [] as any,
-    companyId: [] as any,
-    userTree: [] as any,
-
-    recommend: [] as any,
-    plan: [] as any,
-    planRes: [] as any,
-    warningType: [] as any,
-    warningLevelCode: [] as any,
-  });
-
-  const getdictData = async () => {
-    function recursion(data, current, level) {
-      let result = [] as any;
-
-      if (!data) {
-        // return; 中断执行
-        return;
-      }
-      // let personList = [] as any;
-      level += 1;
-      for (const i in data) {
-        const item = data[i];
-        let dataNew2 = [] as any;
-        if ((item.parentId || '') == current) {
-          if (item.children && item.children.length > 0) {
-            current = item.id;
-            dataNew2 = recursion(item.children, current, level);
-          }
-          item.users?.map((item2) => {
-            let obj3 = item2;
-            obj3.companyId = item.companyId;
-            obj3.companyName = item.companyName;
-            obj3.deptId = item.companyId;
-            obj3.deptName = item.companyName;
-            obj3.personId = item2.userId;
-
-            dataNew2.push({
-              userId: item2.userId,
-              userName: item2.userName,
-              children: [],
-              disabled: false,
-              level: level,
-            });
-
-            dictData.personList.push(obj3);
-          });
-
-          result.push({
-            userId: item.companyId,
-            userName: item.companyName,
-            children: dataNew2,
-            disabled: true,
-            level: level,
-          });
-        }
-      }
-      return result;
-    }
-    // 用户树
-    await getUserTree({ showAll: 1 }).then((res) => {
-      if (res.code == '200') {
-        let arr = res.data;
-        let dataNew = recursion(arr, '', 0);
-        // arr.map((item) => {
-        //   let dataNew2 = [] as any;
-        //   item.depts.map((item2) => {
-        //     let dataNew3 = [] as any;
-        //     item2.users.map((item3) => {
-        //       let obj3 = item3;
-        //       obj3.companyId = item.companyId;
-        //       obj3.companyName = item.companyName;
-        //       obj3.deptId = item2.deptId;
-        //       obj3.deptName = item2.deptName;
-        //       obj3.personId = item3.userId;
-        //       dataNew3.push(obj3);
-        //       personList.push(obj3);
-        //     });
-
-        //     let obj2 = {
-        //       userId: item2.deptId,
-        //       userName: item2.deptName,
-        //       children: item2.users,
-        //       disabled: true,
-        //     };
-        //     dataNew2.push(obj2);
-        //   });
-        //   let obj = {
-        //     userId: item.companyId,
-        //     userName: item.companyName,
-        //     children: dataNew2,
-        //     disabled: true,
-        //   };
-        //   dataNew.push(obj);
-        // });
-
-        dictData.userTree = dataNew;
-      }
-    });
-    // 组织
-    await screenLinkOrganizationGetApi({ showAll: 1 }).then((res) => {
-      if (res.length > 0) {
-        let arr = res;
-        arr.forEach((i) => {
-          i.disabled = true;
-        });
-        dictData.companyId = arr;
-      }
-    });
-    await getKnowledge({ pageSize: 10000, showAll: 1 }).then((res) => {
-      dictData.knowledgeList = res.items;
-    });
-    await getExperts({ pageSize: 10000, showAll: 1 }).then((res) => {
-      dictData.expertsList = res.items;
-    });
-    // 获取事件类型
-    await getTableList({ pageSize: 10000, showAll: 1 }).then((res) => {
-      // console.log(res)
-      dictData.eventType = res.items;
-    });
-    // 区域
-    await getAreaList({ parentId: '511503', showAll: 1 }).then((res) => {
-      // console.log(res)
-      dictData.areaCode = res;
-    });
-    // 事件级别
-    await findDictItemByCode({ dictCode: 'eventLevelCode' }).then((res) => {
-      dictData.eventLevelCode = res;
-    });
-    // 领域
-    await findDictItemByCode({ dictCode: 'domainId' }).then((res) => {
-      dictData.domainId = res;
-    });
-    // 行业
-    await findDictItemByCode({ dictCode: 'industryId' }).then((res) => {
-      dictData.industryId = res;
-    });
-
-    await reservePlanPage({ pageSize: 10000, showAll: 1 }).then((res) => {
-      let arr = res.items;
-      let obj = {};
-      arr.forEach((i) => {
-        if (obj.hasOwnProperty(i.domainId + ',' + i.domainName)) {
-          obj[i.domainId + ',' + i.domainName].push(i);
-        } else {
-          obj[i.domainId + ',' + i.domainName] = [];
-          obj[i.domainId + ',' + i.domainName].push(i);
-        }
-      });
-      let arr2 = [] as any;
-      let planRes = [] as any;
-      for (let key in obj) {
-        const it = key.split(',');
-        arr2.push({
-          id: it[0],
-          name: it[1],
-          disabled: true,
-          children: obj[key].map((i) => {
-            i.children = i.responses.map((m) => {
-              m.name = i.name + m.responseLevelName + '响应';
-              m.planName = i.name;
-              planRes.push(m);
-              m.annexList = i.annexList;
-              return m;
-            });
-            i.disabled = true;
-            return i;
-          }),
-        });
-      }
-      // console.log(arr2,planRes);
-      dictData.plan = arr2;
-      dictData.planRes = planRes;
-    });
-
-    // 获取预警类型
-    await warningType({ pageSize: 10000, showAll: 1 }).then((res) => {
-      dictData.warningType = res.items;
-    });
-    // 预警级别
-    await findDictItemByCode({ dictCode: 'warningLevelCode' }).then((res) => {
-      dictData.warningLevelCode = res;
-    });
-
-    // 事件发射
-    bus.emit('bigscreenDictData', dictData);
-  };
   const dragBox = ref();
   const listenerDrag = () => {
     if (dragBox.value) {
@@ -470,10 +209,7 @@
       });
     }
   };
-
-  onMounted(() => {
-    getdictData();
-  });
+  onMounted(() => {});
   interface deviceInfoData {
     deviceName: string;
     longitude: string;
@@ -505,7 +241,6 @@
   );
   const emit = defineEmits(['showInfo']);
   const showDeviceBaseInfo = ref<Boolean>(prop.showDeviceInfo);
-  // const showEeventDetail = ref<Boolean>(false);
   const currentEvent = ref<Object>(null as any);
   const data = {
     deviceName: '文华路中段41号',
@@ -515,8 +250,6 @@
       { propName: '设备状态', propValue: '正常' },
     ],
     deveiceImgURL: '',
-    // deveiceImgURL: '/src/views/lifeline/bigscreen/images/deviceBaseInfoImg/tempImg.jpg',
-    // event: [],
     event: [
       {
         alarmTime: '2023年03月13日 16:07:22',
@@ -552,9 +285,6 @@
     showDeviceBaseInfo.value = false;
     emit('showInfo', false);
   };
-  // const closeEventDetail = () => {
-  //   showEeventDetail.value = false;
-  // };
   watch(
     () => prop.showDeviceInfo,
     () => {
@@ -564,7 +294,6 @@
         openWxbVideo('3110101592017B0060');
       }
       if (prop.deviceInfo.videoUrl) {
-        // console.log(prop.deviceInfo.videoUrl);
         // 获取当前ip和端口
         let videoUrl = prop.deviceInfo.videoUrl.replace(
           '118.122.253.32:83',
@@ -577,7 +306,7 @@
       }
 
       setTimeout(() => {
-        const element = document.querySelector('.ol-overlaycontainer-stopevent');
+        const element = document.querySelector('.ol-overlaycontainer-stopevent') as HTMLElement;
         if (element) {
           if (showDeviceBaseInfo.value && prop.deviceInfo.dragable) {
             element.style['z-index'] = 10;
@@ -596,11 +325,6 @@
       currentEvent.value = data.event[0];
     }
   });
-  // beforeDestroy() {
-  //   if (this.videoPlayer !== null) {
-  //     this.videoPlayer.dispose() // dispose()会直接删除Dom元素
-  //   }
-  // },
   /*
    * @description 预览视频
    */

+ 197 - 107
src/views/lifeline/bigscreen/index.vue

@@ -11,9 +11,6 @@
         :hasEventDetail="hasEventDetail"
         :deviceIndex="deviceIndex"
       />
-      <!-- <div v-if="showVideo">
-        <flvVideoPlay :src="videoSrc" />
-      </div> -->
     </div>
 
     <Header button-name="返回导航" />
@@ -31,7 +28,7 @@
   import DeviceBaseInfo from '/@/views/lifeline/bigscreen/components/layout/DeviceBaseInfo.vue';
 
   import Flexible from '/@/views/lifeline/bigscreen/common/flexible';
-  import { ref, onMounted, onUnmounted, watch, unref } from 'vue';
+  import { ref, onMounted, onUnmounted, watch, unref, reactive } from 'vue';
   import { addModuleData } from '/@/views/lifeline/bigscreen/Map/utils/mapUtils';
   import { useMapStore } from '/@/store/modules/map';
 
@@ -60,6 +57,29 @@
   import { rescueCarPage as getHosptial } from '/@/views/lifeline/api/riskLinkageSystemApi/emergencyLinkage/medicalTeam/index';
   // 查询应急救援队
   import { getTableList as getRescueTeam } from '/@/views/lifeline//api/riskLinkageSystemApi/emergencyLinkage/rescueTeamApi';
+  // 获取事件等级码表
+  import { findDictItemByCode } from '/@/api/system/dict';
+
+  // 获取区域
+  import { getAreaList } from '/@/api/oem/index';
+  // 获取事件类型
+  import { getTableList as getEventTable } from '/@/views/lifeline/api/riskLinkageSystemApi/configManage/eventTypeApi/index';
+  // 获取知识库列表
+  import { rescueCarPage as getKnowledge } from '/@/views/lifeline/api/riskLinkageSystemApi/baseManage/nxKnowledgeDatabase/index';
+  //获取专家库
+  import { rescueCarPage as getExperts } from '/@/views/lifeline/api/riskLinkageSystemApi/baseManage/nxExpertDatabase/index';
+  import { reservePlanPage } from '/@/api/emergencyLinkage/reservePlanManage';
+  import { rescueCarPage as warningType } from '/@/views/lifeline/api/riskLinkageSystemApi/configManage/warningTypeManage/index';
+  // 查询预警详情
+  // import { getWarningInfoById } from '/@/views/lifeline/api/riskLinkageSystemApi/warningManage/index';
+  //查询报警详情
+  // import { getWarningInfoById as getReportInfoById } from '/@/views/lifeline/api/riskMonitorSystemApi/monitorReportApi/reportHandle/index';
+  // 获取单位
+  import { screenLinkOrganizationGetApi } from '/@/api/ruleengine/ruleengineApi';
+
+  // 获取用户树形结构
+  import { getUserTree } from '/@/views/lifeline/api/common/userInfosTree';
+
   import bus from '/@/views/lifeline/bigscreen/common/bus';
   import Overlay from 'ol/Overlay';
   import eventBus from '/@/utils/eventBus';
@@ -71,9 +91,8 @@
   import { Vector as VectorSource } from 'ol/source';
   import { Vector as VectorLayer } from 'ol/Layer';
   import { debounce } from 'lodash';
+  import { nextTick } from 'process';
 
-  // import flvVideoPlay from '/@/components/FlvVideo/flvVideoPlay.vue';
-  // import { clearVectorLayerById } from '/@/views/lifeline/bigscreen/Map/utils/mapUtils';
   //设备概览:在线、离线、总数
   const deviceStatusStr = ref<string>('');
   eventBus.on('deviceStatusStr', (data) => {
@@ -96,22 +115,170 @@
   const focusListConfig = ['dangerSourceList', 'targetList', 'hosptialList', 'rescueTeamList'];
   let showText = false;
   let initPage = true;
+  const dictData = reactive({
+    domainId: [] as any,
+    industryId: [] as any,
+    areaCode: [] as any,
+    eventType: [] as any,
+    eventLevelCode: [] as any,
+    // 知识库列表
+    knowledgeList: [] as any,
+    expertsList: [] as any,
+    //
+    personList: [] as any,
+    companyId: [] as any,
+    userTree: [] as any,
 
-  // const showVideo = ref<boolean>(false);
-  // const videoSrc = ref<string>('');
-  bus.on('bigscreenDictData', (val: any) => {
-    industryId.value = val.industryId;
-    getDevice();
-    getFocusData();
+    recommend: [] as any,
+    plan: [] as any,
+    planRes: [] as any,
+    warningType: [] as any,
+    warningLevelCode: [] as any,
   });
   onMounted(() => {
-    // 行业
-    // findDictItemByCode({ dictCode: 'industryId' }).then((res) => {
-    //   industryId.value = res;
-    //   getDevice();
-    //   getFocusData();
-    // });
+    nextTick(async () => {
+      await getdictData();
+      industryId.value = dictData.industryId;
+      getDevice();
+      getFocusData();
+    });
   });
+  const getdictData = async () => {
+    function recursion(data, current, level) {
+      let result = [] as any;
+      if (!data) {
+        return;
+      }
+      level += 1;
+      for (const i in data) {
+        const item = data[i];
+        let dataNew2 = [] as any;
+        if ((item.parentId || '') == current) {
+          if (item.children && item.children.length > 0) {
+            current = item.id;
+            dataNew2 = recursion(item.children, current, level);
+          }
+          item.users?.map((item2) => {
+            let obj3 = item2;
+            obj3.companyId = item.companyId;
+            obj3.companyName = item.companyName;
+            obj3.deptId = item.companyId;
+            obj3.deptName = item.companyName;
+            obj3.personId = item2.userId;
+
+            dataNew2.push({
+              userId: item2.userId,
+              userName: item2.userName,
+              children: [],
+              disabled: false,
+              level: level,
+            });
+
+            dictData.personList.push(obj3);
+          });
+
+          result.push({
+            userId: item.companyId,
+            userName: item.companyName,
+            children: dataNew2,
+            disabled: true,
+            level: level,
+          });
+        }
+      }
+      return result;
+    }
+    // 用户树
+    await getUserTree({ showAll: 1 }).then((res) => {
+      if (res.code == '200') {
+        let arr = res.data;
+        let dataNew = recursion(arr, '', 0);
+        dictData.userTree = dataNew;
+      }
+    });
+    // 组织
+    await screenLinkOrganizationGetApi({ showAll: 1 }).then((res) => {
+      if (res.length > 0) {
+        let arr = res;
+        arr.forEach((i) => {
+          i.disabled = true;
+        });
+        dictData.companyId = arr;
+      }
+    });
+    await getKnowledge({ pageSize: 10000, showAll: 1 }).then((res) => {
+      dictData.knowledgeList = res.items;
+    });
+    await getExperts({ pageSize: 10000, showAll: 1 }).then((res) => {
+      dictData.expertsList = res.items;
+    });
+    // 获取事件类型
+    await getEventTable({ pageSize: 10000, showAll: 1 }).then((res) => {
+      dictData.eventType = res.items;
+    });
+    // 区域
+    await getAreaList({ parentId: '511503', showAll: 1 }).then((res) => {
+      dictData.areaCode = res;
+    });
+    // 事件级别
+    await findDictItemByCode({ dictCode: 'eventLevelCode' }).then((res) => {
+      dictData.eventLevelCode = res;
+    });
+    // 领域
+    await findDictItemByCode({ dictCode: 'domainId' }).then((res) => {
+      dictData.domainId = res;
+    });
+    // 行业
+    await findDictItemByCode({ dictCode: 'industryId' }).then((res) => {
+      dictData.industryId = res;
+    });
+
+    await reservePlanPage({ pageSize: 10000, showAll: 1 }).then((res) => {
+      let arr = res.items;
+      let obj = {};
+      arr.forEach((i) => {
+        if (obj.hasOwnProperty(i.domainId + ',' + i.domainName)) {
+          obj[i.domainId + ',' + i.domainName].push(i);
+        } else {
+          obj[i.domainId + ',' + i.domainName] = [];
+          obj[i.domainId + ',' + i.domainName].push(i);
+        }
+      });
+      let arr2 = [] as any;
+      let planRes = [] as any;
+      for (let key in obj) {
+        const it = key.split(',');
+        arr2.push({
+          id: it[0],
+          name: it[1],
+          disabled: true,
+          children: obj[key].map((i) => {
+            i.children = i.responses.map((m) => {
+              m.name = i.name + m.responseLevelName + '响应';
+              m.planName = i.name;
+              planRes.push(m);
+              m.annexList = i.annexList;
+              return m;
+            });
+            i.disabled = true;
+            return i;
+          }),
+        });
+      }
+      dictData.plan = arr2;
+      dictData.planRes = planRes;
+    });
+
+    // 获取预警类型
+    await warningType({ pageSize: 10000, showAll: 1 }).then((res) => {
+      dictData.warningType = res.items;
+    });
+    // 预警级别
+    await findDictItemByCode({ dictCode: 'warningLevelCode' }).then((res) => {
+      dictData.warningLevelCode = res;
+    });
+    bus.emit('bigscreenDictData', dictData);
+  };
   // 事件来源
   bus.on('focus', (val: any) => {
     focusListConfig.forEach((item: string) => {
@@ -136,25 +303,14 @@
   bus.on('monitorInfoItm', (feature) => {
     removeLocateIcon();
     showFeatureDeviceInfo(feature);
-    //   let data = receive.data.monitorWarnData;
-    //   item['warnTime'] = data.warnTime;
-    //   deviceEvents.value = arr;
-    // });
   });
   let num1 = ref(1);
   function showTypeCheckIcon(val) {
     num1.value++;
     if (val == 'device') {
       addOrVisibleLayer('device' + searchIndustry.value, deviceList.value, 'id');
-      // industryId.value.forEach((item) => {
-      //   addOrVisibleLayer('device' + item.id, deviceList.value, 'id');
-      // });
-      // addOrVisibleLayer('device', deviceList.value, 'id');
     } else if (val == 'vedio') {
       addOrVisibleLayer('vedio' + searchIndustry.value, videoList.value, 'id');
-      // industryId.value.forEach((item) => {
-      //   addOrVisibleLayer('vedio' + item.id, videoList.value, 'id');
-      // });
     }
   }
   function getDevice() {
@@ -205,10 +361,6 @@
         }
       }),
     ]).then(() => {
-      // debugger;
-      //添加和删除前,先判断是否有这个图层。有的删除后再添加
-      // addLayerData('device', deviceList.value, 'id');
-      // addLayerData('vedio', videoList.value, 'id');
       let time = 0;
       if (initPage) {
         initPage = false;
@@ -225,8 +377,6 @@
         addOrVisibleLayer('device' + searchIndustry.value, deviceList.value, 'id');
         addOrVisibleLayer('vedio' + searchIndustry.value, videoList.value, 'id');
       }, time);
-
-      // addLayerData('vedio', videoList.value, 'id');
     });
   }
   function getFocusData() {
@@ -280,31 +430,29 @@
   const deviceEvents = ref([] as any);
   const hasEventDetail = ref(true);
   const locateLayer = new VectorLayer({});
-  const overlay = ref();
+  let overlay;
   let map;
   // 地图加载回调
   const mapReady = () => {
     // 加载设备点位
     addOrVisibleLayer('device', deviceList.value, 'id');
     map = mapStore.getMap;
-    // const source = mapStore.getSource;
     //地图点击事件
     // 信息图层
     map.getOverlays().clear();
-    overlay.value = new Overlay({
+    overlay = new Overlay({
       id: 'deviceInfo',
       offset: [0, -195],
       element: deviceBaseInfo.value,
       autoPan: true,
-      positioning: 'center-center', // bottom-center ...
+      positioning: 'top-left', // bottom-center ...
       stopEvent: true,
     });
 
-    map.addOverlay(overlay.value);
+    map.addOverlay(overlay);
     map.on('singleclick', (evt: any) => {
       removeLocateIcon();
       var pixel = map.getEventPixel(evt.originalEvent);
-      // showVideo.value = false;
       map.forEachFeatureAtPixel(pixel, async function (feature) {
         if (feature != undefined) {
           if (
@@ -336,7 +484,7 @@
                 dragable: true,
               };
               showDeviceInfo.value = true;
-              overlay.value.setPosition(feature.getGeometry().getCoordinates());
+              overlay.setPosition(feature.getGeometry().getCoordinates());
             });
           }
         } else {
@@ -352,32 +500,18 @@
 
       if (mapZoom >= showTextLevel && !showText) {
         // 展示图标点的名称
-        // setIconDebounce(true);
         showTextLayerDebounce();
         showText = true;
+        map.render();
       } else if (mapZoom < showTextLevel && showText) {
         // 隐藏图标点的名称
-        // setIconDebounce(false);
-        showText = false;
         showTextLayerDebounce();
+        showText = false;
+        map.render();
       }
     });
   };
-  // const setIconDebounce = debounce(setIconName, 500); //防抖
-  /**
-   * 通过设置text的方法来控制图标名的显示,似乎性能不是很好。会造成卡顿
-   */
-  // function setIconName(show: boolean) {
-  //   layerList.value.forEach((item) => {
-  //     const featureList = item.getSource().getFeatures();
-  //     featureList.forEach((feature) => {
-  //       feature
-  //         .getStyle()
-  //         .getText()
-  //         .setText(show ? feature.get('name') : '');
-  //     });
-  //   });
-  // }
+
   /**
    * 图标点名称图层显隐控制,根据当前显示的图层和当前层级判断是否显示或者隐藏
    */
@@ -394,7 +528,7 @@
       });
     }
   }
-  const showTextLayerDebounce = debounce(showTextLayer, 500);
+  const showTextLayerDebounce = debounce(showTextLayer, 1000);
   //展示设备信息
   function showFeatureDeviceInfo(feature: any) {
     addLocateIcon(feature);
@@ -402,14 +536,13 @@
     deviceInfo.value = {};
     // 根据设备id查询事件详情
     deviceEvents.value = [];
-    // console.log(feature);
     getEventInfo(feature);
     // 获取设备指标
     getDeviceIndex({ deviceId: feature.values_.id, page: 1, size: 999999 }).then((res) => {
       deviceIndex.value = res?.data?.records;
       deviceInfo.value = feature.values_;
       showDeviceInfo.value = true;
-      overlay.value.setPosition(feature.getGeometry().getCoordinates()); // getWarningInfoById(item.warningId).then((receive) => {
+      overlay.setPosition(feature.getGeometry().getCoordinates()); // getWarningInfoById(item.warningId).then((receive) => {
     });
   }
   function getEventInfo(feature) {
@@ -466,10 +599,7 @@
     const iconstyle = new Style({
       image: new Icon({
         src: locatepng,
-        // 对图标进行偏移
         scale: 1,
-        // anchorYUnits: 'pixels',
-        // anchor: [0.5, -20],
       }),
     });
     billoard.setStyle(iconstyle);
@@ -491,19 +621,8 @@
       textLayerList.value[index].setVisible(showText && !visible);
     } else {
       if (data && data.length > 0) {
-        // const currentResolution = map.getView().getResolution();
-        const layer = addModuleData(
-          data,
-          0.7,
-          layerId,
-          featureIdField
-          // true,
-          // 'deviceName',
-          // currentResolution
-        );
+        const layer = addModuleData(data, 0.7, layerId, featureIdField);
         const textLayer = addModuleData(data, 0.7, layerId, featureIdField, true);
-
-        // const layer = addModuleData(data, 0.7, layerId, featureIdField);
         layerList.value.push(layer);
         textLayer.setVisible(showText);
         textLayerList.value.push(textLayer);
@@ -511,35 +630,6 @@
       }
     }
   }
-  // 数据发生改变,重新绘制
-  // function addLayerData(layerId: string, data: Array<any>, featureIdField?: string) {
-  //   const index = layerNameList.value.indexOf(layerId);
-  //   if (index > -1) {
-  //     layerList.value[index].getSource().clear();
-  //     map.removeLayer(layerList.value[index]);
-  //     textLayerList.value[index].getSource().clear();
-  //     map.removeLayer(textLayerList.value[index]);
-  //     layerList.value.splice(index, 1);
-  //     textLayerList.value.splice(index, 1);
-  //     layerNameList.value.splice(index, 1);
-  //   }
-  //   // const currentResolution = map.getView().getResolution();
-  //   const layer = addModuleData(
-  //     data,
-  //     0.7,
-  //     layerId,
-  //     featureIdField
-  //     // true,
-  //     // 'deviceName',
-  //     // currentResolution
-  //   );
-  //   const textLayer = addModuleData(data, 0.7, layerId, featureIdField, true);
-  //   // const layer = addModuleData(data, 0.7, layerId, featureIdField);
-  //   layerList.value.push(layer);
-  //   textLayer.setVisible(showText);
-  //   textLayerList.value.push(textLayer);
-  //   layerNameList.value.push(layerId);
-  // }
 
   // 监听业务类型是否更改;监听设备概览点击情况是否改变
   watch(