|
@@ -2,14 +2,6 @@
|
|
|
<div class="right-layout">
|
|
|
<div class="right-content">
|
|
|
<el-form :inline="false" v-if="router.currentRoute.value.name === 'map'">
|
|
|
- <!-- <el-form-item v-if="relics">
|
|
|
- <el-input v-model="relicsName" :maxlength="50" placeholder="不可移动文物名称">
|
|
|
- <template #append>
|
|
|
- <el-button type="primary" @click="updateRelics">修改</el-button>
|
|
|
- </template>
|
|
|
-</el-input>
|
|
|
-</el-form-item> -->
|
|
|
-
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" :icon="Plus" style="width: 100%" @click="addHandler">
|
|
|
添加场景
|
|
@@ -18,28 +10,47 @@
|
|
|
</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 />
|
|
|
-
|
|
|
</el-icon>
|
|
|
{{ data.raw.sceneName }}
|
|
|
|
|
|
<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>
|
|
|
-
|
|
|
<StateGpsIcon v-if="!data.disable" />
|
|
|
<DeleteLocation v-else />
|
|
|
</el-icon>
|
|
@@ -50,8 +61,6 @@
|
|
|
{{ data.raw.name }}
|
|
|
</span>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
</el-tooltip>
|
|
|
<span class="oper">
|
|
|
<template v-if="router.currentRoute.value.name === 'map'">
|
|
@@ -67,21 +76,25 @@
|
|
|
<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>
|
|
|
</div>
|
|
@@ -91,7 +104,12 @@
|
|
|
</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"
|
|
@@ -99,15 +117,25 @@
|
|
|
导出绘制矢量数据
|
|
|
</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">
|
|
@@ -116,10 +144,8 @@ import {
|
|
|
Delete,
|
|
|
Grid,
|
|
|
Download,
|
|
|
- // LocationInformation,
|
|
|
DeleteLocation,
|
|
|
Edit,
|
|
|
- // Link,
|
|
|
} from "@element-plus/icons-vue";
|
|
|
import { computed, ref, watchEffect } from "vue";
|
|
|
import {
|
|
@@ -138,10 +164,17 @@ import { selectScenes } from "../quisk";
|
|
|
import { addRelicsScenesFetch, delRelicsScenesFetch } from "@/request";
|
|
|
import { exportFile, exportImage } from "./pc4Helper";
|
|
|
import { SceneStatus } from "@/store/scene";
|
|
|
-import StateGpsIcon from '@/assets/state_gps.svg';
|
|
|
-import PanoramaIcon from '@/assets/panorama.svg';
|
|
|
-import FrameIcon from '@/assets/frame.svg';
|
|
|
-// import StateGpsIcon from '@/assets/state_gps.svg';
|
|
|
+import StateGpsIcon from "@/assets/state_gps.svg";
|
|
|
+import PanoramaIcon from "@/assets/panorama.svg";
|
|
|
+import FrameIcon from "@/assets/frame.svg";
|
|
|
+import { DrawingDataType } from "@/request/drawing";
|
|
|
+import { alert } from "@/helper/message";
|
|
|
+import { getWholeLineLinesByPointId } from "drawing-board";
|
|
|
+
|
|
|
+const props = defineProps<{
|
|
|
+ data: DrawingDataType | null;
|
|
|
+}>();
|
|
|
+
|
|
|
const emit = defineEmits<{
|
|
|
(e: "flyScene", data: Scene): void;
|
|
|
(e: "flyPoint", data: ScenePoint): void;
|
|
@@ -155,10 +188,6 @@ const updatePointName = async (title: string) => {
|
|
|
|
|
|
const relicsName = ref("");
|
|
|
watchEffect(() => (relicsName.value = relics.value?.name || ""));
|
|
|
-// const updateRelics = async () => {
|
|
|
-// await updateRelicsName(relicsName.value);
|
|
|
-// ElMessage.success("修改成功");
|
|
|
-// };
|
|
|
|
|
|
const treeRef = ref<any>();
|
|
|
const treeNode = computed(() =>
|
|
@@ -213,7 +242,19 @@ const delRelicsScenes = (scenes: Pick<Scene, "sceneId" | "sceneCode">[]) =>
|
|
|
scenes.map((item) => ({ sceneCode: item.sceneCode, id: item.sceneId }))
|
|
|
);
|
|
|
|
|
|
-const delSceneHandler = async (scenes: Pick<Scene, "sceneId" | "sceneCode">[]) => {
|
|
|
+const delSceneHandler = async (scenes: Scene[]) => {
|
|
|
+ for (const scene of scenes) {
|
|
|
+ const que = scene.scenePos.some((pos) => {
|
|
|
+ const id = pos.id.toString();
|
|
|
+ return getWholeLineLinesByPointId(props.data as any, id).length !== 0;
|
|
|
+ });
|
|
|
+ if (que) {
|
|
|
+ await alert("已存在矢量图数据,不可删除。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(props.data);
|
|
|
+ return;
|
|
|
await delRelicsScenes(scenes);
|
|
|
await refreshScenes();
|
|
|
};
|
|
@@ -225,35 +266,33 @@ const addSceneHandler = async (scenes: Pick<Scene, "sceneId" | "sceneCode">[]) =
|
|
|
);
|
|
|
|
|
|
const handlerExport = (type: number, name: string) => {
|
|
|
- console.log('type', type, name)
|
|
|
- console.log('getSelectPoints', getSelectPoints())
|
|
|
- exportFile(getSelectPoints(), type, name)
|
|
|
-}
|
|
|
+ console.log("type", type, name);
|
|
|
+ console.log("getSelectPoints", getSelectPoints());
|
|
|
+ exportFile(getSelectPoints(), type, name);
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
:deep(.el-tree-node__content) {
|
|
|
--el-tree-node-content-height: 26px;
|
|
|
line-height: 26px;
|
|
|
user-select: none;
|
|
|
margin-bottom: 8px;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
: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;
|
|
|
width: calc(100% - 50px);
|
|
|
align-items: flex-start;
|
|
@@ -277,7 +316,6 @@ const handlerExport = (type: number, name: string) => {
|
|
|
width: 100%;
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
|
-
|
|
|
.name {
|
|
|
padding-left: 15px;
|
|
|
color: #999;
|
|
@@ -298,7 +336,6 @@ const handlerExport = (type: number, name: string) => {
|
|
|
.tree-layout {
|
|
|
p {
|
|
|
color: #303133;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.sub-title {
|