"use strict"; import { basicAction } from "@peace/utils"; import { ApiTable } from "$utils"; export function getCamera(query) { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, actionType: "GET_CAMREA", query: query, url: `${ApiTable.getCamera}`, msg: { option: "获取摄像头列表信息" }, reducer: { name: "equipmentWarehouseCamera", params: { noClear: true } }, }); } export function putForbidden(data, forbidden) { return (dispatch) => basicAction({ type: "put", dispatch: dispatch, actionType: "PUT_FORBIDDEN", data, url: `${ApiTable.putForbidden}`, msg: { option: forbidden ? "启用" : "禁用" }, //禁用摄像头 reducer: {}, }); } export function delCamera(orgId) { return (dispatch) => basicAction({ type: "del", dispatch: dispatch, actionType: "DEL_CAMERA", url: `${ApiTable.delCamera.replace("{cameraId}", orgId)}`, msg: { option: "设备会被存放在“设备回收站”中,删除" }, //删除摄像头 reducer: {}, }); } export function getCameraDetails(orgId) { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, actionType: "GET_CAMREA_DETAILS", url: `${ApiTable.getCameraDetails.replace("{cameraId}", orgId)}`, msg: { option: "" }, //获取摄像头详情 reducer: { name: "nvrDetails" }, }); } export function getCameraKind() { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, actionType: "GET_CAMERA_KIND", url: `${ApiTable.getCameraKind}`, msg: { option: "" }, //获取摄像头种类列表 reducer: { name: "CameraKind" }, }); } export function getAbility() { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, actionType: "GET_ABILITY", url: `${ApiTable.getAbility}`, msg: { option: "" }, //获取摄像头能力列表 reducer: { name: "CameraAbility" }, }); } export function postCameraYingshi(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_CAMERA_YINGSHI", url: `${ApiTable.postCameraYingshi}`, msg: { option: "" }, //创建萤石摄像头 reducer: { name: "" }, }); } export function postCameraIpc(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_CAMERA_IPC", url: `${ApiTable.postCameraIpc}`, msg: { option: "" }, //创建IPC摄像头 reducer: { name: "" }, }); } export function getVideoStreaming(query) { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, query, actionType: "GET_VIDEO_STREAMING", url: `${ApiTable.getVideoStreaming}`, msg: { option: "" }, //获取NVR视频流 reducer: { name: "videoStreaming" }, }); } export function postCameraNvr(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_CAMERA_NVR", url: `${ApiTable.postCameraNvr}`, msg: { option: "" }, //记录NVR摄像头 }); } export function getCascadeSIP() { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, actionType: "GET_CASCADE_SIP", url: `${ApiTable.getCascadeSIP}`, msg: { option: "" }, //获取级联摄像头sip列表 }); } export function postAddCascade(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_ADD_CASCADE", url: `${ApiTable.postAddCascade}`, msg: { option: "" }, //添加级联摄像头 }); } export function getParentCamera(query) { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, query, actionType: "GET_PARENT_CASCADE", url: `${ApiTable.getParentCamera}`, msg: { option: "" }, //获取级联摄像头父级设备 }); } export function postVerifyYingshi(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_VERIFY_YINGSHI", url: `${ApiTable.postVerifyYingshi}`, msg: { option: "" }, ///验证萤石摄像头信息 }); } export function postVerifyIpc(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_VERIFY_IPC", url: `${ApiTable.postVerifyIpc}`, msg: { option: "" }, //验证IPC摄像头信息 }); } export function postVerifyCascade(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_VERIFY_CASCADE", url: `${ApiTable.postVerifyCascade}`, msg: { option: "" }, //验证级联摄像头信息 }); } export function getCascadeStream(query) { return (dispatch) => basicAction({ type: "get", dispatch: dispatch, query, actionType: "GET_CASCADE_STREAM", url: `${ApiTable.getCascadeStream}`, msg: { option: "" }, //获取级联视频流 }); } export function postCameraRemark(data) { return (dispatch) => basicAction({ type: "post", dispatch: dispatch, data, actionType: "POST_CAMERA_REMARK", url: `${ApiTable.postCameraRemark}`, msg: { option: "摄像头备注" }, //编辑摄像头备注 }); }