Explorar el Código

水利附近视频

Hwf hace 1 mes
padre
commit
20739eb406

+ 9 - 9
src/components/HKVideo/video-container2.vue

@@ -4,7 +4,7 @@
       <div class="tag" :title="videoData[0].name">
         <div class="name">{{ videoData[0].name }}</div>
       </div>
-      <HKVideo :dot_data="videoData[0]" :height="595" />
+      <HKVideo :dot_data="videoData[0]" :height="595" autoplay />
     </div>
   </div>
   <div v-else-if="videoData.length >= 2 && videoData.length <= 4" class="video-container2">
@@ -12,7 +12,7 @@
       <div class="tag" :title="item.name">
         <div class="name">{{ item.name }}</div>
       </div>
-      <HKVideo :dot_data="item" :height="288" />
+      <HKVideo :dot_data="item" :height="288" autoplay />
     </div>
   </div>
   <div v-else-if="videoData.length >= 5 && videoData.length <= 6" class="video-container3">
@@ -21,7 +21,7 @@
         <div class="tag" :title="videoData[0].name">
           <div class="name">{{ videoData[0].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[0]" :height="383" />
+        <HKVideo :dot_data="videoData[0]" :height="383" autoplay />
       </div>
     </div>
     <div class="box2">
@@ -29,13 +29,13 @@
         <div class="tag" :title="videoData[1].name">
           <div class="name">{{ videoData[1].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[1]" :height="188" />
+        <HKVideo :dot_data="videoData[1]" :height="188" autoplay />
       </div>
       <div class="video-item3">
         <div class="tag" :title="videoData[2].name">
           <div class="name">{{ videoData[2].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[2]" :height="188" />
+        <HKVideo :dot_data="videoData[2]" :height="188" autoplay />
       </div>
     </div>
     <div class="box3">
@@ -43,19 +43,19 @@
         <div class="tag" :title="videoData[3].name">
           <div class="name">{{ videoData[3].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[3]" :height="188" />
+        <HKVideo :dot_data="videoData[3]" :height="188" autoplay />
       </div>
       <div class="video-item">
         <div class="tag" :title="videoData[4].name">
           <div class="name">{{ videoData[4].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[4]" :height="188" />
+        <HKVideo :dot_data="videoData[4]" :height="188" autoplay />
       </div>
       <div class="video-item">
         <div class="tag" :title="videoData[5].name">
           <div class="name">{{ videoData[5].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[5]" :height="188" />
+        <HKVideo :dot_data="videoData[5]" :height="188" autoplay />
       </div>
     </div>
   </div>
@@ -64,7 +64,7 @@
       <div class="tag" :title="item.name">
         <div class="name">{{ item.name }}</div>
       </div>
-      <HKVideo :dot_data="item" :height="180" />
+      <HKVideo :dot_data="item" :height="180" :autoplay="index < 9" />
     </div>
   </div>
   <div v-else class="tip">附近没有可用监控视频</div>

+ 23 - 24
src/components/Map/YztMap/index.vue

@@ -183,36 +183,35 @@ const handlePointDetails = (data) => {
       titleDom.className = 'title-box';
       titleDom.innerHTML = '<div class="gradient-text">' + title + '</div></div>';
       div.appendChild(titleDom);
-      if (data.dataType === 2) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>物资详情</div>';
-        btn.onclick = () => {
-          emits('handleShowWarehouse', data);
-        };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 4) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>附近视频</div>';
-        btn.onclick = () => {
-          emits('handleShowVideo', data);
+      const objs = {
+        '2': {
+          title: '物资详情',
+          method: 'handleShowWarehouse'
+        },
+        '41': {
+          title: '人员列表',
+          method: 'handleShowPeople'
+        },
+        '43': {
+          title: '历史轨迹',
+          method: 'handleShowTrack'
+        }
+      };
+      let obj = objs[data.dataType];
+      if ([4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58].includes(data.dataType)) {
+        obj = {
+          title: '附近视频',
+          method: 'handleShowVideo'
         };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 41) {
+      }
+      if (!!obj) {
         let btnBox = document.createElement('div');
         let btn = document.createElement('div');
         btnBox.className = 'flex';
         btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>人员列表</div>';
+        btn.innerHTML = '<div class="video-icon"></div>' + obj.title + '<div></div>';
         btn.onclick = () => {
-          emits('handleShowPeople', data);
+          emits(obj.method, data);
         };
         btnBox.appendChild(btn);
         div.appendChild(btnBox);

+ 23 - 24
src/components/Map/index.vue

@@ -132,36 +132,35 @@ const handlePointDetails = (data) => {
       titleDom.className = 'title-box';
       titleDom.innerHTML = '<div class="gradient-text">' + title + '</div></div>';
       div.appendChild(titleDom);
-      if (data.dataType === 2) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>物资详情</div>';
-        btn.onclick = () => {
-          emits('handleShowWarehouse', data);
-        };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 4) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>附近视频</div>';
-        btn.onclick = () => {
-          emits('handleShowVideo', data);
+      const objs = {
+        '2': {
+          title: '物资详情',
+          method: 'handleShowWarehouse'
+        },
+        '41': {
+          title: '人员列表',
+          method: 'handleShowPeople'
+        },
+        '43': {
+          title: '历史轨迹',
+          method: 'handleShowTrack'
+        }
+      };
+      let obj = objs[data.dataType];
+      if ([4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58].includes(data.dataType)) {
+        obj = {
+          title: '附近视频',
+          method: 'handleShowVideo'
         };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 41) {
+      }
+      if (!!obj) {
         let btnBox = document.createElement('div');
         let btn = document.createElement('div');
         btnBox.className = 'flex';
         btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>人员列表</div>';
+        btn.innerHTML = '<div class="video-icon"></div>' + obj.title + '<div></div>';
         btn.onclick = () => {
-          emits('handleShowPeople', data);
+          emits(obj.method, data);
         };
         btnBox.appendChild(btn);
         div.appendChild(btnBox);

+ 19 - 0
src/types/components.d.ts

@@ -27,8 +27,12 @@ declare module 'vue' {
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
+    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
+    ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
+    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -36,14 +40,29 @@ declare module 'vue' {
     ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
     ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
+    ElForm: typeof import('element-plus/es')['ElForm']
+    ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElImage: typeof import('element-plus/es')['ElImage']
+    ElInput: typeof import('element-plus/es')['ElInput']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
+    ElOption: typeof import('element-plus/es')['ElOption']
+    ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
+    ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
+    ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    ElTag: typeof import('element-plus/es')['ElTag']
+    ElText: typeof import('element-plus/es')['ElText']
+    ElTimeline: typeof import('element-plus/es')['ElTimeline']
+    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
+    ElTree: typeof import('element-plus/es')['ElTree']
+    ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     FlvVideo: typeof import('./../components/FlvVideo/index.vue')['default']

+ 10 - 5
src/utils/olMap/olMap.ts

@@ -374,7 +374,8 @@ export class olMap {
       }),
       zIndex: options.zIndex ? options.zIndex : -99
     });
-
+    vectorLayer.set('layerName', options.layer);
+    vectorLayer.set('id', options.code);
     this.map.addLayer(vectorLayer);
   }
   // 加载json图层
@@ -395,6 +396,8 @@ export class olMap {
         }),
         zIndex: layer.zIndex ? layer.zIndex : -99
       });
+      jsonLayer.set('layerName', layer.layer);
+      jsonLayer.set('id', layer.code);
       this.map.addLayer(jsonLayer);
       resolve({});
     });
@@ -669,17 +672,19 @@ export class olMap {
     const layers = this.map.getLayers();
     const layerArray = layers.getArray().slice();
     layerArray.forEach((layer) => {
-      // 标注现在都是用同一个暂不移除'annotation'
-      if (!!layer && ['map'].includes(layer.get('layerName'))) {
+      if (!!layer && ['map', 'annotation'].includes(layer.get('layerName'))) {
         layer.getSource().clear();
         layer.dispose();
         this.map.removeLayer(layer);
       }
     });
-
     if (Array.isArray(newLayers)) {
       for (const layer of newLayers) {
-        await this.formatXml(layer);
+        if (layer.layerType === 'JSON') {
+          await this.createJsonLayer(layer);
+        } else {
+          await this.formatXml(layer);
+        }
       }
     } else if (newLayers.id === 'tianditu') {
       await this.formatXml2();

+ 3 - 3
src/views/globalMap/RightMenu/LayerAnalysis.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="menu-content">
-    <div class="gradient-text title">图层分析</div>
+    <div class="gradient-text common-dialog-title2">图层分析</div>
     <div class="scroll-box">
       <div class="box">
         <div
@@ -16,12 +16,12 @@
       </div>
       <div class="box2">
         <div class="box2-title">各区县分布统计</div>
-        <Chart :option="chartOption1" style="width: 100%; height: 948px" />
+        <Chart :option="chartOption1" style="width: 100%; height: 350px" />
       </div>
       <div class="box2">
         <div class="box2-title">类型统计</div>
         <div class="box2-right">
-          <Chart ref="chartRef" :option="chartOption2" style="width: 500px; height: 100%" />
+          <Chart ref="chartRef" :option="chartOption2" style="width: 250px; height: 100%" />
           <div class="legend-box">
             <div v-for="(item, index) in legendData" :key="index" class="legend-item" @click="handleClickLegend(item)">
               <span class="dot" :style="{ backgroundColor: getColor(item.checked, index) }"></span>{{ item.name }}:{{ item.value }}