config.ts
3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { OverrideMapAmapConfig } from './index'
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
export type dataExtraInfoType = typeof dataJson.markers[number]['extraInfo'] //data.json下的extraInfo类型
export type dataJsonType = typeof dataJson //data.json类型
export type dataJsonMarkersType = typeof dataJson.markers[number] //data.json markers类型
//标注数据格式
export const filterDevice = (items: any) => {
const values = items.reduce((acc: any, curr: any) => {
acc.push({
name: curr.alias,
value: 10,
position: [curr.deviceInfo.longitude, curr.deviceInfo.latitude],
extraInfo: {
tbDeviceId: curr.tbDeviceId,
name: curr.name,
alias: curr.alias,
organizationDTO: curr.organizationDTO,
deviceState: curr.deviceState,
deviceProfile: curr.deviceProfile,
deviceProfileId: curr.deviceProfileId,
deviceInfo: curr.deviceInfo
}
})
return [...acc]
}, [])
return {
markers: values
}
}
export interface devicePartInfoInterface{
tbDeviceId:string
name:string
alias:string
deviceProfileId:string
}
export const dimensions= [
{
"title": "键",
"key": "key"
},
{
"title": "值",
"key": "value"
},
{
"title": "最后更新时间",
"key": "lastUpdateTime"
}
]
export interface sourceInterface {
key: string
value: string
lastUpdateTime: string
}
export enum ThemeEnum {
NORMAL = 'normal',
DARK = 'dark',
LIGHT = 'light',
WHITES_MOKE = 'whitesmoke',
FRESH = 'fresh',
GREY = 'grey',
GRAFFITI = 'graffiti',
MACARON = 'macaron',
BLUE = 'blue',
DARKBLUE = 'darkblue',
WINE = 'wine',
WEIXIN = 'tileLayer'
}
export enum LangEnum {
ZH_CN = 'zh_cn',
EN = 'en',
ZH_EN = 'zh_en'
}
export enum ViewModeEnum {
PLANE = '2D',
STEREOSCOPIC = '3D'
}
export enum FeaturesEnum {
BG = 'bg',
POINT = 'point',
ROAD = 'road',
BUILDING = 'building'
}
export enum MarkerEnum {
// 圆圈
CIRCLE_MARKER = 'CircleMarker',
// 定位标点
MARKER = 'Marker',
// 暂无
NONE = 'none'
}
export const option = {
dataset: dataJson,
mapOptions: {
pitch: 60,
skyColor: '#53A9DE',
amapKey: 'd5f3e16589dbecae64d05fe90e2ba4f2',
amapStyleKey: ThemeEnum.DARK,
amapStyleKeyCustom: '',
amapLon: 104.108689,
amapLat: 30.66176,
amapZindex: 11,
iconMarker: '1.png',
mpBorderConfig: {
value: 'Border01'
},
bgColor: 'rgba(255, 255, 255, 0.05)',
marker: {
fillColor: '#E98984FF',
fillOpacity: 0.5,
strokeColor: 'white',
strokeWeight: 2,
strokeOpacity: 0.5,
zIndex: 10,
bubble: true,
cursor: 'pointer',
clickable: true
},
mapMarkerType: MarkerEnum.MARKER,
viewMode: ViewModeEnum.PLANE,
lang: LangEnum.ZH_CN,
features: [FeaturesEnum.BG, FeaturesEnum.POINT, FeaturesEnum.ROAD, FeaturesEnum.BUILDING],
},
// 自定义配置项
dialogCustomField: false, // 弹窗内的label是否自定义
dialogConfigField: [{
label:'',
value:'',
realValue:''
}] // 弹窗内配置字段
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key = OverrideMapAmapConfig.key
public attr = { ...chartInitConfig, w: 1000, h: 800, zIndex: -1 }
public chartConfig = cloneDeep(OverrideMapAmapConfig)
public option = cloneDeep(option)
}