浏览代码

修改分组标注状态

Hwf 3 周之前
父节点
当前提交
bf3ce3b4a8

+ 12 - 0
src/api/globalMap/onlinePlotting.ts

@@ -158,6 +158,18 @@ export const updateGroupVisible = (groupId, visible) => {
   });
 };
 
+// 更新分组显示状态
+export const updateBzVisible = (ids, visible) => {
+  return request({
+    url: '/api/pattern/ws/bz_visible',
+    method: 'put',
+    data: {
+      zb_id_list: ids,
+      visible: visible
+    }
+  });
+};
+
 // 模板分类树
 export const getTemplateTree = (params) => {
   return request({

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

@@ -45,23 +45,29 @@ declare module 'vue' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
+    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     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']
     ElSlider: typeof import('element-plus/es')['ElSlider']
     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']
     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']
+    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
@@ -74,6 +80,8 @@ 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']
+    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
+    IEpCaretTop: typeof import('~icons/ep/caret-top')['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']

+ 5 - 4
src/views/globalMap/RightMenu/OnlinePlotting/LayerDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog title="预案名称" custom-show hide-footer type="lg" @close="handleClose1">
+  <Dialog title="预案名称" draggable custom-show hide-footer type="lg" @close="handleClose1">
     <div class="btn-box1">
       <div class="btn1" @click="handleShowCooperate">
         <i class="icon1" />
@@ -72,7 +72,7 @@
 </template>
 
 <script lang="ts" setup name="LayerDetail">
-import { addWsUser, delGroup, getBzList, updateGroupVisible } from '@/api/globalMap/onlinePlotting';
+import { addWsUser, delGroup, getBzList, updateBzVisible, updateGroupVisible } from '@/api/globalMap/onlinePlotting';
 import ImportLayer from './ImportLayer.vue';
 import EditGroup from './EditGroup.vue';
 import CollaborativeUser from './CollaborativeUser.vue';
@@ -150,8 +150,9 @@ const handleVisible = (item) => {
   });
 };
 const handleVisible2 = (item) => {
-  item.visible = item.visible === '1' ? '0' : '1';
-  emits('handleSendData', { type: 'update', content: item });
+  updateBzVisible([item.id], item.visible === '1' ? '0' : '1').then(() => {
+    getList();
+  });
 };
 onMounted(() => {
   getList();

+ 3 - 1
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -970,7 +970,9 @@ const getWebSocketData = (data) => {
         if (parseContent.type === 'marker' && !!parseContent.icon) {
           parseContent.icon = getImageUrl(parseContent.icon);
         }
-        data2.push(parseContent);
+        if (item.visible === '1') {
+          data2.push(parseContent);
+        }
       }
     });
     const res = mapUtils.drawData(data2);