Browse Source

修改分组标注状态

Hwf 3 months ago
parent
commit
f341d9de46

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

@@ -151,6 +151,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({

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

@@ -34,6 +34,11 @@ declare module 'vue' {
     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']
+    ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    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']

+ 23 - 0
src/views/globalMap/RightMenu/OnlinePlotting/CollaborativeOperationBar.vue

@@ -0,0 +1,23 @@
+<template>
+  <div v-show="modelValue" style="display: flex; align-items: center; justify-content: flex-end; height: 90px">
+    <div class="btn2" style="margin-left: 10px" @click="handleCloseCollaboration">关闭协同</div>
+    <div class="btn2" style="margin-left: 10px" @click="handleSaveCollaboration">保存</div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { closeCollaboration } from '@/api/globalMap/onlinePlotting';
+
+const props = defineProps({
+  modelValue: Boolean
+});
+const handleCloseCollaboration = () => {
+  closeCollaboration({ pattern_id: patternId.value }).then(() => {
+    collaboration.value = false;
+  });
+};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

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

@@ -1,5 +1,5 @@
 <template>
-  <Dialog title="预案名称" custom-show type="lg" hide-footer @close="handleClose1">
+  <Dialog title="预案名称" draggable custom-show type="lg" hide-footer @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 CollaborativeUser from './CollaborativeUser.vue';
 import EditGroup from './EditGroup.vue';
@@ -151,8 +151,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();

+ 8 - 9
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -1,10 +1,7 @@
 <template>
   <div class="menu-content">
     <div class="gradient-text title">实时标绘</div>
-    <div v-show="collaboration" style="display: flex; align-items: center; justify-content: flex-end; height: 90px">
-      <div class="btn2" style="margin-left: 10px" @click="handleCloseCollaboration">关闭协同</div>
-      <div class="btn2" style="margin-left: 10px" @click="handleSaveCollaboration">保存</div>
-    </div>
+    <CollaborativeOperationBar v-model="collaboration" />
     <div class="line">
       <div class="tabs1">
         <div v-for="(item, index) in menu" :key="index" :class="menuActive1 === index ? 'tab tab_active' : 'tab'" @click="clickTab(index)">
@@ -190,11 +187,9 @@
   <div v-show="tipTitle !== ''" class="tipTitle">{{ tipTitle }}</div>
   <!--保存修改弹窗-->
   <EditDialog v-if="showEdit" v-model="showEdit" :edit-data="editData" @submit="handleSubmit" />
-  <Contact v-if="shareState.showShare" v-model="shareState.showShare" @close="handleCloseShare"
-           @confirm="handleShareConfirm" />
+  <Contact v-if="shareState.showShare" v-model="shareState.showShare" @close="handleCloseShare" @confirm="handleShareConfirm" />
   <!--修改预案-->
-  <Dialog v-if="showForm" v-model="showForm" custom-show title="协同标绘" height="auto" type="xs"
-          @close="showForm = false" @confirm="handleSendForm">
+  <Dialog v-if="showForm" v-model="showForm" custom-show title="协同标绘" height="auto" type="xs" @close="showForm = false" @confirm="handleSendForm">
     <div style="display: flex; align-items: center">
       <div style="font-size: 36px">预案名称:</div>
       <el-input v-model="form.pattern_name" class="custom-input" placeholder="请输入" style="flex: 1" />
@@ -242,6 +237,7 @@ import * as turf from '@turf/turf';
 import Style from 'ol/style/Style';
 import Icon from 'ol/style/Icon';
 import useMapStore from '@/store/modules/map';
+import CollaborativeOperationBar from '@/views/globalMap/RightMenu/OnlinePlotting/CollaborativeOperationBar.vue';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const mapStore = useMapStore();
@@ -907,6 +903,7 @@ const handleShowPatternData = () => {
   confirmData.value = [];
 };
 const handleSaveCollaboration = () => {
+
 };
 let showForm = ref(false);
 let form = ref({
@@ -955,7 +952,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);