From 7bbeb8880494972be358be9430aa26f0de3df101 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 28 Apr 2022 10:28:15 +0800 Subject: [PATCH] bug --- .../AppISManage/AppISManage.vue | 53 ++++++++++--------- .../components/Synergy.vue | 7 ++- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/packages/IntelligentSecurity/AppISManage/AppISManage.vue b/packages/IntelligentSecurity/AppISManage/AppISManage.vue index a2f8acb5..5cb2a019 100644 --- a/packages/IntelligentSecurity/AppISManage/AppISManage.vue +++ b/packages/IntelligentSecurity/AppISManage/AppISManage.vue @@ -186,32 +186,37 @@ showMonitor(monitor, refresh = false) { let { id: deviceId } = monitor - deviceId && - this.instance - .post('/app/appzyvideoequipment/getWebSdkUrl', null, { - params: { deviceId }, - }) - .then((res) => { - if (res?.data) { - this.videoUrl = res.data - let data = { - url: res.data, - isShowPlayBtn: false, - } - if (refresh) { - monitor.url = data.url - } else if (this.splitScreen == 1) { - this.monitors = [{ ...monitor, ...data }] - } else { - if ( - this.monitors.findIndex((e) => e.id == monitor.id) === -1 && - this.monitors.length <= this.splitScreen - ) { - this.monitors.push({ ...monitor, ...data }) - } + + if (deviceId) { + this.isLoading = true + this.instance.post('/app/appzyvideoequipment/getWebSdkUrl', null, { + params: { deviceId }, + }).then((res) => { + if (res?.data) { + this.videoUrl = res.data + let data = { + url: res.data, + isShowPlayBtn: false, + } + if (refresh) { + monitor.url = data.url + } else if (this.splitScreen == 1) { + this.monitors = [{ ...monitor, ...data }] + } else { + if ( + this.monitors.findIndex((e) => e.id == monitor.id) === -1 && + this.monitors.length <= this.splitScreen + ) { + this.monitors.push({ ...monitor, ...data }) } } - }) + } + + this.isLoading = false + }).catch(() => { + this.isLoading = false + }) + } }, renderTreeItem: function (h, { node, data }) { let show = data.deviceStatus == 1 ? 'show' : '' diff --git a/packages/IntelligentSecurity/components/Synergy.vue b/packages/IntelligentSecurity/components/Synergy.vue index 7778b2cd..256eb942 100644 --- a/packages/IntelligentSecurity/components/Synergy.vue +++ b/packages/IntelligentSecurity/components/Synergy.vue @@ -140,7 +140,12 @@ const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect() const seconds = 24 * 60 * 60 const x = e.clientX - canvasInfo.left + 100 - if (x < 100) return + + if (x < 100 || x > this.canvasWidth + 100) { + this.isHide = true + + return false + } const unit = seconds / this.canvasWidth * (x - 100) this.left = x