|
|
@@ -2,7 +2,7 @@
|
|
|
<div class="water-station-popup-container" v-if="visible">
|
|
|
<div class="water-station-popup-title">
|
|
|
<span class="title-text">水文监测点</span>
|
|
|
- <img src="@/assets/image/common/close.png" style="cursor: pointer" alt="" @click="visible = false" />
|
|
|
+ <img src="@/assets/image/common/close.png" style="cursor: pointer" alt="" @click="closeModal" />
|
|
|
</div>
|
|
|
<div class="water-station-popup-content">
|
|
|
<el-radio-group v-model="typeVal" size="mini">
|
|
|
@@ -10,67 +10,93 @@
|
|
|
<el-radio-button label="2">周边监控查询</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
<div class="monitoring-info-container" v-if="typeVal === '1'">
|
|
|
- <div class="info-panel">
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="8" class="label-col">
|
|
|
- <div class="label">实时高程:</div>
|
|
|
- <div class="value"><span>{{swInfo.realTimeElevation}}</span><span>m</span></div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" class="label-col">
|
|
|
- <div class="label">1小时雨量:</div>
|
|
|
- <div class="value"><span>{{swInfo.precipitationOneH}}</span><span>mm</span></div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" class="label-col">
|
|
|
- <div class="label">实时流量:</div>
|
|
|
- <div class="value"><span>{{swInfo.realTimeDischarge}}</span><span>m³/s</span></div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="8" class="label-col">
|
|
|
- <div class="label">昨日最高:</div>
|
|
|
- <div class="value"><span>{{swInfo.maxElevationYesterday}}</span><span>m</span></div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" class="label-col">
|
|
|
- <div class="label">当天雨量:</div>
|
|
|
- <div class="value"><span>{{swInfo.precipitationToday}}</span><span>mm</span></div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" class="label-col">
|
|
|
- <div class="label">实时流速:</div>
|
|
|
- <div class="value"><span>{{swInfo.realTimeVelocity}}</span><span>m³/s</span></div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="info-chart">
|
|
|
- <LineChart style="height: 2.05rem" :options="swOption" />
|
|
|
- </div>
|
|
|
+ <template v-if="swInfo.realTimeElevation">
|
|
|
+ <div class="info-panel">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="8" class="label-col">
|
|
|
+ <div class="label">实时高程:</div>
|
|
|
+ <div class="value">
|
|
|
+ <span>{{ swInfo.realTimeElevation }}</span
|
|
|
+ ><span>m</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="label-col">
|
|
|
+ <div class="label">1小时雨量:</div>
|
|
|
+ <div class="value">
|
|
|
+ <span>{{ swInfo.precipitationOneH }}</span
|
|
|
+ ><span>mm</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="label-col">
|
|
|
+ <div class="label">实时流量:</div>
|
|
|
+ <div class="value">
|
|
|
+ <span>{{ swInfo.realTimeDischarge }}</span
|
|
|
+ ><span>m³/s</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="8" class="label-col">
|
|
|
+ <div class="label">昨日最高:</div>
|
|
|
+ <div class="value">
|
|
|
+ <span>{{ swInfo.maxElevationYesterday }}</span
|
|
|
+ ><span>m</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="label-col">
|
|
|
+ <div class="label">当天雨量:</div>
|
|
|
+ <div class="value">
|
|
|
+ <span>{{ swInfo.precipitationToday }}</span
|
|
|
+ ><span>mm</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="label-col">
|
|
|
+ <div class="label">实时流速:</div>
|
|
|
+ <div class="value">
|
|
|
+ <span>{{ swInfo.realTimeVelocity }}</span
|
|
|
+ ><span>m³/s</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="info-chart">
|
|
|
+ <LineChart style="height: 2.05rem" :options="swOption" v-if="chartShow"/>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template>
|
|
|
+ <div class="noData">
|
|
|
+ <img src="@/assets/image/comprehensive/noData.png" alt="" />
|
|
|
+ <div class="txt">暂无实时监测信息</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<div class="monitor-container" v-else>
|
|
|
<div class="monitor-search">
|
|
|
<span>查询半径</span>
|
|
|
<div class="input-bg">
|
|
|
- <el-input v-model="radius" size="mini" placeholder="输入半径"></el-input>
|
|
|
+ <el-input v-model="radius" size="mini" type="number" min="0" placeholder="输入半径"></el-input>
|
|
|
</div>
|
|
|
<span> km </span>
|
|
|
<el-button type="primary" size="mini" @click="search">查询</el-button>
|
|
|
</div>
|
|
|
- <template v-if="monitorList.length > 0">
|
|
|
- <div class="monitor-list">
|
|
|
+ <div class="monitor-list">
|
|
|
+ <template v-if="monitorList.length > 0">
|
|
|
<ul>
|
|
|
- <li v-for="(item, index) in monitorList" :key="index" :class="{active:activeIndex == index}">
|
|
|
- <span @click="toLoadVideo(item,index)">{{item.name}}</span>
|
|
|
+ <li v-for="(item, index) in monitorList" :key="index" :class="{ active: activeIndex == index }">
|
|
|
+ <span @click="toLoadVideo(item, index)">{{ item.name }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<div class="monitor-video">
|
|
|
- <Artplayer :option="videoOption" :style="style" v-if="artShow"/>
|
|
|
+ <Artplayer :option="videoOption" :style="style" v-if="artShow" />
|
|
|
</div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div class="noData">
|
|
|
+ <img src="@/assets/image/comprehensive/noData.png" alt="" />
|
|
|
+ <div class="txt">暂无摄像头</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <div class="noData">
|
|
|
- <img src="@/assets/image/comprehensive/noData.png" alt="" />
|
|
|
- <div class="txt">暂无摄像头</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -87,14 +113,15 @@ import moment from 'moment'
|
|
|
let graphicsLayer = null
|
|
|
export default {
|
|
|
name: 'WaterStationPopup',
|
|
|
- components: { LineChart,Artplayer },
|
|
|
+ components: { LineChart, Artplayer },
|
|
|
data() {
|
|
|
return {
|
|
|
style: {
|
|
|
width: '480px',
|
|
|
height: '270px'
|
|
|
},
|
|
|
- artShow:false,
|
|
|
+ chartShow:false,
|
|
|
+ artShow: false,
|
|
|
videoOption: {
|
|
|
url: '',
|
|
|
isLive: true, //使用直播模式,会隐藏进度条和播放时间
|
|
|
@@ -118,60 +145,20 @@ export default {
|
|
|
visible: false,
|
|
|
typeVal: '1',
|
|
|
radius: '',
|
|
|
- activeIndex:0,
|
|
|
+ activeIndex: 0,
|
|
|
monitorList: [],
|
|
|
stationGraphic: {},
|
|
|
- swOption: {
|
|
|
- backgroundColor: 'transparent',
|
|
|
- color: ['#66DC95'],
|
|
|
- grid: {
|
|
|
- left: 16,
|
|
|
- right: 16,
|
|
|
- top: 30,
|
|
|
- bottom: 0,
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- textStyle: { color: '#fff' },
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- axisPointer: { type: 'none' },
|
|
|
- textStyle: { color: '#fff' },
|
|
|
- extraCssText: 'background:#2F5481; border-radius: 8px;border:none ',
|
|
|
- formatter: (params) => {
|
|
|
- return `${params[0].axisValue} 高程${params[0].data}m`
|
|
|
- }
|
|
|
- },
|
|
|
- xAxis: [{ type: 'category', boundaryGap: false, data: ['08/20', '08/21', '08/22', '08/23', '08/24', '08/25'] }],
|
|
|
- yAxis: [{ type: 'value', name: '高程(m)', splitLine: { show: false }, min: 380, max: 420 }],
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: '高程(m)',
|
|
|
- type: 'line',
|
|
|
- smooth: true,
|
|
|
- symbol: 'emptyCircle',
|
|
|
- symbolSize: 6,
|
|
|
- lineStyle: { width: 2 },
|
|
|
- emphasis: { scale: 1.5 },
|
|
|
- areaStyle: {
|
|
|
- opacity: 0.8,
|
|
|
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- { offset: 1, color: 'rgba(102,220,149,0)' },
|
|
|
- { offset: 0, color: ' rgba(102,220,149,0.25)' }
|
|
|
- ])
|
|
|
- },
|
|
|
- data: [401, 398, 391, 410, 395, 400, 396]
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
+ swOption: {},
|
|
|
swInfo: {}
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$globalEventBus.$on('clickWaterStation', (data) => {
|
|
|
- if(data.layer.id == '2-2'){
|
|
|
+ this.chartShow = false
|
|
|
+ if (data.layer.id == '2-2') {
|
|
|
this.getMonitoringStatistics(19)
|
|
|
- }else{
|
|
|
- this.getMonitoringStatistics(18)
|
|
|
+ } else {
|
|
|
+ this.getMonitoringStatistics(18)
|
|
|
}
|
|
|
this.stationGraphic = data.graphic
|
|
|
})
|
|
|
@@ -191,9 +178,10 @@ export default {
|
|
|
},
|
|
|
getMonitoringStatistics(id) {
|
|
|
getMonitoringStatistics({ stationId: id }).then((res) => {
|
|
|
+ this.visible = true
|
|
|
+ this.chartShow = true
|
|
|
if (res.data) {
|
|
|
- this.visible = true
|
|
|
- this.swInfo = res.data.info
|
|
|
+ this.swInfo = res.data.info
|
|
|
const option = {
|
|
|
backgroundColor: 'transparent',
|
|
|
color: ['#66DC95'],
|
|
|
@@ -288,6 +276,9 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
this.swOption = option
|
|
|
+ }else{
|
|
|
+ this.swOption = {}
|
|
|
+ this.swInfo = {}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -308,38 +299,40 @@ export default {
|
|
|
'post'
|
|
|
)
|
|
|
.then((res) => {
|
|
|
- if(res.code == 200){
|
|
|
+ if (res.code == 200) {
|
|
|
this.monitorList = res.data
|
|
|
- if(res.data.length > 0){
|
|
|
- this.toLoadVideo(this.monitorList[0],0)
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ this.toLoadVideo(this.monitorList[0], 0)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- toLoadVideo(row,index){
|
|
|
+ toLoadVideo(row, index) {
|
|
|
this.activeIndex = index
|
|
|
this.artShow = false
|
|
|
- window
|
|
|
- .requestSDK(
|
|
|
- '/ttvideo/video/player/getVideoRealtimeUrl',
|
|
|
- {
|
|
|
- deviceCode: row.id,
|
|
|
- channelCode: row.channelCode,
|
|
|
- netType: '1',
|
|
|
- protocolType: 5,
|
|
|
- streamType: 1
|
|
|
- },
|
|
|
- {},
|
|
|
- 'post'
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
- if(res.code == 200){
|
|
|
- this.artShow = true
|
|
|
- this.$set(this.videoOption,'url',res.data.streamUrl)
|
|
|
- }else if(res.code == 4001){
|
|
|
- this.$message.warning('设备离线')
|
|
|
- }
|
|
|
- })
|
|
|
+ window
|
|
|
+ .requestSDK(
|
|
|
+ '/ttvideo/video/player/getVideoRealtimeUrl',
|
|
|
+ {
|
|
|
+ deviceCode: row.id,
|
|
|
+ channelCode: row.channelCode,
|
|
|
+ netType: '1',
|
|
|
+ protocolType: 5,
|
|
|
+ streamType: 1
|
|
|
+ },
|
|
|
+ {},
|
|
|
+ 'post'
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.artShow = true
|
|
|
+ this.$set(this.videoOption, 'url', res.data.streamUrl)
|
|
|
+ } else if (res.code == 4001) {
|
|
|
+ this.$message.warning('设备离线')
|
|
|
+ }else if(res.code == 400){
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
addCameraToMap() {
|
|
|
if (graphicsLayer) {
|
|
|
@@ -360,6 +353,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
graphicsLayer.addGraphic(graphic)
|
|
|
+ },
|
|
|
+ closeModal(){
|
|
|
+ this.visible = false
|
|
|
+ this.radius = ''
|
|
|
+ this.typeVal = '1'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -460,26 +458,26 @@ export default {
|
|
|
&:hover {
|
|
|
background-color: #498ee3;
|
|
|
}
|
|
|
- &.active{
|
|
|
+ &.active {
|
|
|
background-color: #498ee3;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .noData {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- text-align: center;
|
|
|
- img {
|
|
|
- margin-top: px-to-rem(70);
|
|
|
- margin-bottom: px-to-rem(20);
|
|
|
- }
|
|
|
- .txt {
|
|
|
- color: #fff;
|
|
|
- font-size: px-to-rem(14);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.noData {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ text-align: center;
|
|
|
+ img {
|
|
|
+ margin-top: px-to-rem(70);
|
|
|
+ margin-bottom: px-to-rem(20);
|
|
|
+ }
|
|
|
+ .txt {
|
|
|
+ color: #fff;
|
|
|
+ font-size: px-to-rem(14);
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|