hy-dispatch-ui-v3 0.2.53 → 0.2.55
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/dist/tailwind.css +53 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +39 -10
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +12 -22
- package/es/components/hyDialog/dialog.vue.mjs +9 -7
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +5 -5
- package/es/components/hyForm/cpns/extraItem.vue.mjs +6 -1
- package/es/components/hyForm/cpns/formItem.vue.mjs +29 -14
- package/es/components/hyForm/js/index.mjs +29 -25
- package/es/components/hyForm/js/useAppForm.mjs +15 -30
- package/es/components/hyIconBox/iconBox.vue.mjs +1 -1
- package/es/components/hyIconBox/style/iconBox.scss +1 -1
- package/es/components/hyMap/index.mjs +6 -0
- package/es/components/hyMap/js/index.mjs +59 -0
- package/es/components/hyMap/map.vue.mjs +59 -0
- package/es/components/hyOrgCascader/js/index.mjs +53 -0
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +22 -25
- package/es/components/hySearch/search.vue.mjs +6 -8
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +10 -18
- package/es/components/hyTable/table.vue.mjs +8 -11
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +6 -3
- package/es/components/hyTableForm/batchTableForm.vue.mjs +182 -135
- package/es/components/hyTableForm/js/index.mjs +2 -2
- package/es/components/hyTableForm/tableForm.vue.mjs +29 -20
- package/es/components/hyTooltip/tooltip.vue.mjs +1 -1
- package/es/components/hyTree/js/index.mjs +5 -4
- package/es/components/hyTree/tree.vue.mjs +5 -0
- package/es/components/index.mjs +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useApi.mjs +11 -5
- package/es/hooks/useAudioPlayerConfig.mjs +13 -5
- package/es/hooks/useEnsureHyIcon.mjs +11 -5
- package/es/hooks/useLocale.mjs +6 -5
- package/es/hooks/usePermissionMap.mjs +13 -5
- package/es/hooks/useSubscribe.mjs +28 -0
- package/es/hooks/useTooltipConfig.mjs +11 -5
- package/es/hooks/useUserAvatarMap.mjs +13 -5
- package/es/hooks/useVideoPlayerConfig.mjs +13 -5
- package/es/index.mjs +3 -2
- package/es/static/map/CFCASIPInput.min.js +258 -0
- package/es/static/map/MarkerCluster.css +75 -0
- package/es/static/map/bigemap.css +838 -0
- package/es/static/map/bigemap.js +5 -0
- package/es/static/map/bm.geometryutil.js +754 -0
- package/es/static/map/bmDraw.css +329 -0
- package/es/static/map/bmDraw.js +181 -0
- package/es/static/map/car.png +0 -0
- package/es/static/map/markercluster.js +2679 -0
- package/es/static/map/moveMarker.js +74 -0
- package/es/utils/form.mjs +38 -2
- package/es/utils/index.mjs +1 -2
- package/es/utils/map/hook/bigMap.mjs +1136 -0
- package/es/utils/map/hook/gaode.mjs +683 -0
- package/es/utils/map/hook/leafletjs.mjs +1336 -0
- package/es/utils/map/index.mjs +291 -0
- package/es/utils/map/js/mapProxy.mjs +38 -0
- package/es/utils/map/js/webgis.mjs +153 -0
- package/es/version.mjs +1 -1
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +40 -11
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +13 -23
- package/lib/components/hyDialog/dialog.vue.js +9 -7
- package/lib/components/hyForm/cpns/arrayItem.vue.js +4 -4
- package/lib/components/hyForm/cpns/extraItem.vue.js +6 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +26 -11
- package/lib/components/hyForm/js/index.js +29 -23
- package/lib/components/hyForm/js/useAppForm.js +14 -29
- package/lib/components/hyIconBox/iconBox.vue.js +1 -1
- package/lib/components/hyIconBox/style/iconBox.scss +1 -1
- package/lib/components/hyMap/index.js +11 -0
- package/lib/components/hyMap/js/index.js +61 -0
- package/lib/components/hyMap/map.vue.js +63 -0
- package/lib/components/hyOrgCascader/js/index.js +56 -0
- package/lib/components/hyOrgCascader/orgCascader.vue.js +21 -24
- package/lib/components/hySearch/search.vue.js +4 -6
- package/lib/components/hyTable/cpns/columnSelect.vue.js +12 -20
- package/lib/components/hyTable/table.vue.js +17 -20
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +5 -2
- package/lib/components/hyTableForm/batchTableForm.vue.js +181 -134
- package/lib/components/hyTableForm/js/index.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +29 -20
- package/lib/components/hyTooltip/tooltip.vue.js +1 -1
- package/lib/components/hyTree/js/index.js +5 -4
- package/lib/components/hyTree/tree.vue.js +5 -0
- package/lib/components/index.js +22 -20
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/useApi.js +10 -4
- package/lib/hooks/useAudioPlayerConfig.js +12 -4
- package/lib/hooks/useEnsureHyIcon.js +10 -4
- package/lib/hooks/useLocale.js +5 -4
- package/lib/hooks/usePermissionMap.js +12 -4
- package/lib/hooks/useSubscribe.js +31 -0
- package/lib/hooks/useTooltipConfig.js +10 -4
- package/lib/hooks/useUserAvatarMap.js +12 -4
- package/lib/hooks/useVideoPlayerConfig.js +12 -4
- package/lib/index.js +27 -22
- package/lib/static/map/CFCASIPInput.min.js +258 -0
- package/lib/static/map/MarkerCluster.css +75 -0
- package/lib/static/map/bigemap.css +838 -0
- package/lib/static/map/bigemap.js +5 -0
- package/lib/static/map/bm.geometryutil.js +754 -0
- package/lib/static/map/bmDraw.css +329 -0
- package/lib/static/map/bmDraw.js +181 -0
- package/lib/static/map/car.png +0 -0
- package/lib/static/map/markercluster.js +2679 -0
- package/lib/static/map/moveMarker.js +74 -0
- package/lib/utils/form.js +38 -0
- package/lib/utils/index.js +2 -2
- package/lib/utils/map/hook/bigMap.js +1140 -0
- package/lib/utils/map/hook/gaode.js +687 -0
- package/lib/utils/map/hook/leafletjs.js +1360 -0
- package/lib/utils/map/index.js +298 -0
- package/lib/utils/map/js/mapProxy.js +44 -0
- package/lib/utils/map/js/webgis.js +162 -0
- package/lib/version.js +1 -1
- package/package.json +16 -1
- package/es/utils/bus.mjs +0 -5
- package/lib/utils/bus.js +0 -7
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var gaode = require('./hook/gaode.js');
|
|
6
|
+
var leafletjs = require('./hook/leafletjs.js');
|
|
7
|
+
var bigMap = require('./hook/bigMap.js');
|
|
8
|
+
var events = require('events');
|
|
9
|
+
var hyCommon = require('hy-common');
|
|
10
|
+
|
|
11
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
12
|
+
const scriptPromises = new globalThis.Map();
|
|
13
|
+
const mapServerPromises = new globalThis.Map();
|
|
14
|
+
const AMAP_PLUGINS = [
|
|
15
|
+
"AMap.MouseTool",
|
|
16
|
+
"AMap.RangingTool",
|
|
17
|
+
"AMap.PolyEditor",
|
|
18
|
+
"AMap.MarkerClusterer",
|
|
19
|
+
"AMap.Scale",
|
|
20
|
+
"AMap.GeometryUtil"
|
|
21
|
+
];
|
|
22
|
+
const staticAssets = {
|
|
23
|
+
"bigemap.js": new URL("../../static/map/bigemap.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href,
|
|
24
|
+
"markercluster.js": new URL(
|
|
25
|
+
"../../static/map/markercluster.js",
|
|
26
|
+
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))
|
|
27
|
+
).href,
|
|
28
|
+
"bmDraw.js": new URL("../../static/map/bmDraw.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href,
|
|
29
|
+
"bm.geometryutil.js": new URL(
|
|
30
|
+
"../../static/map/bm.geometryutil.js",
|
|
31
|
+
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))
|
|
32
|
+
).href,
|
|
33
|
+
"moveMarker.js": new URL("../../static/map/moveMarker.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/map/index.js', document.baseURI).href))).href
|
|
34
|
+
};
|
|
35
|
+
const staticUrl = (file) => {
|
|
36
|
+
const url = staticAssets[file];
|
|
37
|
+
if (!url) {
|
|
38
|
+
throw new Error(`Unknown map asset: ${file}`);
|
|
39
|
+
}
|
|
40
|
+
return url;
|
|
41
|
+
};
|
|
42
|
+
function setMapServer(mapType, mapConfig = {}) {
|
|
43
|
+
if (mapType === "gaode" && window.AMap?.Map) {
|
|
44
|
+
return Promise.resolve();
|
|
45
|
+
}
|
|
46
|
+
if (mapType === "bigMap" && window.BM) {
|
|
47
|
+
return Promise.resolve();
|
|
48
|
+
}
|
|
49
|
+
if (mapType !== "gaode" && mapType !== "bigMap") {
|
|
50
|
+
return Promise.resolve();
|
|
51
|
+
}
|
|
52
|
+
if (mapServerPromises.has(mapType)) {
|
|
53
|
+
return mapServerPromises.get(mapType);
|
|
54
|
+
}
|
|
55
|
+
const promise = (async () => {
|
|
56
|
+
if (mapType === "bigMap") {
|
|
57
|
+
await loadScript(staticUrl("bigemap.js"));
|
|
58
|
+
await Promise.all([
|
|
59
|
+
loadScript(staticUrl("markercluster.js")),
|
|
60
|
+
loadScript(staticUrl("bmDraw.js")),
|
|
61
|
+
loadScript(staticUrl("bm.geometryutil.js")),
|
|
62
|
+
loadScript(staticUrl("moveMarker.js"))
|
|
63
|
+
]);
|
|
64
|
+
bmInit();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
window._AMapSecurityConfig = {
|
|
68
|
+
securityJsCode: mapConfig.mapSk || "024a144126a2a762fee60e0ca1d0aeeb"
|
|
69
|
+
};
|
|
70
|
+
const plugins = AMAP_PLUGINS.join(",");
|
|
71
|
+
const url = `https://webapi.amap.com/maps?v=1.4.15&key=${encodeURIComponent(mapConfig.mapKey || "")}&plugin=${plugins}`;
|
|
72
|
+
await loadScript(url);
|
|
73
|
+
if (!window.AMap?.Map) {
|
|
74
|
+
throw new Error("AMap SDK loaded without exposing window.AMap.Map");
|
|
75
|
+
}
|
|
76
|
+
})().catch((error) => {
|
|
77
|
+
mapServerPromises.delete(mapType);
|
|
78
|
+
throw error;
|
|
79
|
+
});
|
|
80
|
+
mapServerPromises.set(mapType, promise);
|
|
81
|
+
return promise;
|
|
82
|
+
}
|
|
83
|
+
function setPoiServer(mapConfig) {
|
|
84
|
+
const data = mapConfig;
|
|
85
|
+
data.mapCoordinate = typeof data.bmCorrect === "number" ? data.bmCorrect : data.mapCoordinate;
|
|
86
|
+
data.serverCoordinate = 1;
|
|
87
|
+
data.projectCoordinate = 1;
|
|
88
|
+
data.projectPoiCoordinate = 1;
|
|
89
|
+
data.poiServer = data.poiServer || {};
|
|
90
|
+
let city = data.poiServer.city || "";
|
|
91
|
+
city = city.split("-");
|
|
92
|
+
const poiServer = {
|
|
93
|
+
mapPoiType: "gaode",
|
|
94
|
+
...data.poiServer,
|
|
95
|
+
city: city[city.length - 1],
|
|
96
|
+
mapCoordinate: data.mapCoordinate,
|
|
97
|
+
projectCoordinate: data.projectPoiCoordinate,
|
|
98
|
+
mapSk: data.mapSk
|
|
99
|
+
};
|
|
100
|
+
return new hyCommon.Map({
|
|
101
|
+
poiServer
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function loadScript(url) {
|
|
105
|
+
const absoluteUrl = new URL(url, document.baseURI).href;
|
|
106
|
+
if (scriptPromises.has(absoluteUrl)) {
|
|
107
|
+
return scriptPromises.get(absoluteUrl);
|
|
108
|
+
}
|
|
109
|
+
const promise = new Promise((resolve, reject) => {
|
|
110
|
+
const script = document.createElement("script");
|
|
111
|
+
script.type = "text/javascript";
|
|
112
|
+
script.setAttribute("data-callType", "callScript");
|
|
113
|
+
if (script.readyState) {
|
|
114
|
+
script.onreadystatechange = function() {
|
|
115
|
+
if (script.readyState === "loaded" || script.readyState === "complete") {
|
|
116
|
+
script.onreadystatechange = null;
|
|
117
|
+
resolve();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
} else {
|
|
121
|
+
script.onload = () => {
|
|
122
|
+
resolve();
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
script.onerror = () => {
|
|
126
|
+
scriptPromises.delete(absoluteUrl);
|
|
127
|
+
script.remove();
|
|
128
|
+
reject(new Error(`Map script failed to load: ${absoluteUrl}`));
|
|
129
|
+
};
|
|
130
|
+
script.src = absoluteUrl;
|
|
131
|
+
document.querySelector("head").appendChild(script);
|
|
132
|
+
});
|
|
133
|
+
scriptPromises.set(absoluteUrl, promise);
|
|
134
|
+
return promise;
|
|
135
|
+
}
|
|
136
|
+
function bmInit() {
|
|
137
|
+
(function() {
|
|
138
|
+
var originalInitTile = window.BM.GridLayer.prototype._initTile;
|
|
139
|
+
window.BM.GridLayer.include({
|
|
140
|
+
_initTile: function(tile) {
|
|
141
|
+
originalInitTile.call(this, tile);
|
|
142
|
+
var tileSize = this.getTileSize();
|
|
143
|
+
tile.style.width = tileSize.x + 1 + "px";
|
|
144
|
+
tile.style.height = tileSize.y + 1 + "px";
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
})();
|
|
148
|
+
}
|
|
149
|
+
class Map extends events.EventEmitter {
|
|
150
|
+
constructor(request) {
|
|
151
|
+
super();
|
|
152
|
+
this.map = null;
|
|
153
|
+
this.NewMap(request);
|
|
154
|
+
}
|
|
155
|
+
// 初始化地图
|
|
156
|
+
NewMap(params = {}) {
|
|
157
|
+
params = {
|
|
158
|
+
mapType: "gaode",
|
|
159
|
+
// 地图类型
|
|
160
|
+
lang: "zh_cn",
|
|
161
|
+
// 语言
|
|
162
|
+
layersIndex: null,
|
|
163
|
+
// 图层索引
|
|
164
|
+
// 高德参数
|
|
165
|
+
defaultMapStyle: params.defaultMapStyle,
|
|
166
|
+
// 地图默认样式
|
|
167
|
+
// crs 坐标系
|
|
168
|
+
crs: params.crs,
|
|
169
|
+
bmUiName: params.bmUiName,
|
|
170
|
+
// 地图默认样式
|
|
171
|
+
layersUrlList: params.layersUrlList,
|
|
172
|
+
// 地图瓦片地址
|
|
173
|
+
zoomOffset: params.zoomOffset || 0,
|
|
174
|
+
// 缩放偏移量
|
|
175
|
+
...params
|
|
176
|
+
};
|
|
177
|
+
if (params.mapType === "gaode") {
|
|
178
|
+
this.map = new gaode.default(params);
|
|
179
|
+
} else if (params.mapType === "leaflet") {
|
|
180
|
+
this.map = new leafletjs.default(params);
|
|
181
|
+
} else if (params.mapType === "bigMap") {
|
|
182
|
+
this.map = new bigMap.default(params);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
InitMap(domId, option) {
|
|
186
|
+
option = {
|
|
187
|
+
// 地图最小缩放级别
|
|
188
|
+
minZoom: option.minZoom || 8,
|
|
189
|
+
// 地图最大缩放级别
|
|
190
|
+
maxZoom: option.maxZoom || 18,
|
|
191
|
+
// 地图默认缩放级别
|
|
192
|
+
zoom: option.zoom || 13,
|
|
193
|
+
// 地图中心点
|
|
194
|
+
center: option.center,
|
|
195
|
+
// 地图初始化成功回调
|
|
196
|
+
completeCallbacks: option.completeCallbacks,
|
|
197
|
+
/* === gaode === */
|
|
198
|
+
// defaultMapStyle: option.defaultMapStyle,
|
|
199
|
+
/* === leafletjs === */
|
|
200
|
+
...option
|
|
201
|
+
};
|
|
202
|
+
return this.map.InitMap(domId, option);
|
|
203
|
+
}
|
|
204
|
+
// 自定义 h5 图标
|
|
205
|
+
DivIcon(option) {
|
|
206
|
+
option = {
|
|
207
|
+
html: option.html,
|
|
208
|
+
className: option.className,
|
|
209
|
+
iconSize: option.iconSize,
|
|
210
|
+
iconAnchor: option.iconAnchor,
|
|
211
|
+
...option
|
|
212
|
+
};
|
|
213
|
+
return this.map.DivIcon(option);
|
|
214
|
+
}
|
|
215
|
+
// 自定义 marker
|
|
216
|
+
Marker(option) {
|
|
217
|
+
option = {
|
|
218
|
+
...option,
|
|
219
|
+
icon: option.icon,
|
|
220
|
+
zIndexOffset: option.zIndexOffset,
|
|
221
|
+
position: option.position,
|
|
222
|
+
extData: option.extData,
|
|
223
|
+
// 上饶指定参数
|
|
224
|
+
pane: option.pane || "markerPane",
|
|
225
|
+
// 高德偏移
|
|
226
|
+
offset: option.offset
|
|
227
|
+
};
|
|
228
|
+
return this.map.Marker(option);
|
|
229
|
+
}
|
|
230
|
+
// 自定义 Circle
|
|
231
|
+
Circle(latLngList, option) {
|
|
232
|
+
option = {
|
|
233
|
+
...option,
|
|
234
|
+
radius: option.radius,
|
|
235
|
+
color: option.color,
|
|
236
|
+
opacity: option.opacity,
|
|
237
|
+
weight: option.weight,
|
|
238
|
+
fillColor: option.fillColor,
|
|
239
|
+
fillOpacity: option.fillOpacity
|
|
240
|
+
};
|
|
241
|
+
return this.map.Circle(latLngList, option);
|
|
242
|
+
}
|
|
243
|
+
// 自定义 Polygon
|
|
244
|
+
Polygon(pathList = [], option) {
|
|
245
|
+
option = {
|
|
246
|
+
...option,
|
|
247
|
+
color: option.color,
|
|
248
|
+
opacity: option.opacity,
|
|
249
|
+
weight: option.weight,
|
|
250
|
+
fillColor: option.fillColor,
|
|
251
|
+
fillOpacity: option.fillOpacity
|
|
252
|
+
};
|
|
253
|
+
return this.map.Polygon(pathList, option);
|
|
254
|
+
}
|
|
255
|
+
// 自定义 MarkerClusterGroup
|
|
256
|
+
MarkerClusterGroup(map, markerList = [], option) {
|
|
257
|
+
return this.map.MarkerClusterGroup(map, markerList, option);
|
|
258
|
+
}
|
|
259
|
+
// 自定义 popup
|
|
260
|
+
Popup(option) {
|
|
261
|
+
option = {
|
|
262
|
+
closeOnClick: false,
|
|
263
|
+
...option
|
|
264
|
+
};
|
|
265
|
+
return this.map.Popup(option);
|
|
266
|
+
}
|
|
267
|
+
// 自定义 Polyline
|
|
268
|
+
Polyline(latLngList, option) {
|
|
269
|
+
option = {
|
|
270
|
+
closeOnClick: false,
|
|
271
|
+
...option,
|
|
272
|
+
color: option.color,
|
|
273
|
+
opacity: option.opacity,
|
|
274
|
+
weight: option.weight
|
|
275
|
+
};
|
|
276
|
+
return this.map.Polyline(latLngList, option);
|
|
277
|
+
}
|
|
278
|
+
// 自定义 轨迹回放
|
|
279
|
+
TrackPlayer(latLngList = [], option = {}, map) {
|
|
280
|
+
return this.map.TrackPlayer(latLngList, option, map);
|
|
281
|
+
}
|
|
282
|
+
// 自定义地图工具
|
|
283
|
+
CreatePm(pmType = "rectangle", options = {}, map) {
|
|
284
|
+
return this.map.CreatePm(pmType, options, map);
|
|
285
|
+
}
|
|
286
|
+
// 电子围栏
|
|
287
|
+
CreateFence(pmType = "rectangle", options = {}, map) {
|
|
288
|
+
return this.map.CreateFence(pmType, options, map);
|
|
289
|
+
}
|
|
290
|
+
// 测距工具 labelColor labelFillColor lineColor
|
|
291
|
+
RangingTool(options = {}, map) {
|
|
292
|
+
return this.map.RangingTool(options, map);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
exports.default = Map;
|
|
297
|
+
exports.setMapServer = setMapServer;
|
|
298
|
+
exports.setPoiServer = setPoiServer;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const createMapProxy = (target, handlers = {}) => {
|
|
6
|
+
return new Proxy(target, {
|
|
7
|
+
get(_target, prop) {
|
|
8
|
+
if (handlers[prop]) {
|
|
9
|
+
return (...args) => handlers[prop](_target, ...args);
|
|
10
|
+
}
|
|
11
|
+
return _target[prop];
|
|
12
|
+
},
|
|
13
|
+
set(_target, prop, value) {
|
|
14
|
+
if (prop === "_proxy") return true;
|
|
15
|
+
return Reflect.set(_target, prop, value);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const createWrappedHandlerStore = () => {
|
|
20
|
+
const wrappedHandlerMap = /* @__PURE__ */ new Map();
|
|
21
|
+
return {
|
|
22
|
+
// 记录:原始回调 -> 实际注册到地图的包装回调
|
|
23
|
+
remember(types, originalFn, wrappedFn) {
|
|
24
|
+
if (!wrappedHandlerMap.has(types)) {
|
|
25
|
+
wrappedHandlerMap.set(types, /* @__PURE__ */ new Map());
|
|
26
|
+
}
|
|
27
|
+
wrappedHandlerMap.get(types).set(originalFn, wrappedFn);
|
|
28
|
+
},
|
|
29
|
+
// 取出并移除记录,取不到返回 undefined(说明该回调未被包装)
|
|
30
|
+
take(types, originalFn) {
|
|
31
|
+
const typeMap = wrappedHandlerMap.get(types);
|
|
32
|
+
const wrappedFn = typeMap && typeMap.get(originalFn);
|
|
33
|
+
if (wrappedFn) typeMap.delete(originalFn);
|
|
34
|
+
return wrappedFn;
|
|
35
|
+
},
|
|
36
|
+
clear() {
|
|
37
|
+
wrappedHandlerMap.clear();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.createMapProxy = createMapProxy;
|
|
43
|
+
exports.createWrappedHandlerStore = createWrappedHandlerStore;
|
|
44
|
+
exports.default = createMapProxy;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var PI = 3.141592653589793;
|
|
4
|
+
var a = 6378245;
|
|
5
|
+
var ee = 0.006693421622965943;
|
|
6
|
+
function delta(lat, lon) {
|
|
7
|
+
const a2 = 6378245;
|
|
8
|
+
const ee2 = 0.006693421622965943;
|
|
9
|
+
let dLat = ToLat(lon - 105, lat - 35);
|
|
10
|
+
let dLon = ToLon(lon - 105, lat - 35);
|
|
11
|
+
const radLat = lat / 180 * PI;
|
|
12
|
+
let magic = Math.sin(radLat);
|
|
13
|
+
magic = 1 - ee2 * magic * magic;
|
|
14
|
+
const sqrtMagic = Math.sqrt(magic);
|
|
15
|
+
dLat = dLat * 180 / (a2 * (1 - ee2) / (magic * sqrtMagic) * PI);
|
|
16
|
+
dLon = dLon * 180 / (a2 / sqrtMagic * Math.cos(radLat) * PI);
|
|
17
|
+
return {
|
|
18
|
+
lat: dLat,
|
|
19
|
+
lon: dLon
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function ToLat(x, y) {
|
|
23
|
+
let ret = -100 + 2 * x + 3 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
|
|
24
|
+
ret += (20 * Math.sin(6 * x * PI) + 20 * Math.sin(2 * x * PI)) * 2 / 3;
|
|
25
|
+
ret += (20 * Math.sin(y * PI) + 40 * Math.sin(y / 3 * PI)) * 2 / 3;
|
|
26
|
+
ret += (160 * Math.sin(y / 12 * PI) + 320 * Math.sin(y * PI / 30)) * 2 / 3;
|
|
27
|
+
return ret;
|
|
28
|
+
}
|
|
29
|
+
function ToLon(x, y) {
|
|
30
|
+
let ret = 300 + x + 2 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
|
|
31
|
+
ret += (20 * Math.sin(6 * x * PI) + 20 * Math.sin(2 * x * PI)) * 2 / 3;
|
|
32
|
+
ret += (20 * Math.sin(x * PI) + 40 * Math.sin(x / 3 * PI)) * 2 / 3;
|
|
33
|
+
ret += (150 * Math.sin(x / 12 * PI) + 300 * Math.sin(x / 30 * PI)) * 2 / 3;
|
|
34
|
+
return ret;
|
|
35
|
+
}
|
|
36
|
+
const Coordinate = {
|
|
37
|
+
"WGS84": 0};
|
|
38
|
+
const reverseCoordinate = {
|
|
39
|
+
0: "WGS84",
|
|
40
|
+
1: "GCJ02",
|
|
41
|
+
2: "BD09"
|
|
42
|
+
};
|
|
43
|
+
const conversionCoordinateMap = {
|
|
44
|
+
"WGS84": {
|
|
45
|
+
"GCJ02": WGS84ToGCJ02,
|
|
46
|
+
"BD09": WGS84ToBD09
|
|
47
|
+
},
|
|
48
|
+
"GCJ02": {
|
|
49
|
+
"WGS84": GCJ02ToWGS84,
|
|
50
|
+
"BD09": GCJ02ToBD09
|
|
51
|
+
},
|
|
52
|
+
"BD09": {
|
|
53
|
+
"GCJ02": BD09ToGCJ02,
|
|
54
|
+
"WGS84": BD09ToWGS84
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function getMapConfig() {
|
|
58
|
+
return window.sessionStorage.getItem("mapConfig") ? JSON.parse(sessionStorage.getItem("mapConfig")) : {};
|
|
59
|
+
}
|
|
60
|
+
function exportCoordinate(latLng) {
|
|
61
|
+
const { mapCoordinate = Coordinate.WGS84, projectCoordinate = Coordinate.WGS84 } = getMapConfig();
|
|
62
|
+
return getCoordinate(latLng, {
|
|
63
|
+
importCoordinate: mapCoordinate,
|
|
64
|
+
leaveCoordinate: projectCoordinate
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function importCoordinate(latLng) {
|
|
68
|
+
const { mapCoordinate = Coordinate.WGS84, projectCoordinate = Coordinate.WGS84 } = getMapConfig();
|
|
69
|
+
return getCoordinate(latLng, {
|
|
70
|
+
importCoordinate: projectCoordinate,
|
|
71
|
+
leaveCoordinate: mapCoordinate
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function getCoordinate(latLng, { importCoordinate: importCoordinate2, leaveCoordinate }) {
|
|
75
|
+
let { lat = 0, lng = 0 } = latLng || {};
|
|
76
|
+
lat = Number(lat);
|
|
77
|
+
lng = Number(lng);
|
|
78
|
+
const importValue = reverseCoordinate[importCoordinate2];
|
|
79
|
+
const leaveValue = reverseCoordinate[leaveCoordinate];
|
|
80
|
+
if (importValue === leaveValue) {
|
|
81
|
+
return latLng;
|
|
82
|
+
} else {
|
|
83
|
+
const item = conversionCoordinateMap[importValue];
|
|
84
|
+
if (item) {
|
|
85
|
+
const conversion = item[leaveValue];
|
|
86
|
+
if (conversion) {
|
|
87
|
+
return conversion(lat, lng);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function GCJ02ToWGS84(gcjLat, gcjLon) {
|
|
93
|
+
const d = delta(gcjLat, gcjLon);
|
|
94
|
+
return {
|
|
95
|
+
lat: gcjLat - d.lat,
|
|
96
|
+
lng: gcjLon - d.lon
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function GCJ02ToBD09(gcjLat, gcjLon) {
|
|
100
|
+
const x = gcjLon;
|
|
101
|
+
const y = gcjLat;
|
|
102
|
+
const z = Math.sqrt(x * x + y * y) + 2e-5 * Math.sin(y * PI);
|
|
103
|
+
const theta = Math.atan2(y, x) + 3e-6 * Math.cos(x * PI);
|
|
104
|
+
const bdLon = z * Math.cos(theta) + 65e-4;
|
|
105
|
+
const bdLat = z * Math.sin(theta) + 6e-3;
|
|
106
|
+
return {
|
|
107
|
+
lat: bdLat,
|
|
108
|
+
lng: bdLon
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function BD09ToGCJ02(bdLat, bdLon) {
|
|
112
|
+
const x = bdLon - 65e-4;
|
|
113
|
+
const y = bdLat - 6e-3;
|
|
114
|
+
const z = Math.sqrt(x * x + y * y) - 2e-5 * Math.sin(y * PI);
|
|
115
|
+
const theta = Math.atan2(y, x) - 3e-6 * Math.cos(x * PI);
|
|
116
|
+
const ggLon = z * Math.cos(theta);
|
|
117
|
+
const ggLat = z * Math.sin(theta);
|
|
118
|
+
return {
|
|
119
|
+
lat: ggLat,
|
|
120
|
+
lng: ggLon
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function BD09ToWGS84(bdLat, bdLon) {
|
|
124
|
+
const gcj02 = BD09ToGCJ02(bdLat, bdLon);
|
|
125
|
+
return GCJ02ToWGS84(gcj02.lat, gcj02.lng);
|
|
126
|
+
}
|
|
127
|
+
function WGS84ToBD09(wgLat, wgLon) {
|
|
128
|
+
const gcj02 = WGS84ToGCJ02(wgLat, wgLon);
|
|
129
|
+
const x = gcj02.lng;
|
|
130
|
+
const y = gcj02.lat;
|
|
131
|
+
const z = Math.sqrt(x * x + y * y) + 2e-5 * Math.sin(y * PI);
|
|
132
|
+
const theta = Math.atan2(y, x) + 3e-6 * Math.cos(x * PI);
|
|
133
|
+
const bdLon = z * Math.cos(theta) + 65e-4;
|
|
134
|
+
const bdLat = z * Math.sin(theta) + 6e-3;
|
|
135
|
+
return {
|
|
136
|
+
lat: bdLat,
|
|
137
|
+
lng: bdLon
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function WGS84ToGCJ02(wgLat, wgLon) {
|
|
141
|
+
var marsPoint = { lng: 0, lat: 0 };
|
|
142
|
+
var dLat = ToLat(wgLon - 105, wgLat - 35);
|
|
143
|
+
var dLon = ToLon(wgLon - 105, wgLat - 35);
|
|
144
|
+
var radLat = wgLat / 180 * PI;
|
|
145
|
+
var magic = Math.sin(radLat);
|
|
146
|
+
magic = 1 - ee * magic * magic;
|
|
147
|
+
var sqrtMagic = Math.sqrt(magic);
|
|
148
|
+
dLat = dLat * 180 / (a * (1 - ee) / (magic * sqrtMagic) * PI);
|
|
149
|
+
dLon = dLon * 180 / (a / sqrtMagic * Math.cos(radLat) * PI);
|
|
150
|
+
marsPoint.lat = wgLat + dLat;
|
|
151
|
+
marsPoint.lng = wgLon + dLon;
|
|
152
|
+
return marsPoint;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
exports.BD09ToGCJ02 = BD09ToGCJ02;
|
|
156
|
+
exports.BD09ToWGS84 = BD09ToWGS84;
|
|
157
|
+
exports.GCJ02ToBD09 = GCJ02ToBD09;
|
|
158
|
+
exports.GCJ02ToWGS84 = GCJ02ToWGS84;
|
|
159
|
+
exports.WGS84ToBD09 = WGS84ToBD09;
|
|
160
|
+
exports.WGS84ToGCJ02 = WGS84ToGCJ02;
|
|
161
|
+
exports.exportCoordinate = exportCoordinate;
|
|
162
|
+
exports.importCoordinate = importCoordinate;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hy-dispatch-ui-v3",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -22,11 +22,26 @@
|
|
|
22
22
|
"body-parser": "^2.3.0",
|
|
23
23
|
"crypto-js": "^4.2.0",
|
|
24
24
|
"dayjs": "^1.11.20",
|
|
25
|
+
"esri-leaflet": "^3.0.10",
|
|
26
|
+
"esri-leaflet-cluster": "^3.0.1",
|
|
27
|
+
"esri-leaflet-related": "^3.0.0",
|
|
28
|
+
"esri-leaflet-renderers": "^3.0.0",
|
|
29
|
+
"esri-leaflet-vector": "^4.1.0",
|
|
30
|
+
"events": "^3.3.0",
|
|
25
31
|
"express": "^5.2.1",
|
|
32
|
+
"hy-common": "^0.0.39",
|
|
26
33
|
"hy-virtual-tree": "^2.4.4",
|
|
34
|
+
"leaflet": "^1.5.1",
|
|
35
|
+
"leaflet-pip": "^1.1.0",
|
|
36
|
+
"leaflet-polylinedecorator": "^1.6.0",
|
|
37
|
+
"leaflet.chinatmsproviders": "^3.0.6",
|
|
38
|
+
"leaflet.markercluster": "^1.5.3",
|
|
39
|
+
"leaflet.motion": "^0.3.2",
|
|
40
|
+
"leaflet.pm": "^2.2.0",
|
|
27
41
|
"lodash-unified": "^1.0.3",
|
|
28
42
|
"mitt": "^3.0.1",
|
|
29
43
|
"mysql": "^2.18.1",
|
|
44
|
+
"proj4leaflet": "^1.0.2",
|
|
30
45
|
"sortablejs": "^1.15.7",
|
|
31
46
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
32
47
|
"vue-cropper": "^1.1.4",
|
package/es/utils/bus.mjs
DELETED