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

506 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
}
})
}
2025-07-31 20:54:08 +08:00
export function addPointForCruise({ channelId, tourId, presetId }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
2025-07-31 20:54:08 +08:00
url: '/api/common/channel/front-end/tour/point/add',
2025-07-07 09:30:04 +08:00
params: {
channelId: channelId,
2025-07-31 20:54:08 +08:00
tourId: tourId,
2025-07-07 09:30:04 +08:00
presetId: presetId
}
})
}
2025-07-31 20:54:08 +08:00
export function deletePointForCruise({ channelId, tourId, presetId }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
2025-07-31 20:54:08 +08:00
url: '/api/common/channel/front-end/tour/point/delete',
2025-07-07 09:30:04 +08:00
params: {
channelId: channelId,
2025-07-31 20:54:08 +08:00
tourId: tourId,
2025-07-07 09:30:04 +08:00
presetId: presetId
}
})
}
2025-07-31 20:54:08 +08:00
export function setCruiseSpeed({ channelId, tourId, presetId , speed }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
2025-07-31 20:54:08 +08:00
url: '/api/common/channel/front-end/tour/speed',
2025-07-07 09:30:04 +08:00
params: {
channelId: channelId,
2025-07-31 20:54:08 +08:00
tourId: tourId,
presetId: presetId,
speed: speed
2025-07-07 09:30:04 +08:00
}
})
}
2025-07-31 20:54:08 +08:00
export function setCruiseTime({ channelId, tourId, presetId, time }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
2025-07-31 20:54:08 +08:00
url: '/api/common/channel/front-end/tour/time',
2025-07-07 09:30:04 +08:00
params: {
channelId: channelId,
2025-07-31 20:54:08 +08:00
tourId: tourId,
presetId: presetId,
time: time
2025-07-07 09:30:04 +08:00
}
})
}
2025-07-31 20:54:08 +08:00
export function startCruise({ channelId, tourId }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
2025-07-31 20:54:08 +08:00
url: '/api/common/channel/front-end/tour/start',
2025-07-07 09:30:04 +08:00
params: {
channelId: channelId,
2025-07-31 20:54:08 +08:00
tourId: tourId
2025-07-07 09:30:04 +08:00
}
})
}
2025-07-31 20:54:08 +08:00
export function stopCruise({ channelId, tourId }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
2025-07-31 20:54:08 +08:00
url: '/api/common/channel/front-end/tour/stop',
2025-07-07 09:30:04 +08:00
params: {
channelId: channelId,
2025-07-31 20:54:08 +08:00
tourId: tourId
2025-07-07 09:30:04 +08:00
}
})
}
export function addPreset({ channelId, presetId, presetName }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
url: '/api/common/channel/front-end/preset/add',
params: {
channelId: channelId,
presetId: presetId,
presetName: presetName
2025-07-07 09:30:04 +08:00
}
})
}
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, auxiliaryId }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
url: '/api/common/channel/front-end/auxiliary',
params: {
channelId: channelId,
command: command,
auxiliaryId: auxiliaryId
2025-07-07 09:30:04 +08:00
}
})
}
/**
* command: on 开启 off 关闭
*/
export function wiper({ channelId, command }) {
return request({
method: 'get',
url: '/api/common/channel/front-end/wiper',
params: {
channelId: channelId,
command: command
}
})
}
2025-07-31 18:49:53 +08:00
export function ptz({ channelId, command, panSpeed, tiltSpeed, zoomSpeed }) {
2025-07-07 09:30:04 +08:00
return request({
method: 'get',
url: '/api/common/channel/front-end/ptz',
params: {
channelId: channelId,
command: command,
2025-07-31 18:49:53 +08:00
panSpeed: panSpeed,
tiltSpeed: tiltSpeed,
2025-07-07 09:30:04 +08:00
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
}
})
}