Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/types/components.d.ts
yangyuxuan 3 недель назад
Родитель
Сommit
6d739ed04d

+ 7 - 2
src/components/LineWidthSelect/index.vue

@@ -5,7 +5,12 @@
       <div class="icon"></div>
     </div>
     <div v-show="show" class="select-content">
-      <div v-for="(item, index) in options" :key="index" :class="modelValue === item.value ? 'item item-active' : 'item'" @click="handleClick(item.value)">
+      <div
+        v-for="(item, index) in options"
+        :key="index"
+        :class="modelValue === item.value ? 'item item-active' : 'item'"
+        @click="handleClick(item.value)"
+      >
         <div class="text1" :style="{ height: item.value + 'px' }"></div>
       </div>
     </div>
@@ -14,7 +19,7 @@
 
 <script lang="ts" setup name="LineWidthSelect">
 interface Props {
-  modelValue: boolean;
+  modelValue: string;
   options: object[];
 }
 const props = withDefaults(defineProps<Props>(), {});

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

@@ -45,30 +45,23 @@ 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']
-    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']
     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']
@@ -81,9 +74,6 @@ 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']
-    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']

+ 0 - 4
src/views/emergencyCommandMap/LeftSection/VideoMonitor.vue

@@ -88,10 +88,6 @@ const showVideoMonitorList = () => {
         margin-right: 0;
       }
     }
