@cqsjjb/jjb-react-admin-component 3.3.0-beta.2 → 3.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AMap/README.md +58 -0
- package/AMap/index.d.ts +40 -0
- package/AMap/index.js +371 -0
- package/AMap/index.less +35 -0
- package/BMap/README.md +1 -1
- package/BMap/index.less +31 -32
- package/package.json +1 -1
package/AMap/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
高德地图组件
|
|
2
|
+
|
|
3
|
+
## 代码演示
|
|
4
|
+
|
|
5
|
+
```jsx
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { Button } from 'antd';
|
|
8
|
+
import AMap from '@cqsjjb/jjb-react-admin-component/AMap';
|
|
9
|
+
|
|
10
|
+
function App() {
|
|
11
|
+
const [ open, setOpen ] = useState(false);
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<Button onClick={() => setOpen(true)}>打开地图</Button>
|
|
15
|
+
{open && (
|
|
16
|
+
<AMap
|
|
17
|
+
onOk={data => {
|
|
18
|
+
console.log(data);
|
|
19
|
+
setOpen(false);
|
|
20
|
+
}}
|
|
21
|
+
onCacnel={() => {
|
|
22
|
+
setOpen(false);
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
)}
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
34
|
+
|----------|:-----|:---------------------------------------------------------------------------------------------------------:|--------:|
|
|
35
|
+
| lng | 经度 | `number` | 116.404 |
|
|
36
|
+
| lat | 纬度 | `number` | 39.915 |
|
|
37
|
+
| title | 弹窗标题 | `string` | 高德地图 |
|
|
38
|
+
| width | 弹窗宽度 | `number` | 700 |
|
|
39
|
+
| onOk | 确认回调 | (data: { lng: number, lat: number, comp: <span style="color: red">IComp</span>, compText: Text }) => void | - |
|
|
40
|
+
| onCancel | 取消回调 | `() => void` | 700 |
|
|
41
|
+
|
|
42
|
+
## 确认回调-IComp
|
|
43
|
+
|
|
44
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
45
|
+
|--------------|:----|:--------:|----:|
|
|
46
|
+
| province | 省份 | `string` | - |
|
|
47
|
+
| city | 城市 | `string` | - |
|
|
48
|
+
| district | 区县 | `string` | - |
|
|
49
|
+
| street | 街道 | `string` | - |
|
|
50
|
+
| streetNumber | 门牌号 | `string` | - |
|
|
51
|
+
|
|
52
|
+
## 常见问题
|
|
53
|
+
* 加载地图失败,缺少必要的文件!
|
|
54
|
+
|
|
55
|
+
请确认应用public/index.html中是否导入高德地图SDK。
|
|
56
|
+
* onOk确认回调compText为undefined
|
|
57
|
+
|
|
58
|
+
请确认高德地图是否授权Web应用。
|
package/AMap/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AMapProps {
|
|
4
|
+
/** 初始经度 默认-116.404 */
|
|
5
|
+
lng?: number;
|
|
6
|
+
/** 初始纬度 默认-39.915 */
|
|
7
|
+
lat?: number;
|
|
8
|
+
/** 标题 默认-高德地图 */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** 地图弹窗宽度 默认-700 */
|
|
11
|
+
width?: number;
|
|
12
|
+
/** 确认事件 返回选择的位置信息 */
|
|
13
|
+
onOk?: (data: {
|
|
14
|
+
// 经度
|
|
15
|
+
lng: number;
|
|
16
|
+
// 纬度
|
|
17
|
+
lat: number;
|
|
18
|
+
// 选择的位置信息对象
|
|
19
|
+
comp?: {
|
|
20
|
+
// 省份
|
|
21
|
+
province: string;
|
|
22
|
+
// 城市
|
|
23
|
+
city: string;
|
|
24
|
+
// 区县
|
|
25
|
+
district: string;
|
|
26
|
+
// 街道
|
|
27
|
+
street: string;
|
|
28
|
+
// 门牌号
|
|
29
|
+
streetNumber: string;
|
|
30
|
+
};
|
|
31
|
+
// 选择的位置详细信息文本
|
|
32
|
+
compText?: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
/** 取消事件 */
|
|
35
|
+
onCancel?: () => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const AMap: React.FC<AMapProps>;
|
|
39
|
+
|
|
40
|
+
export default AMap;
|
package/AMap/index.js
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
|
2
|
+
import { Button, Col, message, Modal, Result, Row } from 'antd';
|
|
3
|
+
const _A_MAP_SEARCH_ = '_A_MAP_SEARCH_';
|
|
4
|
+
const _A_MAP_DEFAULT_POINT_ = {
|
|
5
|
+
lng: 116.397437,
|
|
6
|
+
lat: 39.909148
|
|
7
|
+
};
|
|
8
|
+
export default function AMap({
|
|
9
|
+
lng: propLng,
|
|
10
|
+
lat: propLat,
|
|
11
|
+
title = '高德地图',
|
|
12
|
+
width = 700,
|
|
13
|
+
onOk,
|
|
14
|
+
onCancel
|
|
15
|
+
}) {
|
|
16
|
+
const [lng, setLng] = useState(_A_MAP_DEFAULT_POINT_.lng);
|
|
17
|
+
const [lat, setLat] = useState(_A_MAP_DEFAULT_POINT_.lat);
|
|
18
|
+
const GL = useRef(null);
|
|
19
|
+
const mapRef = useRef(null);
|
|
20
|
+
const markerRef = useRef(null);
|
|
21
|
+
const autoRef = useRef(null);
|
|
22
|
+
const placeSearchRef = useRef(null);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (typeof window.AMap === 'undefined') {
|
|
25
|
+
message.error('未导入高德地图文件,生成地图失败!').then(() => null);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let mounted = true;
|
|
29
|
+
|
|
30
|
+
// 保证传入的初始值是 number(避免 NaN)
|
|
31
|
+
const initLng = Number(propLng) || _A_MAP_DEFAULT_POINT_.lng;
|
|
32
|
+
const initLat = Number(propLat) || _A_MAP_DEFAULT_POINT_.lat;
|
|
33
|
+
|
|
34
|
+
// 等待容器可见且尺寸非 0(Modal 动画或隐藏态时常为 0)
|
|
35
|
+
const waitForVisible = (el, timeout = 3000) => new Promise(resolve => {
|
|
36
|
+
const start = Date.now();
|
|
37
|
+
function check() {
|
|
38
|
+
if (!el) return resolve(false);
|
|
39
|
+
const r = el.getBoundingClientRect();
|
|
40
|
+
if (r.width > 0 && r.height > 0) return resolve(true);
|
|
41
|
+
if (Date.now() - start > timeout) return resolve(false);
|
|
42
|
+
requestAnimationFrame(check);
|
|
43
|
+
}
|
|
44
|
+
check();
|
|
45
|
+
});
|
|
46
|
+
async function init() {
|
|
47
|
+
if (!GL.current) {
|
|
48
|
+
console.warn('AMap container ref not ready');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const visible = await waitForVisible(GL.current, 3000);
|
|
52
|
+
if (!visible) {
|
|
53
|
+
// 继续也可,但记录一下。多数情况下等待后再 init 能解决 Pixel(NaN, 0)
|
|
54
|
+
console.warn('AMap container still not visible before init (proceeding anyway).');
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const map = new window.AMap.Map(GL.current, {
|
|
58
|
+
center: [initLng, initLat],
|
|
59
|
+
zoom: 18,
|
|
60
|
+
viewMode: '3D'
|
|
61
|
+
});
|
|
62
|
+
mapRef.current = map;
|
|
63
|
+
|
|
64
|
+
// 保证 state 与实际中心一致
|
|
65
|
+
setLng(initLng);
|
|
66
|
+
setLat(initLat);
|
|
67
|
+
|
|
68
|
+
// 插件加载、控件创建都做容错
|
|
69
|
+
window.AMap.plugin(['AMap.Scale', 'AMap.ToolBar', 'AMap.Geolocation', 'AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder'], () => {
|
|
70
|
+
try {
|
|
71
|
+
map.addControl(new window.AMap.Scale());
|
|
72
|
+
} catch (e) {
|
|
73
|
+
// 某些构建/版本中可能不存在
|
|
74
|
+
console.warn('Scale control failed', e);
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
map.addControl(new window.AMap.ToolBar({
|
|
78
|
+
position: 'RT'
|
|
79
|
+
}));
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.warn('ToolBar control failed', e);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
// 使用合法角落(RB/RT/LB/LT),不要自定义 'BT'
|
|
85
|
+
const geolocation = new window.AMap.Geolocation({
|
|
86
|
+
position: 'RB',
|
|
87
|
+
offset: new window.AMap.Pixel(Number(20), Number(20)),
|
|
88
|
+
showCircle: false,
|
|
89
|
+
showButton: true
|
|
90
|
+
});
|
|
91
|
+
map.addControl(geolocation);
|
|
92
|
+
|
|
93
|
+
// 正确的回调签名 (status, result)
|
|
94
|
+
geolocation.getCurrentPosition((status, result) => {
|
|
95
|
+
if (status !== 'complete') {
|
|
96
|
+
// 不做致命处理,但提示
|
|
97
|
+
message.error('未知原因,定位失败!');
|
|
98
|
+
} else {
|
|
99
|
+
// 如果需要可以从 result.position 取值
|
|
100
|
+
try {
|
|
101
|
+
const pos = result && result.position;
|
|
102
|
+
if (pos) {
|
|
103
|
+
const px = typeof pos.getLng === 'function' ? pos.getLng() : pos.lng;
|
|
104
|
+
const py = typeof pos.getLat === 'function' ? pos.getLat() : pos.lat;
|
|
105
|
+
if (!Number.isNaN(Number(px)) && !Number.isNaN(Number(py))) {
|
|
106
|
+
setLng(Number(px));
|
|
107
|
+
setLat(Number(py));
|
|
108
|
+
map.setCenter([Number(px), Number(py)]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} catch (e) {
|
|
112
|
+
// 忽略
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
} catch (e) {
|
|
117
|
+
console.warn('Geolocation init failed', e);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// 初始 marker 放置
|
|
121
|
+
try {
|
|
122
|
+
markerRef.current = new window.AMap.Marker({
|
|
123
|
+
position: [initLng, initLat],
|
|
124
|
+
map
|
|
125
|
+
});
|
|
126
|
+
} catch (e) {
|
|
127
|
+
console.warn('Marker init failed', e);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// AutoComplete + PlaceSearch
|
|
131
|
+
try {
|
|
132
|
+
placeSearchRef.current = new window.AMap.PlaceSearch({
|
|
133
|
+
map
|
|
134
|
+
});
|
|
135
|
+
autoRef.current = new window.AMap.AutoComplete({
|
|
136
|
+
input: document.getElementById(_A_MAP_SEARCH_)
|
|
137
|
+
});
|
|
138
|
+
autoRef.current.on && autoRef.current.on('select', e => {
|
|
139
|
+
// e.poi 里可能是 AMap.LngLat 实例 / 对象 / 数组,做兼容处理
|
|
140
|
+
const poi = e && e.poi ? e.poi : null;
|
|
141
|
+
let loc = poi && (poi.location || poi.lnglat) || e && (e.location || e.lnglat) || null;
|
|
142
|
+
let foundLng = null;
|
|
143
|
+
let foundLat = null;
|
|
144
|
+
if (loc) {
|
|
145
|
+
if (typeof loc.getLng === 'function' && typeof loc.getLat === 'function') {
|
|
146
|
+
// AMap.LngLat 实例
|
|
147
|
+
foundLng = Number(loc.getLng());
|
|
148
|
+
foundLat = Number(loc.getLat());
|
|
149
|
+
} else if (typeof loc.lng === 'number' && typeof loc.lat === 'number') {
|
|
150
|
+
foundLng = Number(loc.lng);
|
|
151
|
+
foundLat = Number(loc.lat);
|
|
152
|
+
} else if (Array.isArray(loc)) {
|
|
153
|
+
foundLng = Number(loc[0]);
|
|
154
|
+
foundLat = Number(loc[1]);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (foundLng != null && foundLat != null && !Number.isNaN(foundLng) && !Number.isNaN(foundLat)) {
|
|
158
|
+
setLng(foundLng);
|
|
159
|
+
setLat(foundLat);
|
|
160
|
+
map.setCenter([foundLng, foundLat]);
|
|
161
|
+
if (markerRef.current) {
|
|
162
|
+
markerRef.current.setPosition([foundLng, foundLat]);
|
|
163
|
+
} else {
|
|
164
|
+
markerRef.current = new window.AMap.Marker({
|
|
165
|
+
position: [foundLng, foundLat],
|
|
166
|
+
map
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
// 兜底:用 placeSearch 搜索 name(如果有)
|
|
171
|
+
const name = poi && (poi.name || poi.address) || e && (e.info || e.name);
|
|
172
|
+
if (name && placeSearchRef.current && placeSearchRef.current.search) {
|
|
173
|
+
placeSearchRef.current.search(name, (status, result) => {
|
|
174
|
+
// placeSearch 回调再处理,这里保持原有逻辑或按需增强
|
|
175
|
+
if (status === 'complete' && result && result.poiList && result.poiList.pois && result.poiList.pois.length > 0) {
|
|
176
|
+
const p = result.poiList.pois[0];
|
|
177
|
+
const loc2 = p.location || p.lnglat;
|
|
178
|
+
let x = null,
|
|
179
|
+
y = null;
|
|
180
|
+
if (loc2) {
|
|
181
|
+
if (typeof loc2.getLng === 'function') {
|
|
182
|
+
x = Number(loc2.getLng());
|
|
183
|
+
y = Number(loc2.getLat());
|
|
184
|
+
} else if (typeof loc2.lng === 'number') {
|
|
185
|
+
x = Number(loc2.lng);
|
|
186
|
+
y = Number(loc2.lat);
|
|
187
|
+
} else if (Array.isArray(loc2)) {
|
|
188
|
+
x = Number(loc2[0]);
|
|
189
|
+
y = Number(loc2[1]);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (!Number.isNaN(x) && !Number.isNaN(y)) {
|
|
193
|
+
setLng(x);
|
|
194
|
+
setLat(y);
|
|
195
|
+
map.setCenter([x, y]);
|
|
196
|
+
if (markerRef.current) markerRef.current.setPosition([x, y]);else markerRef.current = new window.AMap.Marker({
|
|
197
|
+
position: [x, y],
|
|
198
|
+
map
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
} catch (e) {
|
|
207
|
+
console.warn('AutoComplete / PlaceSearch init failed', e);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// 点击选点
|
|
211
|
+
try {
|
|
212
|
+
map.on && map.on('click', e => {
|
|
213
|
+
const lnglat = e && e.lnglat;
|
|
214
|
+
if (!lnglat) return;
|
|
215
|
+
let clickLng = null;
|
|
216
|
+
let clickLat = null;
|
|
217
|
+
if (typeof lnglat.getLng === 'function') {
|
|
218
|
+
clickLng = Number(lnglat.getLng());
|
|
219
|
+
clickLat = Number(lnglat.getLat());
|
|
220
|
+
} else {
|
|
221
|
+
clickLng = Number(lnglat.lng || Array.isArray(lnglat) && lnglat[0]);
|
|
222
|
+
clickLat = Number(lnglat.lat || Array.isArray(lnglat) && lnglat[1]);
|
|
223
|
+
}
|
|
224
|
+
if (Number.isNaN(clickLng) || Number.isNaN(clickLat)) return;
|
|
225
|
+
setLng(clickLng);
|
|
226
|
+
setLat(clickLat);
|
|
227
|
+
if (markerRef.current) {
|
|
228
|
+
markerRef.current.setPosition([clickLng, clickLat]);
|
|
229
|
+
} else {
|
|
230
|
+
markerRef.current = new window.AMap.Marker({
|
|
231
|
+
position: [clickLng, clickLat],
|
|
232
|
+
map
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
} catch (e) {
|
|
237
|
+
console.warn('map.on click failed', e);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
} catch (err) {
|
|
241
|
+
console.error('AMap init error', err);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
init();
|
|
245
|
+
|
|
246
|
+
// cleanup
|
|
247
|
+
return () => {
|
|
248
|
+
mounted = false;
|
|
249
|
+
try {
|
|
250
|
+
if (mapRef.current) {
|
|
251
|
+
mapRef.current.destroy();
|
|
252
|
+
mapRef.current = null;
|
|
253
|
+
}
|
|
254
|
+
} catch (e) {
|
|
255
|
+
// ignore
|
|
256
|
+
}
|
|
257
|
+
markerRef.current = null;
|
|
258
|
+
autoRef.current = null;
|
|
259
|
+
placeSearchRef.current = null;
|
|
260
|
+
};
|
|
261
|
+
}, [propLng, propLat]);
|
|
262
|
+
|
|
263
|
+
// 重置、确认等操作(同样做 number guard)
|
|
264
|
+
const onResetMap = useCallback(() => {
|
|
265
|
+
const map = mapRef.current;
|
|
266
|
+
if (!map) return;
|
|
267
|
+
const x = Number(_A_MAP_DEFAULT_POINT_.lng);
|
|
268
|
+
const y = Number(_A_MAP_DEFAULT_POINT_.lat);
|
|
269
|
+
setLng(x);
|
|
270
|
+
setLat(y);
|
|
271
|
+
try {
|
|
272
|
+
map.setCenter([x, y]);
|
|
273
|
+
if (markerRef.current) {
|
|
274
|
+
markerRef.current.setPosition([x, y]);
|
|
275
|
+
} else {
|
|
276
|
+
markerRef.current = new window.AMap.Marker({
|
|
277
|
+
position: [x, y],
|
|
278
|
+
map
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
} catch (e) {
|
|
282
|
+
console.warn('reset map failed', e);
|
|
283
|
+
}
|
|
284
|
+
}, []);
|
|
285
|
+
const handleOk = useCallback(() => {
|
|
286
|
+
if (!mapRef.current) return;
|
|
287
|
+
// 确保 lng/lat 是 number
|
|
288
|
+
const x = Number(lng);
|
|
289
|
+
const y = Number(lat);
|
|
290
|
+
if (Number.isNaN(x) || Number.isNaN(y)) {
|
|
291
|
+
onOk && onOk({
|
|
292
|
+
lng,
|
|
293
|
+
lat,
|
|
294
|
+
comp: undefined,
|
|
295
|
+
compText: undefined
|
|
296
|
+
});
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
window.AMap.plugin('AMap.Geocoder', () => {
|
|
300
|
+
try {
|
|
301
|
+
const geocoder = new window.AMap.Geocoder();
|
|
302
|
+
geocoder.getAddress([x, y], (status, result) => {
|
|
303
|
+
let comp;
|
|
304
|
+
if (status === 'complete' && result && result.regeocode) {
|
|
305
|
+
comp = result.regeocode.addressComponent;
|
|
306
|
+
}
|
|
307
|
+
onOk && onOk({
|
|
308
|
+
lng: x,
|
|
309
|
+
lat: y,
|
|
310
|
+
comp,
|
|
311
|
+
compText: comp && [comp.province, comp.city, comp.district, comp.township, comp.street, comp.streetNumber].filter(Boolean).join('') || undefined
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
} catch (e) {
|
|
315
|
+
onOk && onOk({
|
|
316
|
+
lng: x,
|
|
317
|
+
lat: y,
|
|
318
|
+
comp: undefined,
|
|
319
|
+
compText: undefined
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}, [lng, lat, onOk]);
|
|
324
|
+
const hasMapScript = typeof window.AMap !== 'undefined';
|
|
325
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
326
|
+
open: true,
|
|
327
|
+
destroyOnClose: true,
|
|
328
|
+
title: title,
|
|
329
|
+
width: width,
|
|
330
|
+
footer: hasMapScript && /*#__PURE__*/React.createElement(Row, {
|
|
331
|
+
align: "middle",
|
|
332
|
+
justify: "space-between"
|
|
333
|
+
}, /*#__PURE__*/React.createElement(Col, null, "\u5750\u6807\uFF1A", [lng, lat].join('-')), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(Button, {
|
|
334
|
+
ghost: true,
|
|
335
|
+
type: "primary",
|
|
336
|
+
style: {
|
|
337
|
+
marginRight: 12
|
|
338
|
+
},
|
|
339
|
+
onClick: onResetMap
|
|
340
|
+
}, "\u91CD\u7F6E\u5730\u56FE"), /*#__PURE__*/React.createElement(Button, {
|
|
341
|
+
type: "primary",
|
|
342
|
+
onClick: handleOk
|
|
343
|
+
}, "\u786E\u8BA4\u5750\u6807"))),
|
|
344
|
+
maskClosable: false,
|
|
345
|
+
onCancel: () => onCancel && onCancel()
|
|
346
|
+
}, hasMapScript ? /*#__PURE__*/React.createElement("div", {
|
|
347
|
+
style: {
|
|
348
|
+
position: 'relative'
|
|
349
|
+
}
|
|
350
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
351
|
+
ref: GL,
|
|
352
|
+
style: {
|
|
353
|
+
height: 500,
|
|
354
|
+
userSelect: 'none'
|
|
355
|
+
}
|
|
356
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
357
|
+
id: _A_MAP_SEARCH_,
|
|
358
|
+
type: "text",
|
|
359
|
+
maxLength: 30,
|
|
360
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u67E5\u8BE2",
|
|
361
|
+
style: {
|
|
362
|
+
position: 'absolute',
|
|
363
|
+
top: 10,
|
|
364
|
+
left: 10,
|
|
365
|
+
zIndex: 1000
|
|
366
|
+
}
|
|
367
|
+
})) : /*#__PURE__*/React.createElement(Result, {
|
|
368
|
+
status: "error",
|
|
369
|
+
title: "\u52A0\u8F7D\u5730\u56FE\u5931\u8D25\uFF0C\u7F3A\u5C11\u5FC5\u8981\u7684\u6587\u4EF6\uFF01"
|
|
370
|
+
}));
|
|
371
|
+
}
|
package/AMap/index.less
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#_A_MAP_SEARCH_ {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 10px;
|
|
4
|
+
right: 10px;
|
|
5
|
+
z-index: 10;
|
|
6
|
+
color: rgb(102 102 102);
|
|
7
|
+
box-shadow: 1px 2px 1px rgb(0 0 0 / 15%);
|
|
8
|
+
border: none;
|
|
9
|
+
height: 32px;
|
|
10
|
+
line-height: 32px;
|
|
11
|
+
width: 300px;
|
|
12
|
+
padding: 0 10px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
outline: none;
|
|
15
|
+
border-radius: 3px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tangram-suggestion-main {
|
|
19
|
+
z-index: 1000;
|
|
20
|
+
margin-top: 6px;
|
|
21
|
+
|
|
22
|
+
.tangram-suggestion {
|
|
23
|
+
border: none;
|
|
24
|
+
box-shadow: 1px 2px 1px rgb(0 0 0 / 15%);
|
|
25
|
+
border-radius: 3px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#selCityWd {
|
|
30
|
+
box-sizing: content-box;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.city_content_top {
|
|
34
|
+
box-sizing: content-box;
|
|
35
|
+
}
|
package/BMap/README.md
CHANGED
package/BMap/index.less
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
#_B_MAP_SEARCH_ {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 10px;
|
|
4
|
+
right: 10px;
|
|
5
|
+
z-index: 10;
|
|
6
|
+
color: rgb(102 102 102);
|
|
7
|
+
box-shadow: 1px 2px 1px rgb(0 0 0 / 15%);
|
|
8
|
+
border: none;
|
|
9
|
+
height: 32px;
|
|
10
|
+
line-height: 32px;
|
|
11
|
+
width: 300px;
|
|
12
|
+
padding: 0 10px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
outline: none;
|
|
15
|
+
border-radius: 3px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tangram-suggestion-main {
|
|
19
|
+
z-index: 1000;
|
|
20
|
+
margin-top: 6px;
|
|
21
|
+
|
|
22
|
+
.tangram-suggestion {
|
|
8
23
|
border: none;
|
|
9
|
-
|
|
10
|
-
line-height: 32px;
|
|
11
|
-
width: 300px;
|
|
12
|
-
padding: 0 10px;
|
|
13
|
-
font-size: 12px;
|
|
14
|
-
outline: none;
|
|
24
|
+
box-shadow: 1px 2px 1px rgb(0 0 0 / 15%);
|
|
15
25
|
border-radius: 3px;
|
|
16
26
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#selCityWd {
|
|
30
|
-
box-sizing: content-box;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.city_content_top {
|
|
34
|
-
box-sizing: content-box;
|
|
35
|
-
}
|
|
36
|
-
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#selCityWd {
|
|
30
|
+
box-sizing: content-box;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.city_content_top {
|
|
34
|
+
box-sizing: content-box;
|
|
35
|
+
}
|