@cloud-app-dev/vidc 3.0.24 → 3.0.26
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/AppContext/index.js +4 -2
- package/es/Config/index.js +2 -1
- package/es/Config/utils.d.ts +2 -0
- package/es/Config/utils.js +10 -0
- package/es/Map/LevelCenter/DragMarker/index.js +1 -1
- package/es/Map/LevelCenter/demo.d.ts +2 -0
- package/es/Map/LevelCenter/demo.js +48 -0
- package/es/Map/LevelCenter/index.d.ts +1 -1
- package/es/Map/LevelCenter/index.js +4 -4
- package/es/Map/LoaderMap/index.js +1 -1
- package/es/Map/MapDrawSelect/index.d.ts +1 -0
- package/es/Map/MapDrawSelect/index.js +4 -2
- package/es/useDrawRIO/index.js +11 -1
- package/package.json +2 -1
package/es/AppContext/index.js
CHANGED
|
@@ -156,14 +156,16 @@ function Provider(_ref) {
|
|
|
156
156
|
updateLoginStatus: updateLoginStatus,
|
|
157
157
|
updateStore: updateStore
|
|
158
158
|
};
|
|
159
|
-
},
|
|
159
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
|
+
[state.user, state.operation, state.loginStatus]);
|
|
160
161
|
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
161
162
|
value: providerValue
|
|
162
163
|
}, children, /*#__PURE__*/React.createElement(Sync, {
|
|
163
164
|
stateChange: stateChange,
|
|
164
165
|
storeChange: storeChange
|
|
165
166
|
}));
|
|
166
|
-
}
|
|
167
|
+
} // eslint-disable-next-line import/no-anonymous-default-export
|
|
168
|
+
|
|
167
169
|
|
|
168
170
|
export default {
|
|
169
171
|
Provider: Provider,
|
package/es/Config/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import produce from 'immer';
|
|
2
|
-
import { insertThemeStyle } from './utils';
|
|
2
|
+
import { insertThemeStyle, lock } from './utils';
|
|
3
3
|
var Config = {
|
|
4
4
|
app: produce({}, function () {}),
|
|
5
5
|
bs: produce({}, function () {}),
|
|
@@ -73,6 +73,7 @@ var LMConfig = function () {
|
|
|
73
73
|
return window['_CONFIG_'];
|
|
74
74
|
} else {
|
|
75
75
|
window['_CONFIG_'] = Config;
|
|
76
|
+
lock();
|
|
76
77
|
return Config;
|
|
77
78
|
}
|
|
78
79
|
}();
|
package/es/Config/utils.d.ts
CHANGED
package/es/Config/utils.js
CHANGED
|
@@ -40,4 +40,14 @@ export function insertThemeStyle(options) {
|
|
|
40
40
|
isInit = true;
|
|
41
41
|
document.head.appendChild(style);
|
|
42
42
|
}
|
|
43
|
+
}
|
|
44
|
+
export function lock() {
|
|
45
|
+
Object.defineProperty(window, '_CONFIG_', {
|
|
46
|
+
writable: false
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function unlock() {
|
|
50
|
+
Object.defineProperty(window, '_CONFIG_', {
|
|
51
|
+
writable: true
|
|
52
|
+
});
|
|
43
53
|
}
|
|
@@ -32,7 +32,7 @@ function DragMarker(_ref) {
|
|
|
32
32
|
center: latlng
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
-
instance.map.on('
|
|
35
|
+
instance.map.on('moveend', function () {
|
|
36
36
|
var latlng = type.leaflet ? marker.getLatLng() : marker.getPosition();
|
|
37
37
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
38
38
|
center: [latlng.getLng(), latlng.getLat()]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
+
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
+
|
|
12
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
+
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
|
|
16
|
+
import React, { useEffect, useState } from 'react';
|
|
17
|
+
import LevelCenter from './index';
|
|
18
|
+
import deviceList from '../points.json';
|
|
19
|
+
|
|
20
|
+
var App = function App() {
|
|
21
|
+
var _useState = useState({
|
|
22
|
+
center: [113, 30],
|
|
23
|
+
zoom: 10
|
|
24
|
+
}),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
state = _useState2[0],
|
|
27
|
+
setState = _useState2[1];
|
|
28
|
+
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
console.log(state);
|
|
31
|
+
}, [state]);
|
|
32
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
33
|
+
prefixCls: "cloudapp"
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
style: {
|
|
36
|
+
width: '100%',
|
|
37
|
+
height: 800
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React.createElement(LevelCenter, Object.assign({}, state, {
|
|
40
|
+
enableClick: true,
|
|
41
|
+
points: deviceList,
|
|
42
|
+
onLevelCenterChange: function onLevelCenterChange(s) {
|
|
43
|
+
return setState(s);
|
|
44
|
+
}
|
|
45
|
+
}))));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default App;
|
|
@@ -44,14 +44,14 @@ function LevelCenter(_ref) {
|
|
|
44
44
|
instance.setCenter(_center);
|
|
45
45
|
onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
46
46
|
center: _center,
|
|
47
|
-
zoom:
|
|
47
|
+
zoom: instance.getZoom()
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
useMapEvent('
|
|
51
|
+
useMapEvent('zoomend', function () {
|
|
52
52
|
onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
53
53
|
center: defaultCenter,
|
|
54
|
-
zoom:
|
|
54
|
+
zoom: instance.getZoom()
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ClusterLayer, {
|
|
@@ -64,7 +64,7 @@ function LevelCenter(_ref) {
|
|
|
64
64
|
var center = _ref2.center;
|
|
65
65
|
return onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
66
66
|
center: center,
|
|
67
|
-
zoom:
|
|
67
|
+
zoom: instance.getZoom()
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
}), children);
|
|
@@ -31,7 +31,7 @@ function LoaderMap(_a) {
|
|
|
31
31
|
|
|
32
32
|
var glaobalKey = useMemo(function () {
|
|
33
33
|
return MAP_GLABAL_KEY ? MAP_GLABAL_KEY : Config.BSConfig.MAP_GLABAL_KEY || 'L';
|
|
34
|
-
}, []);
|
|
34
|
+
}, [MAP_GLABAL_KEY]);
|
|
35
35
|
var isL = useMemo(function () {
|
|
36
36
|
return glaobalKey === 'L';
|
|
37
37
|
}, [glaobalKey]);
|
|
@@ -9,6 +9,7 @@ export interface IMapDrawSelectProps {
|
|
|
9
9
|
drawUi?: React.ReactNode;
|
|
10
10
|
drawType?: DrawType | 'clear' | 'close';
|
|
11
11
|
drawEnd?: (points: MapPoint[]) => void;
|
|
12
|
+
onPointClick?: (point: MapPoint) => void;
|
|
12
13
|
}
|
|
13
14
|
declare const _default: (props: IMapDrawSelectProps) => JSX.Element;
|
|
14
15
|
export default _default;
|
|
@@ -14,7 +14,8 @@ function MapDrawSelect(_ref) {
|
|
|
14
14
|
children = _ref.children,
|
|
15
15
|
drawUi = _ref.drawUi,
|
|
16
16
|
drawType = _ref.drawType,
|
|
17
|
-
drawEnd = _ref.drawEnd
|
|
17
|
+
drawEnd = _ref.drawEnd,
|
|
18
|
+
onPointClick = _ref.onPointClick;
|
|
18
19
|
|
|
19
20
|
var _useContext = useContext(mapContext),
|
|
20
21
|
instance = _useContext.instance;
|
|
@@ -35,7 +36,8 @@ function MapDrawSelect(_ref) {
|
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ClusterLayer, {
|
|
38
|
-
points: points
|
|
39
|
+
points: points,
|
|
40
|
+
onPointClick: onPointClick
|
|
39
41
|
}), /*#__PURE__*/React.createElement(ResetTools, {
|
|
40
42
|
onMapReset: mapRest
|
|
41
43
|
}), /*#__PURE__*/React.createElement(MouseTool, {
|
package/es/useDrawRIO/index.js
CHANGED
|
@@ -29,6 +29,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
29
29
|
import { lineString } from '@turf/helpers';
|
|
30
30
|
import lineToPolygon from '@turf/line-to-polygon';
|
|
31
31
|
import booleanDisjoint from '@turf/boolean-disjoint';
|
|
32
|
+
import { useHotkeys } from 'react-hotkeys-hook';
|
|
32
33
|
|
|
33
34
|
function useDrawRIO(target, _ref) {
|
|
34
35
|
var row = _ref.row,
|
|
@@ -254,8 +255,17 @@ function useDrawRIO(target, _ref) {
|
|
|
254
255
|
tempPos: []
|
|
255
256
|
});
|
|
256
257
|
});
|
|
257
|
-
};
|
|
258
|
+
}; //快捷键处理
|
|
259
|
+
|
|
258
260
|
|
|
261
|
+
useHotkeys('esc', function () {
|
|
262
|
+
return setState(function (old) {
|
|
263
|
+
return Object.assign(Object.assign({}, old), {
|
|
264
|
+
pos: [],
|
|
265
|
+
tempPos: []
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
});
|
|
259
269
|
var rio = useMemo(function () {
|
|
260
270
|
var rioArr = [];
|
|
261
271
|
var canvas = getTargetElement(target);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@cloud-app-dev/vidc",
|
|
4
4
|
"description": "Video Image Data Componennts",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.26",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"lodash-es": "^4.17.21",
|
|
42
42
|
"moment": "^2.29.4",
|
|
43
43
|
"react-error-boundary": "^3.1.4",
|
|
44
|
+
"react-hotkeys-hook": "^3.4.7",
|
|
44
45
|
"screenfull": "^6.0.2"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|