@cloud-app-dev/vidc 1.0.47 → 2.0.0-alpha.0

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 (108) hide show
  1. package/.umirc.ts +1 -1
  2. package/README.md +4 -0
  3. package/es/AppContext/Sync.d.ts +6 -0
  4. package/es/AppContext/Sync.js +47 -0
  5. package/es/AppContext/index.d.ts +10 -0
  6. package/es/AppContext/index.js +111 -0
  7. package/es/AppContext/interface.d.ts +29 -0
  8. package/es/AppContext/static.d.ts +6 -0
  9. package/es/AppContext/static.js +6 -0
  10. package/es/AutoExit/index.d.ts +1 -1
  11. package/es/RefDrawer/index.d.ts +2 -2
  12. package/es/RefModal/index.d.ts +2 -2
  13. package/es/TreeMode/index.js +1 -2
  14. package/es/WorkerFlow/Demo.js +1 -0
  15. package/es/WorkerFlow/Form/Condition.js +8 -8
  16. package/es/WorkerFlow/Form/GroupList.d.ts +2 -1
  17. package/es/WorkerFlow/Form/GroupList.js +3 -2
  18. package/es/WorkerFlow/Form/GroupSelectModalContent.js +4 -2
  19. package/es/WorkerFlow/Form/UserSet.js +1 -6
  20. package/es/WorkerFlow/Nodes/TitleElement.js +13 -6
  21. package/es/WorkerFlow/index.js +40 -8
  22. package/es/WorkerFlow/utils.js +1 -1
  23. package/es/index.d.ts +1 -8
  24. package/es/index.js +1 -8
  25. package/package.json +4 -4
  26. package/es/AppLayout/AppHeader/index.css +0 -4
  27. package/es/AppLayout/AppHeader/index.d.ts +0 -18
  28. package/es/AppLayout/AppHeader/index.js +0 -41
  29. package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.d.ts +0 -1
  30. package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.js +0 -10
  31. package/es/AppLayout/AppHorizontalMenu/SubGroup.d.ts +0 -9
  32. package/es/AppLayout/AppHorizontalMenu/SubGroup.js +0 -57
  33. package/es/AppLayout/AppHorizontalMenu/index.css +0 -152
  34. package/es/AppLayout/AppHorizontalMenu/index.d.ts +0 -13
  35. package/es/AppLayout/AppHorizontalMenu/index.js +0 -230
  36. package/es/AppLayout/AppInlineMenu/SubGroup.d.ts +0 -9
  37. package/es/AppLayout/AppInlineMenu/SubGroup.js +0 -34
  38. package/es/AppLayout/AppInlineMenu/index.css +0 -110
  39. package/es/AppLayout/AppInlineMenu/index.d.ts +0 -12
  40. package/es/AppLayout/AppInlineMenu/index.js +0 -194
  41. package/es/AppLayout/AppLogo/index.css +0 -74
  42. package/es/AppLayout/AppLogo/index.d.ts +0 -13
  43. package/es/AppLayout/AppLogo/index.js +0 -100
  44. package/es/AppLayout/AppTools/index.css +0 -0
  45. package/es/AppLayout/AppTools/index.d.ts +0 -8
  46. package/es/AppLayout/AppTools/index.js +0 -10
  47. package/es/AppLayout/FunctionPreview/index.css +0 -128
  48. package/es/AppLayout/FunctionPreview/index.d.ts +0 -22
  49. package/es/AppLayout/FunctionPreview/index.js +0 -218
  50. package/es/AppLayout/Header/ListenceRoute.d.ts +0 -5
  51. package/es/AppLayout/Header/ListenceRoute.js +0 -28
  52. package/es/AppLayout/Header/ModifyPassword/index.d.ts +0 -6
  53. package/es/AppLayout/Header/ModifyPassword/index.js +0 -201
  54. package/es/AppLayout/Header/ModifyUserAvatar/index.css +0 -21
  55. package/es/AppLayout/Header/ModifyUserAvatar/index.d.ts +0 -10
  56. package/es/AppLayout/Header/ModifyUserAvatar/index.js +0 -98
  57. package/es/AppLayout/Header/NotifyAlarm.js +0 -122
  58. package/es/AppLayout/Header/ThemeTools.js +0 -69
  59. package/es/AppLayout/Header/Tools.d.ts +0 -11
  60. package/es/AppLayout/Header/Tools.js +0 -86
  61. package/es/AppLayout/Header/ToolsItem.d.ts +0 -1
  62. package/es/AppLayout/Header/ToolsItem.js +0 -12
  63. package/es/AppLayout/Header/UserAction.d.ts +0 -10
  64. package/es/AppLayout/Header/UserAction.js +0 -224
  65. package/es/AppLayout/Header/index.css +0 -136
  66. package/es/AppLayout/Header/index.d.ts +0 -9
  67. package/es/AppLayout/Header/index.js +0 -36
  68. package/es/AppLayout/index.css +0 -21
  69. package/es/AppLayout/index.d.ts +0 -12
  70. package/es/AppLayout/index.js +0 -38
  71. package/es/AppLayout/service/index.js +0 -174
  72. package/es/AppLayout/service/prefix.js +0 -4
  73. package/es/AppLayout/service/url.js +0 -35
  74. package/es/AppLayout/utils/menu.js +0 -24
  75. package/es/AppLayout/utils.d.ts +0 -4
  76. package/es/AppLayout/utils.js +0 -112
  77. package/es/DagInitialConfig/index.css +0 -0
  78. package/es/DagInitialConfig/index.d.ts +0 -10
  79. package/es/DagInitialConfig/index.js +0 -70
  80. package/es/DagInitialConfig/utils.js +0 -185
  81. package/es/DagInitialRequest/index.css +0 -0
  82. package/es/DagInitialRequest/index.d.ts +0 -10
  83. package/es/DagInitialRequest/index.js +0 -77
  84. package/es/DagInitialRequest/utils.js +0 -573
  85. package/es/FormContent/index.css +0 -27
  86. package/es/FormContent/index.d.ts +0 -19
  87. package/es/FormContent/index.js +0 -58
  88. package/es/OrgTree/index.css +0 -39
  89. package/es/OrgTree/index.d.ts +0 -16
  90. package/es/OrgTree/index.js +0 -177
  91. package/es/OrgUserTree/demo.d.ts +0 -2
  92. package/es/OrgUserTree/demo.js +0 -20
  93. package/es/OrgUserTree/index.css +0 -31
  94. package/es/OrgUserTree/index.d.ts +0 -28
  95. package/es/OrgUserTree/index.js +0 -132
  96. package/es/PlaceTree/demo.d.ts +0 -2
  97. package/es/PlaceTree/demo.js +0 -20
  98. package/es/PlaceTree/index.css +0 -40
  99. package/es/PlaceTree/index.d.ts +0 -26
  100. package/es/PlaceTree/index.js +0 -175
  101. package/es/Upload/AntUpload/index.css +0 -22
  102. package/es/Upload/AntUpload/index.d.ts +0 -19
  103. package/es/Upload/AntUpload/index.js +0 -226
  104. package/es/Upload/UploadChildren/index.css +0 -28
  105. package/es/Upload/UploadChildren/index.js +0 -26
  106. package/es/Upload/index.css +0 -0
  107. package/es/Upload/index.d.ts +0 -9
  108. package/es/Upload/index.js +0 -7
