Explorar o código

视频监控处理报错卡顿、样式优化

Hwf hai 6 meses
pai
achega
375ac07eb8

+ 1 - 1
src/components/Dialog/index.vue

@@ -41,7 +41,7 @@ interface Props {
   modelValue?: boolean;
   type?: string;
   title?: string;
-  hideTitle: boolean;
+  hideTitle?: boolean;
   width?: string;
   height?: string;
   cancelText?: string;

+ 3 - 3
src/components/HKVideo/hikvision-h5player.vue

@@ -102,9 +102,9 @@ const createPlayer = () => {
     pluginErrorHandler: function (iWndIndex, iErrorCode, oError) {
       //插件错误回调
       console.log('插件错误回调pluginError callback: ', iWndIndex, iErrorCode, oError);
-      setTimeout(() => {
-        realplay(state.wsUrl);
-      }, 100);
+      // setTimeout(() => {
+      //   realplay(state.wsUrl);
+      // }, 100);
     },
     windowEventOver: function (iWndIndex) {
       //鼠标移过回调

+ 16 - 12
src/components/HKVideo/index.vue

@@ -2,7 +2,7 @@
   <div class="dot-box" :style="{ width: width ? width + 'px' : '100%', height: height ? height + 'px' : '100%' }">
     <div class="video-box" @click="play_now">
       <HikvisionPlayer
-        v-if="isPlaying || autoplay"
+        v-if="!reload && (isPlaying || autoplay)"
         ref="videoPlayer"
         style="width: 100%; height: 100%; object-fit: fill"
         @on-playing="onHkPlaying"
@@ -33,7 +33,6 @@ const props = defineProps({
   height: Number,
   autoplay: Boolean
 });
-
 const play = () => {
   play_now();
 };
@@ -80,19 +79,25 @@ const onHKPlayError = async () => {
 };
 
 let videoPlayer = ref(null);
+let reload = ref(false);
 watch(
   () => props.dot_data,
   () => {
+    if (!!videoPlayer.value) {
+      videoPlayer.value.stop();
+    }
+    posterVisible.value = true;
+    errBKVisible.value = false;
+    isPlaying.value = false;
     if (props.autoplay) {
-      play_now();
-    } else {
-      if (!!videoPlayer.value) {
-        videoPlayer.value.stop();
-      }
-      posterVisible.value = true;
-      errBKVisible.value = false;
-      isPlaying.value = false;
+      reload.value = true;
     }
+    nextTick(() => {
+      if (props.autoplay) {
+        reload.value = false;
+        play_now();
+      }
+    });
   },
   {
     deep: true
@@ -159,10 +164,9 @@ onMounted(() => {
   }
 
   .err_bk {
-    z-index: 999;
+    z-index: 900;
     left: 0;
     top: 0;
-    z-index: 99999;
     background: #000;
     position: absolute;
     width: 100%;

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

@@ -21,6 +21,7 @@ declare module 'vue' {
     ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
     ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCard: typeof import('element-plus/es')['ElCard']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
@@ -37,22 +38,34 @@ declare module 'vue' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
+    ElLink: typeof import('element-plus/es')['ElLink']
     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']
+    ElRadio: typeof import('element-plus/es')['ElRadio']
+    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
     ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
     ElSlider: typeof import('element-plus/es')['ElSlider']
+    ElStep: typeof import('element-plus/es')['ElStep']
+    ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    ElTable: typeof import('element-plus/es')['ElTable']
+    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElTabPane: typeof import('element-plus/es')['ElTabPane']
+    ElTabs: typeof import('element-plus/es')['ElTabs']
     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']
+    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     FooterSection: typeof import('./../components/FooterSection/index.vue')['default']
@@ -63,6 +76,7 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']
@@ -99,4 +113,7 @@ declare module 'vue' {
     YMapold: typeof import('./../components/Map/YMapold.vue')['default']
     YztMap: typeof import('./../components/Map/YztMap/index.vue')['default']
   }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
 }

+ 16 - 17
src/views/emergencyCommandMap/LeftSection/VideoMonitor.vue

@@ -4,7 +4,7 @@
     <div class="more-btn" @click="showVideoMonitorList">查看更多</div>
     <div class="card-content video-list">
       <div v-for="(item, index) in listData" :key="index" class="video-box">
-        <HKVideo :dot_data="item" :width="560" :height="256" autoplay />
+        <HKVideo :dot_data="item" autoplay />
         <div class="video-label">
           <span class="label">{{ item.name }}</span>
         </div>
@@ -29,13 +29,7 @@
 <!--            </el-select>-->
 <!--          </el-form-item>-->
           <el-form-item prop="name">
-            <el-input
-              v-model="queryParams.name"
-              class="custom-input2"
-              placeholder="请输入摄像头名称"
-              size="large"
-              style="width: 500px"
-            />
+            <el-input v-model="queryParams.name" class="custom-input2" placeholder="请输入摄像头名称" size="large" style="width: 500px" />
           </el-form-item>
           <el-form-item>
             <div class="common-btn-primary" @click="handleQuery">搜索</div>
@@ -47,15 +41,15 @@
       <div v-show="editVideo" class="edit-box">
         <div class="flex">
           <div v-for="(item, index) in editData" :key="index" class="box-item">
-            <div class="edit-img">
+            <div class="edit-img" :title="item.name">
               <span class="edit-title">{{ item.name }}</span>
               <div class="close-btn" @click="deleteItem(index)"></div>
             </div>
           </div>
-          <div class="flex" style="flex-direction: column; align-items: center">
-            <div class="common-btn-primary3" @click="handleSave">保存</div>
-            <div class="common-btn-danger2" @click="handleCancel">取消</div>
-          </div>
+        </div>
+        <div class="flex" style="flex-direction: column; align-items: center">
+          <div class="common-btn-primary3" @click="handleSave">保存</div>
+          <div class="common-btn-danger2" @click="handleCancel">取消</div>
         </div>
       </div>
     </div>
@@ -277,7 +271,7 @@ initData();
         position: absolute;
         bottom: 17px;
         right: 20px;
-        z-index: 99;
+        z-index: 901;
         display: flex;
         .label {
           width: 411px;
@@ -330,7 +324,7 @@ initData();
     cursor: pointer;
     background: url('@/assets/images/video/videoBg.png') no-repeat;
     background-size: 100% 100%;
-    padding: 14.5px 9px;
+    padding: 14.5px 16px;
     position: relative;
     margin-bottom: 40px;
     position: relative;
@@ -345,7 +339,7 @@ initData();
       position: absolute;
       bottom: 17px;
       right: 20px;
-      z-index: 99;
+      z-index: 901;
       display: flex;
       .label {
         width: 411px;
@@ -386,7 +380,7 @@ initData();
 }
 .edit-box {
   display: flex;
-  justify-content: center;
+  justify-content: space-between;
   align-items: center;
   border-radius: 8px;
   padding: 5px 10px;
@@ -408,6 +402,11 @@ initData();
   }
   .edit-title {
     color: #fff;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 3; /* 设置显示的行数 */
+    overflow: hidden;
+    text-overflow: ellipsis;
   }
   .close-btn {
     position: absolute;

+ 82 - 0
src/views/globalMap/RightMenu/OnlinePlotting/EditGroup.vue

@@ -0,0 +1,82 @@
+<template>
+  <Dialog custom-show :title="groupForm.groupId ? '编辑分组' : '添加分组'" type="xs" height="auto" hide-footer @close="handleClose">
+    <div class="form-item">
+      <div class="text1">分组名称</div>
+      <el-input v-model="groupForm.name" class="custom-input" placeholder="请输入" />
+    </div>
+    <div class="form-action">
+      <div v-if="groupForm.groupId" class="common-btn-primary" @click="handleAddGroup">保存</div>
+      <div v-else class="common-btn-primary" @click="handleUpdateGroup">删除</div>
+      <div v-if="groupForm.groupId" class="common-btn-primary" @click="handleDeleteGroup">删除</div>
+      <div class="common-btn" @click="handleClose">取消</div>
+    </div>
+  </Dialog>
+</template>
+
+<script lang="ts" setup>
+import { addGroup } from '@/api/globalMap/onlinePlotting';
+
+const props = defineProps({
+  modelValue: Boolean,
+  patternId: String,
+  groupId: String
+});
+const emits = defineEmits(['update:modelValue', 'change']);
+let groupForm = ref({
+  groupId: '',
+  name: ''
+});
+watch(
+  () => props.groupId,
+  () => {
+    if (!!props.groupId) {
+      // 获取详情
+    }
+  },
+  {
+    immediate: true
+  }
+);
+// 新增分组
+const handleAddGroup = () => {
+  const obj = {
+    group_name: groupForm.value.name,
+    pattern_id: props.patternId
+  };
+  addGroup(obj).then((res) => {
+    emits('update:modelValue', false);
+    emits('change', false);
+  });
+};
+// 修改分组
+const handleUpdateGroup = () => {
+
+}
+// 关闭弹窗
+const handleClose = () => {
+  emits('update:modelValue', false);
+};
+// 删除分组
+const handleDeleteGroup = () => {
+  handleClose();
+};
+</script>
+
+<style lang="scss" scoped>
+.form-item {
+  display: flex;
+  align-items: center;
+  .text1 {
+    flex-shrink: 0;
+    margin-right: 10px;
+  }
+  .custom-input {
+    flex: 1;
+  }
+}
+.form-action {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+</style>

+ 15 - 50
src/views/globalMap/RightMenu/OnlinePlotting/LayerDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog title="预案名称" custom-show hide-footer @close="handleClose1">
+  <Dialog title="预案名称" custom-show type="lg" hide-footer @close="handleClose1">
     <div class="btn-box1">
       <div class="btn1" @click="handleShowCooperate">
         <i class="icon1" />
@@ -47,9 +47,9 @@
           <div class="td" :title="item.nickName">{{ item.nick_name }}</div>
           <div class="td" :title="item.dept_name">{{ item.dept_name }}</div>
           <div class="td" :title="item.create_time">{{ item.create_time }}</div>
-          <div class="td">
-            <div v-if="item.group_name !== '默认分组'" class="btn-text">删除</div>
-            <div v-if="item.group_name !== '默认分组'" class="btn-text">编辑</div>
+          <div class="td" style="display: flex; align-items: center; justify-content: center">
+            <div v-if="item.group_name !== '默认分组'" class="btn-text" style="margin-right: 20px" @click="handleDeleteGroup">删除</div>
+            <div v-if="item.group_name !== '默认分组'" class="btn-text" style="margin-right: 20px" @click="handleShowGroup(item.group_id)">编辑</div>
             <div class="btn-text">{{ item.visible !== '0' ? '隐藏' : '显示' }}</div>
           </div>
         </div>
@@ -65,26 +65,17 @@
       </div>
     </div>
   </Dialog>
-  <Dialog v-model="showGroup" :title="groupForm.groupId ? '编辑分组' : '添加分组'" type="xs" hide-footer>
-    <div class="form-item">
-      <div class="text1">分组名称</div>
-      <el-input v-model="groupForm.name" class="custom-input" placeholder="请输入" />
-    </div>
-    <div class="form-action">
-      <div class="common-btn-primary" @click="handleAddGroup">保存</div>
-      <div v-if="groupForm.groupId" class="common-btn-primary" @click="handleDeleteGroup">删除</div>
-      <div class="common-btn" @click="handleClose2">取消</div>
-    </div>
-  </Dialog>
+  <EditGroup v-if="showGroup" v-model="showGroup" :patternId="patternId" :groupId="groupId" @change="getList" />
   <Contact v-if="showCooperate" v-model="showCooperate" @close="handleClose3" @confirm="handleConfirm" />
   <CollaborativeUser v-if="showUser" v-model="showUser" :patternId="patternId" />
   <ImportLayer v-if="showImportLayer" v-model="showImportLayer" />
 </template>
 
 <script lang="ts" setup name="LayerDetail">
-import { addGroup, addWsUser, getBzList, getPatternUserList } from '@/api/globalMap/onlinePlotting';
+import { addWsUser, getBzList } from '@/api/globalMap/onlinePlotting';
 import ImportLayer from './ImportLayer.vue';
 import CollaborativeUser from './CollaborativeUser.vue';
+import EditGroup from './EditGroup.vue';
 const props = defineProps({
   modelValue: Boolean,
   patternId: String
@@ -104,32 +95,21 @@ let queryParams = reactive({
 let dataList = ref([]);
 
 let showGroup = ref(false);
-let groupForm = ref({
-  groupId: '',
-  name: ''
-});
-const handleShowGroup = () => {
+let groupId = ref('');
+const handleShowGroup = (id) => {
+  if (!!id) {
+    groupId.value = id;
+  }
   showGroup.value = true;
 };
-const handleAddGroup = () => {
-  const obj = {
-    group_name: groupForm.value.name,
-    pattern_id: props.patternId
-  };
-  addGroup(obj).then((res) => {
-    showGroup.value = false;
-    getList();
-  });
-};
+
 const handleClose1 = () => {
   emits('update:modelValue', false);
 };
 const handleDeleteGroup = () => {
   showGroup.value = false;
 };
-const handleClose2 = () => {
-  showGroup.value = false;
-};
+
 let showCooperate = ref(false);
 const handleShowCooperate = () => {
   showCooperate.value = true;
@@ -239,22 +219,7 @@ onMounted(() => {
     background-size: 100% 100%;
   }
 }
-.form-item {
-  display: flex;
-  align-items: center;
-  .text1 {
-    flex-shrink: 0;
-    margin-right: 10px;
-  }
-  .custom-input {
-    flex: 1;
-  }
-}
-.form-action {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-}
+
 .btn-text {
   color: #5983df;
   cursor: pointer;

+ 6 - 6
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -868,14 +868,14 @@ const handleSendForm = () => {
   if (!form.value.pattern_name) {
     return proxy?.$modal.msgWarning('请填写预案名称');
   }
-  // webSock = createWebSocket('ZEaBf-NZ4Fi29kSYGdNeJ', getWebSocketData);
-  // patternId.value = 'ZEaBf-NZ4Fi29kSYGdNeJ';
-  createCollaboration(form.value).then(() => {
-    patternId.value = form.value.pattern_id;
-    webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
+  webSock = createWebSocket('ZEaBf-NZ4Fi29kSYGdNeJ', getWebSocketData);
+  patternId.value = 'ZEaBf-NZ4Fi29kSYGdNeJ';
+  // createCollaboration(form.value).then(() => {
+  //   patternId.value = form.value.pattern_id;
+  //   webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
     showForm.value = false;
     collaboration.value = true;
-  });
+  // });
 };
 const handleShowDialog = () => {
   editData.value = {