Commit debf998af863ac4b4add940328f180ffabf29365

Authored by fengwotao
1 parent 7bd5af76

feat(src/packages): 优化高德地图标点弹窗和数据展示

1 1 {
2 2 "markers": [
3 3 {
4   - "name": "模拟11111111111",
  4 + "name": "模拟数据1",
5 5 "value": 20,
6 6 "position": [103.856504, 30.687278],
7 7 "extraInfo": {
8 8 "tbDeviceId": "@xxxxxxxxxxx",
9   - "name": "模拟11111111111",
10   - "alias": "模拟11111111111",
  9 + "name": "模拟数据1",
  10 + "alias": "模拟数据1",
11 11 "organizationDTO": {
12   - "name": "模拟11111111111"
  12 + "name": "模拟数据1"
13 13 },
14 14 "deviceState": "INACTIVE",
15 15 "deviceProfile": {
... ... @@ -23,15 +23,15 @@
23 23 }
24 24 },
25 25 {
26   - "name": "模拟22222222222",
  26 + "name": "模拟数据2",
27 27 "value": 30,
28 28 "position": [104.095368, 30.716787],
29 29 "extraInfo": {
30 30 "tbDeviceId": "@xxxxxxxxxxxxxxx",
31   - "name": "模拟22222222222",
32   - "alias": "模拟22222222222",
  31 + "name": "模拟数据2",
  32 + "alias": "模拟数据2",
33 33 "organizationDTO": {
34   - "name": "模拟22222222222"
  34 + "name": "模拟数据2"
35 35 },
36 36 "deviceState": "INACTIVE",
37 37 "deviceProfile": {
... ...
... ... @@ -11,7 +11,7 @@ import AMapLoader from '@amap/amap-jsapi-loader'
11 11 import { CreateComponentType } from '@/packages/index.d'
12 12 import { useChartDataFetch } from '@/hooks'
13 13 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
14   -import { MarkerEnum, ThemeEnum, dataExtraInfoType, dataJsonType, dataJsonMarkersType, fileterDevice } from './config'
  14 +import { MarkerEnum, ThemeEnum, dataExtraInfoType, dataJsonType, dataJsonMarkersType, filterDevice } from './config'
15 15 import { isArray } from '@/utils'
16 16 import djh from './images/djh.png'
17 17 import online from './images/online.png'
... ... @@ -145,7 +145,7 @@ const handleCloseDrawer = () => (modelShow.value = false)
145 145 const handleSearchParams = async (searchPage: any, params: any) => {
146 146 try {
147 147 const { items } = await getDeviceList(searchPage, params)
148   - const values = fileterDevice(items)
  148 + const values = filterDevice(items)
149 149 if (!values) return
150 150 dataHandle(values)
151 151 } finally {
... ... @@ -163,6 +163,7 @@ const mapClick = (markerInstance: any, markerItem: dataJsonMarkersType) => {
163 163 })
164 164 markerInstance.on('click', async (e: any) => {
165 165 const { extraInfo } = e.target.getExtData()
  166 + if (extraInfo.tbDeviceId.startsWith('@')) return //假的模拟数据则终止弹窗
166 167 let infoWindow = new AMapIns.InfoWindow({
167 168 content: await createInfoWindow(extraInfo),
168 169 offset: new AMapIns.Pixel(0, -50)
... ...