hy-dispatch-ui-v3 0.2.52 → 0.2.54

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.
Files changed (116) hide show
  1. package/dist/tailwind.css +53 -0
  2. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +45 -11
  3. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +12 -22
  4. package/es/components/hyDialog/dialog.vue.mjs +9 -7
  5. package/es/components/hyForm/cpns/arrayItem.vue.mjs +5 -5
  6. package/es/components/hyForm/cpns/extraItem.vue.mjs +6 -1
  7. package/es/components/hyForm/cpns/formItem.vue.mjs +29 -14
  8. package/es/components/hyForm/js/index.mjs +29 -25
  9. package/es/components/hyForm/js/useAppForm.mjs +15 -30
  10. package/es/components/hyIconBox/iconBox.vue.mjs +1 -1
  11. package/es/components/hyIconBox/style/iconBox.scss +1 -1
  12. package/es/components/hyMap/index.mjs +6 -0
  13. package/es/components/hyMap/js/index.mjs +59 -0
  14. package/es/components/hyMap/map.vue.mjs +59 -0
  15. package/es/components/hyOrgCascader/js/index.mjs +53 -0
  16. package/es/components/hyOrgCascader/orgCascader.vue.mjs +22 -25
  17. package/es/components/hySearch/search.vue.mjs +6 -8
  18. package/es/components/hyTable/cpns/columnSelect.vue.mjs +10 -18
  19. package/es/components/hyTable/table.vue.mjs +8 -11
  20. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +6 -3
  21. package/es/components/hyTableForm/batchTableForm.vue.mjs +182 -135
  22. package/es/components/hyTableForm/js/index.mjs +2 -2
  23. package/es/components/hyTableForm/tableForm.vue.mjs +29 -20
  24. package/es/components/hyTooltip/tooltip.vue.mjs +1 -1
  25. package/es/components/hyTree/js/index.mjs +6 -4
  26. package/es/components/hyTree/tree.vue.mjs +7 -1
  27. package/es/components/index.mjs +1 -0
  28. package/es/hooks/index.mjs +1 -0
  29. package/es/hooks/useApi.mjs +11 -5
  30. package/es/hooks/useAudioPlayerConfig.mjs +13 -5
  31. package/es/hooks/useEnsureHyIcon.mjs +11 -5
  32. package/es/hooks/useLocale.mjs +6 -5
  33. package/es/hooks/usePermissionMap.mjs +13 -5
  34. package/es/hooks/useSubscribe.mjs +28 -0
  35. package/es/hooks/useTooltipConfig.mjs +11 -5
  36. package/es/hooks/useUserAvatarMap.mjs +13 -5
  37. package/es/hooks/useVideoPlayerConfig.mjs +13 -5
  38. package/es/index.mjs +3 -2
  39. package/es/static/map/CFCASIPInput.min.js +258 -0
  40. package/es/static/map/MarkerCluster.css +75 -0
  41. package/es/static/map/bigemap.css +838 -0
  42. package/es/static/map/bigemap.js +5 -0
  43. package/es/static/map/bm.geometryutil.js +754 -0
  44. package/es/static/map/bmDraw.css +329 -0
  45. package/es/static/map/bmDraw.js +181 -0
  46. package/es/static/map/car.png +0 -0
  47. package/es/static/map/markercluster.js +2679 -0
  48. package/es/static/map/moveMarker.js +74 -0
  49. package/es/utils/form.mjs +38 -2
  50. package/es/utils/index.mjs +1 -2
  51. package/es/utils/map/hook/bigMap.mjs +1136 -0
  52. package/es/utils/map/hook/gaode.mjs +683 -0
  53. package/es/utils/map/hook/leafletjs.mjs +1336 -0
  54. package/es/utils/map/index.mjs +291 -0
  55. package/es/utils/map/js/mapProxy.mjs +38 -0
  56. package/es/utils/map/js/webgis.mjs +153 -0
  57. package/es/version.mjs +1 -1
  58. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +46 -12
  59. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +13 -23
  60. package/lib/components/hyDialog/dialog.vue.js +9 -7
  61. package/lib/components/hyForm/cpns/arrayItem.vue.js +4 -4
  62. package/lib/components/hyForm/cpns/extraItem.vue.js +6 -1
  63. package/lib/components/hyForm/cpns/formItem.vue.js +26 -11
  64. package/lib/components/hyForm/js/index.js +29 -23
  65. package/lib/components/hyForm/js/useAppForm.js +14 -29
  66. package/lib/components/hyIconBox/iconBox.vue.js +1 -1
  67. package/lib/components/hyIconBox/style/iconBox.scss +1 -1
  68. package/lib/components/hyMap/index.js +11 -0
  69. package/lib/components/hyMap/js/index.js +61 -0
  70. package/lib/components/hyMap/map.vue.js +63 -0
  71. package/lib/components/hyOrgCascader/js/index.js +56 -0
  72. package/lib/components/hyOrgCascader/orgCascader.vue.js +21 -24
  73. package/lib/components/hySearch/search.vue.js +4 -6
  74. package/lib/components/hyTable/cpns/columnSelect.vue.js +12 -20
  75. package/lib/components/hyTable/table.vue.js +17 -20
  76. package/lib/components/hyTableActionButton/tableActionButton.vue.js +5 -2
  77. package/lib/components/hyTableForm/batchTableForm.vue.js +181 -134
  78. package/lib/components/hyTableForm/js/index.js +1 -1
  79. package/lib/components/hyTableForm/tableForm.vue.js +29 -20
  80. package/lib/components/hyTooltip/tooltip.vue.js +1 -1
  81. package/lib/components/hyTree/js/index.js +6 -4
  82. package/lib/components/hyTree/tree.vue.js +7 -1
  83. package/lib/components/index.js +22 -20
  84. package/lib/hooks/index.js +3 -0
  85. package/lib/hooks/useApi.js +10 -4
  86. package/lib/hooks/useAudioPlayerConfig.js +12 -4
  87. package/lib/hooks/useEnsureHyIcon.js +10 -4
  88. package/lib/hooks/useLocale.js +5 -4
  89. package/lib/hooks/usePermissionMap.js +12 -4
  90. package/lib/hooks/useSubscribe.js +31 -0
  91. package/lib/hooks/useTooltipConfig.js +10 -4
  92. package/lib/hooks/useUserAvatarMap.js +12 -4
  93. package/lib/hooks/useVideoPlayerConfig.js +12 -4
  94. package/lib/index.js +27 -22
  95. package/lib/static/map/CFCASIPInput.min.js +258 -0
  96. package/lib/static/map/MarkerCluster.css +75 -0
  97. package/lib/static/map/bigemap.css +838 -0
  98. package/lib/static/map/bigemap.js +5 -0
  99. package/lib/static/map/bm.geometryutil.js +754 -0
  100. package/lib/static/map/bmDraw.css +329 -0
  101. package/lib/static/map/bmDraw.js +181 -0
  102. package/lib/static/map/car.png +0 -0
  103. package/lib/static/map/markercluster.js +2679 -0
  104. package/lib/static/map/moveMarker.js +74 -0
  105. package/lib/utils/form.js +38 -0
  106. package/lib/utils/index.js +2 -2
  107. package/lib/utils/map/hook/bigMap.js +1140 -0
  108. package/lib/utils/map/hook/gaode.js +687 -0
  109. package/lib/utils/map/hook/leafletjs.js +1360 -0
  110. package/lib/utils/map/index.js +298 -0
  111. package/lib/utils/map/js/mapProxy.js +44 -0
  112. package/lib/utils/map/js/webgis.js +162 -0
  113. package/lib/version.js +1 -1
  114. package/package.json +16 -1
  115. package/es/utils/bus.mjs +0 -5
  116. package/lib/utils/bus.js +0 -7
