@ray-js/ray-ipc-utils 1.1.9 → 1.1.11
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/lib/kit/ipc/index.d.ts +9 -0
- package/lib/kit/ipc/index.js +30 -0
- package/lib/service/index.js +3 -12
- package/package.json +1 -1
package/lib/kit/ipc/index.d.ts
CHANGED
|
@@ -159,3 +159,12 @@ export declare const goToIpcSettingMini: <T>(deviceId: string, options?: {
|
|
|
159
159
|
export declare const goToIpcServiceHallMini: <T>(options?: {
|
|
160
160
|
position?: 'right' | 'bottom';
|
|
161
161
|
}) => Promise<IRes<T>>;
|
|
162
|
+
/**
|
|
163
|
+
* 跳转 回放聚合页
|
|
164
|
+
* @param {string} deviceId - 设备ID
|
|
165
|
+
* @param {string} sdCardState - SD卡状态是否正常
|
|
166
|
+
* @param {Object} options - 可选配置项
|
|
167
|
+
*/
|
|
168
|
+
export declare const goToIpcPlayBackHubNativePage: <T>(deviceId: string, sdCardState?: boolean, theme?: 'dark' | 'light', extraParams?: {
|
|
169
|
+
[key: string]: any;
|
|
170
|
+
} | undefined) => Promise<IRes<T>>;
|
package/lib/kit/ipc/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import "core-js/modules/esnext.iterator.constructor.js";
|
|
|
3
3
|
import "core-js/modules/esnext.iterator.map.js";
|
|
4
4
|
import _find from 'lodash/find';
|
|
5
5
|
import { getSystemInfoSync } from '@ray-js/ray';
|
|
6
|
+
import { getServiceIsOpen } from '../../service';
|
|
6
7
|
// IPC Kit相关
|
|
7
8
|
/**
|
|
8
9
|
*
|
|
@@ -881,4 +882,33 @@ export const goToIpcServiceHallMini = async function () {
|
|
|
881
882
|
msg: String(err)
|
|
882
883
|
};
|
|
883
884
|
}
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* 跳转 回放聚合页
|
|
889
|
+
* @param {string} deviceId - 设备ID
|
|
890
|
+
* @param {string} sdCardState - SD卡状态是否正常
|
|
891
|
+
* @param {Object} options - 可选配置项
|
|
892
|
+
*/
|
|
893
|
+
|
|
894
|
+
export const goToIpcPlayBackHubNativePage = async function (deviceId, sdCardState) {
|
|
895
|
+
let theme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
896
|
+
let extraParams = arguments.length > 3 ? arguments[3] : undefined;
|
|
897
|
+
try {
|
|
898
|
+
let result = null;
|
|
899
|
+
const serviceData = await getServiceIsOpen(deviceId, 'security_cloud_service');
|
|
900
|
+
if (serviceData.code === 0 && serviceData.data) {
|
|
901
|
+
result = await goToIpcPageNativeRoute('camera_cloud_panel', deviceId, theme, extraParams);
|
|
902
|
+
} else if (serviceData.code === 0 && !serviceData.data && sdCardState) {
|
|
903
|
+
result = await goToIpcPageNativeRoute('camera_playback_panel', deviceId, theme, extraParams);
|
|
904
|
+
} else {
|
|
905
|
+
result = await goToIpcPageNativeRoute('camera_cloud_panel', deviceId, theme, extraParams);
|
|
906
|
+
}
|
|
907
|
+
return result;
|
|
908
|
+
} catch (err) {
|
|
909
|
+
return {
|
|
910
|
+
code: -1,
|
|
911
|
+
msg: String(err)
|
|
912
|
+
};
|
|
913
|
+
}
|
|
884
914
|
};
|
package/lib/service/index.js
CHANGED
|
@@ -339,15 +339,6 @@ export const updateCollectionPointsInfo = async (deviceId, id, name) => {
|
|
|
339
339
|
export const delCollectionPointsInfo = async (deviceId, pointData) => {
|
|
340
340
|
// 1. 先获取巡航状态,如果正在巡航,提示停止巡航
|
|
341
341
|
const cruiseSwitchInfo = await getDpStateValue(deviceId, 'cruise_switch');
|
|
342
|
-
if ((cruiseSwitchInfo === null || cruiseSwitchInfo === void 0 ? void 0 : cruiseSwitchInfo.code) === -1) {
|
|
343
|
-
ty.showToast({
|
|
344
|
-
title: cruiseSwitchInfo.msg
|
|
345
|
-
});
|
|
346
|
-
return {
|
|
347
|
-
code: -1,
|
|
348
|
-
msg: cruiseSwitchInfo.msg
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
342
|
if (cruiseSwitchInfo.data) {
|
|
352
343
|
ty.showToast({
|
|
353
344
|
title: Strings.getLang('ipc_utils_cruise_ing_tip')
|
|
@@ -359,13 +350,13 @@ export const delCollectionPointsInfo = async (deviceId, pointData) => {
|
|
|
359
350
|
}
|
|
360
351
|
// 2. 下发DP删除收藏点 dpCode: memory_point_set
|
|
361
352
|
const memoryPointSetDpId = await getDpIdByCode(deviceId, 'memory_point_set');
|
|
362
|
-
if (
|
|
353
|
+
if (cruiseSwitchInfo.data) {
|
|
363
354
|
ty.showToast({
|
|
364
|
-
title:
|
|
355
|
+
title: Strings.getLang('ipc_utils_cruise_ing_tip')
|
|
365
356
|
});
|
|
366
357
|
return {
|
|
367
358
|
code: -1,
|
|
368
|
-
msg:
|
|
359
|
+
msg: Strings.getLang('ipc_utils_cruise_ing_tip')
|
|
369
360
|
};
|
|
370
361
|
}
|
|
371
362
|
const publishResult = publishDps(deviceId, {
|