@@ -1,573 +0,0 @@
1
- import _Config from "@cloud-app-dev/basic-components/es/Config";
2
- import _Service from "@cloud-app-dev/basic-components/es/Service";
3
- import _cache from "@cloud-app-dev/utils/es/cache";
4
-
5
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
-
7
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
-
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
-
11
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
-
13
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
-
15
- 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."); }
16
-
17
- 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); }
18
-
19
- 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; }
20
-
21
- 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; }
22
-
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
-
25
- 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; }
26
-
27
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
28
-
29
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
-
31
- 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); } }
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); }); }; }
34
-
35
- function catchPromise(fn) {
36
- return new Promise(function (resolve) {
37
- fn.then(function (res) {
38
- return resolve(res);
39
- }, function (err) {
40
- console.error(err);
41
- resolve();
42
- });
43
- });
44
- }
45
-
46
- var method = 'post';
47
- export function initialization() {
48
- return _initialization.apply(this, arguments);
49
- }
50
-
51
- function _initialization() {
52
- _initialization = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
53
- var headers, result, userInfo, userId, operationCenterId, data, data2, centerUrl, centerInfo, userPrivilegesUrl, centerPrivilegesUrl, allPrivilegesUrl, systemInfoUrl, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, userPrivileges, _yield$Promise$all2$2, centerPrivileges, _yield$Promise$all2$3, allPrivileges, systemInfo;
54
-
55
- return regeneratorRuntime.wrap(function _callee$(_context) {
56
- while (1) {
57
- switch (_context.prev = _context.next) {
58
- case 0:
59
- headers = {
60
- Authorization: _cache.getCache('token', 'session')
61
- };
62
- _context.next = 3;
63
- return _Service.$http({
64
- url: '/api/user/v1/getUserByToken',
65
- method: method,
66
- headers: headers,
67
- requestId: 'getUserInfo'
68
- });
69
-
70
- case 3:
71
- result = _context.sent;
72
- userInfo = result.data;
73
- userId = userInfo.id;
74
- operationCenterId = userInfo.operationCenterId;
75
- data = {
76
- id: userId
77
- };
78
- data2 = {
79
- id: operationCenterId
80
- };
81
- centerUrl = "/api/user/operationCenter/v1/operationCenters/".concat(operationCenterId);
82
- _context.next = 12;
83
- return _Service.$http({
84
- data: data2,
85
- method: method,
86
- url: centerUrl,
87
- headers: headers,
88
- requestId: 'operationCenterInfo'
89
- });
90
-
91
- case 12:
92
- centerInfo = _context.sent;
93
- userPrivilegesUrl = "/api/user/role/v1/queryUserRoles/".concat(userId);
94
- centerPrivilegesUrl = "/api/micro/applicationSystemScene/v1/queryAllFunctionByApplicationSystemId/".concat(operationCenterId);
95
- allPrivilegesUrl = "/api/micro/function/v1/queryFunctionList";
96
- systemInfoUrl = "/api/user/v1/systemInfo/".concat(userId);
97
- _context.next = 19;
98
- return Promise.all([catchPromise(_Service.$http({
99
- data: data,
100
- method: method,
101
- url: userPrivilegesUrl,
102
- headers: headers,
103
- requestId: 'queryUserRoles'
104
- })), catchPromise(_Service.$http({
105
- data: data2,
106
- method: 'get',
107
- url: centerPrivilegesUrl,
108
- headers: headers,
109
- requestId: 'centerPrivilegesUrl'
110
- })), catchPromise(_Service.$http({
111
- method: 'get',
112
- url: allPrivilegesUrl,
113
- headers: headers,
114
- requestId: 'allPrivilegesUrl'
115
- })), catchPromise(_Service.$http({
116
- data: data,
117
- method: method,
118
- url: systemInfoUrl,
119
- headers: headers,
120
- requestId: 'systemInfoUrl'
121
- })) //获取用户系统信息
122
- ]);
123
-
124
- case 19:
125
- _yield$Promise$all = _context.sent;
126
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 4);
127
- _yield$Promise$all2$ = _yield$Promise$all2[0];
128
- userPrivileges = _yield$Promise$all2$ === void 0 ? {
129
- data: []
130
- } : _yield$Promise$all2$;
131
- _yield$Promise$all2$2 = _yield$Promise$all2[1];
132
- centerPrivileges = _yield$Promise$all2$2 === void 0 ? {
133
- data: []
134
- } : _yield$Promise$all2$2;
135
- _yield$Promise$all2$3 = _yield$Promise$all2[2];
136
- allPrivileges = _yield$Promise$all2$3 === void 0 ? {
137
- data: []
138
- } : _yield$Promise$all2$3;
139
- systemInfo = _yield$Promise$all2[3];
140
- return _context.abrupt("return", {
141
- userInfo: userInfo,
142
- userPrivileges: userPrivileges,
143
- centerPrivileges: centerPrivileges,
144
- allPrivileges: allPrivileges,
145
- centerInfo: centerInfo,
146
- systemInfo: systemInfo
147
- });
148
-
149
- case 29:
150
- case "end":
151
- return _context.stop();
152
- }
153
- }
154
- }, _callee);
155
- }));
156
- return _initialization.apply(this, arguments);
157
- }
158
-
159
- export function queryOrganizationsList(options) {
160
- var headers = {
161
- Authorization: _cache.getCache('token', 'session')
162
- };
163
- var url = '/api/user/v1/organization/queryChildOrganizationsById';
164
- return catchPromise(_Service.$http({
165
- headers: headers,
166
- url: url,
167
- method: 'post',
168
- requestId: 'queryOrganizationsList',
169
- data: _objectSpread({
170
- selectChildOrganization: true
171
- }, options)
172
- }));
173
- }
174
- export function queryPlacesList(_x) {
175
- return _queryPlacesList.apply(this, arguments);
176
- }
177
-
178
- function _queryPlacesList() {
179
- _queryPlacesList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(orgId) {
180
- var headers, url, url2, data, res, _res, _res$, placeDeviceList, _res$2, placeAuthList;
181
-
182
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
183
- while (1) {
184
- switch (_context2.prev = _context2.next) {
185
- case 0:
186
- headers = {
187
- Authorization: _cache.getCache('token', 'session')
188
- };
189
- url = '/api/place/v1/getPlacesByHasDevice';
190
- url2 = '/api/user/v1/organization/queryPlacesByOrganizationId';
191
- data = {
192
- organizationId: orgId,
193
- includeSubOrgIds: true
194
- };
195
- _context2.next = 6;
196
- return Promise.all([catchPromise(_Service.$http({
197
- method: method,
198
- url: url,
199
- headers: headers,
200
- data: {},
201
- requestId: 'getPlacesByHasDevice'
202
- })), catchPromise(_Service.$http({
203
- method: method,
204
- url: url2,
205
- headers: headers,
206
- data: data,
207
- requestId: 'queryPlacesByOrganizationId'
208
- })) //获取运营中心菜单
209
- ]);
210
-
211
- case 6:
212
- res = _context2.sent;
213
- _res = _slicedToArray(res, 2), _res$ = _res[0], placeDeviceList = _res$ === void 0 ? {
214
- data: []
215
- } : _res$, _res$2 = _res[1], placeAuthList = _res$2 === void 0 ? {
216
- data: []
217
- } : _res$2;
218
- return _context2.abrupt("return", [placeDeviceList.data, placeAuthList.data]);
219
-
220
- case 9:
221
- case "end":
222
- return _context2.stop();
223
- }
224
- }
225
- }, _callee2);
226
- }));
227
- return _queryPlacesList.apply(this, arguments);
228
- }
229
-
230
- function queryUserDevicesNew(data) {
231
- var headers = {
232
- Authorization: _cache.getCache('token', 'session')
233
- };
234
- var url = '/api/device/v1/queryDevices4User';
235
- return _Service.$http({
236
- url: url,
237
- method: 'post',
238
- data: data,
239
- headers: headers,
240
- requestId: 'queryDevices4User'
241
- });
242
- }
243
-
244
- function queryUserDevicesStatusNew(data) {
245
- var headers = {
246
- Authorization: _cache.getCache('token', 'session')
247
- };
248
- var url = '/api/device/v1/queryDeviceStatus4User';
249
- return _Service.$http({
250
- url: url,
251
- method: 'post',
252
- data: data,
253
- headers: headers,
254
- requestId: 'queryDeviceStatus4User'
255
- });
256
- }
257
-
258
- function queryDeviceLocalRecordAbilityList(data) {
259
- var headers = {
260
- Authorization: _cache.getCache('token', 'session')
261
- };
262
- var url = '/api/device/v1/queryDeviceLocalRecordAbilityList';
263
- return _Service.$http({
264
- url: url,
265
- method: 'post',
266
- data: data,
267
- headers: headers,
268
- requestId: 'queryDeviceLocalRecordAbilityList'
269
- });
270
- }
271
-
272
- function emptyPromise() {
273
- return new Promise(function (resolve) {
274
- return resolve(false);
275
- });
276
- }
277
-
278
- export function formatDeviceMap() {
279
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
280
- var groupLibs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
281
- var deviceState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
282
- var deviceFrontEnd = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
283
- var deviceStorage = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
284
- var deviceList = [];
285
- data.forEach(function (item) {
286
- var _item$split = item.split('|'),
287
- _item$split2 = _slicedToArray(_item$split, 21),
288
- cid = _item$split2[0],
289
- deviceName = _item$split2[1],
290
- deviceType = _item$split2[3],
291
- id = _item$split2[4],
292
- latitude = _item$split2[5],
293
- longitude = _item$split2[6],
294
- lygroupIndex = _item$split2[7],
295
- manufacturerDeviceId = _item$split2[8],
296
- manufacturerDeviceType = _item$split2[9],
297
- organizationIds = _item$split2[10],
298
- pathId = _item$split2[11],
299
- placeId = _item$split2[12],
300
- sn = _item$split2[13],
301
- boxNum = _item$split2[14],
302
- cameraType = _item$split2[15],
303
- villageLocationType = _item$split2[16],
304
- placeTags = _item$split2[17],
305
- parentId = _item$split2[18],
306
- accessType = _item$split2[19],
307
- createTime = _item$split2[20];
308
-
309
- try {
310
- organizationIds = JSON.parse(organizationIds).map(function (v) {
311
- return v.toString();
312
- });
313
- } catch (e) {
314
- organizationIds = [];
315
- }
316
-
317
- try {
318
- pathId = JSON.parse(pathId);
319
- } catch (e) {
320
- pathId = [];
321
- }
322
-
323
- try {
324
- placeTags = JSON.parse(placeTags).map(function (v) {
325
- return v.toString();
326
- });
327
- } catch (e) {
328
- placeTags = [];
329
- }
330
-
331
- try {
332
- cameraType = JSON.parse(cameraType);
333
- } catch (e) {
334
- cameraType = null;
335
- }
336
-
337
- deviceList.push({
338
- cid: cid,
339
- deviceName: deviceName,
340
- deviceStatus: deviceState[id],
341
- deviceType: deviceType,
342
- id: id,
343
- latitude: latitude,
344
- longitude: longitude,
345
- lygroupId: groupLibs[lygroupIndex],
346
- manufacturerDeviceId: manufacturerDeviceId,
347
- manufacturerDeviceType: manufacturerDeviceType,
348
- organizationIds: organizationIds,
349
- pathId: pathId,
350
- placeId: placeId,
351
- sn: sn,
352
- boxNum: boxNum,
353
- cameraType: cameraType,
354
- hasFrontEnd: +deviceFrontEnd[id] !== 0,
355
- hasStorage: +deviceStorage[id] !== 0,
356
- parentId: parentId,
357
- accessType: accessType,
358
- villageLocationType: villageLocationType,
359
- placeTags: placeTags,
360
- createTime: createTime
361
- });
362
- });
363
- return deviceList;
364
- }
365
- export function queryUserDevice(_x2) {
366
- return _queryUserDevice.apply(this, arguments);
367
- }
368
-
369
- function _queryUserDevice() {
370
- _queryUserDevice = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(options) {
371
- var needDeviceLocalRecordAbility,
372
- devices,
373
- _devices,
374
- listRes,
375
- statusRes,
376
- frontEndRes,
377
- deviceState,
378
- deviceFrontEnd,
379
- deviceStorage,
380
- _args3 = arguments;
381
-
382
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
383
- while (1) {
384
- switch (_context3.prev = _context3.next) {
385
- case 0:
386
- needDeviceLocalRecordAbility = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : true;
387
- _context3.next = 3;
388
- return Promise.all([queryUserDevicesNew(options ? options : {
389
- offset: 0,
390
- limit: 100000
391
- }), queryUserDevicesStatusNew(options ? options : {
392
- offset: 0,
393
- limit: 100000
394
- }), needDeviceLocalRecordAbility ? queryDeviceLocalRecordAbilityList(options ? options : {
395
- queryType: 2
396
- }) : emptyPromise()]);
397
-
398
- case 3:
399
- devices = _context3.sent;
400
- _devices = _slicedToArray(devices, 3), listRes = _devices[0], statusRes = _devices[1], frontEndRes = _devices[2];
401
- deviceState = {};
402
- statusRes.data.split('|').forEach(function (res) {
403
- var _res$split = res.split(','),
404
- _res$split2 = _slicedToArray(_res$split, 2),
405
- id = _res$split2[0],
406
- state = _res$split2[1];
407
-
408
- deviceState[id] = "".concat(state);
409
- });
410
- deviceFrontEnd = {};
411
- deviceStorage = {};
412
- frontEndRes && frontEndRes.data.split('|').forEach(function (res_1) {
413
- var _res_1$split = res_1.split(','),
414
- _res_1$split2 = _slicedToArray(_res_1$split, 3),
415
- id_1 = _res_1$split2[0],
416
- state_1 = _res_1$split2[1],
417
- storage = _res_1$split2[2];
418
-
419
- deviceFrontEnd[id_1] = state_1;
420
- deviceStorage[id_1] = storage;
421
- });
422
- return _context3.abrupt("return", formatDeviceMap(listRes.data.list, listRes.data.other, deviceState, deviceFrontEnd, deviceStorage));
423
-
424
- case 11:
425
- case "end":
426
- return _context3.stop();
427
- }
428
- }
429
- }, _callee3);
430
- }));
431
- return _queryUserDevice.apply(this, arguments);
432
- }
433
-
434
- export function authFormat() {
435
- var userRoles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
436
- var systemFeatures = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
437
- var userType = arguments.length > 2 ? arguments[2] : undefined;
438
- var features = [];
439
- /* prettier-ignore */
440
-
441
- var appIds = Object.values(_Config.AppConfig).filter(function (v) {
442
- return v.appType === 0;
443
- }).map(function (v) {
444
- return v.id;
445
- });
446
- userRoles = userRoles.map(function (v) {
447
- return "".concat(v);
448
- });
449
- systemFeatures.forEach(function (item) {
450
- var _item$extJson;
451
-
452
- if (Array.isArray((_item$extJson = item.extJson) === null || _item$extJson === void 0 ? void 0 : _item$extJson.relations) && userRoles.includes("".concat(item.code))) {
453
- var _userRoles;
454
-
455
- /* prettier-ignore */
456
- var relationCodes = item.extJson.relations.map(function (v) {
457
- return systemFeatures.find(function (v2) {
458
- return v2.alias === v;
459
- });
460
- }).filter(function (v) {
461
- return !!v;
462
- }).map(function (v) {
463
- return "".concat(v.code);
464
- });
465
-
466
- (_userRoles = userRoles).push.apply(_userRoles, _toConsumableArray(relationCodes));
467
- }
468
-
469
- if (appIds.includes(item.microApplicationId)) {
470
- userRoles.push("".concat(item.code));
471
- }
472
- });
473
- systemFeatures.forEach(function (item) {
474
- if (userRoles.includes("".concat(item.code)) || +userType === 100702 && userRoles.includes(item.parentCode)) {
475
- if (item.groups && item.groups.group1) {
476
- features.push({
477
- id: item.groups.group1.key,
478
- name: item.groups.group1.label,
479
- code: item.groups.group1.key,
480
- alias: item.groups.group1.key,
481
- sort: item.groups.group1.sort || item.sort,
482
- icon: item.groups.group1.icon,
483
- isMenu: 1,
484
- level: 1,
485
- microApplicationId: item.microApplicationId
486
- });
487
-
488
- if (item.groups.group2) {
489
- var _item$groups$group;
490
-
491
- features.push({
492
- id: item.groups.group2.key,
493
- name: item.groups.group2.label,
494
- code: item.groups.group2.key,
495
- alias: item.groups.group2.key,
496
- sort: item.groups.group2.sort || ((_item$groups$group = item.groups.group1) === null || _item$groups$group === void 0 ? void 0 : _item$groups$group.sort) || item.sort,
497
- icon: item.groups.group2.icon,
498
- isMenu: 1,
499
- level: 2,
500
- microApplicationId: item.microApplicationId,
501
- parentCode: item.groups.group1.key
502
- });
503
- item.parentCode = item.groups.group2.key;
504
- } else {
505
- features.push({
506
- id: item.groups.group1.key + 'lv2',
507
- name: item.groups.group1.label,
508
- code: item.groups.group1.key + 'lv2',
509
- alias: item.groups.group1.key + 'lv2',
510
- sort: item.groups.group1.sort || item.sort,
511
- isMenu: 1,
512
- level: 2,
513
- microApplicationId: item.microApplicationId,
514
- parentCode: item.groups.group1.key
515
- });
516
- item.parentCode = item.groups.group1.key + 'lv2';
517
- }
518
- }
519
-
520
- item.level = item.isMenu === 1 ? 3 : 4;
521
- features.push(item);
522
- }
523
- });
524
- (window._HOT_FEATURES_ || []).forEach(function (item) {
525
- if (item.groups && item.groups.group1) {
526
- features.push({
527
- id: item.groups.group1.key,
528
- name: item.groups.group1.label,
529
- code: item.groups.group1.key,
530
- alias: item.groups.group1.key,
531
- sort: item.groups.group1.sort || item.sort,
532
- icon: item.groups.group1.icon,
533
- isMenu: 1,
534
- microApplicationId: item.microApplicationId
535
- });
536
-
537
- if (item.groups.group2) {
538
- var _item$groups$group2;
539
-
540
- features.push({
541
- id: item.groups.group2.key,
542
- name: item.groups.group2.label,
543
- code: item.groups.group2.key,
544
- sort: item.groups.group2.sort || ((_item$groups$group2 = item.groups.group1) === null || _item$groups$group2 === void 0 ? void 0 : _item$groups$group2.sort) || item.sort,
545
- alias: item.groups.group2.key,
546
- icon: item.groups.group2.icon,
547
- isMenu: 1,
548
- microApplicationId: item.microApplicationId,
549
- parentCode: item.groups.group1.key
550
- });
551
- item.parentCode = item.groups.group2.key;
552
- } else {
553
- features.push({
554
- id: item.groups.group1.key + 'lv2',
555
- name: item.groups.group1.label,
556
- code: item.groups.group1.key + 'lv2',
557
- alias: item.groups.group1.key + 'lv2',
558
- sort: item.groups.group1.sort || item.sort,
559
- icon: item.groups.group1.icon,
560
- isMenu: 1,
561
- level: 2,
562
- microApplicationId: item.microApplicationId,
563
- parentCode: item.groups.group1.key
564
- });
565
- item.parentCode = item.groups.group1.key + 'lv2';
566
- }
567
- }
568
-
569
- item.level = 3;
570
- features.push(item);
571
- });
572
- return features;
573
- }
@@ -1,27 +0,0 @@
1
- .lm-c-drawer-with-footer-content {
2
- background-color: var(--drawer-content-bg);
3
- display: flex;
4
- flex-direction: column;
5
- height: 100%;
6
- }
7
- .lm-c-drawer-with-footer-content .content-part {
8
- flex: 1;
9
- overflow: auto;
10
- padding: 24px;
11
- }
12
- .lm-c-drawer-with-footer-content .footer-part {
13
- height: 48px;
14
- background-color: var(--drawer-footer-bg);
15
- padding: 0 24px;
16
- border-top: 1px solid var(--drawer-divider-color);
17
- position: relative;
18
- font-size: var(--fs-small);
19
- display: flex;
20
- align-items: center;
21
- justify-content: space-between;
22
- }
23
- .lm-c-drawer-with-footer-content .notice-ext-view {
24
- flex: 1;
25
- overflow: hidden;
26
- text-align: left;
27
- }
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import { FormProps, FormInstance } from 'antd/lib/form';
3
- export interface FormContentProps extends FormProps {
4
- refs?: FormInstance;
5
- wrapStyle?: React.CSSProperties;
6
- className?: string;
7
- footerType?: number | string;
8
- okText?: string;
9
- cancelText?: string;
10
- onOk?: (e: EventType) => void;
11
- onCancel?: (e: EventType) => void;
12
- disabled?: boolean;
13
- noticeExtView?: React.ReactNode;
14
- children?: React.ReactNode;
15
- }
16
-
17
- declare const FormContent: React.FunctionComponent<FormContentProps>;
18
-
19
- export default FormContent;
@@ -1,58 +0,0 @@
1
- import "antd/lib/form/style";
2
- import _Form from "antd/lib/form";
3
- import "antd/lib/button/style";
4
- import _Button from "antd/lib/button";
5
- var _excluded = ["onOk", "className", "noticeExtView", "form", "okText", "cancelText", "refs", "onCancel", "children", "disabled", "footerType", "wrapStyle"];
6
-
7
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
-
9
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
-
11
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
-
13
- import React from 'react';
14
- import "./index.css";
15
- export default function FormContent(props) {
16
- var onOk = props.onOk,
17
- _props$className = props.className,
18
- className = _props$className === void 0 ? '' : _props$className,
19
- noticeExtView = props.noticeExtView,
20
- form = props.form,
21
- _props$okText = props.okText,
22
- okText = _props$okText === void 0 ? '确认' : _props$okText,
23
- _props$cancelText = props.cancelText,
24
- cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
25
- refs = props.refs,
26
- onCancel = props.onCancel,
27
- children = props.children,
28
- _props$disabled = props.disabled,
29
- disabled = _props$disabled === void 0 ? false : _props$disabled,
30
- _props$footerType = props.footerType,
31
- footerType = _props$footerType === void 0 ? 1 : _props$footerType,
32
- wrapStyle = props.wrapStyle,
33
- params = _objectWithoutProperties(props, _excluded);
34
-
35
- return /*#__PURE__*/React.createElement(_Form, _extends({}, params, {
36
- form: form,
37
- ref: refs,
38
- className: "lm-c-drawer-with-footer-content ".concat(className)
39
- }), /*#__PURE__*/React.createElement("div", {
40
- style: wrapStyle,
41
- className: "content-part"
42
- }, children), /*#__PURE__*/React.createElement("div", {
43
- className: "footer-part"
44
- }, /*#__PURE__*/React.createElement("div", {
45
- className: "notice-ext-view"
46
- }, noticeExtView), /*#__PURE__*/React.createElement("div", {
47
- className: "footer-action"
48
- }, footerType === 1 && /*#__PURE__*/React.createElement(_Button, {
49
- style: {
50
- marginRight: 10
51
- },
52
- onClick: onCancel
53
- }, cancelText), /*#__PURE__*/React.createElement(_Button, {
54
- disabled: disabled,
55
- onClick: onOk,
56
- type: "primary"
57
- }, okText))));
58
- }