| | |
| | | <template> |
| | | <div class="CameraBox"> |
| | | <div v-if="cameras"> |
| | | <div class="CameraBox" v-if="cameras"> |
| | | <div v-for="(camera, index) in cameraArr" :key="index" class="boxItem"> |
| | | <div class="header"> |
| | | <i class="iconfont"></i> |
| | |
| | | <div class="button addRule" @click="addRule">添加新场景</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="empty" v-else>暂未获得摄像机信息</div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | type: Array, |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getCameraInfo(); |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | cameraArr: [], |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getCameraInfo(); |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | //是否进行视频分析处理 |
| | | pollEnable(row, index) { |
| | |
| | | message: "配置失败", |
| | | }); |
| | | } |
| | | this.TreeDataPool.fetchTreeData(); |
| | | }); |
| | | } |
| | | // this.PollData.statisticTaskInfo(); |
| | |
| | | this.cameraArr[index].cameraId && |
| | | this.cameraArr[index].cameraId !== undefined |
| | | ) { |
| | | console.log(1); |
| | | if (this.PollData.RealTimeSum < this.PollData.channelTotal) { |
| | | if (row) { |
| | | console.log(2); |
| | | this.cameraArr[index].dealWay = true; |
| | | } else { |
| | | console.log(3); |
| | | |
| | | this.cameraArr[index].dealWay = false; |
| | | } |
| | | changeRunType({ |
| | |
| | | }); |
| | | } |
| | | } |
| | | this.TreeDataPool.fetchTreeData(); |
| | | // this.TreeDataPool.fetchTreeData(); |
| | | // this.PollData.statisticTaskInfo(); |
| | | } |
| | | }, |
| | |
| | | }, |
| | | |
| | | getCameraInfo() { |
| | | this.cameraArr = []; |
| | | if (this.cameras.length <= 0) { |
| | | return; |
| | | } |
| | | |
| | | let arr = []; |
| | | |
| | | this.cameras.forEach(async (id) => { |
| | | if (!id) { |
| | | return; |
| | | } |
| | | const rsp = await getCameraInfo(id); |
| | | if (rsp.success) { |
| | | this.cameraArr.push({ |
| | | arr.push({ |
| | | cameraId: rsp.data.id, |
| | | cameraName: rsp.data.name ? rsp.data.name : "", |
| | | analytics: rsp.data.runType !== -1 ? true : false, |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | this.cameraArr = arr; |
| | | this.$forceUpdate(); |
| | | }, |
| | | }, |
| | | watch: { |