@cloud-app-dev/vidc 1.0.39 → 1.0.43
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/.fatherrc.js +3 -0
- package/.umirc.ts +3 -0
- package/es/AppLayout/AppHeader/index.d.ts +18 -0
- package/es/AppLayout/AppHeader/index.js +5 -6
- package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.d.ts +1 -0
- package/es/AppLayout/AppHorizontalMenu/SubGroup.d.ts +9 -0
- package/es/AppLayout/AppHorizontalMenu/index.d.ts +13 -0
- package/es/AppLayout/AppHorizontalMenu/index.js +10 -16
- package/es/AppLayout/AppInlineMenu/SubGroup.d.ts +9 -0
- package/es/AppLayout/AppInlineMenu/SubGroup.js +29 -70
- package/es/AppLayout/AppInlineMenu/index.d.ts +12 -0
- package/es/AppLayout/AppInlineMenu/index.js +14 -18
- package/es/AppLayout/AppLogo/index.d.ts +13 -0
- package/es/AppLayout/AppLogo/index.js +11 -12
- package/es/AppLayout/AppTools/index.d.ts +7 -9
- package/es/AppLayout/FunctionPreview/index.d.ts +22 -0
- package/es/AppLayout/FunctionPreview/index.js +35 -40
- package/es/AppLayout/Header/ListenceRoute.d.ts +5 -0
- package/es/AppLayout/Header/ListenceRoute.js +1 -1
- package/es/AppLayout/Header/ModifyPassword/index.d.ts +6 -0
- package/es/AppLayout/Header/ModifyPassword/index.js +72 -38
- package/es/AppLayout/Header/ModifyUserAvatar/index.d.ts +10 -0
- package/es/AppLayout/Header/ModifyUserAvatar/index.js +4 -10
- package/es/AppLayout/Header/NotifyAlarm.js +14 -9
- package/es/AppLayout/Header/Tools.d.ts +11 -0
- package/es/AppLayout/Header/Tools.js +4 -5
- package/es/AppLayout/Header/ToolsItem.d.ts +1 -0
- package/es/AppLayout/Header/ToolsItem.js +7 -14
- package/es/AppLayout/Header/UserAction.d.ts +10 -0
- package/es/AppLayout/Header/UserAction.js +30 -36
- package/es/AppLayout/Header/index.d.ts +9 -0
- package/es/AppLayout/Header/index.js +10 -22
- package/es/AppLayout/index.d.ts +10 -12
- package/es/AppLayout/index.js +2 -1
- package/es/AppLayout/service/index.js +5 -5
- package/es/AppLayout/utils.d.ts +4 -0
- package/es/AppLayout/utils.js +12 -37
- package/es/DagInitialRequest/utils.js +7 -8
- package/es/InitialRequest/index.js +2 -2
- package/es/InitialRequest/utils.js +8 -9
- package/es/OrgUserTree/index.d.ts +6 -0
- package/es/OrgUserTree/index.js +6 -2
- package/es/PlaceTree/index.js +4 -3
- package/es/TreeMode/index.d.ts +1 -0
- package/es/TreeMode/index.js +12 -3
- package/es/UserSelect/demo.d.ts +2 -0
- package/es/UserSelect/demo.js +20 -0
- package/es/UserSelect/index.js +8 -5
- package/es/WorkerFlow/Demo.js +4 -33
- package/es/WorkerFlow/Form/Approver.d.ts +3 -2
- package/es/WorkerFlow/Form/Approver.js +14 -3
- package/es/WorkerFlow/Form/Condition.js +4 -1
- package/es/WorkerFlow/Form/FormAuth.js +1 -1
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +25 -13
- package/es/WorkerFlow/Form/Handle.d.ts +3 -2
- package/es/WorkerFlow/Form/Handle.js +13 -3
- package/es/WorkerFlow/Form/Notifier.js +2 -1
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +41 -2
- package/es/WorkerFlow/Form/UserSelectModalContent.js +12 -2
- package/es/WorkerFlow/Form/UserSet.d.ts +3 -2
- package/es/WorkerFlow/Form/UserSet.js +8 -5
- package/es/WorkerFlow/Form/UsersHandleType.js +3 -1
- package/es/WorkerFlow/Nodes/Add.js +16 -5
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +3 -4
- package/es/WorkerFlow/Nodes/AddOptionList.js +6 -6
- package/es/WorkerFlow/Nodes/Approver.js +1 -1
- package/es/WorkerFlow/Nodes/Condition.js +8 -11
- package/es/WorkerFlow/Nodes/Handle.js +1 -1
- package/es/WorkerFlow/Nodes/Notifier.js +1 -1
- package/es/WorkerFlow/Nodes/TitleElement.js +1 -1
- package/es/WorkerFlow/Tools.d.ts +1 -1
- package/es/WorkerFlow/Tools.js +3 -2
- package/es/WorkerFlow/XML/utils.d.ts +1 -0
- package/es/WorkerFlow/XML/utils.js +30 -0
- package/es/WorkerFlow/index.css +12 -2
- package/es/WorkerFlow/index.js +9 -2
- package/es/WorkerFlow/interface.d.ts +5 -2
- package/es/WorkerFlow/utils.d.ts +2 -2
- package/es/WorkerFlow/utils.js +16 -4
- package/es/utils.js +2 -2
- package/package.json +3 -3
- package/scripts/entry.js +1 -1
|
@@ -1,39 +1,27 @@
|
|
|
1
1
|
import _Config from "@cloud-app-dev/basic-components/es/Config";
|
|
2
|
+
import _Store from "@cloud-app-dev/basic-components/es/Store";
|
|
2
3
|
import _useHistory from "@cloud-app-dev/basic-components/es/useHistory";
|
|
3
|
-
import React
|
|
4
|
-
import { uuid } from '@cloud-app-dev/utils';
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import AppHeader from '../AppHeader';
|
|
6
|
-
import { inject, observer } from 'mobx-react';
|
|
7
6
|
import ListenceRoute from './ListenceRoute';
|
|
8
7
|
import AppTools from './Tools';
|
|
9
8
|
import "./index.css";
|
|
10
9
|
|
|
11
10
|
function Header(_ref) {
|
|
12
|
-
var
|
|
13
|
-
auth = _ref.auth,
|
|
14
|
-
renderMenu = _ref.renderMenu,
|
|
11
|
+
var renderMenu = _ref.renderMenu,
|
|
15
12
|
isMenuHome = _ref.isMenuHome,
|
|
16
|
-
portalPath = _ref.portalPath
|
|
13
|
+
portalPath = _ref.portalPath,
|
|
14
|
+
menuType = _ref.menuType;
|
|
17
15
|
|
|
18
16
|
var history = _useHistory();
|
|
19
17
|
|
|
20
|
-
var onSelectItem = useCallback(function (e) {
|
|
21
|
-
var menu = auth.userMenuList.find(function (v) {
|
|
22
|
-
return isNaN(+v.code) || isNaN(+e.key) ? v.code === e.key : +v.code === +e.key;
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
if (menu && menu.routeUrl) {
|
|
26
|
-
history.push("".concat(menu.routeUrl).concat(e.domEvent.ctrlKey || e.domEvent.metaKey ? "?key=".concat(uuid()) : ''));
|
|
27
|
-
}
|
|
28
|
-
}, [history, auth.userMenuList]);
|
|
29
18
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppHeader, {
|
|
30
|
-
userInfo: app.userInfo,
|
|
31
|
-
systemLogo: app.appInfo.systemLogoUrl || app.systemConfig.systemLogo || _Config.BSConfig.systemLogo,
|
|
32
|
-
systemName: app.systemConfig.systemName,
|
|
33
|
-
menuType:
|
|
19
|
+
userInfo: _Store.app.userInfo,
|
|
20
|
+
systemLogo: _Store.app.appInfo.systemLogoUrl || _Store.app.systemConfig.systemLogo || _Config.BSConfig.systemLogo,
|
|
21
|
+
systemName: _Store.app.systemConfig.systemName,
|
|
22
|
+
menuType: menuType,
|
|
34
23
|
history: history,
|
|
35
24
|
renderMenu: renderMenu,
|
|
36
|
-
menuSelect: onSelectItem,
|
|
37
25
|
isMenuHome: isMenuHome,
|
|
38
26
|
appTools: /*#__PURE__*/React.createElement(AppTools, {
|
|
39
27
|
history: history,
|
|
@@ -45,4 +33,4 @@ function Header(_ref) {
|
|
|
45
33
|
}));
|
|
46
34
|
}
|
|
47
35
|
|
|
48
|
-
export default
|
|
36
|
+
export default Header;
|
package/es/AppLayout/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IAppLayoutProps {
|
|
4
|
+
content?: React.ReactNode;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
menuType?: string;
|
|
7
|
+
isMenuHome?: boolean;
|
|
8
|
+
renderMenu?: boolean;
|
|
9
|
+
portalPath?: string;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
declare const AppLayout: React.FunctionComponent<AppLayoutProps>;
|
|
13
|
-
|
|
11
|
+
declare function AppLayout({ content, children, menuType, isMenuHome, renderMenu, portalPath }: IAppLayoutProps): JSX.Element;
|
|
14
12
|
export default AppLayout;
|
package/es/AppLayout/index.js
CHANGED
|
@@ -28,7 +28,8 @@ function AppLayout(_ref) {
|
|
|
28
28
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
29
29
|
isMenuHome: isMenuHome,
|
|
30
30
|
renderMenu: renderMenu,
|
|
31
|
-
portalPath: portalPath
|
|
31
|
+
portalPath: portalPath,
|
|
32
|
+
menuType: menuType
|
|
32
33
|
})), /*#__PURE__*/React.createElement(_Layout.Content, {
|
|
33
34
|
className: "app-layout-content"
|
|
34
35
|
}, children || content)));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _Service from "@cloud-app-dev/basic-components/es/Service";
|
|
2
|
+
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
2
3
|
|
|
3
4
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
5
|
|
|
@@ -11,7 +12,6 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
11
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
12
13
|
|
|
13
14
|
import URL from './url';
|
|
14
|
-
import { cache } from '@cloud-app-dev/utils';
|
|
15
15
|
import JSEncrypt from 'jsencrypt';
|
|
16
16
|
var RSA = {
|
|
17
17
|
decrypt: function decrypt(ciphertext, key) {
|
|
@@ -26,7 +26,7 @@ var RSA = {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
var defaultHeaders = {
|
|
29
|
-
Authorization:
|
|
29
|
+
Authorization: _cache.getCache('token', 'session')
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
var MainService = /*#__PURE__*/function () {
|
|
@@ -80,7 +80,7 @@ var MainService = /*#__PURE__*/function () {
|
|
|
80
80
|
key: "getPublicKey",
|
|
81
81
|
value: function getPublicKey() {
|
|
82
82
|
var headers = {
|
|
83
|
-
Authorization:
|
|
83
|
+
Authorization: _cache.getCache('token', 'session')
|
|
84
84
|
};
|
|
85
85
|
return _Service.$http({
|
|
86
86
|
headers: headers,
|
|
@@ -107,7 +107,7 @@ var MainService = /*#__PURE__*/function () {
|
|
|
107
107
|
switch (_context.prev = _context.next) {
|
|
108
108
|
case 0:
|
|
109
109
|
headers = {
|
|
110
|
-
Authorization:
|
|
110
|
+
Authorization: _cache.getCache('token', 'session')
|
|
111
111
|
};
|
|
112
112
|
_context.next = 3;
|
|
113
113
|
return this.getPublicKey();
|
|
@@ -160,7 +160,7 @@ var MainService = /*#__PURE__*/function () {
|
|
|
160
160
|
url: '/api/user/v1/getUserByToken',
|
|
161
161
|
method: 'post',
|
|
162
162
|
headers: {
|
|
163
|
-
Authorization:
|
|
163
|
+
Authorization: _cache.getCache('token', 'session')
|
|
164
164
|
},
|
|
165
165
|
requestId: 'getUserInfo'
|
|
166
166
|
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function updateFunctionCount(name: string): Promise<void>;
|
|
2
|
+
export declare function getFunctionCount(): Promise<any[]>;
|
|
3
|
+
export declare function clearFunctionCount(): Promise<void>;
|
|
4
|
+
export declare function deleteFunctionItemCount(name: string): Promise<void>;
|
package/es/AppLayout/utils.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { LM_DB, SocketEmitter } from '@cloud-app-dev/utils';
|
|
1
|
+
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
|
+
import _LM_DB from "@cloud-app-dev/utils/es/LM_DB";
|
|
3
|
+
import { __awaiter } from "tslib";
|
|
6
4
|
import { orderBy } from 'lodash';
|
|
7
|
-
var db = new
|
|
8
|
-
export function updateFunctionCount(
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function _updateFunctionCount() {
|
|
13
|
-
_updateFunctionCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(name) {
|
|
5
|
+
var db = new _LM_DB('functionCount');
|
|
6
|
+
export function updateFunctionCount(name) {
|
|
7
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
14
8
|
var item, expireTime;
|
|
15
9
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
10
|
while (1) {
|
|
@@ -50,7 +44,7 @@ function _updateFunctionCount() {
|
|
|
50
44
|
});
|
|
51
45
|
|
|
52
46
|
case 11:
|
|
53
|
-
|
|
47
|
+
_SocketEmitter.emit('updateFunctionCount', null);
|
|
54
48
|
|
|
55
49
|
case 12:
|
|
56
50
|
case "end":
|
|
@@ -59,22 +53,16 @@ function _updateFunctionCount() {
|
|
|
59
53
|
}
|
|
60
54
|
}, _callee);
|
|
61
55
|
}));
|
|
62
|
-
return _updateFunctionCount.apply(this, arguments);
|
|
63
56
|
}
|
|
64
|
-
|
|
65
57
|
export function getFunctionCount() {
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _getFunctionCount() {
|
|
70
|
-
_getFunctionCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
58
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
71
59
|
var list;
|
|
72
60
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
73
61
|
while (1) {
|
|
74
62
|
switch (_context2.prev = _context2.next) {
|
|
75
63
|
case 0:
|
|
76
64
|
_context2.next = 2;
|
|
77
|
-
return db.query(
|
|
65
|
+
return db.query();
|
|
78
66
|
|
|
79
67
|
case 2:
|
|
80
68
|
list = _context2.sent;
|
|
@@ -87,15 +75,9 @@ function _getFunctionCount() {
|
|
|
87
75
|
}
|
|
88
76
|
}, _callee2);
|
|
89
77
|
}));
|
|
90
|
-
return _getFunctionCount.apply(this, arguments);
|
|
91
78
|
}
|
|
92
|
-
|
|
93
79
|
export function clearFunctionCount() {
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function _clearFunctionCount() {
|
|
98
|
-
_clearFunctionCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
80
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
99
81
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
100
82
|
while (1) {
|
|
101
83
|
switch (_context3.prev = _context3.next) {
|
|
@@ -110,15 +92,9 @@ function _clearFunctionCount() {
|
|
|
110
92
|
}
|
|
111
93
|
}, _callee3);
|
|
112
94
|
}));
|
|
113
|
-
return _clearFunctionCount.apply(this, arguments);
|
|
114
95
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return _deleteFunctionItemCount.apply(this, arguments);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _deleteFunctionItemCount() {
|
|
121
|
-
_deleteFunctionItemCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(name) {
|
|
96
|
+
export function deleteFunctionItemCount(name) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
122
98
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
123
99
|
while (1) {
|
|
124
100
|
switch (_context4.prev = _context4.next) {
|
|
@@ -133,5 +109,4 @@ function _deleteFunctionItemCount() {
|
|
|
133
109
|
}
|
|
134
110
|
}, _callee4);
|
|
135
111
|
}));
|
|
136
|
-
return _deleteFunctionItemCount.apply(this, arguments);
|
|
137
112
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _Config from "@cloud-app-dev/basic-components/es/Config";
|
|
2
2
|
import _Service from "@cloud-app-dev/basic-components/es/Service";
|
|
3
|
+
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
3
4
|
|
|
4
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
6
|
|
|
@@ -31,8 +32,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
31
32
|
|
|
32
33
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
33
34
|
|
|
34
|
-
import { cache } from '@cloud-app-dev/utils';
|
|
35
|
-
|
|
36
35
|
function catchPromise(fn) {
|
|
37
36
|
return new Promise(function (resolve) {
|
|
38
37
|
fn.then(function (res) {
|
|
@@ -58,7 +57,7 @@ function _initialization() {
|
|
|
58
57
|
switch (_context.prev = _context.next) {
|
|
59
58
|
case 0:
|
|
60
59
|
headers = {
|
|
61
|
-
Authorization:
|
|
60
|
+
Authorization: _cache.getCache('token', 'session')
|
|
62
61
|
};
|
|
63
62
|
_context.next = 3;
|
|
64
63
|
return _Service.$http({
|
|
@@ -159,7 +158,7 @@ function _initialization() {
|
|
|
159
158
|
|
|
160
159
|
export function queryOrganizationsList(options) {
|
|
161
160
|
var headers = {
|
|
162
|
-
Authorization:
|
|
161
|
+
Authorization: _cache.getCache('token', 'session')
|
|
163
162
|
};
|
|
164
163
|
var url = '/api/user/v1/organization/queryChildOrganizationsById';
|
|
165
164
|
return catchPromise(_Service.$http({
|
|
@@ -185,7 +184,7 @@ function _queryPlacesList() {
|
|
|
185
184
|
switch (_context2.prev = _context2.next) {
|
|
186
185
|
case 0:
|
|
187
186
|
headers = {
|
|
188
|
-
Authorization:
|
|
187
|
+
Authorization: _cache.getCache('token', 'session')
|
|
189
188
|
};
|
|
190
189
|
url = '/api/place/v1/getPlacesByHasDevice';
|
|
191
190
|
url2 = '/api/user/v1/organization/queryPlacesByOrganizationId';
|
|
@@ -230,7 +229,7 @@ function _queryPlacesList() {
|
|
|
230
229
|
|
|
231
230
|
function queryUserDevicesNew(data) {
|
|
232
231
|
var headers = {
|
|
233
|
-
Authorization:
|
|
232
|
+
Authorization: _cache.getCache('token', 'session')
|
|
234
233
|
};
|
|
235
234
|
var url = '/api/device/v1/queryDevices4User';
|
|
236
235
|
return _Service.$http({
|
|
@@ -244,7 +243,7 @@ function queryUserDevicesNew(data) {
|
|
|
244
243
|
|
|
245
244
|
function queryUserDevicesStatusNew(data) {
|
|
246
245
|
var headers = {
|
|
247
|
-
Authorization:
|
|
246
|
+
Authorization: _cache.getCache('token', 'session')
|
|
248
247
|
};
|
|
249
248
|
var url = '/api/device/v1/queryDeviceStatus4User';
|
|
250
249
|
return _Service.$http({
|
|
@@ -258,7 +257,7 @@ function queryUserDevicesStatusNew(data) {
|
|
|
258
257
|
|
|
259
258
|
function queryDeviceLocalRecordAbilityList(data) {
|
|
260
259
|
var headers = {
|
|
261
|
-
Authorization:
|
|
260
|
+
Authorization: _cache.getCache('token', 'session')
|
|
262
261
|
};
|
|
263
262
|
var url = '/api/device/v1/queryDeviceLocalRecordAbilityList';
|
|
264
263
|
return _Service.$http({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _logger from "@cloud-app-dev/utils/es/logger";
|
|
1
2
|
import _Store from "@cloud-app-dev/basic-components/es/Store";
|
|
2
3
|
|
|
3
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -22,7 +23,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
22
23
|
|
|
23
24
|
import React, { useState, useEffect } from 'react';
|
|
24
25
|
import { initialization, queryOrganizationsList, queryPlacesList, queryUserDevice, authFormat, queryUserOrganizationsList } from './utils';
|
|
25
|
-
import { logger } from '@cloud-app-dev/utils';
|
|
26
26
|
var _BASE_DATA_INIT = false;
|
|
27
27
|
|
|
28
28
|
function InitialRequest(_ref) {
|
|
@@ -89,7 +89,7 @@ function InitialRequest(_ref) {
|
|
|
89
89
|
}).then(function () {
|
|
90
90
|
return setIsInit(true);
|
|
91
91
|
}).catch(function (e) {
|
|
92
|
-
return
|
|
92
|
+
return _logger.error('接口初始化失败!', e);
|
|
93
93
|
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
94
|
}, []);
|
|
95
95
|
return isInit ? children : Spin ? /*#__PURE__*/React.createElement(Spin, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _Store from "@cloud-app-dev/basic-components/es/Store";
|
|
2
2
|
import _Config from "@cloud-app-dev/basic-components/es/Config";
|
|
3
3
|
import _Service from "@cloud-app-dev/basic-components/es/Service";
|
|
4
|
+
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
4
5
|
|
|
5
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
7
|
|
|
@@ -32,8 +33,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
32
33
|
|
|
33
34
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
34
35
|
|
|
35
|
-
import { cache } from '@cloud-app-dev/utils';
|
|
36
|
-
|
|
37
36
|
function catchPromise(fn) {
|
|
38
37
|
return new Promise(function (resolve) {
|
|
39
38
|
fn.then(function (res) {
|
|
@@ -59,7 +58,7 @@ function _initialization() {
|
|
|
59
58
|
switch (_context.prev = _context.next) {
|
|
60
59
|
case 0:
|
|
61
60
|
headers = {
|
|
62
|
-
Authorization:
|
|
61
|
+
Authorization: _cache.getCache('token', 'session')
|
|
63
62
|
};
|
|
64
63
|
_context.next = 3;
|
|
65
64
|
return _Service.$http({
|
|
@@ -213,7 +212,7 @@ function _queryOrganizationsList() {
|
|
|
213
212
|
switch (_context2.prev = _context2.next) {
|
|
214
213
|
case 0:
|
|
215
214
|
headers = {
|
|
216
|
-
Authorization:
|
|
215
|
+
Authorization: _cache.getCache('token', 'session')
|
|
217
216
|
};
|
|
218
217
|
url = '/api/udm-api/DeviceBuzTree/queryList';
|
|
219
218
|
_context2.next = 4;
|
|
@@ -258,7 +257,7 @@ function _queryUserOrganizationsList() {
|
|
|
258
257
|
switch (_context3.prev = _context3.next) {
|
|
259
258
|
case 0:
|
|
260
259
|
headers = {
|
|
261
|
-
Authorization:
|
|
260
|
+
Authorization: _cache.getCache('token', 'session')
|
|
262
261
|
};
|
|
263
262
|
url = '/api/user/v1/organization/queryChildOrganizationsById';
|
|
264
263
|
return _context3.abrupt("return", catchPromise(_Service.$http({
|
|
@@ -294,7 +293,7 @@ function _queryPlacesList() {
|
|
|
294
293
|
switch (_context4.prev = _context4.next) {
|
|
295
294
|
case 0:
|
|
296
295
|
headers = {
|
|
297
|
-
Authorization:
|
|
296
|
+
Authorization: _cache.getCache('token', 'session')
|
|
298
297
|
};
|
|
299
298
|
url = '/api/place/v1/getPlacesByHasDevice';
|
|
300
299
|
url2 = '/api/user/v1/organization/queryPlacesByOrganizationId';
|
|
@@ -339,7 +338,7 @@ function _queryPlacesList() {
|
|
|
339
338
|
|
|
340
339
|
function queryUserDevicesNew(data) {
|
|
341
340
|
var headers = {
|
|
342
|
-
Authorization:
|
|
341
|
+
Authorization: _cache.getCache('token', 'session')
|
|
343
342
|
};
|
|
344
343
|
var url = '/api/device/v1/queryDevices4User';
|
|
345
344
|
return _Service.$http({
|
|
@@ -353,7 +352,7 @@ function queryUserDevicesNew(data) {
|
|
|
353
352
|
|
|
354
353
|
function queryUserDevicesStatusNew(data) {
|
|
355
354
|
var headers = {
|
|
356
|
-
Authorization:
|
|
355
|
+
Authorization: _cache.getCache('token', 'session')
|
|
357
356
|
};
|
|
358
357
|
var url = '/api/device/v1/queryDeviceStatus4User';
|
|
359
358
|
return _Service.$http({
|
|
@@ -367,7 +366,7 @@ function queryUserDevicesStatusNew(data) {
|
|
|
367
366
|
|
|
368
367
|
function queryDeviceLocalRecordAbilityList(data) {
|
|
369
368
|
var headers = {
|
|
370
|
-
Authorization:
|
|
369
|
+
Authorization: _cache.getCache('token', 'session')
|
|
371
370
|
};
|
|
372
371
|
var url = '/api/device/v1/queryDeviceLocalRecordAbilityList';
|
|
373
372
|
return _Service.$http({
|
|
@@ -19,4 +19,10 @@ interface IOrgUserTreeProps extends BaseTreeProps {
|
|
|
19
19
|
onDefailtSelect?: (id?: string) => void;
|
|
20
20
|
}
|
|
21
21
|
declare function OrgUserTree({ title, className, renderHeader, inputPlaceholder, activeKey, treeNodeProps, onDefailtSelect, ...props }: IOrgUserTreeProps): JSX.Element;
|
|
22
|
+
declare namespace OrgUserTree {
|
|
23
|
+
var defaultProps: {
|
|
24
|
+
className: string;
|
|
25
|
+
treeNodeProps: {};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
22
28
|
export default OrgUserTree;
|
package/es/OrgUserTree/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
2
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
3
3
|
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
|
+
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
4
5
|
import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
|
|
5
6
|
|
|
6
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -27,7 +28,6 @@ import { __rest } from "tslib";
|
|
|
27
28
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
28
29
|
import api from '../Api';
|
|
29
30
|
import TreeTitle from '../TreeTitle';
|
|
30
|
-
import { treeHelper } from '@cloud-app-dev/utils';
|
|
31
31
|
import { getParentListById } from '../utils';
|
|
32
32
|
import "./index.css";
|
|
33
33
|
|
|
@@ -56,7 +56,7 @@ function OrgUserTree(_a) {
|
|
|
56
56
|
orgList = _useHttp$data === void 0 ? [] : _useHttp$data;
|
|
57
57
|
|
|
58
58
|
var treeData = useMemo(function () {
|
|
59
|
-
return
|
|
59
|
+
return _treeHelper.computTreeList(orgList);
|
|
60
60
|
}, [orgList]);
|
|
61
61
|
useEffect(function () {
|
|
62
62
|
var keys = [];
|
|
@@ -125,4 +125,8 @@ function OrgUserTree(_a) {
|
|
|
125
125
|
})));
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
OrgUserTree.defaultProps = {
|
|
129
|
+
className: '',
|
|
130
|
+
treeNodeProps: {}
|
|
131
|
+
};
|
|
128
132
|
export default OrgUserTree;
|
package/es/PlaceTree/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
|
2
2
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
3
3
|
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
4
|
import _Store from "@cloud-app-dev/basic-components/es/Store";
|
|
5
|
+
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
5
6
|
|
|
6
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
8
|
|
|
@@ -25,7 +26,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
25
26
|
|
|
26
27
|
import { __rest } from "tslib";
|
|
27
28
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
28
|
-
import { treeHelper } from '@cloud-app-dev/utils';
|
|
29
29
|
import TreeTitle from '../TreeTitle';
|
|
30
30
|
import "./index.css";
|
|
31
31
|
|
|
@@ -48,7 +48,8 @@ function PlaceTree(params) {
|
|
|
48
48
|
inputPlaceholder = _b.inputPlaceholder,
|
|
49
49
|
renderHeader = _b.renderHeader,
|
|
50
50
|
keyword = _b.keyword,
|
|
51
|
-
treeNodeProps = _b.treeNodeProps,
|
|
51
|
+
_b$treeNodeProps = _b.treeNodeProps,
|
|
52
|
+
treeNodeProps = _b$treeNodeProps === void 0 ? {} : _b$treeNodeProps,
|
|
52
53
|
renderSuffix = _b.renderSuffix,
|
|
53
54
|
showCount = _b.showCount,
|
|
54
55
|
props = __rest(_b, ["title", "inputPlaceholder", "renderHeader", "keyword", "treeNodeProps", "renderSuffix", "showCount"]);
|
|
@@ -61,7 +62,7 @@ function PlaceTree(params) {
|
|
|
61
62
|
setState = _useState2[1];
|
|
62
63
|
|
|
63
64
|
var treeDatas = useMemo(function () {
|
|
64
|
-
return treeData ||
|
|
65
|
+
return treeData || _treeHelper.computPlaceTree(_Store.place.placeList);
|
|
65
66
|
}, [treeData]);
|
|
66
67
|
var onExpand = useCallback(function (expandedKeys) {
|
|
67
68
|
return setState({
|
package/es/TreeMode/index.d.ts
CHANGED
package/es/TreeMode/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
2
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
3
3
|
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
|
+
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
4
5
|
import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
|
|
5
6
|
|
|
6
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -27,7 +28,6 @@ import { __rest } from "tslib";
|
|
|
27
28
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
28
29
|
import api from '../Api';
|
|
29
30
|
import TreeTitle from '../TreeTitle';
|
|
30
|
-
import { treeHelper } from '@cloud-app-dev/utils';
|
|
31
31
|
import { getParentListById, getPlaceCodesWithParent } from '../utils';
|
|
32
32
|
import "./index.css";
|
|
33
33
|
var defaultList = [];
|
|
@@ -66,8 +66,12 @@ function TreeMode(_a) {
|
|
|
66
66
|
list = _useHttp$data === void 0 ? defaultList : _useHttp$data;
|
|
67
67
|
|
|
68
68
|
var treeData = useMemo(function () {
|
|
69
|
-
return mode === 'Place' ?
|
|
69
|
+
return mode === 'Place' ? _treeHelper.computPlaceTree(list) : _treeHelper.computTreeList(list);
|
|
70
70
|
}, [list, mode]);
|
|
71
|
+
/**
|
|
72
|
+
* @description 实现关键字展开节点
|
|
73
|
+
*/
|
|
74
|
+
|
|
71
75
|
useEffect(function () {
|
|
72
76
|
var _a, _b;
|
|
73
77
|
|
|
@@ -137,6 +141,10 @@ function TreeMode(_a) {
|
|
|
137
141
|
var treeName = useMemo(function () {
|
|
138
142
|
return mode === 'Place' ? 'areaName' : mode === 'Org' ? 'organizationName' : 'groupName';
|
|
139
143
|
}, [mode]);
|
|
144
|
+
/**
|
|
145
|
+
* @description 触发默认选中节点事件
|
|
146
|
+
*/
|
|
147
|
+
|
|
140
148
|
useEffect(function () {
|
|
141
149
|
var id = treeData[0] ? treeData[0][treeKey] : undefined;
|
|
142
150
|
|
|
@@ -185,6 +193,7 @@ function TreeMode(_a) {
|
|
|
185
193
|
|
|
186
194
|
TreeMode.defaultProps = {
|
|
187
195
|
mode: 'Bz',
|
|
188
|
-
className: ''
|
|
196
|
+
className: '',
|
|
197
|
+
treeNodeProps: {}
|
|
189
198
|
};
|
|
190
199
|
export default TreeMode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import OrgTree from './index';
|
|
5
|
+
|
|
6
|
+
function App() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
8
|
+
prefixCls: "cloudapp"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
style: {
|
|
11
|
+
padding: 20,
|
|
12
|
+
width: 1000,
|
|
13
|
+
height: 600
|
|
14
|
+
}
|
|
15
|
+
}, /*#__PURE__*/React.createElement(OrgTree, {
|
|
16
|
+
selectUsers: []
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default App;
|
package/es/UserSelect/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _useChangeEffect from "@cloud-app-dev/basic-components/es/useChangeEffect";
|
|
2
|
+
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
2
3
|
import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
|
|
3
4
|
|
|
4
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -23,8 +24,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
23
24
|
|
|
24
25
|
import React, { useCallback, useMemo, useState, useImperativeHandle } from 'react';
|
|
25
26
|
import api from '../Api';
|
|
26
|
-
import
|
|
27
|
-
import { treeHelper } from '@cloud-app-dev/utils';
|
|
27
|
+
import TreeMode from '../TreeMode';
|
|
28
28
|
import List from '../List';
|
|
29
29
|
import { uniq, intersectionWith, uniqBy, differenceWith } from 'lodash';
|
|
30
30
|
import "./index.css";
|
|
@@ -55,7 +55,7 @@ function UserSelect(_ref, ref) {
|
|
|
55
55
|
orgList = _useHttp$data === void 0 ? [] : _useHttp$data;
|
|
56
56
|
|
|
57
57
|
var treeData = useMemo(function () {
|
|
58
|
-
return
|
|
58
|
+
return _treeHelper.computTreeList(orgList);
|
|
59
59
|
}, [orgList]);
|
|
60
60
|
var selectId = useMemo(function () {
|
|
61
61
|
return state.orgId ? state.orgId : treeData[0] ? treeData[0].id : undefined;
|
|
@@ -120,7 +120,10 @@ function UserSelect(_ref, ref) {
|
|
|
120
120
|
|
|
121
121
|
return /*#__PURE__*/React.createElement("div", {
|
|
122
122
|
className: "user-select-modal-content ".concat(className)
|
|
123
|
-
}, /*#__PURE__*/React.createElement(
|
|
123
|
+
}, /*#__PURE__*/React.createElement(TreeMode, {
|
|
124
|
+
mode: "Org",
|
|
125
|
+
title: "\u7EC4\u7EC7\u673A\u6784",
|
|
126
|
+
inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
|
|
124
127
|
onSelect: function onSelect(ids) {
|
|
125
128
|
return setState(function (old) {
|
|
126
129
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -128,7 +131,7 @@ function UserSelect(_ref, ref) {
|
|
|
128
131
|
});
|
|
129
132
|
});
|
|
130
133
|
},
|
|
131
|
-
|
|
134
|
+
selectedKeys: [selectId]
|
|
132
135
|
}), /*#__PURE__*/React.createElement(List, {
|
|
133
136
|
onChecked: onUserChecked1,
|
|
134
137
|
list: userList,
|