@@ -336,7 +425,8 @@ export default {
singleEchartDialogShowFlag: false,
singleEchartData: null,
stationCode: '',
- urlimg: 'https://fxnsp.zgzhny.com/lh-api/sys/common/static/',
+ stationType:'',
+ urlimg: 'https://fxnsp.sxcooh.com/lh-api/sys/common/static/',
player: {},
timer: {},
interval: {},
@@ -346,7 +436,10 @@ export default {
DetailListAirData: '',
// DetailListSoilData: '',
DisplayList: '',
- DisplayListdetailList: '',
+ DisplayListdetailList0: '',
+ DisplayListdetailList1: '',
+ DisplayListdetailList2: '',
+ DisplayListdetailList3: '',
inforname: '',
dialogVisible: false,
fullscreen: false, //全屏
@@ -371,19 +464,7 @@ export default {
};
},
destroyed() {
- //离开页面是销毁
- Object.values(this.timer).map(item => {
- if(item){
- clearTimeout(item);
- }
- });
- Object.values(this.interval).map(item => {
- if(item){
- clearInterval(item);
- }
- });
- this.interval = {};
- this.timer = {};
+ this.doDestroyed();
},
created() {
this.stationCode = this.$route.query.stationCode
@@ -403,22 +484,51 @@ export default {
},
},
mounted() {
- this.initStart();
- this.stationInfoApi();
+ this.initStart()
},
methods: {
+ doDestroyed(){
+ //离开页面是销毁
+ Object.values(this.timer).map(item => {
+ if(item){
+ clearTimeout(item);
+ }
+ });
+ Object.values(this.interval).map(item => {
+ if(item){
+ clearInterval(item);
+ }
+ });
+ this.interval = {};
+ this.timer = {};
+ let that = this;
+ if(that.player){
+ Object.keys(that.player).forEach(key => {
+ if(that.player[key]){
+ console.log(that.player[key])
+ if(that.player[key].stop){that.player[key].stop();}
+ if(that.player[key].destroy){that.player[key].destroy();}
+ }
+ })
+ that.player = {};
+ }
+ },
initStart(){
this.loading = true;
// 实时时间
this.infor()
getStationDisplay(this.stationCode).then(val => {
this.DisplayList = val.result
- this.DisplayListdetailList = val.result.effect_assess[0].detailList[2]
+ this.DisplayListdetailList0 = val.result.effect_assess[0].detailList[0]
+ this.DisplayListdetailList1 = val.result.effect_assess[0].detailList[1]
+ this.DisplayListdetailList2 = val.result.effect_assess[0].detailList[2]
+ this.DisplayListdetailList3 = val.result.effect_assess[0].detailList[3]
})
this.initChartData();//下方echart监测图标
this.stationDetailApi();
this.getNowTime();
this.initMaintainLog();
+ this.stationInfoApi();
},
initMaintainLog(){//巡检日志
getMaintainLog({stationCode: this.stationCode, pageSize: 3}).then(res => {
@@ -441,38 +551,42 @@ export default {
if (res.code === 200) {
this.summryAllData = res.result;
let len = this.summryAllData.length;
- this.summryAllData.map((item1, index) => {
- if (index % 2 === 0 && item1['datas'] && (index + 1) < len) {
- let data1 = item1['datas'];
- let keys = Object.keys(data1);
- let data2 = this.summryAllData[index + 1]['datas'];
- let data3 = {}
- let item3 = JSON.parse(JSON.stringify(item1));
- if (data2) {
- keys.map(key => {
- if (data1[key] instanceof Array) {
- data3[key] = []
- data1[key].map((itemSub, index) => {
- data3[key].push((data2[key][index] - data1[key][index]).toFixed(2))
- })
- }
- })
- item3['datas'] = data3;
- this.riverList.push(item3);
- }
- }
- });
+ // this.summryAllData.map((item1, index) => {
+ // if (index % 2 === 0 && item1['datas'] && (index + 1) < len) {
+ // let data1 = item1['datas'];
+ // let keys = Object.keys(data1);
+ // let data2 = this.summryAllData[index + 1]['datas'];
+ // let data3 = {}
+ // let item3 = JSON.parse(JSON.stringify(item1));
+ // if (data2) {
+ // keys.map(key => {
+ // if (data1[key] instanceof Array) {
+ // data3[key] = []
+ // data1[key].map((itemSub, index) => {
+ // data3[key].push((data2[key][index] - data1[key][index]).toFixed(2))
+ // })
+ // }
+ // })
+ // item3['datas'] = data3;
+ // this.riverList.push(item3);
+ // }
+ // }
+ // });
this.initEchartDom(this.echartIndex)
}
})
},
// 折线图数据
- initEchartDom(index) {
+ initEchartDom(index, times) {
this.$nextTick(() => {
+ console.warn('初始化echarts')
let domKey = `myChartDiv0`;
let divDom = document.getElementById(domKey);
if (!divDom) {
- console.log('没找到dom:', domKey, divDom)
+ console.warn('没找到dom,两秒后重试:', domKey, divDom)
+ if(times!==2){
+ setTimeout(()=>{this.initEchartDom(index,2)}, 1500);
+ }
return;
}
if(this.echartObj){
@@ -480,7 +594,7 @@ export default {
}
this.echartObj = this.$echarts.init(divDom);
let data = this.summryAllData[index];
- console.log('开始初始化echart:' )
+ console.warn('开始初始化echart:' )
let dataObj = [];
let i = 0;
let colors = [
@@ -571,6 +685,8 @@ export default {
series: seriesData
};
this.echartObj.setOption(optionLine);
+
+ console.warn('初始化echarts结束')
})
},
zdinfor(){
@@ -644,6 +760,7 @@ export default {
}
getStationDetail(this.stationCode).then(res => {
this.stationDetail = res.result
+ this.stationType = res.result.stationType
this.DetailListAirData = res.result.latestAirData[0]
//空气数据
if (this.DetailListAirData) { }
@@ -704,12 +821,15 @@ export default {
that.timer[itm.deployCode] && clearTimeout(that.timer[itm.deployCode]);
if (that.player[itm.deployCode]) {
console.log('萤石云播放器播放成功自定义回调2', that.player[itm.deployCode])
- that.player[itm.deployCode].closeSound();
that.timer[itm.deployCode] = setTimeout(() => {
- that.player[itm.deployCode].closeSound();
+ if(that.player[itm.deployCode] && that.player[itm.deployCode].closeSound){
+ that.player[itm.deployCode].closeSound();
+ }
}, 2000)
that.timer[itm.deployCode] = setTimeout(() => {
- that.player[itm.deployCode].pause()
+ if(that.player[itm.deployCode] && that.player[itm.deployCode].pause){
+ that.player[itm.deployCode].pause()
+ }
}, 60000)
}
},
@@ -719,6 +839,7 @@ export default {
stationInfo().then(res => {
this.stationInfoList = res.result
if (this.stationInfoList) {
+ this.stationList = [];
res.result.map(item => {
this.stationList.push({
stationCode: item.stationCode,
@@ -729,7 +850,8 @@ export default {
})
},
switchStation(e){
- console.log(e);
+ console.log('切换站点');
+ this.doDestroyed();
// this.$router.push({path: '/MywrList', query: {stationCode: e.stationCode}})
this.initStart();
},
@@ -2431,5 +2553,95 @@ a:hover {
z-index: 2000;
width: 180px
}
+.xuqingchuli{
+ .in1con_lf_tit{
+ width: 100%;
+ height: 3vw;
+ text-align: center;
+ overflow: hidden;
+ position: relative;
+ }
+ .in1con_lf_titshow{
+ font-size: 1vw;
+ color: #fff;
+ text-shadow: 0px 2px 0px rgba(4,49,52,0.55);
+ display: block;
+ margin-top: 0.9vw;
+ font-family: douyuFont;
+ }
+
+ .qxfwzcl{
+ width: 100%;
+ margin-top: 1vw;
+ overflow: hidden;
+ }
+ .qxfwzcl_left{
+ width: 40%;
+ float: left;
+ }
+ .qxfwzcl_rit{
+ width: 60%;
+ float: right;
+ position: relative;
+ }
+ .qxfwzcl_left_tit{
+ width: 90%;
+ height: 1.4vw;
+ line-height: 1.4vw;
+ background: url(../../assets/image/qctit.png)no-repeat;
+ background-size: cover;
+ margin-left: 5%;
+ color:#e5eefa ;
+ padding-left: 0.6vw;
+ font-size: 0.7vw;
+ }
+ .qxfwzcl_left_num{
+ width: 100%;
+ display: block;
+ text-align: center;
+ font-size: 1.8vw;
+ color: #f1ff0d;
+ margin-top: 0.2vw;
+ margin-bottom: 1vw;
+ }
+ .in1con_lf_imglf_num_jix{
+ font-size: 1.5vw;
+ font-weight: 300;
+ font-family: HYChangLiSongKeBen;
+ letter-spacing:0.1vw
+ }
+
+ .qxfwzcl_rit_smt{
+ font-size: 0.7vw;
+ color: #fff;
+ position: absolute;
+ top: 8.4vw;
+ left: 25%;
+ z-index: 2;
+ }
+ .qxfwzcl_rit_num{
+ font-size: 2vw;
+ color: #f1ff0d;
+ position: absolute;
+ top:4.4vw;
+ left: 34%;
+ z-index: 2;
+ }
+ .png01_iSpt{
+ width: 150%;
+ position: absolute;
+ top: -3vw;
+ left: -34%;
+ z-index: 2;
+ }
+
+ .qcshuj{
+ width: 100%;
+ position: absolute;
+ top: -2vw;
+ left: 0;
+ z-index: 1;
+ }
+}
diff --git a/src/pages/weather/weather.vue b/src/pages/weather/weather.vue
index b5143a3..e2ff719 100644
--- a/src/pages/weather/weather.vue
+++ b/src/pages/weather/weather.vue
@@ -6,7 +6,7 @@
-
+