-
+
@@ -16,27 +16,35 @@ const comTitle = defineAsyncComponent(() => import('./com-title.vue'));
const PreviewVideo = defineAsyncComponent(() => import("../../../device/components/preview-video/index.vue"));
const refreshForm = reactive
({
- dutyId: ""
+ dutyId: null,
+ groupIdList: [],
+ deviceChannelCodeList: []
})
const previewVideoRef = ref(null)
-watch(
- () => refreshForm.dutyId,
- () => {
- refreshVideo()
- }
-)
const refreshVideo = async () => {
- const { code, data } = await deviceChannelApi.list({
- groupId: refreshForm.dutyId
+ const { code, data } = await deviceChannelApi.getChannelPage({
+ groupIdList: refreshForm.groupIdList,
+ deviceChannelCodeList: refreshForm.deviceChannelCodeList
})
if (code != 0) return
- const channelCode = data?.map((v: any) => v.channelCode) ?? []
+ const channelCode = data?.records?.map((v: any) => v.channelCode) ?? []
previewVideoRef.value.init(channelCode)
}
+const groupChange = (e: any) => {
+ if (!e) return
+ const [groupIds, channelCodes] = e
+ if (!groupIds.length && !channelCodes.length) {
+ previewVideoRef.value.close()
+ return
+ }
+ refreshForm.groupIdList = groupIds
+ refreshForm.deviceChannelCodeList = channelCodes
+ refreshVideo()
+}
\ No newline at end of file