hy-dispatch-ui-v3 0.2.56 → 0.2.57
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/es/components/hyMap/js/index.mjs +2 -2
- package/es/components/hyMap/map.vue.mjs +3 -3
- package/es/index.mjs +1 -0
- package/es/static/map/markercluster.js +0 -1
- package/es/utils/index.mjs +1 -0
- package/es/utils/map/index.mjs +22 -8
- package/es/version.mjs +1 -1
- package/lib/components/hyMap/js/index.js +1 -1
- package/lib/components/hyMap/map.vue.js +3 -3
- package/lib/index.js +4 -0
- package/lib/static/map/markercluster.js +0 -1
- package/lib/utils/index.js +4 -0
- package/lib/utils/map/index.js +22 -10
- package/lib/version.js +1 -1
- package/package.json +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InitMap } from '../../../utils/map/index.mjs';
|
|
2
2
|
import { nextTick } from 'vue';
|
|
3
3
|
|
|
4
4
|
const useAppMapWrapper = (hy) => {
|
|
@@ -10,7 +10,7 @@ const useAppMapWrapper = (hy) => {
|
|
|
10
10
|
const hyMap = null;
|
|
11
11
|
const map = null;
|
|
12
12
|
function newMap(mapType) {
|
|
13
|
-
hy.hyMap = new
|
|
13
|
+
hy.hyMap = new InitMap({
|
|
14
14
|
...mapConfig,
|
|
15
15
|
mapType,
|
|
16
16
|
BM: window.BM
|
|
@@ -2,11 +2,11 @@ import { ref, onMounted, openBlock, createElementBlock, createElementVNode } fro
|
|
|
2
2
|
import { useAppMapWrapper } from './js/index.mjs';
|
|
3
3
|
import { useMixins } from '../../hooks/useMixins.mjs';
|
|
4
4
|
|
|
5
|
-
import "
|
|
5
|
+
import "../../static/map/bigemap.css";
|
|
6
6
|
|
|
7
|
-
import "
|
|
7
|
+
import "../../static/map/MarkerCluster.css";
|
|
8
8
|
|
|
9
|
-
import "
|
|
9
|
+
import "../../static/map/bmDraw.css";
|
|
10
10
|
|
|
11
11
|
const _sfc_main = {
|
|
12
12
|
__name: "map",
|
package/es/index.mjs
CHANGED
|
@@ -25,6 +25,7 @@ export { HyTableActionButton } from './components/hyTableActionButton/index.mjs'
|
|
|
25
25
|
export { HyTree } from './components/hyTree/index.mjs';
|
|
26
26
|
export { HyUserAvatar } from './components/hyUserAvatar/index.mjs';
|
|
27
27
|
export { HyVideoPlayer } from './components/hyVideoPlayer/index.mjs';
|
|
28
|
+
export { InitMap, setMapServer, setPoiServer } from './utils/map/index.mjs';
|
|
28
29
|
export { PERMISSION } from './utils/permission.mjs';
|
|
29
30
|
export { base64Decrypt, encryptToBase64, generateRandomCode } from './utils/crypto.mjs';
|
|
30
31
|
export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './utils/file.mjs';
|
package/es/utils/index.mjs
CHANGED
|
@@ -7,3 +7,4 @@ export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl
|
|
|
7
7
|
export { clearSpace, columnRuleHandler, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
|
|
8
8
|
export { enterNumbersRrLetters, enterTheMumber, filterSpaces, formatNumber, formatTimeFn, getPublicFileSize, inputForbidden, keepTwoDecimalPlaces, onlyNumber } from './input.mjs';
|
|
9
9
|
export { PERMISSION } from './permission.mjs';
|
|
10
|
+
export { InitMap, setMapServer, setPoiServer } from './map/index.mjs';
|
package/es/utils/map/index.mjs
CHANGED
|
@@ -27,7 +27,20 @@ const staticAssets = {
|
|
|
27
27
|
).href,
|
|
28
28
|
"moveMarker.js": new URL("../../static/map/moveMarker.js", import.meta.url).href
|
|
29
29
|
};
|
|
30
|
-
const
|
|
30
|
+
const normalizeStaticBaseUrl = (baseUrl) => {
|
|
31
|
+
return baseUrl.replace(/\/+$/, "");
|
|
32
|
+
};
|
|
33
|
+
const getPackageStaticBaseUrl = () => {
|
|
34
|
+
if (/\/node_modules\//.test(import.meta.url)) {
|
|
35
|
+
return "/node_modules/hy-dispatch-ui-v3/es/static/map";
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
const staticUrl = (file, baseUrl) => {
|
|
40
|
+
const configuredBaseUrl = baseUrl || globalThis.__HY_DISPATCH_UI_STATIC_URL__ || getPackageStaticBaseUrl();
|
|
41
|
+
if (configuredBaseUrl) {
|
|
42
|
+
return `${normalizeStaticBaseUrl(configuredBaseUrl)}/${file}`;
|
|
43
|
+
}
|
|
31
44
|
const url = staticAssets[file];
|
|
32
45
|
if (!url) {
|
|
33
46
|
throw new Error(`Unknown map asset: ${file}`);
|
|
@@ -49,12 +62,13 @@ function setMapServer(mapType, mapConfig = {}) {
|
|
|
49
62
|
}
|
|
50
63
|
const promise = (async () => {
|
|
51
64
|
if (mapType === "bigMap") {
|
|
52
|
-
|
|
65
|
+
const staticBaseUrl = mapConfig.staticBaseUrl;
|
|
66
|
+
await loadScript(staticUrl("bigemap.js", staticBaseUrl));
|
|
53
67
|
await Promise.all([
|
|
54
|
-
loadScript(staticUrl("markercluster.js")),
|
|
55
|
-
loadScript(staticUrl("bmDraw.js")),
|
|
56
|
-
loadScript(staticUrl("bm.geometryutil.js")),
|
|
57
|
-
loadScript(staticUrl("moveMarker.js"))
|
|
68
|
+
loadScript(staticUrl("markercluster.js", staticBaseUrl)),
|
|
69
|
+
loadScript(staticUrl("bmDraw.js", staticBaseUrl)),
|
|
70
|
+
loadScript(staticUrl("bm.geometryutil.js", staticBaseUrl)),
|
|
71
|
+
loadScript(staticUrl("moveMarker.js", staticBaseUrl))
|
|
58
72
|
]);
|
|
59
73
|
bmInit();
|
|
60
74
|
return;
|
|
@@ -141,7 +155,7 @@ function bmInit() {
|
|
|
141
155
|
});
|
|
142
156
|
})();
|
|
143
157
|
}
|
|
144
|
-
class
|
|
158
|
+
class InitMap extends EventEmitter {
|
|
145
159
|
constructor(request) {
|
|
146
160
|
super();
|
|
147
161
|
this.map = null;
|
|
@@ -288,4 +302,4 @@ class Map extends EventEmitter {
|
|
|
288
302
|
}
|
|
289
303
|
}
|
|
290
304
|
|
|
291
|
-
export {
|
|
305
|
+
export { InitMap, setMapServer, setPoiServer };
|
package/es/version.mjs
CHANGED
|
@@ -6,11 +6,11 @@ var vue = require('vue');
|
|
|
6
6
|
var index = require('./js/index.js');
|
|
7
7
|
var useMixins = require('../../hooks/useMixins.js');
|
|
8
8
|
|
|
9
|
-
import "
|
|
9
|
+
import "../../static/map/bigemap.css";
|
|
10
10
|
|
|
11
|
-
import "
|
|
11
|
+
import "../../static/map/MarkerCluster.css";
|
|
12
12
|
|
|
13
|
-
import "
|
|
13
|
+
import "../../static/map/bmDraw.css";
|
|
14
14
|
|
|
15
15
|
const _sfc_main = {
|
|
16
16
|
__name: "map",
|
package/lib/index.js
CHANGED
|
@@ -29,6 +29,7 @@ var index$m = require('./components/hyTableActionButton/index.js');
|
|
|
29
29
|
var index$n = require('./components/hyTree/index.js');
|
|
30
30
|
var index$o = require('./components/hyUserAvatar/index.js');
|
|
31
31
|
var index$p = require('./components/hyVideoPlayer/index.js');
|
|
32
|
+
var index$q = require('./utils/map/index.js');
|
|
32
33
|
var permission = require('./utils/permission.js');
|
|
33
34
|
var crypto = require('./utils/crypto.js');
|
|
34
35
|
var file = require('./utils/file.js');
|
|
@@ -92,6 +93,9 @@ exports.HyTableActionButton = index$m.HyTableActionButton;
|
|
|
92
93
|
exports.HyTree = index$n.HyTree;
|
|
93
94
|
exports.HyUserAvatar = index$o.HyUserAvatar;
|
|
94
95
|
exports.HyVideoPlayer = index$p.HyVideoPlayer;
|
|
96
|
+
exports.InitMap = index$q.InitMap;
|
|
97
|
+
exports.setMapServer = index$q.setMapServer;
|
|
98
|
+
exports.setPoiServer = index$q.setPoiServer;
|
|
95
99
|
exports.PERMISSION = permission.PERMISSION;
|
|
96
100
|
exports.base64Decrypt = crypto.base64Decrypt;
|
|
97
101
|
exports.encryptToBase64 = crypto.encryptToBase64;
|
package/lib/utils/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var file = require('./file.js');
|
|
|
9
9
|
var form = require('./form.js');
|
|
10
10
|
var input = require('./input.js');
|
|
11
11
|
var permission = require('./permission.js');
|
|
12
|
+
var index = require('./map/index.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -64,3 +65,6 @@ exports.inputForbidden = input.inputForbidden;
|
|
|
64
65
|
exports.keepTwoDecimalPlaces = input.keepTwoDecimalPlaces;
|
|
65
66
|
exports.onlyNumber = input.onlyNumber;
|
|
66
67
|
exports.PERMISSION = permission.PERMISSION;
|
|
68
|
+
exports.InitMap = index.InitMap;
|
|
69
|
+
exports.setMapServer = index.setMapServer;
|
|
70
|
+
exports.setPoiServer = index.setPoiServer;
|
package/lib/utils/map/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var gaode = require('./hook/gaode.js');
|
|
6
4
|
var leafletjs = require('./hook/leafletjs.js');
|
|
7
5
|
var bigMap = require('./hook/bigMap.js');
|
|
@@ -32,7 +30,20 @@ const staticAssets = {
|
|
|
32
30
|
).href,
|
|
33
31
|
"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
32
|
};
|
|
35
|
-
const
|
|
33
|
+
const normalizeStaticBaseUrl = (baseUrl) => {
|
|
34
|
+
return baseUrl.replace(/\/+$/, "");
|
|
35
|
+
};
|
|
36
|
+
const getPackageStaticBaseUrl = () => {
|
|
37
|
+
if (/\/node_modules\//.test((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)))) {
|
|
38
|
+
return "/node_modules/hy-dispatch-ui-v3/es/static/map";
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
const staticUrl = (file, baseUrl) => {
|
|
43
|
+
const configuredBaseUrl = baseUrl || globalThis.__HY_DISPATCH_UI_STATIC_URL__ || getPackageStaticBaseUrl();
|
|
44
|
+
if (configuredBaseUrl) {
|
|
45
|
+
return `${normalizeStaticBaseUrl(configuredBaseUrl)}/${file}`;
|
|
46
|
+
}
|
|
36
47
|
const url = staticAssets[file];
|
|
37
48
|
if (!url) {
|
|
38
49
|
throw new Error(`Unknown map asset: ${file}`);
|
|
@@ -54,12 +65,13 @@ function setMapServer(mapType, mapConfig = {}) {
|
|
|
54
65
|
}
|
|
55
66
|
const promise = (async () => {
|
|
56
67
|
if (mapType === "bigMap") {
|
|
57
|
-
|
|
68
|
+
const staticBaseUrl = mapConfig.staticBaseUrl;
|
|
69
|
+
await loadScript(staticUrl("bigemap.js", staticBaseUrl));
|
|
58
70
|
await Promise.all([
|
|
59
|
-
loadScript(staticUrl("markercluster.js")),
|
|
60
|
-
loadScript(staticUrl("bmDraw.js")),
|
|
61
|
-
loadScript(staticUrl("bm.geometryutil.js")),
|
|
62
|
-
loadScript(staticUrl("moveMarker.js"))
|
|
71
|
+
loadScript(staticUrl("markercluster.js", staticBaseUrl)),
|
|
72
|
+
loadScript(staticUrl("bmDraw.js", staticBaseUrl)),
|
|
73
|
+
loadScript(staticUrl("bm.geometryutil.js", staticBaseUrl)),
|
|
74
|
+
loadScript(staticUrl("moveMarker.js", staticBaseUrl))
|
|
63
75
|
]);
|
|
64
76
|
bmInit();
|
|
65
77
|
return;
|
|
@@ -146,7 +158,7 @@ function bmInit() {
|
|
|
146
158
|
});
|
|
147
159
|
})();
|
|
148
160
|
}
|
|
149
|
-
class
|
|
161
|
+
class InitMap extends events.EventEmitter {
|
|
150
162
|
constructor(request) {
|
|
151
163
|
super();
|
|
152
164
|
this.map = null;
|
|
@@ -293,6 +305,6 @@ class Map extends events.EventEmitter {
|
|
|
293
305
|
}
|
|
294
306
|
}
|
|
295
307
|
|
|
296
|
-
exports.
|
|
308
|
+
exports.InitMap = InitMap;
|
|
297
309
|
exports.setMapServer = setMapServer;
|
|
298
310
|
exports.setPoiServer = setPoiServer;
|
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.57",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -141,6 +141,10 @@
|
|
|
141
141
|
"import": "./es/style/theme.scss",
|
|
142
142
|
"require": "./lib/style/theme.scss"
|
|
143
143
|
},
|
|
144
|
+
"./utils/map": {
|
|
145
|
+
"import": "./es/utils/map/index.mjs",
|
|
146
|
+
"require": "./lib/utils/map/index.js"
|
|
147
|
+
},
|
|
144
148
|
"./static": {
|
|
145
149
|
"import": "./es/static/index.js",
|
|
146
150
|
"require": "./lib/static/index.js"
|