From fd58fba8137034b1941e92f11e290e2dbec0e9a2 Mon Sep 17 00:00:00 2001 From: 4670101279 Date: Sun, 9 Oct 2022 17:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 ++ .env.production | 3 +++ .env.staging | 2 ++ src/views/data/photo/index.vue | 4 ++-- src/views/data/photo2/index.vue | 5 +++-- src/views/index.vue | 37 +++++++++++++++++++++++---------- src/views/login.vue | 4 ++-- 7 files changed, 40 insertions(+), 17 deletions(-) diff --git a/.env.development b/.env.development index c197569..5bfd22d 100644 --- a/.env.development +++ b/.env.development @@ -7,5 +7,7 @@ ENV = 'development' # 华双视频水位数据接收平台/开发环境 VUE_APP_BASE_API = '/control-api' +VUE_APP_PIC_PREFIX = 'https://www.huastech.com.cn' + # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index 1915e72..9a4418d 100644 --- a/.env.production +++ b/.env.production @@ -6,3 +6,6 @@ ENV = 'production' # 华双视频水位数据接收平台/生产环境 VUE_APP_BASE_API = '/control-api' + +# VUE_APP_PIC_PREFIX = 'https://www.huastech.com.cn' +VUE_APP_PIC_PREFIX = '/control-api' diff --git a/.env.staging b/.env.staging index ae36e4a..6520756 100644 --- a/.env.staging +++ b/.env.staging @@ -8,3 +8,5 @@ ENV = 'staging' # 华双视频水位数据接收平台/测试环境 VUE_APP_BASE_API = '/control-api' + +VUE_APP_PIC_PREFIX = 'https://www.huastech.com.cn' diff --git a/src/views/data/photo/index.vue b/src/views/data/photo/index.vue index e02c450..012833b 100644 --- a/src/views/data/photo/index.vue +++ b/src/views/data/photo/index.vue @@ -163,8 +163,8 @@ export default { e.imgName = errorImg } else { - e.imgName = "https://www.huastech.com.cn" + e.imgName - // e.imgName = process.env.VUE_APP_BASE_API + e.imgName + // e.imgName = "https://www.huastech.com.cn" + e.imgName + e.imgName = process.env.VUE_APP_PIC_PREFIX + e.imgName } }) this.loading = false; diff --git a/src/views/data/photo2/index.vue b/src/views/data/photo2/index.vue index b5bf675..d356313 100644 --- a/src/views/data/photo2/index.vue +++ b/src/views/data/photo2/index.vue @@ -135,8 +135,9 @@ export default { e.imgName = errorImg } else { - e.imgName = "https://www.huastech.com.cn" + e.imgName - // e.imgName = process.env.VUE_APP_BASE_API + e.imgName + console.log( process.env.VUE_APP_PIC_PREFIX + e.imgName) + // e.imgName = "https://www.huastech.com.cn" + e.imgName + e.imgName = process.env.VUE_APP_PIC_PREFIX + e.imgName } }) this.loading = false; diff --git a/src/views/index.vue b/src/views/index.vue index 03fcd17..7fcb38f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -7,7 +7,7 @@

视频水位计数据监控大屏

-
+
@@ -104,7 +104,8 @@ export default { // 数据接口 api: '/control-api/api/daping/station/', // 图片接口 - imgapi: process.env.VUE_APP_BASE_API, + // imgapi: "https://www.huastech.com.cn", + imgapi: process.env.VUE_APP_PIC_PREFIX, // 接口数据 station: [], level: {}, @@ -183,7 +184,7 @@ export default { .catch(e => { console.error(e) }) this.setMarks() - this.playInfobox() + // this.playInfobox() this.setTable() }) .catch(e => { console.error(e) }) @@ -531,7 +532,7 @@ export default { // 定位 var center = new BMap.Point(this.center[0], this.center[1]); // 生成地图 - map.centerAndZoom(center, 12); + map.centerAndZoom(center, 13); // 地图样式 map.setMapStyleV2({ @@ -559,23 +560,37 @@ export default { // 点击地标打开窗口 marker.addEventListener('click', () => { clearInterval(this.play) - this.box.close() + //取消轮播,加上判断 + if(this.box != null){ + this.box.close() + } + // this.box.close() this.flag = false let box = this.box = this.setInfoBox(this.map, marker, item) - setTimeout(() => { - box.close() - this.playInfobox() - }, 9999) + // setTimeout(() => { + // box.close() + // this.playInfobox() + // }, 9999) }) + // marker.addEventListener('mouseout', () => { + // //取消轮播,加上判断 + // if(this.box != null){ + // this.box.close() + // } + // }) }) }, - + closeBox(){ + if(this.box != null){ + this.box.close() + } + }, // 创建信息框 setInfoBox(map, marker, item) { let htmlStr = `
-
+
站点: ${item.stnm}
水位: ${item.value}m
diff --git a/src/views/login.vue b/src/views/login.vue index b665ea1..a0a8c79 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -72,8 +72,8 @@ export default { return { codeUrl: "", loginForm: { - username: "admin", - password: "admin123", + username: "", + password: "", rememberMe: false, code: "", uuid: ""