@@ -0,0 +1,291 @@
1
+ import Google from './hook/gaode.mjs';
2
+ import Leafletjs from './hook/leafletjs.mjs';
3
+ import bigMap from './hook/bigMap.mjs';
4
+ import { EventEmitter } from 'events';
5
+ import hyCommon from 'hy-common';
6
+
7
+ const scriptPromises = new globalThis.Map();
8
+ const mapServerPromises = new globalThis.Map();
9
+ const AMAP_PLUGINS = [
10
+ "AMap.MouseTool",
11
+ "AMap.RangingTool",
12
+ "AMap.PolyEditor",
13
+ "AMap.MarkerClusterer",
14
+ "AMap.Scale",
15
+ "AMap.GeometryUtil"
16
+ ];
17
+ const staticAssets = {
18
+ "bigemap.js": new URL("../../static/map/bigemap.js", import.meta.url).href,
19
+ "markercluster.js": new URL(
20
+ "../../static/map/markercluster.js",
21
+ import.meta.url
22
+ ).href,
23
+ "bmDraw.js": new URL("../../static/map/bmDraw.js", import.meta.url).href,
24
+ "bm.geometryutil.js": new URL(
25
+ "../../static/map/bm.geometryutil.js",
26
+ import.meta.url
27
+ ).href,
28
+ "moveMarker.js": new URL("../../static/map/moveMarker.js", import.meta.url).href
29
+ };
30
+ const staticUrl = (file) => {
31
+ const url = staticAssets[file];
32
+ if (!url) {
33
+ throw new Error(`Unknown map asset: ${file}`);
34
+ }
35
+ return url;
36
+ };
37
+ function setMapServer(mapType, mapConfig = {}) {
38
+ if (mapType === "gaode" && window.AMap?.Map) {
39
+ return Promise.resolve();
40
+ }
41
+ if (mapType === "bigMap" && window.BM) {
42
+ return Promise.resolve();
43
+ }
44
+ if (mapType !== "gaode" && mapType !== "bigMap") {
45
+ return Promise.resolve();
46
+ }
47
+ if (mapServerPromises.has(mapType)) {
48
+ return mapServerPromises.get(mapType);
49
+ }
50
+ const promise = (async () => {
51
+ if (mapType === "bigMap") {
52
+ await loadScript(staticUrl("bigemap.js"));
53
+ await Promise.all([
54
+ loadScript(staticUrl("markercluster.js")),
55
+ loadScript(staticUrl("bmDraw.js")),
56
+ loadScript(staticUrl("bm.geometryutil.js")),
57
+ loadScript(staticUrl("moveMarker.js"))
58
+ ]);
59
+ bmInit();
60
+ return;
61
+ }
62
+ window._AMapSecurityConfig = {
63
+ securityJsCode: mapConfig.mapSk || "024a144126a2a762fee60e0ca1d0aeeb"
64
+ };
65
+ const plugins = AMAP_PLUGINS.join(",");
66
+ const url = `https://webapi.amap.com/maps?v=1.4.15&key=${encodeURIComponent(mapConfig.mapKey || "")}&plugin=${plugins}`;
67
+ await loadScript(url);
68
+ if (!window.AMap?.Map) {
69
+ throw new Error("AMap SDK loaded without exposing window.AMap.Map");
70
+ }
71
+ })().catch((error) => {
72
+ mapServerPromises.delete(mapType);
73
+ throw error;
74
+ });
75
+ mapServerPromises.set(mapType, promise);
76
+ return promise;
77
+ }
78
+ function setPoiServer(mapConfig) {
79
+ const data = mapConfig;
80
+ data.mapCoordinate = typeof data.bmCorrect === "number" ? data.bmCorrect : data.mapCoordinate;
81
+ data.serverCoordinate = 1;
82
+ data.projectCoordinate = 1;
83
+ data.projectPoiCoordinate = 1;
84
+ data.poiServer = data.poiServer || {};
85
+ let city = data.poiServer.city || "";
86
+ city = city.split("-");
87
+ const poiServer = {
88
+ mapPoiType: "gaode",
89
+ ...data.poiServer,
90
+ city: city[city.length - 1],
91
+ mapCoordinate: data.mapCoordinate,
92
+ projectCoordinate: data.projectPoiCoordinate,
93
+ mapSk: data.mapSk
94
+ };
95
+ return new hyCommon.Map({
96
+ poiServer
97
+ });
98
+ }
99
+ function loadScript(url) {
100
+ const absoluteUrl = new URL(url, document.baseURI).href;
101
+ if (scriptPromises.has(absoluteUrl)) {
102
+ return scriptPromises.get(absoluteUrl);
103
+ }
104
+ const promise = new Promise((resolve, reject) => {
105
+ const script = document.createElement("script");
106
+ script.type = "text/javascript";
107
+ script.setAttribute("data-callType", "callScript");
108
+ if (script.readyState) {
109
+ script.onreadystatechange = function() {
110
+ if (script.readyState === "loaded" || script.readyState === "complete") {
111
+ script.onreadystatechange = null;
112
+ resolve();
113
+ }
114
+ };
115
+ } else {
116
+ script.onload = () => {
117
+ resolve();
118
+ };
119
+ }
120
+ script.onerror = () => {
121
+ scriptPromises.delete(absoluteUrl);
122
+ script.remove();
123
+ reject(new Error(`Map script failed to load: ${absoluteUrl}`));
124
+ };
125
+ script.src = absoluteUrl;
126
+ document.querySelector("head").appendChild(script);
127
+ });
128
+ scriptPromises.set(absoluteUrl, promise);
129
+ return promise;
130
+ }
131
+ function bmInit() {
132
+ (function() {
133
+ var originalInitTile = window.BM.GridLayer.prototype._initTile;
134
+ window.BM.GridLayer.include({
135
+ _initTile: function(tile) {
136
+ originalInitTile.call(this, tile);
137
+ var tileSize = this.getTileSize();
138
+ tile.style.width = tileSize.x + 1 + "px";
139
+ tile.style.height = tileSize.y + 1 + "px";
140
+ }
141
+ });
142
+ })();
143
+ }
144
+ class Map extends EventEmitter {
145
+ constructor(request) {
146
+ super();
147
+ this.map = null;
148
+ this.NewMap(request);
149
+ }
150
+ // 初始化地图
151
+ NewMap(params = {}) {
152
+ params = {
153
+ mapType: "gaode",
154
+ // 地图类型
155
+ lang: "zh_cn",
156
+ // 语言
157
+ layersIndex: null,
158
+ // 图层索引
159
+ // 高德参数
160
+ defaultMapStyle: params.defaultMapStyle,
161
+ // 地图默认样式
162
+ // crs 坐标系
163
+ crs: params.crs,
164
+ bmUiName: params.bmUiName,
165
+ // 地图默认样式
166
+ layersUrlList: params.layersUrlList,
167
+ // 地图瓦片地址
168
+ zoomOffset: params.zoomOffset || 0,
169
+ // 缩放偏移量
170
+ ...params
171
+ };
172
+ if (params.mapType === "gaode") {
173
+ this.map = new Google(params);
174
+ } else if (params.mapType === "leaflet") {
175
+ this.map = new Leafletjs(params);
176
+ } else if (params.mapType === "bigMap") {
177
+ this.map = new bigMap(params);
178
+ }
179
+ }
180
+ InitMap(domId, option) {
181
+ option = {
182
+ // 地图最小缩放级别
183
+ minZoom: option.minZoom || 8,
184
+ // 地图最大缩放级别
185
+ maxZoom: option.maxZoom || 18,
186
+ // 地图默认缩放级别
187
+ zoom: option.zoom || 13,
188
+ // 地图中心点
189
+ center: option.center,
190
+ // 地图初始化成功回调
191
+ completeCallbacks: option.completeCallbacks,
192
+ /* === gaode === */
193
+ // defaultMapStyle: option.defaultMapStyle,
194
+ /* === leafletjs === */
195
+ ...option
196
+ };
197
+ return this.map.InitMap(domId, option);
198
+ }
199
+ // 自定义 h5 图标
200
+ DivIcon(option) {
201
+ option = {
202
+ html: option.html,
203
+ className: option.className,
204
+ iconSize: option.iconSize,
205
+ iconAnchor: option.iconAnchor,
206
+ ...option
207
+ };
208
+ return this.map.DivIcon(option);
209
+ }
210
+ // 自定义 marker
211
+ Marker(option) {
212
+ option = {
213
+ ...option,
214
+ icon: option.icon,
215
+ zIndexOffset: option.zIndexOffset,
216
+ position: option.position,
217
+ extData: option.extData,
218
+ // 上饶指定参数
219
+ pane: option.pane || "markerPane",
220
+ // 高德偏移
221
+ offset: option.offset
222
+ };
223
+ return this.map.Marker(option);
224
+ }
225
+ // 自定义 Circle
226
+ Circle(latLngList, option) {
227
+ option = {
228
+ ...option,
229
+ radius: option.radius,
230
+ color: option.color,
231
+ opacity: option.opacity,
232
+ weight: option.weight,
233
+ fillColor: option.fillColor,
234
+ fillOpacity: option.fillOpacity
235
+ };
236
+ return this.map.Circle(latLngList, option);
237
+ }
238
+ // 自定义 Polygon
239
+ Polygon(pathList = [], option) {
240
+ option = {
241
+ ...option,
242
+ color: option.color,
243
+ opacity: option.opacity,
244
+ weight: option.weight,
245
+ fillColor: option.fillColor,
246
+ fillOpacity: option.fillOpacity
247
+ };
248
+ return this.map.Polygon(pathList, option);
249
+ }
250
+ // 自定义 MarkerClusterGroup
251
+ MarkerClusterGroup(map, markerList = [], option) {
252
+ return this.map.MarkerClusterGroup(map, markerList, option);
253
+ }
254
+ // 自定义 popup
255
+ Popup(option) {
256
+ option = {
257
+ closeOnClick: false,
258
+ ...option
259
+ };
260
+ return this.map.Popup(option);
261
+ }
262
+ // 自定义 Polyline
263
+ Polyline(latLngList, option) {
264
+ option = {
265
+ closeOnClick: false,
266
+ ...option,
267
+ color: option.color,
268
+ opacity: option.opacity,
269
+ weight: option.weight
270
+ };
271
+ return this.map.Polyline(latLngList, option);
272
+ }
273
+ // 自定义 轨迹回放
274
+ TrackPlayer(latLngList = [], option = {}, map) {
275
+ return this.map.TrackPlayer(latLngList, option, map);
276
+ }
277
+ // 自定义地图工具
278
+ CreatePm(pmType = "rectangle", options = {}, map) {
279
+ return this.map.CreatePm(pmType, options, map);
280
+ }
281
+ // 电子围栏
282
+ CreateFence(pmType = "rectangle", options = {}, map) {
283
+ return this.map.CreateFence(pmType, options, map);
284
+ }
285
+ // 测距工具 labelColor labelFillColor lineColor
286
+ RangingTool(options = {}, map) {
287
+ return this.map.RangingTool(options, map);
288
+ }
289
+ }
290
+
291
+ export { Map as default, setMapServer, setPoiServer };
@@ -0,0 +1,38 @@
1
+ const createMapProxy = (target, handlers = {}) => {
2
+ return new Proxy(target, {
3
+ get(_target, prop) {
4
+ if (handlers[prop]) {
5
+ return (...args) => handlers[prop](_target, ...args);
6
+ }
7
+ return _target[prop];
8
+ },
9
+ set(_target, prop, value) {
10
+ if (prop === "_proxy") return true;
11
+ return Reflect.set(_target, prop, value);
12
+ }
13
+ });
14
+ };
15
+ const createWrappedHandlerStore = () => {
16
+ const wrappedHandlerMap = /* @__PURE__ */ new Map();
17
+ return {
18
+ // 记录:原始回调 -> 实际注册到地图的包装回调
19
+ remember(types, originalFn, wrappedFn) {
20
+ if (!wrappedHandlerMap.has(types)) {
21
+ wrappedHandlerMap.set(types, /* @__PURE__ */ new Map());
22
+ }
23
+ wrappedHandlerMap.get(types).set(originalFn, wrappedFn);
24
+ },
25
+ // 取出并移除记录,取不到返回 undefined(说明该回调未被包装)
26
+ take(types, originalFn) {
27
+ const typeMap = wrappedHandlerMap.get(types);
28
+ const wrappedFn = typeMap && typeMap.get(originalFn);
29
+ if (wrappedFn) typeMap.delete(originalFn);
30
+ return wrappedFn;
31
+ },
32
+ clear() {
33
+ wrappedHandlerMap.clear();
34
+ }
35
+ };
36
+ };
37
+
38
+ export { createMapProxy, createWrappedHandlerStore, createMapProxy as default };
@@ -0,0 +1,153 @@
1
+ var PI = 3.141592653589793;
2
+ var a = 6378245;
3
+ var ee = 0.006693421622965943;
4
+ function delta(lat, lon) {
5
+ const a2 = 6378245;
6
+ const ee2 = 0.006693421622965943;
7
+ let dLat = ToLat(lon - 105, lat - 35);
8
+ let dLon = ToLon(lon - 105, lat - 35);
9
+ const radLat = lat / 180 * PI;
10
+ let magic = Math.sin(radLat);
11
+ magic = 1 - ee2 * magic * magic;
12
+ const sqrtMagic = Math.sqrt(magic);
13
+ dLat = dLat * 180 / (a2 * (1 - ee2) / (magic * sqrtMagic) * PI);
14
+ dLon = dLon * 180 / (a2 / sqrtMagic * Math.cos(radLat) * PI);
15
+ return {
16
+ lat: dLat,
17
+ lon: dLon
18
+ };
19
+ }
20
+ function ToLat(x, y) {
21
+ let ret = -100 + 2 * x + 3 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
22
+ ret += (20 * Math.sin(6 * x * PI) + 20 * Math.sin(2 * x * PI)) * 2 / 3;
23
+ ret += (20 * Math.sin(y * PI) + 40 * Math.sin(y / 3 * PI)) * 2 / 3;
24
+ ret += (160 * Math.sin(y / 12 * PI) + 320 * Math.sin(y * PI / 30)) * 2 / 3;
25
+ return ret;
26
+ }
27
+ function ToLon(x, y) {
28
+ let ret = 300 + x + 2 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
29
+ ret += (20 * Math.sin(6 * x * PI) + 20 * Math.sin(2 * x * PI)) * 2 / 3;
30
+ ret += (20 * Math.sin(x * PI) + 40 * Math.sin(x / 3 * PI)) * 2 / 3;
31
+ ret += (150 * Math.sin(x / 12 * PI) + 300 * Math.sin(x / 30 * PI)) * 2 / 3;
32
+ return ret;
33
+ }
34
+ const Coordinate = {
35
+ "WGS84": 0};
36
+ const reverseCoordinate = {
37
+ 0: "WGS84",
38
+ 1: "GCJ02",
39
+ 2: "BD09"
40
+ };
41
+ const conversionCoordinateMap = {
42
+ "WGS84": {
43
+ "GCJ02": WGS84ToGCJ02,
44
+ "BD09": WGS84ToBD09
45
+ },
46
+ "GCJ02": {
47
+ "WGS84": GCJ02ToWGS84,
48
+ "BD09": GCJ02ToBD09
49
+ },
50
+ "BD09": {
51
+ "GCJ02": BD09ToGCJ02,
52
+ "WGS84": BD09ToWGS84
53
+ }
54
+ };
55
+ function getMapConfig() {
56
+ return window.sessionStorage.getItem("mapConfig") ? JSON.parse(sessionStorage.getItem("mapConfig")) : {};
57
+ }
58
+ function exportCoordinate(latLng) {
59
+ const { mapCoordinate = Coordinate.WGS84, projectCoordinate = Coordinate.WGS84 } = getMapConfig();
60
+ return getCoordinate(latLng, {
61
+ importCoordinate: mapCoordinate,
62
+ leaveCoordinate: projectCoordinate
63
+ });
64
+ }
65
+ function importCoordinate(latLng) {
66
+ const { mapCoordinate = Coordinate.WGS84, projectCoordinate = Coordinate.WGS84 } = getMapConfig();
67
+ return getCoordinate(latLng, {
68
+ importCoordinate: projectCoordinate,
69
+ leaveCoordinate: mapCoordinate
70
+ });
71
+ }
72
+ function getCoordinate(latLng, { importCoordinate: importCoordinate2, leaveCoordinate }) {
73
+ let { lat = 0, lng = 0 } = latLng || {};
74
+ lat = Number(lat);
75
+ lng = Number(lng);
76
+ const importValue = reverseCoordinate[importCoordinate2];
77
+ const leaveValue = reverseCoordinate[leaveCoordinate];
78
+ if (importValue === leaveValue) {
79
+ return latLng;
80
+ } else {
81
+ const item = conversionCoordinateMap[importValue];
82
+ if (item) {
83
+ const conversion = item[leaveValue];
84
+ if (conversion) {
85
+ return conversion(lat, lng);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ function GCJ02ToWGS84(gcjLat, gcjLon) {
91
+ const d = delta(gcjLat, gcjLon);
92
+ return {
93
+ lat: gcjLat - d.lat,
94
+ lng: gcjLon - d.lon
95
+ };
96
+ }
97
+ function GCJ02ToBD09(gcjLat, gcjLon) {
98
+ const x = gcjLon;
99
+ const y = gcjLat;
100
+ const z = Math.sqrt(x * x + y * y) + 2e-5 * Math.sin(y * PI);
101
+ const theta = Math.atan2(y, x) + 3e-6 * Math.cos(x * PI);
102
+ const bdLon = z * Math.cos(theta) + 65e-4;
103
+ const bdLat = z * Math.sin(theta) + 6e-3;
104
+ return {
105
+ lat: bdLat,
106
+ lng: bdLon
107
+ };
108
+ }
109
+ function BD09ToGCJ02(bdLat, bdLon) {
110
+ const x = bdLon - 65e-4;
111
+ const y = bdLat - 6e-3;
112
+ const z = Math.sqrt(x * x + y * y) - 2e-5 * Math.sin(y * PI);
113
+ const theta = Math.atan2(y, x) - 3e-6 * Math.cos(x * PI);
114
+ const ggLon = z * Math.cos(theta);
115
+ const ggLat = z * Math.sin(theta);
116
+ return {
117
+ lat: ggLat,
118
+ lng: ggLon
119
+ };
120
+ }
121
+ function BD09ToWGS84(bdLat, bdLon) {
122
+ const gcj02 = BD09ToGCJ02(bdLat, bdLon);
123
+ return GCJ02ToWGS84(gcj02.lat, gcj02.lng);
124
+ }
125
+ function WGS84ToBD09(wgLat, wgLon) {
126
+ const gcj02 = WGS84ToGCJ02(wgLat, wgLon);
127
+ const x = gcj02.lng;
128
+ const y = gcj02.lat;
129
+ const z = Math.sqrt(x * x + y * y) + 2e-5 * Math.sin(y * PI);
130
+ const theta = Math.atan2(y, x) + 3e-6 * Math.cos(x * PI);
131
+ const bdLon = z * Math.cos(theta) + 65e-4;
132
+ const bdLat = z * Math.sin(theta) + 6e-3;
133
+ return {
134
+ lat: bdLat,
135
+ lng: bdLon
136
+ };
137
+ }
138
+ function WGS84ToGCJ02(wgLat, wgLon) {
139
+ var marsPoint = { lng: 0, lat: 0 };
140
+ var dLat = ToLat(wgLon - 105, wgLat - 35);
141
+ var dLon = ToLon(wgLon - 105, wgLat - 35);
142
+ var radLat = wgLat / 180 * PI;
143
+ var magic = Math.sin(radLat);
144
+ magic = 1 - ee * magic * magic;
145
+ var sqrtMagic = Math.sqrt(magic);
146
+ dLat = dLat * 180 / (a * (1 - ee) / (magic * sqrtMagic) * PI);
147
+ dLon = dLon * 180 / (a / sqrtMagic * Math.cos(radLat) * PI);
148
+ marsPoint.lat = wgLat + dLat;
149
+ marsPoint.lng = wgLon + dLon;
150
+ return marsPoint;
151
+ }
152
+
153
+ export { BD09ToGCJ02, BD09ToWGS84, GCJ02ToBD09, GCJ02ToWGS84, WGS84ToBD09, WGS84ToGCJ02, exportCoordinate, importCoordinate };
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.51";
1
+ const version = "0.2.53";
2
2
 
3
3
  export { version };
@@ -7,8 +7,8 @@ var elementPlus = require('element-plus');
7
7
  var iconsVue = require('@element-plus/icons-vue');
8
8
  var index = require('../hyDialog/index.js');
9
9
  var index$1 = require('../hyTableForm/index.js');
10
- var index$2 = require('../hyTooltip/index.js');
11
- var index$3 = require('../hyButton/index.js');
10
+ var index$2 = require('../hyButton/index.js');
11
+ var index$3 = require('../hyTooltip/index.js');
12
12
 
13
13
  import "./style/batchUploadDialog.scss";
14
14
 
@@ -104,11 +104,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
104
104
  const emits = __emit;
105
105
  const batchTableFormRef = vue.useTemplateRef("batchTableFormRef");
106
106
  const visible = vue.useModel(__props, "modelValue");
107
- const showSubmit = vue.ref(false);
107
+ const HyDialogRef = vue.useTemplateRef("HyDialogRef");
108
+ const currentStep = vue.ref(1);
108
109
  const isSubmitting = vue.ref(false);
110
+ const totalElements = vue.ref(0);
109
111
  const failedCount = vue.ref(0);
110
112
  const failedStatus = vue.ref(null);
111
- const HyDialogRef = vue.useTemplateRef("HyDialogRef");
112
113
  function setDragLevelIndex(dragLevel) {
113
114
  HyDialogRef.value.setDragLevelIndex(dragLevel);
114
115
  }
@@ -119,26 +120,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
119
120
  emits("onDialogMousedown", e);
120
121
  }
121
122
  async function show() {
122
- visible.value = true;
123
- showSubmit.value = false;
123
+ currentStep.value = 1;
124
124
  failedCount.value = 0;
125
+ totalElements.value = 0;
125
126
  failedStatus.value = null;
127
+ visible.value = true;
126
128
  }
127
129
  function onTableUploadingHandler(...args) {
128
130
  emits("uploading", ...args);
129
131
  }
130
132
  function onTableUploadedHandler(...args) {
131
- showSubmit.value = true;
132
133
  emits("uploaded", ...args);
133
134
  }
134
135
  function onTableResetHandler(...args) {
135
136
  failedCount.value = 0;
136
137
  failedStatus.value = null;
137
- showSubmit.value = false;
138
138
  emits("reset", ...args);
139
139
  }
140
140
  function onTableValidateHandler(params) {
141
141
  const { row, prop, isValid, message, total, success, failed } = params;
142
+ totalElements.value = total;
142
143
  failedCount.value = failed;
143
144
  failedStatus.value = !failed ? null : failedStatus.value || "validate";
144
145
  emits("validate", params);
@@ -160,10 +161,18 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
160
161
  isSubmitting.value = false;
161
162
  emits("submit", params);
162
163
  }
164
+ function onNextStep() {
165
+ batchTableFormRef.value.nextStep();
166
+ }
163
167
  async function onSubmitHandler() {
164
168
  const res = await batchTableFormRef.value.validate();
165
169
  if (props.uploadType === "custom") {
166
- return { ...res, result: res.total === res.success };
170
+ const dataSource = batchTableFormRef.value.getTableDataSource();
171
+ onTableSubmitHandler({
172
+ ...res,
173
+ result: res.total === res.success,
174
+ dataSource
175
+ });
167
176
  } else {
168
177
  batchTableFormRef.value.submitDataSource();
169
178
  }
@@ -229,16 +238,39 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
229
238
  1
230
239
  /* TEXT */
231
240
  ))
241
+ ])) : currentStep.value === 2 && !totalElements.value ? (vue.openBlock(), vue.createElementBlock("div", {
242
+ key: 1,
243
+ class: "flex items-center gap-1.5 text-xs text-warning"
244
+ }, [
245
+ vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
246
+ default: vue.withCtx(() => [
247
+ vue.createVNode(vue.unref(iconsVue.Warning))
248
+ ]),
249
+ _: 1
250
+ /* STABLE */
251
+ }),
252
+ vue.createElementVNode("span", null, "\u5F53\u524D\u672A\u5BFC\u5165\u6570\u636E\uFF0C\u8BF7\u60A8\u5BFC\u5165\u6DFB\u52A0\u6570\u636E")
232
253
  ])) : vue.createCommentVNode("v-if", true)
