@ray-js/api 1.3.21 → 1.3.23
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/@types/api-extend.d.ts +9 -0
- package/LICENSE.md +9 -0
- package/lib/BaseKit-3.3.10.js +85 -83
- package/lib/BizKit-3.2.7.js +48 -47
- package/lib/DeviceKit-3.3.1.js +194 -193
- package/lib/HomeKit-3.1.4.js +2 -1
- package/lib/MapKit-3.0.7.js +4 -2
- package/lib/MiniKit-3.1.0.js +65 -64
- package/lib/P2PKit-2.0.3.js +4 -2
- package/lib/PlayNetKit-1.1.3.js +2 -1
- package/lib/cloud/alarm.js +6 -9
- package/lib/cloud/core.js +3 -4
- package/lib/cloud/device.js +25 -36
- package/lib/cloud/interface.d.ts +7 -7
- package/lib/cloud/linkage.js +51 -49
- package/lib/cloud/statistic.js +30 -42
- package/lib/cloud/timer.js +45 -62
- package/lib/constants.js +1 -1
- package/lib/core/promisify/index.js +5 -9
- package/lib/getBoundingClientRect/index.js +16 -17
- package/lib/getBoundingClientRect/index.thing.js +16 -17
- package/lib/getBoundingClientRect/index.wechat.js +16 -17
- package/lib/getCdnUrl/index.js +0 -2
- package/lib/getCdnUrl/index.thing.js +30 -85
- package/lib/getCdnUrl/index.wechat.js +0 -2
- package/lib/getElementById/index.js +1 -3
- package/lib/getElementById/index.thing.js +2 -4
- package/lib/getElementById/index.wechat.js +2 -4
- package/lib/hideTabBar/index.d.ts +7 -1
- package/lib/index.js +3 -2
- package/lib/lifecycles/offAppEvent/index.js +2 -2
- package/lib/lifecycles/offAppHide/index.js +2 -2
- package/lib/lifecycles/offAppShow/index.js +2 -2
- package/lib/lifecycles/offError/index.js +2 -2
- package/lib/lifecycles/offThemeChange/index.js +2 -2
- package/lib/lifecycles/offWindowResize/index.js +2 -2
- package/lib/lifecycles/onAppEvent/index.js +2 -2
- package/lib/lifecycles/onAppHide/index.js +2 -2
- package/lib/lifecycles/onAppShow/index.js +2 -2
- package/lib/lifecycles/onError/index.js +2 -2
- package/lib/lifecycles/onPageNotFound/index.js +2 -2
- package/lib/lifecycles/onThemeChange/index.js +2 -2
- package/lib/lifecycles/onWindowResize/index.js +2 -2
- package/lib/navigateBack/index.js +3 -6
- package/lib/navigateTo/index.js +2 -5
- package/lib/onNavigationBarBack/index.js +1 -2
- package/lib/onNavigationBarBack/index.wechat.js +1 -2
- package/lib/panel/devInfo/index.js +84 -121
- package/lib/panel/i18n/index.d.ts +1 -1
- package/lib/panel/i18n/index.js +180 -263
- package/lib/panel/i18n/index.wechat.d.ts +1 -1
- package/lib/panel/i18n/index.wechat.js +184 -268
- package/lib/panel/normalizeNetwork.d.ts +2 -2
- package/lib/panel/normalizeNetwork.js +2 -7
- package/lib/panel/publishDps.d.ts +1 -1
- package/lib/panel/publishDps.js +14 -19
- package/lib/panel/types/devInfo.d.ts +3 -3
- package/lib/panel/types/utilities.d.ts +8 -8
- package/lib/panel/utils.js +1 -3
- package/lib/reLaunch/index.js +2 -5
- package/lib/redirectTo/index.js +2 -7
- package/lib/requestCloud/index.js +2 -2
- package/lib/requestCloud/index.wechat.js +0 -1
- package/lib/setNavigationBarBack/index.js +1 -2
- package/lib/setNavigationBarBack/index.wechat.js +1 -2
- package/lib/setNavigationBarColor/index.js +3 -6
- package/lib/setNavigationBarTitle/index.js +5 -6
- package/lib/showTabBar/index.d.ts +7 -1
- package/lib/switchTab/index.js +2 -5
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +9 -18
- package/lib/utils.wechat.d.ts +1 -1
- package/lib/utils.wechat.js +14 -26
- package/lib/viewAPI.d.ts +1 -0
- package/lib/viewAPI.js +14 -12
- package/package.json +5 -5
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
-
import "core-js/modules/es.object.to-string.js";
|
4
|
-
import "core-js/modules/es.promise.js";
|
5
|
-
var regionMap = {
|
1
|
+
const regionMap = {
|
6
2
|
AY: 'images.tuyacn.com',
|
7
3
|
AZ: 'usimagesd1448c85ulz2o4.cdn5th.com',
|
8
4
|
EU: 'euimagesd2h2yqnfpu4gl5.cdn5th.com',
|
@@ -11,21 +7,21 @@ var regionMap = {
|
|
11
7
|
WE: 'd2h2yqnfpu4gl5.cdn5th.com',
|
12
8
|
UE: 'usimagesd1448c85ulz2o4.cdn5th.com'
|
13
9
|
};
|
14
|
-
|
10
|
+
let regionCode = 'EU';
|
15
11
|
export function getRegionCode() {
|
16
|
-
return new Promise(
|
12
|
+
return new Promise((resolve, reject) => {
|
17
13
|
ty.getAppInfo({
|
18
|
-
success: function
|
14
|
+
success: function (res) {
|
19
15
|
resolve(res.regionCode);
|
20
16
|
},
|
21
|
-
fail: function
|
17
|
+
fail: function (err) {
|
22
18
|
reject(err);
|
23
19
|
}
|
24
20
|
});
|
25
21
|
});
|
26
22
|
}
|
27
23
|
ty.getAppInfo({
|
28
|
-
success: function
|
24
|
+
success: function (res) {
|
29
25
|
regionCode = res.regionCode;
|
30
26
|
}
|
31
27
|
});
|
@@ -34,85 +30,34 @@ export default function getCdnUrl(path, cdnMap, region) {
|
|
34
30
|
console.warn('请传入cdnMap');
|
35
31
|
return path;
|
36
32
|
}
|
37
|
-
|
38
|
-
var cdnShortPath = cdnMap[path];
|
39
|
-
|
33
|
+
const cdnShortPath = cdnMap[path];
|
40
34
|
if (!cdnShortPath) {
|
41
35
|
console.warn('[App] cdn "' + path + '" is not exist.');
|
42
36
|
return path;
|
43
37
|
}
|
44
|
-
|
45
|
-
var cdnPath = 'https://' + regionMap[region || regionCode] + '/' + cdnShortPath;
|
38
|
+
const cdnPath = 'https://' + regionMap[region || regionCode] + '/' + cdnShortPath;
|
46
39
|
return cdnPath;
|
47
40
|
}
|
48
|
-
export function getCdnUrlAsync() {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
if (!region) {
|
72
|
-
_context.next = 8;
|
73
|
-
break;
|
74
|
-
}
|
75
|
-
|
76
|
-
_regionCode = region;
|
77
|
-
_context.next = 17;
|
78
|
-
break;
|
79
|
-
|
80
|
-
case 8:
|
81
|
-
_context.prev = 8;
|
82
|
-
_context.next = 11;
|
83
|
-
return getRegionCode();
|
84
|
-
|
85
|
-
case 11:
|
86
|
-
_regionCode = _context.sent;
|
87
|
-
_context.next = 17;
|
88
|
-
break;
|
89
|
-
|
90
|
-
case 14:
|
91
|
-
_context.prev = 14;
|
92
|
-
_context.t0 = _context["catch"](8);
|
93
|
-
console.warn('[App] getRegionCode error, use default region EU', _context.t0);
|
94
|
-
|
95
|
-
case 17:
|
96
|
-
cdnShortPath = cdnMap[path];
|
97
|
-
|
98
|
-
if (cdnShortPath) {
|
99
|
-
_context.next = 21;
|
100
|
-
break;
|
101
|
-
}
|
102
|
-
|
103
|
-
console.warn('[App] cdn "' + path + '" is not exist.');
|
104
|
-
return _context.abrupt("return", path);
|
105
|
-
|
106
|
-
case 21:
|
107
|
-
cdnPath = 'https://' + regionMap[_regionCode] + '/' + cdnShortPath;
|
108
|
-
return _context.abrupt("return", cdnPath);
|
109
|
-
|
110
|
-
case 23:
|
111
|
-
case "end":
|
112
|
-
return _context.stop();
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}, _callee, null, [[8, 14]]);
|
116
|
-
}));
|
117
|
-
return _getCdnUrlAsync.apply(this, arguments);
|
41
|
+
export async function getCdnUrlAsync(path, cdnMap, region) {
|
42
|
+
if (!cdnMap) {
|
43
|
+
console.warn('请传入cdnMap');
|
44
|
+
return path;
|
45
|
+
}
|
46
|
+
let _regionCode = 'EU';
|
47
|
+
if (region) {
|
48
|
+
_regionCode = region;
|
49
|
+
} else {
|
50
|
+
try {
|
51
|
+
_regionCode = await getRegionCode();
|
52
|
+
} catch (error) {
|
53
|
+
console.warn('[App] getRegionCode error, use default region EU', error);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
const cdnShortPath = cdnMap[path];
|
57
|
+
if (!cdnShortPath) {
|
58
|
+
console.warn('[App] cdn "' + path + '" is not exist.');
|
59
|
+
return path;
|
60
|
+
}
|
61
|
+
const cdnPath = 'https://' + regionMap[_regionCode] + '/' + cdnShortPath;
|
62
|
+
return cdnPath;
|
118
63
|
}
|
@@ -1,8 +1,6 @@
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
2
|
-
import "core-js/modules/es.promise.js";
|
3
1
|
export default function getElementById(id) {
|
4
|
-
return new Promise(
|
5
|
-
|
2
|
+
return new Promise(resolve => {
|
3
|
+
const nodeRef = ty.createSelectorQuery().select(`#${id}`);
|
6
4
|
resolve(nodeRef);
|
7
5
|
});
|
8
6
|
}
|
@@ -1,8 +1,6 @@
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
2
|
-
import "core-js/modules/es.promise.js";
|
3
1
|
export default function getElementById(id) {
|
4
|
-
return new Promise(
|
5
|
-
|
2
|
+
return new Promise(resolve => {
|
3
|
+
const nodeRef = wx.createSelectorQuery().select(`#${id}`);
|
6
4
|
resolve(nodeRef);
|
7
5
|
});
|
8
6
|
}
|
@@ -1,3 +1,9 @@
|
|
1
1
|
/// <reference path="../../@types/api.d.ts" />
|
2
|
-
declare const _default: (arg?:
|
2
|
+
declare const _default: (arg?: {
|
3
|
+
animation?: boolean | undefined;
|
4
|
+
} & {
|
5
|
+
success?: ((S?: any) => void) | undefined;
|
6
|
+
fail?: ((F?: any) => void) | undefined;
|
7
|
+
complete?: ((C?: any) => void) | undefined;
|
8
|
+
} & import("../core").PromisifyArgs<any, any>) => Promise<any>;
|
3
9
|
export default _default;
|
package/lib/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference path="../@types/api.d.ts" />
|
2
|
+
|
2
3
|
export * from './constants';
|
3
4
|
export * from './all-kits';
|
4
5
|
export * from './lifecycles';
|
@@ -21,15 +22,15 @@ export { default as switchTab } from './switchTab';
|
|
21
22
|
export { default as onNavigationBarBack } from './onNavigationBarBack';
|
22
23
|
export { default as setNavigationBarBack } from './setNavigationBarBack';
|
23
24
|
export { default as getCdnUrl, getCdnUrlAsync } from './getCdnUrl';
|
25
|
+
|
24
26
|
/**
|
25
27
|
* 提供 glboal-api 将 wx / ty 对象暴露出去,供给业务在Ray为显示导出api时进行快速响应开发。
|
26
28
|
*/
|
27
|
-
|
28
29
|
export { default as globalApi } from './global-api';
|
29
30
|
export * from './cloud';
|
31
|
+
|
30
32
|
/**
|
31
33
|
* 0.10.3将一部分未支持的api导入
|
32
34
|
*/
|
33
|
-
|
34
35
|
export * from './viewAPI';
|
35
36
|
export * from './panel';
|
@@ -1,14 +1,11 @@
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
2
|
-
import "core-js/modules/es.promise.js";
|
3
1
|
/// <reference path="../../@types/api.d.ts" />
|
4
|
-
import router from '@ray-js/router';
|
5
2
|
|
6
|
-
|
7
|
-
|
3
|
+
import router from '@ray-js/router';
|
4
|
+
const navigateBack = function () {
|
5
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
8
6
|
delta: 1
|
9
7
|
};
|
10
8
|
router.go(options.delta * -1);
|
11
9
|
return Promise.resolve();
|
12
10
|
};
|
13
|
-
|
14
11
|
export default navigateBack;
|
package/lib/navigateTo/index.js
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
2
|
-
import "core-js/modules/es.promise.js";
|
3
1
|
/// <reference path="../../@types/api.d.ts" />
|
4
|
-
import router from '@ray-js/router';
|
5
2
|
|
6
|
-
|
3
|
+
import router from '@ray-js/router';
|
4
|
+
const navigateTo = function (options) {
|
7
5
|
router.push(options.url);
|
8
6
|
return Promise.resolve();
|
9
7
|
};
|
10
|
-
|
11
8
|
export default navigateTo;
|
@@ -1,13 +1,8 @@
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import "core-js/modules/es.object.to-string.js";
|
5
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
6
|
-
import "core-js/modules/es.promise.js";
|
7
2
|
import { getDeviceInfo, getLaunchOptionsSync, getGroupInfo, getApp, registerDeviceListListener, registerGroupChange, exitMiniProgram, subscribeDeviceRemoved, onDeviceRemoved } from '@ray-js/api';
|
8
3
|
// 本地化缓存 deviceInfo 方便随时调用
|
9
|
-
|
10
|
-
|
4
|
+
let __deviceInfo = null;
|
5
|
+
const defaultPanelEnvironmentOptions = {
|
11
6
|
useDefaultOffline: true,
|
12
7
|
bleCover: false,
|
13
8
|
customTop: null,
|
@@ -15,17 +10,20 @@ var defaultPanelEnvironmentOptions = {
|
|
15
10
|
showBLEToast: true
|
16
11
|
};
|
17
12
|
export function parseDevice(dev) {
|
18
|
-
if (!dev) return null;
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
if (!dev) return null;
|
14
|
+
// @ts-ignore
|
15
|
+
const deviceInfo = _objectSpread({}, dev);
|
16
|
+
const {
|
17
|
+
schema
|
18
|
+
} = dev;
|
19
|
+
const idCodes = {};
|
20
|
+
const codeIds = {};
|
21
|
+
schema.forEach(item => {
|
26
22
|
// @ts-ignore
|
27
|
-
|
28
|
-
|
23
|
+
const {
|
24
|
+
id,
|
25
|
+
code
|
26
|
+
} = item;
|
29
27
|
idCodes[id] = code;
|
30
28
|
codeIds[code] = id;
|
31
29
|
});
|
@@ -33,35 +31,33 @@ export function parseDevice(dev) {
|
|
33
31
|
deviceInfo.codeIds = codeIds;
|
34
32
|
return deviceInfo;
|
35
33
|
}
|
34
|
+
|
36
35
|
/**
|
37
36
|
* 初始化面板环境下使用到的设备信息
|
38
37
|
* @returns Promise<DevInfo>
|
39
38
|
*/
|
40
|
-
|
41
|
-
|
42
|
-
return new Promise(function (resolve, reject) {
|
39
|
+
export const initDevInfo = option => {
|
40
|
+
return new Promise((resolve, reject) => {
|
43
41
|
if (__deviceInfo) {
|
44
42
|
resolve(__deviceInfo);
|
45
43
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
groupId = _ref.groupId;
|
52
|
-
|
44
|
+
const data = getLaunchOptionsSync();
|
45
|
+
const {
|
46
|
+
deviceId,
|
47
|
+
groupId
|
48
|
+
} = option || data.query;
|
53
49
|
if (groupId) {
|
54
50
|
getGroupInfo({
|
55
|
-
groupId
|
56
|
-
success:
|
51
|
+
groupId,
|
52
|
+
success: groupInfo => {
|
57
53
|
__deviceInfo = groupInfo;
|
58
54
|
resolve(__deviceInfo);
|
59
55
|
}
|
60
56
|
});
|
61
57
|
} else {
|
62
58
|
getDeviceInfo({
|
63
|
-
deviceId
|
64
|
-
success:
|
59
|
+
deviceId,
|
60
|
+
success: deviceInfo => {
|
65
61
|
__deviceInfo = parseDevice(deviceInfo);
|
66
62
|
resolve(__deviceInfo);
|
67
63
|
},
|
@@ -70,108 +66,75 @@ export var initDevInfo = function (option) {
|
|
70
66
|
}
|
71
67
|
});
|
72
68
|
};
|
73
|
-
export
|
69
|
+
export const getDevInfo = () => {
|
74
70
|
return __deviceInfo;
|
75
71
|
};
|
76
|
-
export
|
72
|
+
export const updateDevInfo = devInfo => {
|
77
73
|
__deviceInfo = devInfo;
|
78
74
|
};
|
75
|
+
|
79
76
|
/**
|
80
77
|
* 监听设备移除
|
81
78
|
*/
|
82
|
-
|
83
|
-
var handleDeviceRemoved = function () {
|
79
|
+
const handleDeviceRemoved = () => {
|
84
80
|
exitMiniProgram();
|
85
81
|
};
|
82
|
+
|
86
83
|
/**
|
87
84
|
* 绑定当前设备或群组基础事件
|
88
85
|
* @param config: InitPanelEnvironmentOptions 配置项
|
89
86
|
*/
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
var groupId = (_options$groupId = options.groupId) !== null && _options$groupId !== void 0 ? _options$groupId : event.query.groupId;
|
131
|
-
var useDefaultOffline = options.useDefaultOffline; // @ts-ignore
|
132
|
-
|
133
|
-
if (ty.panel && ty.panel.initPanelKit && useDefaultOffline) {
|
134
|
-
// @ts-ignore
|
135
|
-
ty.panel.initPanelKit(_objectSpread({
|
136
|
-
deviceId: deviceId,
|
137
|
-
groupId: groupId
|
138
|
-
}, options));
|
139
|
-
} else {
|
140
|
-
// 否则使用 registerDeviceListListener 注册,删除上述条件方法
|
141
|
-
// 若需要能用离线逻辑,则需要在 global.config.ts 中添加 pageWrapper: ['@ray-js/ray-panel-wrapper/lib/page'],
|
142
|
-
if (deviceId) {
|
143
|
-
registerDeviceListListener({
|
144
|
-
deviceIdList: [deviceId]
|
145
|
-
});
|
146
|
-
}
|
147
|
-
|
148
|
-
if (groupId) {
|
149
|
-
registerGroupChange({
|
150
|
-
groupIdList: [groupId]
|
151
|
-
});
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
|
-
if (deviceId) {
|
156
|
-
subscribeDeviceRemoved({
|
157
|
-
deviceId: deviceId,
|
158
|
-
success: function success() {
|
159
|
-
onDeviceRemoved(handleDeviceRemoved);
|
160
|
-
}
|
161
|
-
});
|
162
|
-
}
|
163
|
-
}; // 使用 Promise 确保业务可以通过 initPanelEnvironment 的正常调用明确设备信息初始化完成
|
164
|
-
|
165
|
-
|
166
|
-
_context.next = 9;
|
167
|
-
return initDevInfo(options.deviceId || options.groupId ? options : undefined);
|
168
|
-
|
169
|
-
case 9:
|
170
|
-
case "end":
|
171
|
-
return _context.stop();
|
172
|
-
}
|
87
|
+
export async function initPanelEnvironment() {
|
88
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultPanelEnvironmentOptions;
|
89
|
+
if (!getApp()) {
|
90
|
+
await new Promise(resolve => {
|
91
|
+
setTimeout(() => {
|
92
|
+
resolve(initPanelEnvironment(options));
|
93
|
+
}, 0);
|
94
|
+
});
|
95
|
+
return;
|
96
|
+
}
|
97
|
+
const App = getApp();
|
98
|
+
|
99
|
+
// 基础库版本需要大于 2.6.0
|
100
|
+
// @ts-ignore
|
101
|
+
App.onReady = event => {
|
102
|
+
var _options$deviceId, _options$groupId;
|
103
|
+
const deviceId = (_options$deviceId = options.deviceId) !== null && _options$deviceId !== void 0 ? _options$deviceId : event.query.deviceId;
|
104
|
+
const groupId = (_options$groupId = options.groupId) !== null && _options$groupId !== void 0 ? _options$groupId : event.query.groupId;
|
105
|
+
const {
|
106
|
+
useDefaultOffline
|
107
|
+
} = options;
|
108
|
+
// @ts-ignore
|
109
|
+
if (ty.panel && ty.panel.initPanelKit && useDefaultOffline) {
|
110
|
+
// @ts-ignore
|
111
|
+
ty.panel.initPanelKit(_objectSpread({
|
112
|
+
deviceId,
|
113
|
+
groupId
|
114
|
+
}, options));
|
115
|
+
} else {
|
116
|
+
// 否则使用 registerDeviceListListener 注册,删除上述条件方法
|
117
|
+
// 若需要能用离线逻辑,则需要在 global.config.ts 中添加 pageWrapper: ['@ray-js/ray-panel-wrapper/lib/page'],
|
118
|
+
if (deviceId) {
|
119
|
+
registerDeviceListListener({
|
120
|
+
deviceIdList: [deviceId]
|
121
|
+
});
|
122
|
+
}
|
123
|
+
if (groupId) {
|
124
|
+
registerGroupChange({
|
125
|
+
groupIdList: [groupId]
|
126
|
+
});
|
173
127
|
}
|
174
|
-
}
|
175
|
-
|
176
|
-
|
128
|
+
}
|
129
|
+
if (deviceId) {
|
130
|
+
subscribeDeviceRemoved({
|
131
|
+
deviceId,
|
132
|
+
success: () => {
|
133
|
+
onDeviceRemoved(handleDeviceRemoved);
|
134
|
+
}
|
135
|
+
});
|
136
|
+
}
|
137
|
+
};
|
138
|
+
// 使用 Promise 确保业务可以通过 initPanelEnvironment 的正常调用明确设备信息初始化完成
|
139
|
+
await initDevInfo(options.deviceId || options.groupId ? options : undefined);
|
177
140
|
}
|