|
@@ -18,16 +18,15 @@
|
|
ref="ref_search"
|
|
ref="ref_search"
|
|
v-model="searchInput"
|
|
v-model="searchInput"
|
|
:fetch-suggestions="searchHandleMapSearch"
|
|
:fetch-suggestions="searchHandleMapSearch"
|
|
- :popper-append-to-body="false"
|
|
+ popper-class="__gis-search_popper"
|
|
clearable
|
|
clearable
|
|
- :disabled="true"
|
|
|
|
:debounce="800"
|
|
:debounce="800"
|
|
placeholder="请输入关键字进行搜索"
|
|
placeholder="请输入关键字进行搜索"
|
|
@select="searchToMapLocation"
|
|
@select="searchToMapLocation"
|
|
>
|
|
>
|
|
<template #default="{ item }">
|
|
<template #default="{ item }">
|
|
<div class="search-item __hover">
|
|
<div class="search-item __hover">
|
|
- <img :src="item.icon"/>
|
|
+ <img :src="item.icon" alt=""/>
|
|
<div class="name">{{item.name}}</div>
|
|
<div class="name">{{item.name}}</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -52,14 +51,14 @@
|
|
<RouterViewCom/>
|
|
<RouterViewCom/>
|
|
</div>
|
|
</div>
|
|
<VideoPlayKedaCom v-if="$store.state.gis.videoParams.show" v-model:layout="videoLayout" :form="$store.state.gis.videoParams" @close="$store.commit('gis/SET_VIDEO_PARAMS', {show: false})"/>
|
|
<VideoPlayKedaCom v-if="$store.state.gis.videoParams.show" v-model:layout="videoLayout" :form="$store.state.gis.videoParams" @close="$store.commit('gis/SET_VIDEO_PARAMS', {show: false})"/>
|
|
- <div class="mockButtons">
|
|
+<!-- <div class="mockButtons">-->
|
|
- <el-button @click="mockSB1">模拟设备1</el-button>
|
|
+<!-- <el-button @click="mockSB1">模拟设备1</el-button>-->
|
|
- <el-button @click="mockSB2">模拟设备2</el-button><br/>
|
|
+<!-- <el-button @click="mockSB2">模拟设备2</el-button><br/>-->
|
|
- <el-button @click="mockJQ1">模拟景区1</el-button><br/>
|
|
+<!-- <el-button @click="mockJQ1">模拟景区1</el-button><br/>-->
|
|
- <el-button @click="mockLG1">模拟旅馆1</el-button><br/>
|
|
+<!-- <el-button @click="mockLG1">模拟旅馆1</el-button><br/>-->
|
|
- <el-button @click="mockCZW1">模拟出租屋1</el-button><br/>
|
|
+<!-- <el-button @click="mockCZW1">模拟出租屋1</el-button><br/>-->
|
|
- <el-button @click="mockHCZ1">模拟火车站1</el-button>
|
|
+<!-- <el-button @click="mockHCZ1">模拟火车站1</el-button>-->
|
|
- </div>
|
|
+<!-- </div>-->
|
|
</div>
|
|
</div>
|
|
<GisDefaultDom ref="ref_gisDefault"/>
|
|
<GisDefaultDom ref="ref_gisDefault"/>
|
|
<GisQyDom ref="ref_gisQy"/>
|
|
<GisQyDom ref="ref_gisQy"/>
|
|
@@ -95,6 +94,8 @@ import {clearLocationDom} from '@/components/easyMap/func/location'
|
|
import {clearMeasureDom} from '@/components/easyMap/func/measure'
|
|
import {clearMeasureDom} from '@/components/easyMap/func/measure'
|
|
import GisDefaultDom from '../map-info/overlay/default/index.vue'
|
|
import GisDefaultDom from '../map-info/overlay/default/index.vue'
|
|
import GisQyDom from '../map-info/overlay/qy/index.vue'
|
|
import GisQyDom from '../map-info/overlay/qy/index.vue'
|
|
|
|
+import axios from "axios";
|
|
|
|
+import store from "@/store";
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: '',
|
|
name: '',
|
|
@@ -162,31 +163,73 @@ export default defineComponent({
|
|
})
|
|
})
|
|
const searchHandleMapSearch = (queryString: string, cb: (arg: any) => void) => {
|
|
const searchHandleMapSearch = (queryString: string, cb: (arg: any) => void) => {
|
|
if (queryString.trim()) {
|
|
if (queryString.trim()) {
|
|
- const arr = [
|
|
+ const arr: any = []
|
|
- {name: 123},
|
|
+ const typeName: any = []
|
|
- {name: 123},
|
|
+ store.state.dictionary.elementTypeList.forEach(v => {
|
|
- {name: 123},
|
|
+ if (['sb', 'qy'].includes(v.dictType)) {
|
|
- {name: 123},
|
|
+ typeName.push(v.geoType)
|
|
- {name: 123},
|
|
+ }
|
|
- {name: 123},
|
|
+ })
|
|
- ]
|
|
+ axios({
|
|
- cb(arr)
|
|
+ url: store.state.gis.element.layer.getSource().getUrls()[0],
|
|
|
|
+ method: 'get',
|
|
|
|
+ params: {
|
|
|
|
+ service: 'WFS',
|
|
|
|
+ version: '1.0.0',
|
|
|
|
+ request: 'GetFeature',
|
|
|
|
+ typename: typeName.join(','),
|
|
|
|
+ srsName: 'EPSG:4326',
|
|
|
|
+ outputFormat: 'application/json',
|
|
|
|
+ CQL_FILTER: `name like '%${queryString.trim()}%'`
|
|
|
|
+ }
|
|
|
|
+ }).then(res => {
|
|
|
|
+ res.data.features?.forEach(v => {
|
|
|
|
+ const obj = {
|
|
|
|
+ info: v.properties,
|
|
|
|
+ id: v.properties.dataId,
|
|
|
|
+ name: v.properties.name,
|
|
|
|
+ typeValue: v.properties.typeValue,
|
|
|
|
+ wkt: `POINT(${v.geometry.coordinates.join(' ')})`,
|
|
|
|
+ icon: store.getters['dictionary/elementTypeMapObj'].get(v.properties.typeValue).icon,
|
|
|
|
+ featureType: '',
|
|
|
|
+ }
|
|
|
|
+ if (['lgszyjkscsb', 'jgzzmgs', 'lgsjkyfl'].includes(v.properties.typeValue)) {
|
|
|
|
+ obj.featureType = 'qy'
|
|
|
|
+ } else if (['gal', 'shl', 'myl'].includes(v.properties.typeValue)) {
|
|
|
|
+ obj.featureType = 'sb'
|
|
|
|
+ }
|
|
|
|
+ arr.push(obj)
|
|
|
|
+ })
|
|
|
|
+ cb(arr)
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ cb(arr)
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
cb([])
|
|
cb([])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const searchToMapLocation = (val) => {
|
|
const searchToMapLocation = (val) => {
|
|
state.searchInput = val.name
|
|
state.searchInput = val.name
|
|
- // if (val.source === 'element') {
|
|
+ switch (val.featureType) {
|
|
- // state.elementFilter.forEach(l => {
|
|
+ case 'qy': {
|
|
- // l.list.forEach(v => {
|
|
+ console.log(1)
|
|
- // if (v.value === val.elementType) {
|
|
+ store.commit('gis/SET_GIS_PARAMS_QY_RESET')
|
|
- // v.active = true
|
|
+ store.commit('gis/SET_GIS_PARAMS_QY', {
|
|
- // }
|
|
+ wkt: val.wkt,
|
|
- // })
|
|
+ id: val.id,
|
|
- // })
|
|
+ info: val.info
|
|
- // }
|
|
+ })
|
|
- // positionSwitchGeom(val.geomType, val.coordinates, true, val.source)
|
|
+ } break
|
|
|
|
+ case 'sb': {
|
|
|
|
+ console.log(2)
|
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
|
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
|
|
+ wkt: val.wkt,
|
|
|
|
+ id: val.id,
|
|
|
|
+ info: val.info
|
|
|
|
+ })
|
|
|
|
+ } break
|
|
|
|
+ }
|
|
}
|
|
}
|
|
const toolsHandleClick = (item) => {
|
|
const toolsHandleClick = (item) => {
|
|
if (item.value === 'clear') {
|
|
if (item.value === 'clear') {
|
|
@@ -205,7 +248,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const mockSB1 = () => {
|
|
const mockSB1 = () => {
|
|
- store.dispatch('gis/LOAD_GIS_PARAMS_DEFAULT', {
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
type: 'sb',
|
|
type: 'sb',
|
|
wkt: 'POINT(110.73667031084902 19.011386491828695)',
|
|
wkt: 'POINT(110.73667031084902 19.011386491828695)',
|
|
id: 1,
|
|
id: 1,
|
|
@@ -230,7 +273,7 @@ export default defineComponent({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const mockSB2 = () => {
|
|
const mockSB2 = () => {
|
|
- store.dispatch('gis/LOAD_GIS_PARAMS_DEFAULT', {
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
type: 'sb',
|
|
type: 'sb',
|
|
wkt: 'POINT(110.95227700030215 19.027865984016195)',
|
|
wkt: 'POINT(110.95227700030215 19.027865984016195)',
|
|
id: 1,
|
|
id: 1,
|
|
@@ -255,7 +298,7 @@ export default defineComponent({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const mockJQ1 = () => {
|
|
const mockJQ1 = () => {
|
|
- store.dispatch('gis/LOAD_GIS_PARAMS_DEFAULT', {
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_JQ', {
|
|
type: 'jq',
|
|
type: 'jq',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
id: 1,
|
|
id: 1,
|
|
@@ -267,7 +310,7 @@ export default defineComponent({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const mockLG1 = () => {
|
|
const mockLG1 = () => {
|
|
- store.dispatch('gis/LOAD_GIS_PARAMS_DEFAULT', {
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_LG', {
|
|
type: 'lg',
|
|
type: 'lg',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
id: 1,
|
|
id: 1,
|
|
@@ -278,7 +321,7 @@ export default defineComponent({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const mockCZW1 = () => {
|
|
const mockCZW1 = () => {
|
|
- store.dispatch('gis/LOAD_GIS_PARAMS_DEFAULT', {
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_CZW', {
|
|
type: 'czw',
|
|
type: 'czw',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
id: 1,
|
|
id: 1,
|
|
@@ -289,7 +332,7 @@ export default defineComponent({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const mockHCZ1 = () => {
|
|
const mockHCZ1 = () => {
|
|
- store.dispatch('gis/LOAD_GIS_PARAMS_DEFAULT', {
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_HCZ', {
|
|
type: 'hcz',
|
|
type: 'hcz',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
wkt: 'POINT(110.74277601017481 18.85289817214939)',
|
|
id: 1,
|
|
id: 1,
|
|
@@ -441,41 +484,6 @@ export default defineComponent({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- :deep(.el-autocomplete__popper) {
|
|
|
|
- opacity: 0.9;
|
|
|
|
- background-image: linear-gradient(45deg,transparent 10px,#101D69 10px), linear-gradient(-135deg,transparent 10px,#101D69 10px);
|
|
|
|
- border: none;
|
|
|
|
- .el-popper__arrow::before {
|
|
|
|
- background: #101D69;
|
|
|
|
- border-color: #101D69;
|
|
|
|
- }
|
|
|
|
- .el-autocomplete-suggestion {
|
|
|
|
- .el-scrollbar {
|
|
|
|
- .el-autocomplete-suggestion__wrap {
|
|
|
|
- .el-scrollbar__view {
|
|
|
|
- >li {
|
|
|
|
- &:hover {
|
|
|
|
- background-color: rgba(59,84,172,0.5);
|
|
|
|
- }
|
|
|
|
- .search-item {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: flex-start;
|
|
|
|
- >img {
|
|
|
|
- margin-right: 6px;
|
|
|
|
- width: 16px;
|
|
|
|
- height: 16px;
|
|
|
|
- }
|
|
|
|
- .name {
|
|
|
|
- color: #ffffff;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
.gt-tools {
|
|
.gt-tools {
|
|
width: 100%;
|
|
width: 100%;
|