233
254
  ]),
234
255
  "operate-right-box": vue.withCtx(() => [
235
- showSubmit.value ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.HyTooltip), {
256
+ currentStep.value === 1 ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.HyButton), {
236
257
  key: 0,
258
+ type: "primary",
259
+ class: "!min-w-[120px]",
260
+ onClick: onNextStep
261
+ }, {
262
+ default: vue.withCtx(() => [
263
+ vue.createTextVNode("\u8FDB\u5165\u6DFB\u52A0")
264
+ ]),
265
+ _: 1
266
+ /* STABLE */
267
+ })) : currentStep.value === 2 ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.HyTooltip), {
268
+ key: 1,
237
269
  disabled: !isSubmitting.value,
238
270
  content: "\u6570\u636E\u6B63\u5728\u5BFC\u5165\u4E2D\uFF0C\u8BF7\u7A0D\u7B49"
239
271
  }, {
240
272
  default: vue.withCtx(() => [
241
- vue.createVNode(vue.unref(index$3.HyButton), {
273
+ vue.createVNode(vue.unref(index$2.HyButton), {
242
274
  type: "primary",
243
275
  loading: isSubmitting.value,
244
276
  class: "!min-w-[120px]",
@@ -264,6 +296,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
264
296
  key: 0,
265
297
  ref_key: "batchTableFormRef",
266
298
  ref: batchTableFormRef,
299
+ step: currentStep.value,
300
+ "onUpdate:step": ($event) => currentStep.value = $event,
267
301
  tableColumns: __props.tableColumns,
268
302
  formColumns: __props.formColumns,
269
303
  rules: __props.rules,
@@ -292,7 +326,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
292
326
  ])
293
327
  };
294
328
  })
295
- ]), 1032, ["tableColumns", "formColumns", "rules", "emptyText", "fontSize", "rowClickExpand", "columnNum", "size", "beforeDataHandle", "submit-handler"])) : vue.createCommentVNode("v-if", true)
329
+ ]), 1032, ["step", "onUpdate:step", "tableColumns", "formColumns", "rules", "emptyText", "fontSize", "rowClickExpand", "columnNum", "size", "beforeDataHandle", "submit-handler"])) : vue.createCommentVNode("v-if", true)
296
330
  ]),
