From 1ae5558c65d0b6ab624a67785f9228b63c4873ea Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 24 Mar 2022 16:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=8E=A7=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppMonitorManage/AppMonitorManage.vue | 62 ++++++++++++++++--- vue.config.js | 2 +- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/project/shandong10086/apps/shandong/monitor/AppMonitorManage/AppMonitorManage.vue b/project/shandong10086/apps/shandong/monitor/AppMonitorManage/AppMonitorManage.vue index 48f06e1e..b3d7703a 100644 --- a/project/shandong10086/apps/shandong/monitor/AppMonitorManage/AppMonitorManage.vue +++ b/project/shandong10086/apps/shandong/monitor/AppMonitorManage/AppMonitorManage.vue @@ -11,8 +11,16 @@
-
+
+ {{ m.name }} +
@@ -93,18 +101,18 @@ let {id} = monitor, index = this.monitors.findIndex(e => e.id == id) if (index > -1) { - this.monitors.splice(index, 1) - this.monitors.map((e, i) => { - if (i > index) { - this.showMonitor(e, true) - } - }) + this.$message.error('该监控视频已存在') } else if (this.monitors.length >= this.splitScreen && this.splitScreen > 1) { - this.$message.warning("可分屏监控已满,请先取消其他的监控") + this.$message.error("可分屏监控已满,请先取消其他的监控") } else { this.showMonitor(monitor) } }, + + removeMonitor (i) { + this.monitors.splice(i, 1) + }, + showMonitor(monitor, refresh = false) { let {id: deviceId} = monitor deviceId && this.instance.post("/app/appzyvideoequipment/getWebSdkUrl", null, { @@ -113,14 +121,17 @@ if (res?.data) { this.videoUrl = res.data let data = { - url: res.data + url: res.data, + isShowPlayBtn: false } if (refresh) { monitor.url = data.url } else if (this.splitScreen == 1) { this.monitors = [{...monitor, ...data}] } else { - this.monitors.push({...monitor, ...data}) + if (this.monitors.findIndex(e => e.id == monitor.id) === -1 && this.monitors.length <= this.splitScreen) { + this.monitors.push({...monitor, ...data}) + } } } }) @@ -251,9 +262,40 @@ } .videoBox { + position: relative; background: #000; flex-shrink: 0; + span { + position: absolute; + bottom: 0; + left: 0; + z-index: 11; + width: 60%; + height: 38px; + line-height: 38px; + padding: 0 10px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #fff; + font-size: 16px; + } + + i { + position: absolute; + top: 50%; + left: 50%; + z-index: 11; + font-size: 60px; + cursor: pointer; + transform: translate(-50%, -50%); + + &:hover { + opacity: 0.6; + } + } + iframe { width: 100%; height: 100%; diff --git a/vue.config.js b/vue.config.js index 4c62f6b4..e4ebd77c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -64,7 +64,7 @@ module.exports = { proxy: { //设置代理,可解决跨5 '/lan': { - target: 'http://192.168.1.87:9000/', + target: 'https://sdtestweb.sdvillage.cn', changeOrigin: true, pathRewrite: { //地址重写