From feaf0a9778879ef211c5587a513ba4cbdabb52d0 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 23 六月 2022 17:42:58 +0800 Subject: [PATCH] bug修复 --- src/pages/cameraAccess/components/CameraInfo.vue | 143 +++++++++++++++++++++++++++++++++++------------ 1 files changed, 105 insertions(+), 38 deletions(-) diff --git a/src/pages/cameraAccess/components/CameraInfo.vue b/src/pages/cameraAccess/components/CameraInfo.vue index a7a559a..00b0eda 100644 --- a/src/pages/cameraAccess/components/CameraInfo.vue +++ b/src/pages/cameraAccess/components/CameraInfo.vue @@ -230,6 +230,7 @@ createCamera, updateCameraInfo, getCameraInfo, + getGB28181CameraInfo, delCamera, } from "@/api/camera"; import { getSoundList } from "@/api/event"; @@ -367,48 +368,99 @@ this.$refs.addForm.resetFields(); this.voice = null; + console.log(node); + // this.initFormData(); // this.$refs.addForm.clearValidate(); if (node.type === "4") { - getCameraInfo(node.id).then((res) => { - if (res.success) { - // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�') - if (res.data.resolutions) { - let list = res.data.resolutions.map((i) => { - let obj = {}; - if (i.width == 0 && i.height == 0) { - obj.label = "鏈満鍒嗚鲸鐜�"; - obj.value = "0*0"; - } else { - obj.label = i.width + "*" + i.height; - obj.value = i.width + "*" + i.height; - } - return obj; - }); - this.resolutionList = list; - this.sensors = res.data.sensors; - } - - this.$nextTick(() => { - this.initFormData(); - Object.assign(this.form, res.data); - - this.soundList.forEach((element) => { - if (this.form.voiceId == element.id) { - this.voice = element; - } - }); - - if (this.form.run_type !== -1) { - this.form.isAI = true; - } else { - this.form.isAI = false; + // 鍥芥爣鎽勫儚鏈� + if (node.cameraType === 1) { + getGB28181CameraInfo(node.id).then((res) => { + if (res.success) { + // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�') + if (res.data.resolutions) { + let list = res.data.resolutions.map((i) => { + let obj = {}; + if (i.width == 0 && i.height == 0) { + obj.label = "鏈満鍒嗚鲸鐜�"; + obj.value = "0*0"; + } else { + obj.label = i.width + "*" + i.height; + obj.value = i.width + "*" + i.height; + } + return obj; + }); + this.resolutionList = list; + this.sensors = res.data.sensors; + console.log(list); } - this.form.resolution = - this.form.resolution_width + "*" + this.form.resolution_height; - }); - } - }); + + this.$nextTick(() => { + this.initFormData(); + Object.assign(this.form, res.data); + + this.soundList.forEach((element) => { + if (this.form.voiceId == element.id) { + this.voice = element; + } + }); + + if (this.form.run_type !== -1) { + this.form.isAI = true; + } else { + this.form.isAI = false; + } + this.form.resolution = + this.form.resolution_width + + "*" + + this.form.resolution_height; + }); + } + }); + } else { + getCameraInfo(node.id).then((res) => { + if (res.success) { + // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�') + if (res.data.resolutions) { + let list = res.data.resolutions.map((i) => { + let obj = {}; + if (i.width == 0 && i.height == 0) { + obj.label = "鏈満鍒嗚鲸鐜�"; + obj.value = "0*0"; + } else { + obj.label = i.width + "*" + i.height; + obj.value = i.width + "*" + i.height; + } + return obj; + }); + this.resolutionList = list; + this.sensors = res.data.sensors; + console.log(list); + } + + this.$nextTick(() => { + this.initFormData(); + Object.assign(this.form, res.data); + + this.soundList.forEach((element) => { + if (this.form.voiceId == element.id) { + this.voice = element; + } + }); + + if (this.form.run_type !== -1) { + this.form.isAI = true; + } else { + this.form.isAI = false; + } + this.form.resolution = + this.form.resolution_width + + "*" + + this.form.resolution_height; + }); + } + }); + } } }, // 淇濆瓨 @@ -582,8 +634,23 @@ }, // 娣诲姞璁惧 addDevice(node) { + console.log("1111"); this.isAdd = true; this.addParentId = node; + this.resolutionList = [ + { + label: "鏈満鍒嗚鲸鐜�", + value: "0*0", + }, + { + label: "1920*1080", + value: "1920*1080", + }, + { + label: "2688*1520", + value: "2688*1520", + }, + ]; this.initFormData(); }, }, -- Gitblit v1.8.0