This commit is contained in:
yanran200730
2022-04-28 10:28:15 +08:00
parent e99ea5b2de
commit 7bbeb88804
2 changed files with 35 additions and 25 deletions

View File

@@ -186,32 +186,37 @@
showMonitor(monitor, refresh = false) { showMonitor(monitor, refresh = false) {
let { id: deviceId } = monitor let { id: deviceId } = monitor
deviceId &&
this.instance if (deviceId) {
.post('/app/appzyvideoequipment/getWebSdkUrl', null, { this.isLoading = true
params: { deviceId }, this.instance.post('/app/appzyvideoequipment/getWebSdkUrl', null, {
}) params: { deviceId },
.then((res) => { }).then((res) => {
if (res?.data) { if (res?.data) {
this.videoUrl = res.data this.videoUrl = res.data
let data = { let data = {
url: res.data, url: res.data,
isShowPlayBtn: false, isShowPlayBtn: false,
} }
if (refresh) { if (refresh) {
monitor.url = data.url monitor.url = data.url
} else if (this.splitScreen == 1) { } else if (this.splitScreen == 1) {
this.monitors = [{ ...monitor, ...data }] this.monitors = [{ ...monitor, ...data }]
} else { } else {
if ( if (
this.monitors.findIndex((e) => e.id == monitor.id) === -1 && this.monitors.findIndex((e) => e.id == monitor.id) === -1 &&
this.monitors.length <= this.splitScreen this.monitors.length <= this.splitScreen
) { ) {
this.monitors.push({ ...monitor, ...data }) this.monitors.push({ ...monitor, ...data })
}
} }
} }
}) }
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
}
}, },
renderTreeItem: function (h, { node, data }) { renderTreeItem: function (h, { node, data }) {
let show = data.deviceStatus == 1 ? 'show' : '' let show = data.deviceStatus == 1 ? 'show' : ''

View File

@@ -140,7 +140,12 @@
const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect() const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect()
const seconds = 24 * 60 * 60 const seconds = 24 * 60 * 60
const x = e.clientX - canvasInfo.left + 100 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) const unit = seconds / this.canvasWidth * (x - 100)
this.left = x this.left = x