Browse Source

优化

master
4670101279 2 years ago
parent
commit
fd58fba813
  1. 2
      .env.development
  2. 3
      .env.production
  3. 2
      .env.staging
  4. 4
      src/views/data/photo/index.vue
  5. 5
      src/views/data/photo2/index.vue
  6. 37
      src/views/index.vue
  7. 4
      src/views/login.vue

2
.env.development

@ -7,5 +7,7 @@ ENV = 'development'
# 华双视频水位数据接收平台/开发环境 # 华双视频水位数据接收平台/开发环境
VUE_APP_BASE_API = '/control-api' VUE_APP_BASE_API = '/control-api'
VUE_APP_PIC_PREFIX = 'https://www.huastech.com.cn'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

3
.env.production

@ -6,3 +6,6 @@ ENV = 'production'
# 华双视频水位数据接收平台/生产环境 # 华双视频水位数据接收平台/生产环境
VUE_APP_BASE_API = '/control-api' VUE_APP_BASE_API = '/control-api'
# VUE_APP_PIC_PREFIX = 'https://www.huastech.com.cn'
VUE_APP_PIC_PREFIX = '/control-api'

2
.env.staging

@ -8,3 +8,5 @@ ENV = 'staging'
# 华双视频水位数据接收平台/测试环境 # 华双视频水位数据接收平台/测试环境
VUE_APP_BASE_API = '/control-api' VUE_APP_BASE_API = '/control-api'
VUE_APP_PIC_PREFIX = 'https://www.huastech.com.cn'

4
src/views/data/photo/index.vue

@ -163,8 +163,8 @@ export default {
e.imgName = errorImg e.imgName = errorImg
} }
else { else {
e.imgName = "https://www.huastech.com.cn" + e.imgName // e.imgName = "https://www.huastech.com.cn" + e.imgName
// e.imgName = process.env.VUE_APP_BASE_API + e.imgName e.imgName = process.env.VUE_APP_PIC_PREFIX + e.imgName
} }
}) })
this.loading = false; this.loading = false;

5
src/views/data/photo2/index.vue

@ -135,8 +135,9 @@ export default {
e.imgName = errorImg e.imgName = errorImg
} }
else { else {
e.imgName = "https://www.huastech.com.cn" + e.imgName console.log( process.env.VUE_APP_PIC_PREFIX + 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; this.loading = false;

37
src/views/index.vue

@ -7,7 +7,7 @@
<header> <header>
<h1>视频水位计数据监控大屏</h1> <h1>视频水位计数据监控大屏</h1>
</header> </header>
<div class="left"> <div class="left" @click="closeBox">
<!-- 实时水位 --> <!-- 实时水位 -->
<div class="panel feet"> <div class="panel feet">
<div class="title"> <div class="title">
@ -104,7 +104,8 @@ export default {
// //
api: '/control-api/api/daping/station/', 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: [], station: [],
level: {}, level: {},
@ -183,7 +184,7 @@ export default {
.catch(e => { console.error(e) }) .catch(e => { console.error(e) })
this.setMarks() this.setMarks()
this.playInfobox() // this.playInfobox()
this.setTable() this.setTable()
}) })
.catch(e => { console.error(e) }) .catch(e => { console.error(e) })
@ -531,7 +532,7 @@ export default {
// //
var center = new BMap.Point(this.center[0], this.center[1]); var center = new BMap.Point(this.center[0], this.center[1]);
// //
map.centerAndZoom(center, 12); map.centerAndZoom(center, 13);
// //
map.setMapStyleV2({ map.setMapStyleV2({
@ -559,23 +560,37 @@ export default {
// //
marker.addEventListener('click', () => { marker.addEventListener('click', () => {
clearInterval(this.play) clearInterval(this.play)
this.box.close() //
if(this.box != null){
this.box.close()
}
// this.box.close()
this.flag = false this.flag = false
let box = this.box = this.setInfoBox(this.map, marker, item) let box = this.box = this.setInfoBox(this.map, marker, item)
setTimeout(() => { // setTimeout(() => {
box.close() // box.close()
this.playInfobox() // this.playInfobox()
}, 9999) // }, 9999)
}) })
// marker.addEventListener('mouseout', () => {
// //
// if(this.box != null){
// this.box.close()
// }
// })
}) })
}, },
closeBox(){
if(this.box != null){
this.box.close()
}
},
// //
setInfoBox(map, marker, item) { setInfoBox(map, marker, item) {
let htmlStr = ` let htmlStr = `
<div style="height: 100%; position: relative;"> <div style="height: 100%; position: relative;">
<div style="position: absolute; left: 14px; top: 33px; z-index: -1; background: hsla(200, 88%, 33%, .6); box-shadow: 0 0 16px hsl(200, 88%, 33%); width: 336px; height: 135px;"></div> <div style="position: absolute; left: 14px; top: 33px; z-index: -1; background: hsla(200, 88%, 33%, .6); box-shadow: 0 0 16px hsl(200, 88%, 33%); width: 336px; height: 135px;"></div>
<div style="background: url('`+borderpng+`') center center; width: 100%; height: 100%; color: #effaff; font-size: 18px; text-shadow: 2px 2px 4px #17263C; display: flex;"> <div οnclick="closeBox" style="background: url('`+borderpng+`') center center; width: 100%; height: 100%; color: #effaff; font-size: 18px; text-shadow: 2px 2px 4px #17263C; display: flex;">
<div style="flex: 1; padding: 66px 0 0 20px;"> <div style="flex: 1; padding: 66px 0 0 20px;">
<div style="height: 30px; white-space: nowrap; word-wrap: ellipsis; overflow: hidden;">站点: ${item.stnm}</div> <div style="height: 30px; white-space: nowrap; word-wrap: ellipsis; overflow: hidden;">站点: ${item.stnm}</div>
<div style="height: 30px;">水位: ${item.value}m</div> <div style="height: 30px;">水位: ${item.value}m</div>

4
src/views/login.vue

@ -72,8 +72,8 @@ export default {
return { return {
codeUrl: "", codeUrl: "",
loginForm: { loginForm: {
username: "admin", username: "",
password: "admin123", password: "",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "" uuid: ""

Loading…
Cancel
Save