1
|
<template>
|
1
|
<template>
|
2
|
<div @mouseenter="handleMouseenter" @mouseleave="handleMouseleave" class="chart-amap" ref="vChartRef">
|
2
|
<div @mouseenter="handleMouseenter" @mouseleave="handleMouseleave" class="chart-amap" ref="vChartRef">
|
3
|
- <div v-show="showSearchBox" @click.stop="handleOpenSearchBox" class="search-box"></div>
|
|
|
4
|
- <search-box :modelShow="modelShow" @searchParams="handleSearchParams" @closeDrawer="handleCloseDrawer"></search-box>
|
3
|
+ <!-- <div v-show="showSearchBox" @click.stop="handleOpenSearchBox" class="search-box"></div>
|
|
|
4
|
+ <search-box :modelShow="modelShow" @searchParams="handleSearchParams" @closeDrawer="handleCloseDrawer"></search-box> -->
|
5
|
</div>
|
5
|
</div>
|
6
|
</template>
|
6
|
</template>
|
7
|
|
7
|
|
|
@@ -16,7 +16,7 @@ import { isArray } from '@/utils' |
|
@@ -16,7 +16,7 @@ import { isArray } from '@/utils' |
16
|
import djh from './images/djh.png'
|
16
|
import djh from './images/djh.png'
|
17
|
import online from './images/online.png'
|
17
|
import online from './images/online.png'
|
18
|
import lx1 from './images/lx1.png'
|
18
|
import lx1 from './images/lx1.png'
|
19
|
-import positionImg from './images/marker/1.png'
|
19
|
+import onLineImg from './images/marker/3.png'
|
20
|
import { getDeviceActiveTime, getDeviceList } from '@/api/external/common/index'
|
20
|
import { getDeviceActiveTime, getDeviceList } from '@/api/external/common/index'
|
21
|
import dayjs from 'dayjs'
|
21
|
import dayjs from 'dayjs'
|
22
|
import SearchBox from './components/SearchBox.vue'
|
22
|
import SearchBox from './components/SearchBox.vue'
|
|
@@ -32,7 +32,7 @@ const modelShow = ref(false) |
|
@@ -32,7 +32,7 @@ const modelShow = ref(false) |
32
|
|
32
|
|
33
|
const showSearchBox = ref(false)
|
33
|
const showSearchBox = ref(false)
|
34
|
|
34
|
|
35
|
-let {
|
35
|
+const {
|
36
|
amapKey,
|
36
|
amapKey,
|
37
|
amapStyleKey,
|
37
|
amapStyleKey,
|
38
|
amapLon,
|
38
|
amapLon,
|
|
@@ -47,7 +47,8 @@ let { |
|
@@ -47,7 +47,8 @@ let { |
47
|
skyColor,
|
47
|
skyColor,
|
48
|
marker,
|
48
|
marker,
|
49
|
iconMarker,
|
49
|
iconMarker,
|
50
|
- mpBorderConfig
|
50
|
+ mpBorderConfig,
|
|
|
51
|
+ bgColor
|
51
|
} = toRefs(props.chartConfig.option.mapOptions)
|
52
|
} = toRefs(props.chartConfig.option.mapOptions)
|
52
|
|
53
|
|
53
|
//官方没有高德地图api的ts,所以类型全用的any
|
54
|
//官方没有高德地图api的ts,所以类型全用的any
|
|
@@ -132,7 +133,7 @@ const createInfoWindow = async (extraInfo: dataExtraInfoType) => { |
|
@@ -132,7 +133,7 @@ const createInfoWindow = async (extraInfo: dataExtraInfoType) => { |
132
|
</div>
|
133
|
</div>
|
133
|
<div style="color:white;">所属组织:${organizationDTO.name}</div>
|
134
|
<div style="color:white;">所属组织:${organizationDTO.name}</div>
|
134
|
<div style="margin-top:6px;color:white">接入协议:${deviceProfile.transportType}</div>
|
135
|
<div style="margin-top:6px;color:white">接入协议:${deviceProfile.transportType}</div>
|
135
|
- <div style="margin-top:6px;color:white">
|
136
|
+ <div style="margin-top:6px;color:white;width:15vw;text-overflow: ellipsis;overflow: hidden; word-break: break-all;white-space: nowrap;">
|
136
|
设备位置:${!deviceInfo.address ? '该设备暂无地理位置' : deviceInfo.address}
|
137
|
设备位置:${!deviceInfo.address ? '该设备暂无地理位置' : deviceInfo.address}
|
137
|
</div>
|
138
|
</div>
|
138
|
<div style="margin-top:6px;color:white">
|
139
|
<div style="margin-top:6px;color:white">
|
|
@@ -158,10 +159,15 @@ const handleCloseDrawer = () => (modelShow.value = false) |
|
@@ -158,10 +159,15 @@ const handleCloseDrawer = () => (modelShow.value = false) |
158
|
|
159
|
|
159
|
const handleSearchParams = async (searchPage: any, params: any) => {
|
160
|
const handleSearchParams = async (searchPage: any, params: any) => {
|
160
|
try {
|
161
|
try {
|
|
|
162
|
+ Object.keys(params).forEach(item => {
|
|
|
163
|
+ if (!params[item]) Reflect.deleteProperty(params, item)
|
|
|
164
|
+ })
|
161
|
const { items } = await getDeviceList(searchPage, params)
|
165
|
const { items } = await getDeviceList(searchPage, params)
|
162
|
const values = filterDevice(items)
|
166
|
const values = filterDevice(items)
|
163
|
if (!values) return
|
167
|
if (!values) return
|
164
|
- dataHandle(values)
|
168
|
+ setTimeout(() => {
|
|
|
169
|
+ dataHandle(values)
|
|
|
170
|
+ }, 1000)
|
165
|
} finally {
|
171
|
} finally {
|
166
|
handleCloseDrawer()
|
172
|
handleCloseDrawer()
|
167
|
}
|
173
|
}
|
|
@@ -198,10 +204,11 @@ const dataHandle = (newData: dataJsonType) => { |
|
@@ -198,10 +204,11 @@ const dataHandle = (newData: dataJsonType) => { |
198
|
// 记录新标记
|
204
|
// 记录新标记
|
199
|
if (mapMarkerType.value === MarkerEnum.MARKER) {
|
205
|
if (mapMarkerType.value === MarkerEnum.MARKER) {
|
200
|
newData.markers.forEach((markerItem: dataJsonMarkersType) => {
|
206
|
newData.markers.forEach((markerItem: dataJsonMarkersType) => {
|
|
|
207
|
+ const { deviceState } = markerItem.extraInfo
|
201
|
const markerInstance = new AMapIns.Marker({
|
208
|
const markerInstance = new AMapIns.Marker({
|
202
|
position: [markerItem.position[0], markerItem.position[1]],
|
209
|
position: [markerItem.position[0], markerItem.position[1]],
|
203
|
offset: new AMapIns.Pixel(-13, -30),
|
210
|
offset: new AMapIns.Pixel(-13, -30),
|
204
|
- icon: iconMarker.value || positionImg
|
211
|
+ icon: deviceState === 'ONLINE' ? onLineImg : iconMarker.value
|
205
|
})
|
212
|
})
|
206
|
// markers.push(markerInstance) 原作者这种方式添加,属于JS API 1.4.8版本的
|
213
|
// markers.push(markerInstance) 原作者这种方式添加,属于JS API 1.4.8版本的
|
207
|
// markerInstance.setMap(mapIns)
|
214
|
// markerInstance.setMap(mapIns)
|
|
@@ -255,7 +262,9 @@ watch( |
|
@@ -255,7 +262,9 @@ watch( |
255
|
// 预览
|
262
|
// 预览
|
256
|
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
|
263
|
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
|
257
|
stopWatch()
|
264
|
stopWatch()
|
258
|
- dataHandle(newData)
|
265
|
+ setTimeout(() => {
|
|
|
266
|
+ dataHandle(newData)
|
|
|
267
|
+ }, 1000)
|
259
|
})
|
268
|
})
|
260
|
</script>
|
269
|
</script>
|
261
|
|
270
|
|
|
@@ -271,15 +280,9 @@ useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => { |
|
@@ -271,15 +280,9 @@ useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => { |
271
|
}
|
280
|
}
|
272
|
.amap-info-content .go-border-box {
|
281
|
.amap-info-content .go-border-box {
|
273
|
position: absolute;
|
282
|
position: absolute;
|
274
|
- transform: scale(0.7);
|
283
|
+ transform: scale(0.68);
|
275
|
top: -10px;
|
284
|
top: -10px;
|
276
|
- /* opacity: 0,8; */
|
|
|
277
|
- /* background-color: rgba(0, 0, 0, 0.1); */
|
|
|
278
|
- background-color:rgba(255,255,255,0.1)
|
|
|
279
|
-}
|
|
|
280
|
-.amap-info-content .go-border-box svg {
|
|
|
281
|
- /* background-color: rgba(0, 0, 0, 0.1); */
|
|
|
282
|
- /* background-color: rgba(255, 255, 255, 0.8); */
|
285
|
+ background-color: v-bind(bgColor);
|
283
|
}
|
286
|
}
|
284
|
</style>
|
287
|
</style>
|
285
|
<style lang="scss" scoped>
|
288
|
<style lang="scss" scoped>
|