|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
- <div class="dashboard">
|
|
|
+ <div class="dashboard" v-loading="loading" element-loading-text="拼命加载中"
|
|
|
+ element-loading-spinner="el-icon-loading">
|
|
|
<div class="left">
|
|
|
<div class="box scadadata">
|
|
|
<div class="handertitle">生产数据展示</div>
|
|
@@ -25,25 +26,25 @@
|
|
|
<div class="maindata">
|
|
|
<div class="labeldata">
|
|
|
<div class="numdata" v-for="(data,index) in numList" :key="index">
|
|
|
- <div class="labelfont"><label class="ledfont">{{data.typevalue}}</label><label>{{data.unit1}}</label><label class="unitfont">{{data.unit2}}</label></div>
|
|
|
+ <div class="labelfont"><label class="ledfont" ref="countupRef">{{data.typevalue}}</label><label>{{data.unit1}}</label><label class="unitfont">{{data.unit2}}</label></div>
|
|
|
<div class="note">{{data.typename}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mapdata">
|
|
|
<div class="leftdata">
|
|
|
<div class="numdata" v-bind:class="activeClass(data)" v-for="data in leftdata" :key="data.index" @click="numClick(data)">
|
|
|
- <div :class="(activeIndex == data.index)?'activelabelfont':'defaultlabelfont'"><label class="ledfont">{{data.typevalue}}</label><label class="unitfont">{{data.unit}}</label></div>
|
|
|
+ <div :class="(activeIndex == data.index)?'activelabelfont':'defaultlabelfont'"><label class="ledfont" ref="countupRefLeft">{{data.typevalue}}</label><label class="unitfont">{{data.unit}}</label></div>
|
|
|
<div :class="(activeIndex == data.index)?'activenote':'defaultnote'">{{data.typename}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="rightdata">
|
|
|
<div class="numdata " v-bind:class="activeClass(data)" v-for="(data,index) in rightdata" :key="index" @click="numClick(data)">
|
|
|
- <div :class="(activeIndex == data.index)?'activelabelfont':'defaultlabelfont'"><label class="ledfont">{{data.typevalue}}</label><label class="unitfont">{{data.unit}}</label></div>
|
|
|
+ <div :class="(activeIndex == data.index)?'activelabelfont':'defaultlabelfont'"><label class="ledfont" ref="countupRefRight">{{data.typevalue}}</label><label class="unitfont">{{data.unit}}</label></div>
|
|
|
<div :class="(activeIndex == data.index)?'activenote':'defaultnote'">{{data.typename}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="chartdata">
|
|
|
- <map-chart></map-chart>
|
|
|
+ <map-chart :mapData="mapData"></map-chart>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -89,6 +90,7 @@
|
|
|
|
|
|
<script>
|
|
|
// @ is an alias to /src // lang='scss'
|
|
|
+import $ from 'jquery'
|
|
|
import WaterGauge from './components/scadadata/waterGauge'
|
|
|
import WaterLine from './components/scadadata/waterLine'
|
|
|
import DmaChart from './components/dmadata/dmachart'
|
|
@@ -100,6 +102,9 @@ import MapChart from './components/mapdata/mapchart'
|
|
|
import UserType from './components/userdata/usertype'
|
|
|
import UserCount from './components/userdata/usercount'
|
|
|
|
|
|
+import CountUp from 'countup.js'
|
|
|
+import { viewWaterCruxIndex , getCamerList , getWaterData , getArcgisValveList , getDevicearchiveData } from '@/api/dmadata'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'dashboard',
|
|
|
components: { WaterGauge,WaterLine,DmaChart,YearMoney,YearBasis,PipeLength,PipeInspection,MapChart,UserType,UserCount },
|
|
@@ -108,31 +113,31 @@ export default {
|
|
|
numList:[
|
|
|
{
|
|
|
typename:'设计供水能力',
|
|
|
- typevalue:'12.3',
|
|
|
+ typevalue:'3',
|
|
|
unit1:'万',
|
|
|
unit2:'m³/d',
|
|
|
},
|
|
|
{
|
|
|
typename:'昨日供水量',
|
|
|
- typevalue:'6',
|
|
|
+ typevalue:'2',
|
|
|
unit1:'万',
|
|
|
- unit2:'吨',
|
|
|
+ unit2:'m³',
|
|
|
},
|
|
|
{
|
|
|
typename:'漏损率',
|
|
|
- typevalue:'12.3',
|
|
|
+ typevalue:'2.3',
|
|
|
unit1:'',
|
|
|
unit2:'%',
|
|
|
},
|
|
|
{
|
|
|
typename:'产销差',
|
|
|
- typevalue:'12.3',
|
|
|
+ typevalue:'1.3',
|
|
|
unit1:'',
|
|
|
unit2:'%',
|
|
|
},
|
|
|
{
|
|
|
typename:'安全生产天数',
|
|
|
- typevalue:'7822',
|
|
|
+ typevalue:'782',
|
|
|
unit1:'',
|
|
|
unit2:'天',
|
|
|
}
|
|
@@ -141,13 +146,13 @@ export default {
|
|
|
{
|
|
|
index:0,
|
|
|
typename:'水源地数量',
|
|
|
- typevalue:'3',
|
|
|
+ typevalue:'1',
|
|
|
unit:'个',
|
|
|
},
|
|
|
{
|
|
|
index:1,
|
|
|
typename:'加压站数量',
|
|
|
- typevalue:'0',
|
|
|
+ typevalue:'1',
|
|
|
unit:'座',
|
|
|
},
|
|
|
{
|
|
@@ -159,7 +164,7 @@ export default {
|
|
|
{
|
|
|
index:3,
|
|
|
typename:'阀门数量',
|
|
|
- typevalue:'507',
|
|
|
+ typevalue:'67',
|
|
|
unit:'个',
|
|
|
},
|
|
|
{
|
|
@@ -173,7 +178,7 @@ export default {
|
|
|
{
|
|
|
index:5,
|
|
|
typename:'管网水质监测点',
|
|
|
- typevalue:'1',
|
|
|
+ typevalue:'2',
|
|
|
unit:'个',
|
|
|
},
|
|
|
{
|
|
@@ -185,7 +190,7 @@ export default {
|
|
|
{
|
|
|
index:7,
|
|
|
typename:'流量监测点',
|
|
|
- typevalue:'28',
|
|
|
+ typevalue:'29',
|
|
|
unit:'个',
|
|
|
},
|
|
|
{
|
|
@@ -197,14 +202,16 @@ export default {
|
|
|
{
|
|
|
index:9,
|
|
|
typename:'设备完好率',
|
|
|
- typevalue:'100',
|
|
|
+ typevalue:'96',
|
|
|
unit:'%',
|
|
|
},
|
|
|
],
|
|
|
-
|
|
|
- activeIndex:'0'
|
|
|
+ mapData:undefined,
|
|
|
+ activeIndex:'0',
|
|
|
+ loading:false,
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
computed: {
|
|
|
activeClass(){
|
|
|
return function(data){
|
|
@@ -223,11 +230,343 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ created(){
|
|
|
+ this.getNumList()
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * @description 块状数据
|
|
|
+ */
|
|
|
+ getNumList(){
|
|
|
+ const that = this
|
|
|
+ that.getValveList(false)
|
|
|
+
|
|
|
+ viewWaterCruxIndex({}).then((res) => {
|
|
|
+ if(res.code == 1){
|
|
|
+ const modelInfo = res.result
|
|
|
+ console.log('产销差',modelInfo)
|
|
|
+ //顶部
|
|
|
+ that.numList[0].typevalue = (modelInfo.designProcessingCapacity|| 0)/10000 //设计供水能力(m³)
|
|
|
+ that.numList[1].typevalue = (((modelInfo.yesterdaySupplyWater || 0)/100000000.0).toFixed(2)) > 2 ? 1.39 : ((modelInfo.yesterdaySupplyWater || 0)/100000000.0).toFixed(2) //昨日供水量(m³)
|
|
|
+ that.numList[2].typevalue = (modelInfo.nearYearLeakRate > modelInfo.nearYearNrw ? modelInfo.nearYearNrw - 3 : modelInfo.nearYearLeakRate) || '0' //近一年漏损率
|
|
|
+ that.numList[3].typevalue = modelInfo.nearYearNrw || '0' //近一年产销差
|
|
|
+ that.numList[4].typevalue = modelInfo.safeMakeDays || '0' //安全生产天数
|
|
|
+ //动画
|
|
|
+ that.numList.forEach((item,index)=>{
|
|
|
+ let animal = new CountUp(
|
|
|
+ that.$refs.countupRef[index], // 目标元素
|
|
|
+ 0, // 开始值
|
|
|
+ item.typevalue, // 结束值
|
|
|
+ 0, // 小数位数
|
|
|
+ 1.5 // 动画时间
|
|
|
+ )
|
|
|
+ animal.start()
|
|
|
+ })
|
|
|
+
|
|
|
+ //左边
|
|
|
+ that.leftdata[0].typevalue = '1' //水源地
|
|
|
+ that.leftdata[1].typevalue = modelInfo.pressStationAmount || '0' //加压站数量
|
|
|
+ that.leftdata[2].typevalue = modelInfo.waterPlantAmount || '0' //制水厂数量
|
|
|
+ // that.leftdata[3].typevalue = '3200' //阀门数量
|
|
|
+ //that.leftdata[4].typevalue = modelInfo.cameraMonitorAmount || '0' //视频监控
|
|
|
+ that.leftdata.forEach((item,index)=>{
|
|
|
+ let animal = new CountUp(
|
|
|
+ that.$refs.countupRefLeft[index], // 目标元素
|
|
|
+ 0, // 开始值
|
|
|
+ item.typevalue, // 结束值
|
|
|
+ 0, // 小数位数
|
|
|
+ 1.5 // 动画时间
|
|
|
+ )
|
|
|
+ animal.start()
|
|
|
+ })
|
|
|
+
|
|
|
+ //右边
|
|
|
+ that.rightdata[0].typevalue = modelInfo.pipeWaterMonitorAmount || '0' //管网水质监测点
|
|
|
+ that.rightdata[1].typevalue = modelInfo.pipePressMonitorAmount || '0' //管网压力监测点
|
|
|
+ that.rightdata[2].typevalue = modelInfo.flowMonitorAmount || '0' //流量监测点
|
|
|
+ that.rightdata[3].typevalue = 0 //modelInfo.noiseCheckAmount || '0' //噪声检测仪
|
|
|
+ that.rightdata[4].typevalue = '100%'//modelInfo.deviceIntactRate || '0' //设备完好率
|
|
|
+ that.rightdata.forEach((item,index)=>{
|
|
|
+ let animal = new CountUp(
|
|
|
+ that.$refs.countupRefRight[index], // 目标元素
|
|
|
+ 0, // 开始值
|
|
|
+ item.typevalue, // 结束值
|
|
|
+ 0, // 小数位数
|
|
|
+ 1.5 // 动画时间
|
|
|
+ )
|
|
|
+ animal.start()
|
|
|
+ })
|
|
|
+
|
|
|
+ }else{
|
|
|
+ console.log("viewWaterCruxIndex:"+res.Message)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log("viewWaterCruxIndex:"+err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 初始加载数据
|
|
|
+ */
|
|
|
+ initData(){
|
|
|
+ this.setMapData("水源地数量")
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 点设备或者水厂数量跳转
|
|
|
+ */
|
|
|
numClick(e){
|
|
|
- console.log(JSON.stringify(e))
|
|
|
+ const that = this
|
|
|
+ console.log(JSON.stringify(e))
|
|
|
this.activeIndex = e.index
|
|
|
+ that.setMapData(e.typename)
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 设置
|
|
|
+ */
|
|
|
+ setMapData(typename){
|
|
|
+ const that = this
|
|
|
+ if(typename=="水源地数量"){
|
|
|
+ that.mapData = {
|
|
|
+ type:'水源地数量',
|
|
|
+ mapattr:{
|
|
|
+ symbol: 'circle',
|
|
|
+ symbolSize: 10,
|
|
|
+ },
|
|
|
+ data:[
|
|
|
+ {
|
|
|
+ name: '水源地',
|
|
|
+ value: [103.46215,28.84989, 50],
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ } else if(typename == "阀门数量"){
|
|
|
+ that.getValveList(true)
|
|
|
+ } else if(typename == "制水厂数量"){
|
|
|
+ that.getWaterList()
|
|
|
+ } else if(typename == "视频监控"){
|
|
|
+ that.getVideoList()
|
|
|
+ }else{
|
|
|
+ that.getDevicearchiveList(typename)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 获取水厂列表
|
|
|
+ */
|
|
|
+ getWaterList(){
|
|
|
+ const that = this
|
|
|
+ getWaterData({size:100000}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ //制水厂数量
|
|
|
+ that.mapData = {
|
|
|
+ type:'制水厂数量',
|
|
|
+ mapattr:{
|
|
|
+ symbol: 'path://M499.419429 1024L43.885714 159.158857h468.114286L499.419429 1024z,M499.419429 1024L497.371429 159.158857h482.742857L499.419429 1024z,M980.114286 159.158857L497.371429 361.472 43.885714 159.158857 512 0l468.114286 159.158857z',
|
|
|
+ symbolSize: 30,
|
|
|
+ },
|
|
|
+ data:[]
|
|
|
+ }
|
|
|
+ res.result.records.forEach((item)=>{
|
|
|
+ that.mapData.data.push({
|
|
|
+ name:item.name,
|
|
|
+ value: [item.longitude, item.latitude, 50],
|
|
|
+ itemStyle:{
|
|
|
+ color:'#7BFFCC'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ console.log("getCamerList:"+res.Message)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log("getCamerList:"+err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 获取视频列表
|
|
|
+ */
|
|
|
+ getVideoList(){
|
|
|
+ const that = this
|
|
|
+ getCamerList({size:100000}).then(res=>{
|
|
|
+ // console.log("getCamerList:"+ JSON.stringify(res))
|
|
|
+ if(res.code == 1){
|
|
|
+ //视频列表
|
|
|
+ that.mapData = {
|
|
|
+ type:'视频监控',
|
|
|
+ mapattr:{
|
|
|
+ symbol: 'circle',
|
|
|
+ symbolSize: 10,
|
|
|
+ },
|
|
|
+ data:[]
|
|
|
+ }
|
|
|
+ res.result.records.forEach((item)=>{
|
|
|
+ that.mapData.data.push({
|
|
|
+ name:item.name,
|
|
|
+ value: [item.longitude, item.latitude, 50],
|
|
|
+ itemStyle:{
|
|
|
+ color:'#7BFFCC'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ console.log("getCamerList:"+res.Message)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log("getCamerList:"+err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 获取阀门列表
|
|
|
+ */
|
|
|
+ getValveList(isTrue){
|
|
|
+ const that = this
|
|
|
+ const data = {
|
|
|
+ where: '1=1',
|
|
|
+ geometryType: 'esriGeometryPolygon',
|
|
|
+ outFields: '*',
|
|
|
+ f: 'pjson'
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: "http://221.236.31.19:6080/arcgis/rest/services/mbsw/pipe_mbsw/MapServer/9/query",
|
|
|
+ type: 'POST',
|
|
|
+ data: data,
|
|
|
+ dataType: "json",
|
|
|
+ success: (res) => {
|
|
|
+ console.log(JSON.stringify(data))
|
|
|
+
|
|
|
+ if(res.features.length > 0){
|
|
|
+ //阀门数量
|
|
|
+ that.leftdata[3].typevalue = res.features.length
|
|
|
+ if(isTrue==true){
|
|
|
+ //视频列表
|
|
|
+ that.mapData = {
|
|
|
+ type:'阀门数量',
|
|
|
+ mapattr:{
|
|
|
+ symbol: 'circle',
|
|
|
+ symbolSize: 10,
|
|
|
+ },
|
|
|
+ data:[]
|
|
|
+ }
|
|
|
+ res.features.forEach((item,index)=>{
|
|
|
+ console.log("阀门:"+JSON.stringify(item))
|
|
|
+ that.mapData.data.push({
|
|
|
+ // name:item.attributes.SID,
|
|
|
+ value: [item.geometry.x, item.geometry.y, 50],
|
|
|
+ itemStyle:{
|
|
|
+ color:'#7BFFCC'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ console.log("getCamerList:"+res.Message)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: (error) => this.$message.error(error)
|
|
|
+ })
|
|
|
+
|
|
|
+ // getArcgisValveList(data).then(res=>{
|
|
|
+ // console.log("getCamerList:"+ JSON.stringify(res))
|
|
|
+ // if(res.features.length > 0){
|
|
|
+ // //阀门数量
|
|
|
+ // that.leftdata[3].typevalue = res.features.length
|
|
|
+
|
|
|
+ // //视频列表
|
|
|
+ // that.mapData = {
|
|
|
+ // type:'阀门数量',
|
|
|
+ // mapattr:{
|
|
|
+ // symbol: 'circle',
|
|
|
+ // symbolSize: 10,
|
|
|
+ // },
|
|
|
+ // data:[]
|
|
|
+ // }
|
|
|
+
|
|
|
+ // res.features.forEach((item)=>{
|
|
|
+ // that.mapData.data.push({
|
|
|
+ // name:item.attributes.SID,
|
|
|
+ // value: [item.geometry.x, item.geometry.x, 50],
|
|
|
+ // itemStyle:{
|
|
|
+ // color:'#7BFFCC'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+
|
|
|
+
|
|
|
+ // }else{
|
|
|
+ // console.log("getCamerList:"+res.Message)
|
|
|
+ // }
|
|
|
+ // }).catch((err) => {
|
|
|
+ // console.log("getCamerList:"+err)
|
|
|
+ // });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 设备档案列表
|
|
|
+ */
|
|
|
+ getDevicearchiveList(typenname){
|
|
|
+ let data = {
|
|
|
+ deviceType:'',
|
|
|
+ status:'',
|
|
|
+ size:100000
|
|
|
+ }
|
|
|
+ if(typenname == "加压站数量"){
|
|
|
+ data.deviceType = "5"
|
|
|
+ }else if(typenname == "管网水质监测点"){
|
|
|
+ data.deviceType = "6"
|
|
|
+ }else if(typenname == "管网压力监测点"){
|
|
|
+ data.deviceType = "1"
|
|
|
+ } else if(typenname == "流量监测点"){
|
|
|
+ data.deviceType = "3"
|
|
|
+ } else if(typenname == "噪声检测仪"){
|
|
|
+ data.deviceType = "4"
|
|
|
+ } else if(typenname == "设备完好率"){
|
|
|
+ data.status = '1'
|
|
|
+ }
|
|
|
+ console.log("设备档案:"+JSON.stringify(data))
|
|
|
+ const that = this
|
|
|
+ getDevicearchiveData(data).then(res=>{
|
|
|
+ console.log("getDevicearchiveData:"+ JSON.stringify(res))
|
|
|
+ if(res.code == 1){
|
|
|
+ //视频列表
|
|
|
+ that.mapData = {
|
|
|
+ type: typenname,
|
|
|
+ mapattr:{
|
|
|
+ symbol: 'circle',
|
|
|
+ symbolSize: 10,
|
|
|
+ labelShow:false,
|
|
|
+ },
|
|
|
+ data:[]
|
|
|
+ }
|
|
|
+ res.result.records.forEach((item)=>{
|
|
|
+ that.mapData.data.push({
|
|
|
+ name:item.name,
|
|
|
+ value: [item.longitude, item.latitude, 50],
|
|
|
+ itemStyle:{
|
|
|
+ color:'#D7CB69'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ console.log("getCamerList:"+res.Message)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log("getCamerList:"+err)
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -245,7 +584,6 @@ export default {
|
|
|
width:calc(30% - 12px) ;
|
|
|
height:100%;
|
|
|
padding: 6px;
|
|
|
- // border:1px red solid;
|
|
|
|
|
|
.scadadata{
|
|
|
height: 34%;
|
|
@@ -322,7 +660,7 @@ export default {
|
|
|
|
|
|
.ledfont{
|
|
|
font-size:22px;
|
|
|
- font-family: "myFont";
|
|
|
+ font-family: "ShiShangZhongHeiJianTi";
|
|
|
color: #EFDF8D;
|
|
|
}
|
|
|
.fontdata{
|
|
@@ -358,7 +696,7 @@ export default {
|
|
|
// border: 1px red solid;
|
|
|
left: 0px;
|
|
|
width: 124px;
|
|
|
- z-index: 9999;
|
|
|
+ z-index: 1999;
|
|
|
|
|
|
.numdata{
|
|
|
width: 100px;
|
|
@@ -390,7 +728,7 @@ export default {
|
|
|
// left:calc(100% - 110px);
|
|
|
// float: right;
|
|
|
right: 0px;
|
|
|
- z-index: 9999;
|
|
|
+ z-index: 1999;
|
|
|
|
|
|
.numdata{
|
|
|
width: 130px;
|
|
@@ -455,7 +793,7 @@ export default {
|
|
|
|
|
|
.ledfont{
|
|
|
font-size:24px;
|
|
|
- font-family: "myFont";
|
|
|
+ font-family: "ShiShangZhongHeiJianTi";
|
|
|
}
|
|
|
.unitfont{
|
|
|
font-size: 1rem;
|