Files
wvp-platform/web/src/api/commonChannel.js

503 lines
10 KiB
JavaScript
Raw Normal View History

2025-04-28 15:04:06 +08:00
import request from '@/utils/request'
// 通用通道API
export function queryOne(id) {
return request({
method: 'get',
url: '/api/common/channel/one',
params: {
id: id
}
})
}
2025-06-12 15:28:20 +08:00
export function getIndustryList() {
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'get',
url: '/api/common/channel/industry/list'
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function getTypeList() {
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'get',
url: '/api/common/channel/type/list'
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function getNetworkIdentificationList() {
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'get',
url: '/api/common/channel/network/identification/list'
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function update(data) {
2025-04-28 15:04:06 +08:00
return request({
method: 'post',
2025-06-12 15:28:20 +08:00
url: '/api/common/channel/update',
data: data
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function reset(id) {
2025-04-28 15:04:06 +08:00
return request({
method: 'post',
2025-06-12 15:28:20 +08:00
url: '/api/common/channel/reset',
params: {
id: id
2025-04-28 15:04:06 +08:00
}
})
}
2025-06-12 15:28:20 +08:00
export function add(data) {
2025-04-28 15:04:06 +08:00
return request({
method: 'post',
2025-06-12 15:28:20 +08:00
url: '/api/common/channel/add',
data: data
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function getList(params) {
const { page, count, query, online, hasRecordPlan, channelType } = params
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'get',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/list',
2025-06-12 15:28:20 +08:00
params: {
page: page,
count: count,
channelType: channelType,
query: query,
online: online,
hasRecordPlan: hasRecordPlan
2025-04-28 15:04:06 +08:00
}
})
}
export function getCivilCodeList(params) {
const { page, count, channelType, query, online, civilCode } = params
return request({
method: 'get',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/civilcode/list',
2025-04-28 15:04:06 +08:00
params: {
page: page,
count: count,
channelType: channelType,
query: query,
online: online,
civilCode: civilCode
}
})
}
2025-06-12 15:28:20 +08:00
export function getUnusualCivilCodeList(params) {
const { page, count, channelType, query, online } = params
2025-04-28 15:04:06 +08:00
return request({
method: 'get',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/civilCode/unusual/list',
2025-04-28 15:04:06 +08:00
params: {
page: page,
count: count,
channelType: channelType,
query: query,
2025-06-12 15:28:20 +08:00
online: online
2025-04-28 15:04:06 +08:00
}
})
}
export function getUnusualParentList(params) {
const { page, count, channelType, query, online } = params
return request({
method: 'get',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/parent/unusual/list',
2025-04-28 15:04:06 +08:00
params: {
page: page,
count: count,
channelType: channelType,
query: query,
online: online
}
})
}
2025-06-12 15:28:20 +08:00
export function clearUnusualCivilCodeList(params) {
const { all, channelIds } = params
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/civilCode/unusual/clear',
2025-06-12 15:28:20 +08:00
data: {
all: all,
channelIds: channelIds
}
})
}
2025-04-28 15:04:06 +08:00
export function clearUnusualParentList(params) {
const { all, channelIds } = params
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/parent/unusual/clear',
2025-04-28 15:04:06 +08:00
data: {
all: all,
channelIds: channelIds
}
})
}
2025-06-12 15:28:20 +08:00
export function getParentList(params) {
const { page, count, channelType, query, online, groupDeviceId } = params
2025-04-28 15:04:06 +08:00
return request({
method: 'get',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/parent/list',
2025-04-28 15:04:06 +08:00
params: {
page: page,
count: count,
channelType: channelType,
query: query,
2025-06-12 15:28:20 +08:00
online: online,
groupDeviceId: groupDeviceId
2025-04-28 15:04:06 +08:00
}
})
}
2025-06-12 15:28:20 +08:00
export function addToRegion(params) {
const { civilCode, channelIds } = params
2025-04-28 15:04:06 +08:00
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/region/add',
2025-04-28 15:04:06 +08:00
data: {
2025-06-12 15:28:20 +08:00
civilCode: civilCode,
2025-04-28 15:04:06 +08:00
channelIds: channelIds
}
})
}
2025-06-12 15:28:20 +08:00
export function deleteFromRegion(channels) {
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/region/delete',
2025-06-12 15:28:20 +08:00
data: {
channelIds: channels
}
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function addDeviceToRegion(params) {
const { civilCode, deviceIds } = params
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/region/device/add',
2025-06-12 15:28:20 +08:00
data: {
civilCode: civilCode,
deviceIds: deviceIds
}
2025-04-28 15:04:06 +08:00
})
}
2025-06-12 15:28:20 +08:00
export function deleteDeviceFromRegion(deviceIds) {
2025-04-28 15:04:06 +08:00
return request({
2025-06-12 15:28:20 +08:00
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/region/device/delete',
2025-06-12 15:28:20 +08:00
data: {
deviceIds: deviceIds
}
})
}
export function addToGroup(params) {
const { parentId, businessGroup, channelIds } = params
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/group/add',
2025-06-12 15:28:20 +08:00
data: {
parentId: parentId,
businessGroup: businessGroup,
channelIds: channelIds
}
})
}
export function deleteFromGroup(channels) {
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/group/delete',
2025-06-12 15:28:20 +08:00
data: {
channelIds: channels
}
})
}
export function addDeviceToGroup(params) {
const { parentId, businessGroup, deviceIds } = params
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/group/device/add',
2025-06-12 15:28:20 +08:00
data: {
parentId: parentId,
businessGroup: businessGroup,
deviceIds: deviceIds
}
})
}
export function deleteDeviceFromGroup(deviceIds) {
return request({
method: 'post',
2025-07-07 09:30:04 +08:00
url: '/api/common/channel/group/device/delete',
2025-06-12 15:28:20 +08:00
data: {
deviceIds: deviceIds
}
2025-04-28 15:04:06 +08:00
})
}
export function playChannel(channelId) {
return request({
method: 'get',
url: '/api/common/channel/play',
params: {
channelId: channelId
}
})
}
2025-07-07 09:30:04 +08:00
// 前端控制
export function setSpeedForScan({ channelId, scanId, speed }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/scan/set/speed',
params: {
channelId: channelId,
scanId: scanId,
speed: speed
}
})
}
export function setLeftForScan({ channelId, scanId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/scan/set/left',
params: {
channelId: channelId,
scanId: scanId
}
})
}
export function setRightForScan({ channelId, scanId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/scan/set/right',
params: {
channelId: channelId,
scanId: scanId
}
})
}
export function startScan({ channelId, scanId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/scan/start',
params: {
channelId: channelId,
scanId: scanId
}
})
}
export function stopScan({ channelId, scanId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/scan/stop',
params: {
channelId: channelId,
scanId: scanId
}
})
}
export function queryPreset(channelId) {
return request({
method: 'get',
url: '/api/common/channel/front-end/preset/query',
params: {
channelId: channelId
}
})
}
export function addPointForCruise({ channelId, cruiseId, presetId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/cruise/point/add',
params: {
channelId: channelId,
cruiseId: cruiseId,
presetId: presetId
}
})
}
export function deletePointForCruise({ channelId, cruiseId, presetId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/cruise/point/delete',
params: {
channelId: channelId,
cruiseId: cruiseId,
presetId: presetId
}
})
}
export function setCruiseSpeed({ channelId, cruiseId, cruiseSpeed }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/cruise/speed',
params: {
channelId: channelId,
cruiseId: cruiseId,
speed: cruiseSpeed
}
})
}
export function setCruiseTime({ channelId, cruiseId, cruiseTime }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/cruise/time',
params: {
channelId: channelId,
cruiseId: cruiseId,
time: cruiseTime
}
})
}
export function startCruise({ channelId, cruiseId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/cruise/start',
params: {
channelId: channelId,
cruiseId: cruiseId
}
})
}
export function stopCruise({ channelId, cruiseId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/cruise/stop',
params: {
channelId: channelId,
cruiseId: cruiseId
}
})
}
export function addPreset({ channelId, presetId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/preset/add',
params: {
channelId: channelId,
presetId: presetId
}
})
}
export function callPreset({ channelId, presetId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/preset/call',
params: {
channelId: channelId,
presetId: presetId
}
})
}
export function deletePreset({ channelId, presetId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/preset/delete',
params: {
channelId: channelId,
presetId: presetId
}
})
}
/**
* command: on 开启 off 关闭
*/
export function auxiliary({ channelId, command, switchId }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/auxiliary',
params: {
channelId: channelId,
command: command,
switchId: switchId
}
})
}
/**
* command: on 开启 off 关闭
*/
export function wiper({ channelId, command }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/wiper',
params: {
channelId: channelId,
command: command
}
})
}
export function ptz({ channelId, command, horizonSpeed, verticalSpeed, zoomSpeed }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/ptz',
params: {
channelId: channelId,
command: command,
horizonSpeed: horizonSpeed,
verticalSpeed: verticalSpeed,
zoomSpeed: zoomSpeed
}
})
}
export function iris({ channelId, command, speed }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/fi/iris',
params: {
channelId: channelId,
command: command,
speed: speed
}
})
}
export function focus({ channelId, command, speed }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/fi/focus',
params: {
channelId: channelId,
command: command,
speed: speed
}
})
}