Browse Source

fix: 控制区异常

feature-v1.0.0
邱伟洋 1 month ago
parent
commit
d899b06e66
  1. 1
      src/views/Drawer/index.vue
  2. 1
      src/views/LeftPanel/index.vue
  3. 117
      src/views/Main/MapSearch/index.vue
  4. 5
      src/views/Main/index.vue
  5. 1
      src/views/RegionSelect/index.vue
  6. 1
      src/views/RightPanel/index.vue

1
src/views/Drawer/index.vue

@ -21,5 +21,6 @@ defineOptions({
align-items: center; align-items: center;
padding: 24px; padding: 24px;
gap: 16px; gap: 16px;
pointer-events: all;
} }
</style> </style>

1
src/views/LeftPanel/index.vue

@ -21,5 +21,6 @@ defineOptions({
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 12px; gap: 12px;
pointer-events: none;
} }
</style> </style>

117
src/views/Main/MapSearch/index.vue

@ -3,60 +3,59 @@
<span class="map-search-icon"> <span class="map-search-icon">
<iconpark-icon name="search" size="16" fill="#fff"></iconpark-icon> <iconpark-icon name="search" size="16" fill="#fff"></iconpark-icon>
</span> </span>
<div v-click-outside="onClickOutside">
<el-popover <el-popover
placement="bottom" placement="bottom"
:width="280" :width="280"
:visible="popoverVisible" :visible="popoverVisible"
popper-class="map-search-popper" popper-class="map-search-popper"
> >
<template #reference> <template #reference>
<el-input <el-input
class="map-search-input" class="map-search-input"
placeholder="输入水库名称、水库编码" placeholder="输入水库名称、水库编码"
v-model="searchValue" v-model="searchValue"
@input="changeInputValue" @input="changeInputValue"
></el-input> ></el-input>
</template> </template>
<template #default> <template #default>
<div class="map-search-result"> <div class="map-search-result">
<div class="map-search-result-title"> <div class="map-search-result-title">
共搜索到<span>{{ searchResultList.length }}</span 共搜索到<span>{{ searchResultList.length }}</span
>条结果 >条结果
</div> </div>
<div
v-if="searchResultList.length > 0"
class="map-search-result-list"
>
<div <div
v-if="searchResultList.length > 0" class="map-search-result-list-item"
class="map-search-result-list" v-for="(item, index) in searchResultList"
:key="index"
@click.stop="flyTo(item)"
> >
<div <div class="title">
class="map-search-result-list-item" <span class="name">{{ item?.properties?.RES_NAME }}</span>
v-for="(item, index) in searchResultList" <span class="tag">{{ item?.properties?.ENG_SCAL }}</span>
:key="index" </div>
@click.stop="flyTo(item)" <div class="item">
> <i></i>工程代码{{ item?.properties?.RES_CODE }}
<div class="title"> </div>
<span class="name">{{ item?.properties?.RES_NAME }}</span> <div class="item">
<span class="tag">{{ item?.properties?.ENG_SCAL }}</span> <i></i>工程类型{{ item?.properties?.RES_TYPE }}
</div> </div>
<div class="item"> <div class="item">
<i></i>工程代码{{ item?.properties?.RES_CODE }} <i></i>工程地址{{ item?.properties?.RES_LOC }}
</div>
<div class="item">
<i></i>工程类型{{ item?.properties?.RES_TYPE }}
</div>
<div class="item">
<i></i>工程地址{{ item?.properties?.RES_LOC }}
</div>
</div> </div>
</div>
<div v-else class="map-search-result-list no-data">
<img src="@/assets/card/no-data.png" />
<span>暂无结果</span>
</div> </div>
</div> </div>
</template> <div v-else class="map-search-result-list no-data">
</el-popover> <img src="@/assets/card/no-data.png" />
</div> <span>暂无结果</span>
</div>
</div>
</template>
</el-popover>
</div> </div>
</template> </template>
@ -64,7 +63,6 @@
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import { getReservoirList } from "@/api/map"; import { getReservoirList } from "@/api/map";
import { useProjectStore } from "@/store/modules/project"; import { useProjectStore } from "@/store/modules/project";
import { ClickOutside as vClickOutside } from "element-plus";
import * as SyCim from "sy-cesium-sdk"; import * as SyCim from "sy-cesium-sdk";
defineOptions({ defineOptions({
name: "MapSearch", name: "MapSearch",
@ -72,12 +70,24 @@ defineOptions({
const Cesium = SyCim.Cesium; const Cesium = SyCim.Cesium;
const projectStore = useProjectStore(); const projectStore = useProjectStore();
const popoverVisible = ref(false); const popoverVisible = ref(false);
const hidePopover = (e: any) => {
if (e?.target?.className?.includes("map-search-result-title")) {
return;
}
popoverVisible.value = false;
};
const addEventListener = () => {
removeEventListener();
document.addEventListener("click", hidePopover, false);
};
const removeEventListener = () => {
document.removeEventListener("click", hidePopover);
};
const showPopover = () => { const showPopover = () => {
popoverVisible.value = true; popoverVisible.value = true;
addEventListener();
}; };
const onClickOutside = () => {
popoverVisible.value = false;
};
const searchValue = ref(""); const searchValue = ref("");
const searchResultList = ref<any[]>([]); const searchResultList = ref<any[]>([]);
const layerData = computed(() => const layerData = computed(() =>
@ -97,6 +107,7 @@ const changeInputValue = async (value: string) => {
const flyTo = (item: any) => { const flyTo = (item: any) => {
const coordinates = item?.geometry?.coordinates; const coordinates = item?.geometry?.coordinates;
if (!coordinates) return; if (!coordinates) return;
popoverVisible.value = false;
const center = SyCim.Parse.parsePosition( const center = SyCim.Parse.parsePosition(
`${coordinates[0]},${coordinates[1]},10` `${coordinates[0]},${coordinates[1]},10`
).toCartesian3(); ).toCartesian3();

5
src/views/Main/index.vue

@ -100,12 +100,17 @@ onBeforeUnmount(() => {
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
pointer-events: none;
.top { .top {
pointer-events: all;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
} }
.bottom {
pointer-events: all;
}
} }
</style> </style>

1
src/views/RegionSelect/index.vue

@ -48,6 +48,7 @@ onMounted(() => {
height: 32px; height: 32px;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
pointer-events: all;
.title { .title {
background: #36b29e; background: #36b29e;
height: 100%; height: 100%;

1
src/views/RightPanel/index.vue

@ -21,5 +21,6 @@ defineOptions({
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 12px; gap: 12px;
pointer-events: none;
} }
</style> </style>

Loading…
Cancel
Save