297
331
  _: 2
298
332
  /* DYNAMIC */
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
- var iconsVue = require('@element-plus/icons-vue');
8
7
  var useLocale = require('../../hooks/useLocale.js');
9
- var index = require('../hyButton/index.js');
8
+ var index = require('../hyIcon/index.js');
9
+ var index$1 = require('../hyButton/index.js');
10
10
 
11
11
  const __default__ = vue.defineComponent({
12
12
  name: "HyConfirmDialog"
@@ -161,15 +161,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
161
161
  onClick: onCloseHandler
162
162
  },
163
163
  [
164
- vue.createVNode(vue.unref(elementPlus.ElIcon), {
165
- size: "18",
166
- color: "rgb(var(--hy-danger-2))"
167
- }, {
168
- default: vue.withCtx(() => [
169
- vue.createVNode(vue.unref(iconsVue.CircleClose))
170
- ]),
171
- _: 1
172
- /* STABLE */
164
+ vue.createVNode(vue.unref(index.HyIcon), {
165
+ "svg-name": "layout-dialog-close-v2",
166
+ "class-name": "!w-[18px] !h-[18px]"
173
167
  })
174
168
  ],
175
169
  2
@@ -180,16 +174,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
180
174
  default: vue.withCtx(() => [
181
175
  vue.createElementVNode("div", { class: "flex flex-col items-center justify-between pt-[37px] pb-[27px]" }, [
182
176
  vue.createElementVNode("div", { class: "flex flex-col items-center text-main" }, [
183
- vue.createVNode(vue.unref(elementPlus.ElIcon), {
184
- size: "40",
185
- color: __props.iconColor
186
- }, {
187
- default: vue.withCtx(() => [
188
- vue.createVNode(vue.unref(iconsVue.Warning))
189
- ]),
190
- _: 1
191
- /* STABLE */
192
- }, 8, ["color"]),
177
+ vue.createCommentVNode(' <el-icon size="40" :color="iconColor"><Warning /></el-icon> '),
178
+ vue.createVNode(vue.unref(index.HyIcon), {
179
+ "svg-name": "dispatch-share1-prompt",
180
+ class: "!w-[40px] !h-[40px]",
181
+ style: vue.normalizeStyle({ color: __props.iconColor })
182
+ }, null, 8, ["style"]),
193
183
  vue.createElementVNode(
194
184
  "div",
195
185
  {
@@ -208,7 +198,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
208
198
  key: 0,
209
199
  class: "pt-[32px]"
210
200
  }, [
211
- __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index.HyButton), {
201
+ __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyButton), {
212
202
  key: 0,
213
203
  type: __props.cancelType,
214
204
  disabled: loading.value,
@@ -224,7 +214,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
224
214
  _: 1
225
215
  /* STABLE */
226
216
  }, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true),
227
- __props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(index.HyButton), {
217
+ __props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyButton), {
228
218
  key: 1,
229
219
  type: __props.submitType,
230
220
  disabled: loading.value,