-    :deep(.err_box) {
-      align-items: flex-start;
-      padding-top: 15px;
-    }
   }
 }
 .more-btn {

+ 1 - 1
src/views/globalMap/RightMenu/OnlinePlotting/EditClassDialog.vue

@@ -50,7 +50,7 @@ import { deepClone } from '@/utils';
 import { toRefs } from 'vue';
 
 const props = defineProps({
-  modelValue: String,
+  modelValue: Boolean,
   id: String,
   templateId: String
 });

+ 102 - 24
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -3,7 +3,7 @@
     <div class="gradient-text common-dialog-title2">实时标绘</div>
     <div v-show="collaboration" style="display: flex; align-items: center; justify-content: flex-end">
       <div class="btn2" style="margin-left: 10px" @click="handleCloseCollaboration">关闭协同</div>
-<!--      <div class="btn2" style="margin-left: 10px">保存</div>-->
+      <!--      <div class="btn2" style="margin-left: 10px">保存</div>-->
     </div>
     <div class="line">
       <div class="tabs1">
@@ -133,24 +133,26 @@
           <div class="th">预案名称</div>
           <div class="th">操作</div>
         </div>
-        <div v-for="(item, index) in patternList" :key="index" class="tr">
-          <div class="td">
-            <div>{{ item.pattern_name }}</div>
-          </div>
-          <div class="td td2">
-            <div class="btn" @click="handleDelete(item.id)">
-              <div class="delete-icon"></div>
-              删除
-            </div>
-            <div class="line2"></div>
-            <div class="btn" @click="handleEdit(item.id)">
-              <div class="edit-icon"></div>
-              编辑
+        <div class="table-content">
+          <div v-for="(item, index) in patternList" :key="index" class="tr" @click="handleShowConfirm(item)">
+            <div class="td">
+              <div>{{ item.pattern_name }}</div>
             </div>
-            <div class="line2"></div>
-            <div class="btn" @click="handleShare('2', item.id)">
-              <div class="share-icon"></div>
-              分享
+            <div class="td td2">
+              <div class="btn" @click.stop="handleDelete(item.id)">
+                <div class="delete-icon"></div>
+                删除
+              </div>
+              <div class="line2"></div>
+              <div class="btn" @click.stop="handleEdit(item.id)">
+                <div class="edit-icon"></div>
+                编辑
+              </div>
+              <div class="line2"></div>
+              <div class="btn" @click.stop="handleShare('2', item.id)">
+                <div class="share-icon"></div>
+                分享
+              </div>
             </div>
           </div>
         </div>
@@ -183,12 +185,26 @@
   <!--保存修改弹窗-->
   <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" />
+  <!--修改预案-->
   <Dialog v-if="showForm" v-model="showForm" custom-show title="协同标绘" type="xs" @close="showForm = false" @confirm="handleSendForm">
     <div style="display: flex; align-items: center">
       <div style="font-size: 16px">预案名称:</div>
       <el-input v-model="form.pattern_name" class="custom-input" placeholder="请输入" style="flex: 1" />
     </div>
   </Dialog>
+  <!--加载预案确认-->
+  <Dialog
+    v-if="showConfirmDialog"
+    v-model="showConfirmDialog"
+    custom-show
+    title="提示"
+    height="auto"
+    type="xs"
+    @close="handleCancel"
+    @confirm="handleShowPatternData"
+  >
+    <div>是否确定加载该预案到地图上?</div>
+  </Dialog>
   <LayerDetail v-if="showLayer" v-model="showLayer" :pattern-id="patternId" />
   <!--协同标绘选择弹窗-->
   <SelectPoltting v-if="showOnlinePlotting" v-model="showOnlinePlotting" @confirm="handleOpenPlotting" />
@@ -209,7 +225,7 @@ import {
   deleteClassificationCreate,
   deletePatternById,
   getPatternInfo,
-  getPatternList, getPatternList2,
+  getPatternList,
   getTemplateTree
 } from '@/api/globalMap/onlinePlotting';
 import { Search } from '@element-plus/icons-vue';
@@ -392,7 +408,8 @@ const clickTab3 = (item, index) => {
     const drawTool = getDrawTool();
     if (mouseToolState.value.graphicsType === 'anyLine') {
       drawTool.setDrawEndMethod(handleEndDraw);
-    } else if (mouseToolState.value.graphicsType !== 'text') {
+    }
+    if (mouseToolState.value.graphicsType !== 'text') {
       const newOptions = drawTool.drawGraphics(mouseToolState.value);
       // 绘制完成事件
       initDrawMethod(newOptions);
@@ -799,6 +816,7 @@ const queryParams = reactive({
   pattern_name: ''
 });
 
+let patternLayerData = [];
 const patternList = ref([]);
 let total = ref(0);
 let editData = ref({
@@ -807,6 +825,8 @@ let editData = ref({
   content: {}
 });
 let showEdit = ref(false);
+let showConfirmDialog = ref(false);
+let confirmData = ref([]);
 const handleSubmit = () => {
   showEdit.value = false;
   editData.value = {
@@ -831,6 +851,7 @@ const getList = () => {
 const handleDelete = (id: number) => {
   proxy?.$modal.confirm('是否确认删除选择的数据项?').then(() => {
     deletePatternById(id).then(() => {
+      proxy?.$modal.msgSuccess('删除成功');
       getList();
     });
   });
@@ -842,6 +863,44 @@ const handleEdit = (id) => {
   });
   showEdit.value = true;
 };
+const handleShowConfirm = (data) => {
+  confirmData.value = data.content;
+  showConfirmDialog.value = true;
+};
+const handleCancel = () => {
+  showConfirmDialog.value = false;
+  confirmData.value = [];
+};
+// 加载预案图层
+const handleShowPatternData = () => {
+  showConfirmDialog.value = false;
+  const data = [];
+  confirmData.value.forEach((item) => {
+    overlaysData.push(deepClone(item));
+    if (item.type === 'marker') {
+      item.icon = getImageUrl(item.icon);
+      item.image = getImageUrl(item.image);
+      item.imageHover = getImageUrl(item.imageHover);
+    }
+    data.push(item);
+  });
+  const res = mapUtils.drawData(data);
+  res.forEach((item) => {
+    overlays.push(item);
+  });
+  commit(deepClone(overlaysData));
+  confirmData.value = [];
+};
+// 清除预案图层
+const clearpatternLayerData = () => {
+  if (patternLayerData.length > 0) {
+    patternLayerData.forEach((item) => {
+      item.setMap(null);
+      item.destroy();
+    });
+    patternLayerData = [];
+  }
+};
 // 实时标绘
 let showOnlinePlotting = ref(false);
 
@@ -967,7 +1026,7 @@ const handleQuitSetting = () => {
   showSetting.value = false;
   getTemplateTreeData();
 };
-const handleShowSetting = (item, index) => {
+const handleShowSetting = (item) => {
   menu.value[0].children.forEach((menu2) => {
     menu2.children.forEach((item2) => {
       item2.showSetting = item.name === item2.name;
@@ -1029,10 +1088,21 @@ const handleSendData = (data) => {
     );
   }
 };
+const clearData = () => {
+  overlays.forEach((item) => {
+    item.setMap(null);
+    item.destroy();
+  });
+  overlays = [];
+  overlaysData = [];
+};
 onMounted(() => {
   getTemplateTreeData();
   getList();
 });
+onUnmounted(() => {
+  clearData();
+});
 </script>
 
 <style lang="scss" scoped>
@@ -1447,15 +1517,22 @@ onMounted(() => {
         }
       }
     }
+    .table-content {
+      max-height: 405px;
+      overflow: auto;
+    }
     .tr {
       display: flex;
+      align-items: center;
       font-size: 14px;
-      height: 32px;
+      min-height: 32px;
       background: url('@/assets/images/map/rightMenu/onlinePlotting/tr.png') no-repeat;
       background-size: 100% 100%;
       margin-top: 10px;
+      cursor: pointer;
       &:hover {
         background: url('@/assets/images/map/rightMenu/onlinePlotting/trActive.png') no-repeat;
+        background-size: 100% 100%;
       }
       .td {
         padding: 11px;
@@ -1503,6 +1580,7 @@ onMounted(() => {
     width: 6px;
     height: 6px;
     background: url('@/assets/images/inputIcon1.png') no-repeat;
+    background-size: 100% 100%;
   }
   &::after {
     content: '';
@@ -1512,6 +1590,7 @@ onMounted(() => {
     width: 6px;
     height: 6px;
     background: url('@/assets/images/inputIcon2.png') no-repeat;
+    background-size: 100% 100%;
   }
 }
 .params-box {
@@ -1520,8 +1599,7 @@ onMounted(() => {
 .footer {
   display: flex;
   justify-content: flex-end;
-  margin-top: 30px;
-  padding-right: 40px;
+  margin-top: 15px;
   :deep(.el-pagination__total) {
     color: #a7ccdf !important;
   }