diff --git a/src/api/device/deviceChannel.ts b/src/api/device/deviceChannel.ts index ebeb5c9..015cd83 100644 --- a/src/api/device/deviceChannel.ts +++ b/src/api/device/deviceChannel.ts @@ -22,6 +22,19 @@ export const getChannelPage = (query:any) => { }) } +// 编码设备通道分页查询 +export const cameraChannelPage = (query: any) => { + return request({ + url: '/admin/deviceChannel/cameraPage', + method: 'post', + data: query, + params: { + current: query.current, + size: query.size, + } + }) +} + export function getReplayList(data: any) { return request({ url: '/admin/deviceChannel/getReplayList', diff --git a/src/views/base/deviceCamera/index.vue b/src/views/base/deviceCamera/index.vue index e180769..ecd7ffb 100644 --- a/src/views/base/deviceCamera/index.vue +++ b/src/views/base/deviceCamera/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/device/components/preview-video/preview-video-dialog.vue b/src/views/device/components/preview-video/preview-video-dialog.vue index ff11695..d92955c 100644 --- a/src/views/device/components/preview-video/preview-video-dialog.vue +++ b/src/views/device/components/preview-video/preview-video-dialog.vue @@ -35,8 +35,11 @@ import * as DeviceChannelApi from "/@/api/device/deviceChannel" const previewVideoRef = ref() -const state = reactive({ +const state = reactive({ dialogVisible: false, + // device-设备维度 code=设备id;channel-通道维度 code=通道编码 + type: "device", + code: null, channelList: [], loading: false, treeLoading: false, @@ -57,12 +60,21 @@ const handleClose = () => { } // 打开弹窗 -const openDialog = async (id: string) => { +const openDialog = async (type: string, code: string) => { + if (!type || !code) return + state.type = type + state.code = code state.dialogVisible = true - // 获取deviceManage信息 - if (!id) return - await getdeviceManageData(id) - await getDeviceChannelList() + if (state.type === "device") { + // 获取deviceManage信息 + await getdeviceManageData(code) + await getDeviceChannelList() + return + } + if (state.type === "channel") { + await getDeviceChannelList() + return + } }; const videoChangePage = async ({ current, size }: any) => { @@ -149,7 +161,14 @@ const getdeviceManageData = async (id: string) => { const getDeviceChannelList = async () => { state.treeLoading = true try { - const { data, code } = await DeviceChannelApi.list({ deviceCode: detail.deviceCode }) + const _data: any = {} + if (state.type == "device") { + _data.deviceCode = detail.deviceCode + } + if (state.type == "channel") { + _data.channelCode = state.code + } + const { data, code } = await DeviceChannelApi.list(_data) if (code != 0) throw new Error() channel.treeList = data channel.list = data diff --git a/src/views/device/deviceCamera/index.vue b/src/views/device/deviceCamera/index.vue index e7faec5..73556ca 100644 --- a/src/views/device/deviceCamera/index.vue +++ b/src/views/device/deviceCamera/index.vue @@ -1,5 +1,5 @@