gemercheung 1 yıl önce
ebeveyn
işleme
ff629c06bd
1 değiştirilmiş dosya ile 46 ekleme ve 82 silme
  1. 46 82
      src/view/map/map-right.vue

+ 46 - 82
src/view/map/map-right.vue

@@ -10,28 +10,13 @@
       </el-form>
       <div class="tree-layout">
         <p class="sub-title">全部数据</p>
-        <el-tree
-          style="max-width: 600px"
-          :data="treeNode"
-          :props="{ disabled: 'run' }"
-          node-key="id"
-          ref="treeRef"
-          :show-checkbox="router.currentRoute.value.name === 'map'"
-          default-expand-all
-          :expand-on-click-node="false"
-        >
+        <el-tree style="max-width: 600px" :data="treeNode" :props="{ disabled: 'run' }" node-key="id" ref="treeRef"
+          :show-checkbox="router.currentRoute.value.name === 'map'" default-expand-all :expand-on-click-node="false">
           <template #default="{ node, data }">
-            <div
-              class="tree-item"
-              @click="!data.disable && emit((data.type === 'scene' ? 'flyScene' : 'flyPoint') as any, data.raw)"
-            >
-              <el-tooltip
-                v-if="data.type === 'scene'"
-                class="box-item"
-                effect="dark"
-                :content="data.raw.sceneName + ' ' + node.label"
-                placement="top"
-              >
+            <div class="tree-item"
+              @click="!data.disable && emit((data.type === 'scene' ? 'flyScene' : 'flyPoint') as any, data.raw)">
+              <el-tooltip v-if="data.type === 'scene'" class="box-item" effect="dark"
+                :content="data.raw.sceneName + ' ' + node.label" placement="top">
                 <span :class="{ disable: data.disable }" class="title">
                   <el-icon>
                     <Grid />
@@ -41,13 +26,7 @@
                   <span class="tree-scene-name">{{ node.label }}</span>
                 </span>
               </el-tooltip>
-              <el-tooltip
-                v-else
-                class="box-item"
-                effect="dark"
-                :content="node.label"
-                placement="top"
-              >
+              <el-tooltip v-else class="box-item" effect="dark" :content="node.label" placement="top">
                 <div class="title-box">
                   <span :class="{ disable: data.disable }" class="title">
                     <el-icon>
@@ -76,24 +55,18 @@
                 <el-icon color="#409efc" style="margin-left: 8px">
                   <!-- root -->
                   <template v-if="data.raw.scenePos">
-                    <FrameIcon
-                      v-if="!data.run"
-                      @click.stop="
-                        data.type === 'scene'
-                          ? gotoScene(data.raw)
-                          : emit('gotoPoint', data.raw)
-                      "
-                    />
+                    <FrameIcon v-if="!data.run" @click.stop="
+                      data.type === 'scene'
+                        ? gotoScene(data.raw)
+                        : emit('gotoPoint', data.raw)
+                      " />
                   </template>
                   <template v-else>
-                    <PanoramaIcon
-                      v-if="!data.run"
-                      @click.stop="
-                        data.type === 'scene'
-                          ? gotoScene(data.raw)
-                          : emit('gotoPoint', data.raw)
-                      "
-                    />
+                    <PanoramaIcon v-if="!data.run" @click.stop="
+                      data.type === 'scene'
+                        ? gotoScene(data.raw)
+                        : emit('gotoPoint', data.raw)
+                      " />
                   </template>
                 </el-icon>
               </span>
@@ -104,12 +77,7 @@
     </div>
 
     <template v-if="router.currentRoute.value.name === 'map'">
-      <el-button
-        type="primary"
-        :icon="Download"
-        style="width: 100%"
-        @click="handlerExport(2, relics?.name)"
-      >
+      <el-button type="primary" :icon="Download" style="width: 100%" @click="handlerExport(2, relics?.name)">
         导出本体边界坐标
       </el-button>
       <!-- <el-button type="primary" :icon="Download" style="width: 100%; margin-top: 20px; margin-left: 0"
@@ -117,25 +85,15 @@
         导出绘制矢量数据
       </el-button> -->
 
-      <el-button
-        type="primary"
-        :icon="Download"
-        style="width: 100%; margin-top: 20px; margin-left: 0"
-        @click="exportImage(getSelectPoints(), relics?.name)"
-      >
+      <el-button type="primary" :icon="Download" style="width: 100%; margin-top: 20px; margin-left: 0"
+        @click="exportImage(getSelectPoints(), relics?.name)">
         下载全景图
       </el-button>
     </template>
   </div>
 
-  <SingleInput
-    :visible="!!inputPoint"
-    @update:visible="inputPoint = null"
-    :value="inputPoint?.name || ''"
-    :update-value="updatePointName"
-    title="测点说明"
-    placeholder="请填写测点说明"
-  />
+  <SingleInput :visible="!!inputPoint" @update:visible="inputPoint = null" :value="inputPoint?.name || ''"
+    :update-value="updatePointName" title="测点说明" placeholder="请填写测点说明" />
 </template>
 
 <script setup lang="ts">
@@ -170,7 +128,7 @@ import FrameIcon from "@/assets/frame.svg";
 import { DrawingDataType, getDrawingDetailFetch } from "@/request/drawing";
 import { alert } from "@/helper/message";
 import { Polygons, getWholeLineLinesByPointId } from "drawing-board";
-
+import { ElMessageBox } from "element-plus";
 const props = defineProps<{
   data: DrawingDataType | null;
   boardPolygons: Polygons;
@@ -251,23 +209,30 @@ const delRelicsScenes = (scenes: Pick<Scene, "sceneId" | "sceneCode">[]) =>
   );
 
 const delSceneHandler = async (scenes: Scene[]) => {
-  const res = await getDrawingDetailFetch(String(relicsId.value));
-  for (const scene of scenes) {
-    const que = scene.scenePos.some((pos) => {
-      const id = pos.id.toString();
-      console.log(getWholeLineLinesByPointId(res.data as any, id), id);
-      return getWholeLineLinesByPointId(res.data as any, id).length !== 0;
-    });
-    if (que) {
-      await alert("已存在矢量图数据,不可删除。");
-      return;
+
+  const ok = await ElMessageBox.confirm("确定要删除场景吗?", {
+    type: "warning",
+  });
+  if (ok) {
+    const res = await getDrawingDetailFetch(String(relicsId.value));
+    for (const scene of scenes) {
+      const que = scene.scenePos.some((pos) => {
+        const id = pos.id.toString();
+        console.log(getWholeLineLinesByPointId(res.data as any, id), id);
+        return getWholeLineLinesByPointId(res.data as any, id).length !== 0;
+      });
+      if (que) {
+        await alert("已存在矢量图数据,不可删除。");
+        return;
+      }
     }
+
+    console.log(res.data);
+    return;
+    await delRelicsScenes(scenes);
+    await refreshScenes();
   }
 
-  console.log(res.data);
-  return;
-  await delRelicsScenes(scenes);
-  await refreshScenes();
 };
 
 const addSceneHandler = async (scenes: Pick<Scene, "sceneId" | "sceneCode">[]) =>
@@ -294,14 +259,13 @@ const handlerExport = (type: number, name: string) => {
 :deep(.el-tree-node__children .el-tree-node__content) {
   --el-tree-node-content-height: 52px;
 
-  & > label.el-checkbox {
+  &>label.el-checkbox {
     padding-top: 6px;
     align-items: flex-start;
   }
 }
 
-:deep(.el-tree .tree-item) {
-}
+:deep(.el-tree .tree-item) {}
 
 .tree-item {
   display: flex;