소스 검색

1、绵阳师院-新增内容

zjz 2 년 전
부모
커밋
b857980a68

+ 3 - 2
src/api/DMA/zoningManage.js

@@ -468,11 +468,12 @@ export function getLeakageAnalysisView(params) {
 /**
  * @description 统计分析 - 漏损率指标分析
  */
-export function getLeakageRate(params) {
+export function getLeakageRate(params, file) {
   return request({
     url: '/gis/customDisplay/getLeakageRate',
     method: 'get',
-    params
+    params,
+    responseType: file ? 'blob' : 'json'
   })
 }
 

+ 3 - 2
src/api/scadaApi.js

@@ -131,11 +131,12 @@ export function updateAlarmManageList(data) {
     data
   })
 }
-export function reportFormCensus(params) {
+export function reportFormCensus(params, file) {
   return request({
     url: '/gis/customDisplay/reportFormCensus',
     method: 'get',
-    params
+    params,
+    responseType: file ? 'blob' : 'json'
   })
 }
 

+ 1 - 3
src/components/MinMap/index.vue

@@ -291,9 +291,7 @@ export default {
           dataType: 'text',
           success: (data) => {
             count++
-            data = that.$x2js.xml2js(data)
-            Object.assign(i, data)
-            console.log(i, 'path')
+           
             if (count === that.userInfo.length) {
               that.$emit('showUser', this.userInfo)
             }

+ 89 - 0
src/layout/components/Header/index.vue

@@ -6,6 +6,15 @@
         <span class="title_text">{{ sysTitle }}</span>
       </div>
       <div class="right-menu">
+        <div class="btn_box">
+          <i class="el-icon-bell bell-info" title="消息提示" @click="notificationDialog = true">
+            <span v-show="notificationNum !== 0" class="bell-dot">{{ notificationNum > 100 ? '99+' : notificationNum }}</span>
+            <el-dialog v-if="notificationDialog" :visible.sync="notificationDialog" title="消息" append-to-body>
+              <notification @close-notification="handleCloseNotification" @reget-noti="handleMarked" />
+            </el-dialog>
+            <video ref="videoMsg" src="../../../assets/images/home/msg.mp3" style="display:none;" />
+          </i>
+        </div>
         <el-dropdown class="avatar-container" trigger="click">
           <div class="avatar-wrapper">
             <div>
@@ -150,7 +159,37 @@ export default {
       return this.$store.state.routeSetting.dynamicRoutes.sysSetting && this.$store.state.routeSetting.dynamicRoutes.sysSetting.some(item => item.children.some(child => child.name === 'userinfoEdit')) || false
     }
   },
+  mounted() {
+    this.getNotificationNum()
+    this.timer = window.setInterval(() => {
+      setTimeout(() => {
+        this.getNotificationNum()
+      }, 0)
+    }, notificationInterval)
+  },
+  destroyed() {
+    window.clearInterval(this.timer)
+  },
   methods: {
+     // 轮询消息推送
+     getNotificationNum() {
+      getNotifications({ flag: '0' }).then(res => {
+        this.notificationNum = res.result.total
+
+        // 判断消息条数,播放消息语音
+        if (this.notificationNum > 0) {
+          this.speckVideo()
+        }
+      })
+    },
+    // 消息界面跳转到对应处理的位置后 关闭弹窗
+    handleCloseNotification() {
+      this.notificationDialog = false
+    },
+    // 消息界面标记已读后 刷新条数
+    handleMarked() {
+      this.getNotificationNum()
+    },
     // 退出登录
     async logout() {
       await this.$store.dispatch('user/logout')
@@ -202,6 +241,17 @@ export default {
           this.dialogPassword = true
         }
       })
+    },
+
+     /**
+     * @description 消息播放
+     */
+     speckVideo() {
+      this.$nextTick(() => {
+        const _videoMsg = this.$refs.videoMsg
+        if(_videoMsg)
+          _videoMsg.play()
+      })
     }
   }
 }
@@ -237,6 +287,45 @@ export default {
       outline: none;
     }
 
+    .btn_box {
+      float: left;
+      display: flex;
+      align-items: center;
+      >i {
+        color: #fff;
+        font-size: 20px;
+        cursor: pointer;
+        // &:nth-of-type(2){
+        //   padding: 0 10px;
+        // }
+        &:nth-of-type(odd){
+          padding: 0 10px;
+        }
+      }
+      .bell-info {
+        position: relative;
+        .bell-dot {
+          width: 26px;
+          height: 26px;
+          color: #ffffff;
+          background: red;
+          border-radius: 50%;
+          position: absolute;
+          // top: -14px;
+          // right: -14px;
+          top: -16px;
+          right: -5px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          font-size: 12px;
+          font-weight: bolder;
+          overflow: hidden;
+          transform: scale(.8);
+        }
+      }
+    }
+
     .avatar-container {
       cursor: pointer;
       .avatar-wrapper {

+ 2 - 2
src/utils/request.js

@@ -6,8 +6,8 @@ import qs from 'qs'
 import router from '@/router'
 
 // 创建axios实例
-export const IP = 'http://221.182.8.141:10060'
-export const NewIp = 'http://221.182.8.141:10060'
+export const IP = 'http://10.11.3.54:10060/'
+export const NewIp = 'http://10.11.3.54:10060/'
 const service = axios.create({
   baseURL: IP,
   withCredentials: true, // 跨域请求时发送cookiesokies

+ 3 - 2
src/views/components/olMap/mapConfig.js

@@ -38,13 +38,14 @@ export const mapConfig = {
     geoservers:[
         {
             name:'管网分布',
-            url: "http://221.182.8.141:1080/geoserver/mysw/wms?service=WMS&version=1.1.0&request=GetMap&layers=mysw:mysw&styles=&bbox=104.58889709700009,31.450546764000023,104.60423371100009,31.45976521700006&width=768&height=461&srs=EPSG:4490&format=application/openlayers",
+            // url: "http://221.182.8.141:1080/geoserver/mysw/wms?service=WMS&version=1.1.0&request=GetMap&layers=mysw:mysw&styles=&bbox=104.58889709700009,31.450546764000023,104.60423371100009,31.45976521700006&width=768&height=461&srs=EPSG:4490&format=application/openlayers",
+            url: "http://10.11.3.54:1080/geoserver/mysw/wms?service=WMS&version=1.1.0&request=GetMap&layers=mysw:mysw&bbox=104.58889709700009,31.450546764000023,104.60423371100009,31.45976521700006&width=768&height=461&srs=EPSG:4490&styles=&format=application/openlayers",
             layers: 'mysw',
             visible:true,
             type: "layer",
             serverType: "geoserver",
             queryParam:{
-                url: "http://221.182.8.141:1080/geoserver/mysw/wms",
+                url: "http://10.11.3.54:1080/geoserver/mysw/wms",
                 srsName: 'EPSG:4326',   //坐标系统  'EPSG:4326'
                 featureNS: 'mysw',  //命名空间 URI 
                 featurePrefix: "mysw",  //工作区名称

+ 4 - 4
src/views/currentSystem/regionalMetering/DMAHomePage/components/dmadata/flowrankingchart.vue

@@ -83,11 +83,11 @@ export default {
                 monitoringValue = datas[i].value 
               }
               res += datas[i].seriesName + ':' 
-                  + datas[i].value + ' m³/s <br/>'
+                  + datas[i].value + ' m³/h <br/>'
             }
 
             if(monitoringValue > standardValue){
-              res += "差异值:"+ that.accSub(monitoringValue , standardValue)+"  m³/s"
+              res += "差异值:"+ that.accSub(monitoringValue , standardValue)+"  m³/h"
             }
             
             return res
@@ -155,7 +155,7 @@ export default {
             type: 'bar',
             barWidth: "15",
             label: {
-              formatter:'{c} m³',
+              formatter:'{c} m³/h',
               color: '#333333',
               show: true,
               position: 'right',
@@ -168,7 +168,7 @@ export default {
             type: 'bar',
             barWidth: "15",
             label: {
-              formatter:'{c} m³',
+              formatter:'{c} m³/h',
               color: '#333333',
               show: true,
               position: 'right',

+ 40 - 15
src/views/currentSystem/regionalMetering/DMAHomePage/index.vue

@@ -18,7 +18,7 @@
           </div>
         </div>
         <div class="boxorder">
-          <water-ranking-chart :chartdata="sumsupplywaterChart" ></water-ranking-chart>
+          <water-ranking-table :chartdata="sumsupplywaterTable" ></water-ranking-table>
         </div>
       </div>
       <div class="onecenter">
@@ -101,6 +101,7 @@ import olMap from "@/views/components/olMap/index.vue";
 import SupplyWaterChart from './components/dmadata/supplywaterchart'
 import MinNightFlowChart from './components/dmadata/minnightflowchart'
 import WaterRankingChart from './components/dmadata/waterrankingchart'
+import WaterRankingTable from './components/dmadata/waterrankingtable'
 import FlowRankingChart from './components/dmadata/flowrankingchart'
 import TableItem from "@/components/TableAuto";
 import comMixins from '@/views/mixins/comMixins'
@@ -110,7 +111,7 @@ import { getDmaLevel, getMonthReportForm, exportReportForm } from '@/api/DMA/zon
 import { minStroomMeterSets, threeSituations } from '@/api/DMA/productionSellDiff'
 
 export default {
-  components: { SupplyWaterChart , MinNightFlowChart , WaterRankingChart , FlowRankingChart ,olMap , TableItem },
+  components: { SupplyWaterChart , MinNightFlowChart , WaterRankingChart , FlowRankingChart ,olMap , TableItem  , WaterRankingTable},
   mixins: [comMixins],
   data() {
     return {
@@ -134,6 +135,15 @@ export default {
           seriesAry1:[],
         }
       },
+      sumsupplywaterTable:{
+        title:'当月及昨日供水量排行榜',
+        yAxisTitle:'单位:m³',
+        unit:'m³',
+        type:'bar',
+        data:{
+          dataAry:[],
+        }
+      },
 
       supplywaterChart:{
         title:'累计供水量统计',
@@ -174,7 +184,7 @@ export default {
       
       flowWaterChart:{
         title:'昨日夜间最小流量监测排行榜',
-        yAxisTitle:'单位:m³/s',
+        yAxisTitle:'单位:m³/h',
         unit:'m³',
         type:'bar',
         data:{
@@ -306,16 +316,31 @@ export default {
           const _result = res.result
           if(_result.mapList.length>0){
             that.deviceIdAry = []
-            that.sumsupplywaterChart.data.dataAry = []
-            that.sumsupplywaterChart.data.seriesAry1 = []
+            that.sumsupplywaterTable.data.dataAry = []
             _result.mapList.forEach((item,index)=>{
               that.deviceIdAry.push(item.id);
-              that.sumsupplywaterChart.data.dataAry.push(item.siteName)
-              that.sumsupplywaterChart.data.seriesAry1.push(item.flow)
+              that.sumsupplywaterTable.data.dataAry.push({
+                siteId: item.id,
+                siteName: item.siteName,
+                indexCode: item.indexCode,
+                monthFlow: item.flow,
+                monthRate: item.rate,
+                dayFlow: '',
+                dayRate: ''
+              })
+            })
+          }
+          if(_result.dayMapList.length>0){
+            that.sumsupplywaterTable.data.dataAry.map(item=>{
+              const filterAry = _result.dayMapList.filter((dayItem)=>{
+                return dayItem.indexCode == item.indexCode
+              })
+
+              if(filterAry.length>0){
+                item.dayFlow = filterAry[0].flow
+                item.dayRate = filterAry[0].rate
+              }
             })
-
-            that.sumsupplywaterChart.data.dataAry = that.sumsupplywaterChart.data.dataAry.reverse()
-            that.sumsupplywaterChart.data.seriesAry1 = that.sumsupplywaterChart.data.seriesAry1.reverse()
           }
         }else{
           console.log("getWaterSupplyRanking:"+res.Message)
@@ -390,10 +415,10 @@ export default {
                   if(_dimension == "0"){     
                     //站点
                     that.supplywaterChart.data.dataAry.push(itemMap.month)
-                    that.supplywaterChart.data.seriesAry1.push(itemMap.waterSupply)
+                    that.supplywaterChart.data.seriesAry1.push(itemMap.waterSupply || '0')
                   }
                   if(_dimension == "1"){
-                    that.supplywaterChart.data.seriesAry2.push(itemMap.waterSupply)
+                    that.supplywaterChart.data.seriesAry2.push(itemMap.waterSupply || '0')
                   }
                 })
               }
@@ -596,7 +621,7 @@ export default {
     // border: 1px red solid;
 
     .oneleft{
-      width: 20%;
+      width: 22%;
       height: 100%;
       // background: #FFFFFF;
       border-radius: 6px;
@@ -666,7 +691,7 @@ export default {
     }
 
     .onecenter{
-      width: 59%;
+      width: 55%;
       height: 100%;
       background: #FFFFFF;
       border-radius: 6px;
@@ -676,7 +701,7 @@ export default {
     }
 
     .oneright{
-      width: 20%;
+      width: 22%;
       height: 100%;
       // background: #FFFFFF;
       border-radius: 6px;

+ 46 - 5
src/views/currentSystem/regionalMetering/statisticalReport/minuteWaterReport.vue

@@ -17,7 +17,10 @@
           size="small" :value-format="hourFormData"
           placeholder="选择结束时间"  style="width:140px">
         </el-time-picker>
-
+        <span class="spanjg">所属区域:</span>
+        <el-select v-model="querySearch.areaId" size="small" placeholder="请选择所属区域" clearable  @change="areaChange" style="width:100px;" >
+          <el-option v-for="item in areaList" :key="item.ccode" :label="item.cname" :value="item.ccode" />
+        </el-select>
         <span class="spanjg">设备名称:</span>
         <el-select
           v-model="querySearch.deviceId"
@@ -34,6 +37,10 @@
             :value="item.code"
           />
         </el-select>
+        <span class="spanjg">步长:</span>
+        <el-select v-model="querySearch.dataGroup" size="small" placeholder="请选择步长" style="width:100px;" >
+          <el-option v-for="item in stepList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
 
         <el-button
           class="spanjg"
@@ -109,6 +116,7 @@
 <script>
 import TableItem from '@/components/TableAuto'
 import comMixins from '@/views/mixins/comMixins'
+import { getSysCommonCode } from "@/api/dataCenter";
 import { getWaterTimeTotal, getWaterTimeFlowDetail } from '@/api/DMA/workbench'
 import { queryDevice, queryAlarmManageList } from "@/api/shiYuan/scada";
 import { getDmaLevel, getYearReportForm, exportReportForm } from '@/api/DMA/zoningManage'
@@ -212,10 +220,18 @@ export default {
         endDate: undefined,
         startHour: undefined,
         endHour: undefined,
+        areaId:'',      //区域编码
         deviceId:[],
-        code: ''
+        dataGroup:'5',    //步长
+        code: '',
       },
+      areaList:[],    //所属区域
       deviceList: [], // 设备列表
+      stepList:[    //步长
+        { id: "5", name: "5分钟" },
+        { id: "30", name: "30分钟" },
+        { id: "60", name: "60分钟" },
+      ],
       detailTable: [], // table表格数据
       activeName: 'first',
       tempDeviceCode: '',   //临时数据
@@ -228,6 +244,7 @@ export default {
   },
   created() {
     this.initDate()
+    this.getComonCodeArea()
     this.reportQuery()
   },
   mounted() {
@@ -255,6 +272,16 @@ export default {
       this.querySearch.endHour = this.getCurrentDay()+" 23:59:59"
     },
 
+    /**
+     * @description 所属区域
+     */
+    getComonCodeArea(){
+      //所属区域
+      getSysCommonCode({ pCid: "54000" }).then(res => {
+        this.areaList = res.result[0].codeList;
+      });
+    },
+
     handleClick(tab, event) {
       const that = this
       console.log(tab, event);
@@ -266,6 +293,13 @@ export default {
     },
 
     /* --------------------- 界面操作 ----------------*/
+    /**
+     * @description 所属区域变更
+     */
+    areaChange(){
+      this.getDeviceList()
+    },
+
     /**
      * @description 清除页面相关数据 => Map、表单数据
      */
@@ -308,12 +342,14 @@ export default {
      * @description 设备档案
      */
      getDeviceList(){
-      queryDevice({ size: 10000 }).then(res => {
+      var that = this
+      that.deviceList = []
+      queryDevice({ size: 10000 , areaId: that.querySearch.areaId }).then(res => {
         if (res.code !== 1) {
           this.$message.error("获取设备信息出错!");
           return false;
         }
-        this.deviceList = res.result.records;
+        that.deviceList = res.result.records;
         console.log(this.deviceList, "12131");
       });
     },
@@ -328,6 +364,7 @@ export default {
         endDate:'',
         startTime:'',
         endTime:'',
+        areaId: that.querySearch.areaId,
         code:'',
       }
       if (that.querySearch.startDate != '' && that.querySearch.endDate != '') {
@@ -373,6 +410,8 @@ export default {
         endDate:'',
         startTime:'',
         endTime:'',
+        areaId: that.querySearch.areaId,
+        dataGroup: that.querySearch.dataGroup,
         code:'',
       }
       if (that.querySearch.startDate != '' && that.querySearch.endDate != '') {
@@ -436,7 +475,7 @@ export default {
                 type: 'line',
                 symbolSize: 10,
                 symbol: 'rect',
-                stack: 'Total',
+                // stack: 'Total',
                 smooth: true
               }
               item.flowDetailVoList.forEach((itemDetail,indexDetail)=>{
@@ -475,6 +514,8 @@ export default {
         endDate:'',
         startTime:'',
         endTime:'',
+        areaId: that.querySearch.areaId,
+        dataGroup: that.querySearch.dataGroup,
         code:'',
       }
       if (that.querySearch.startDate != '' && that.querySearch.endDate != '') {

BIN
src/views/login/images/pipe.png


+ 11 - 7
src/views/shiYuan/configManage/deviceManage/WaterDetail.vue

@@ -8,15 +8,14 @@
             <el-input v-model="reportForm.name" :disabled="isLook" placeholder="请输入设备名称" size="small" />
           </div>
         </div>
-        <!-- <div class="flexDiv">
-            <span class="flexTitle">所属类型:</span>
+        <div class="flexDiv">
+            <span class="flexTitle">所属区域:</span>
             <div class="flexInfo">
-              <el-select v-model="reportForm.type" size="small" placeholder="" style="width:100%" :disabled="isLook">
-                <el-option key="1" label="水厂" value="1" />
-                <el-option key="2" label="管网" value="2" />
+              <el-select v-model="reportForm.areaId" size="small" placeholder="请选择所属区域" style="width:100%" :disabled="isLook" >
+                <el-option v-for="item in areaList" :key="item.ccode" :label="item.cname" :value="item.ccode" />
               </el-select>
             </div>
-          </div> -->
+          </div>
         <div class="flexDiv">
           <span class="flexTitle">规格型号:</span>
           <div class="flexInfo">
@@ -32,7 +31,7 @@
         <div class="flexDiv">
           <span class="flexTitle">设备类型:</span>
           <div class="flexInfo">
-            <el-select v-model="reportForm.deviceType" size="small" placeholder="" style="width:100%" :disabled="isLook">
+            <el-select v-model="reportForm.deviceType" size="small" placeholder="请选择所属设备类型" style="width:100%" :disabled="isLook">
               <el-option v-for="item in deviceType" :key="item.ccode" :label="item.cname" :value="item.ccode" />
             </el-select>
           </div>
@@ -140,6 +139,7 @@ export default {
         { id: "1", name: "水厂" },
         { id: "2", name: "管网" }
       ],
+      areaList:[],    //所属区域
       deviceType: [], // 管网设备类型
       waterList: [], // 水厂列表
       userList: [],
@@ -164,6 +164,10 @@ export default {
     getSysCommonCode({ pCid: "53400" }).then(res => {
       this.deviceType = res.result[0].codeList;
     });
+    //所属区域
+    getSysCommonCode({ pCid: "54000" }).then(res => {
+      this.areaList = res.result[0].codeList;
+    });
     queryWaterWorks({}).then(res => {
       if (res.code !== 1) {
         this.$message.error("获取水厂信息出错!");

+ 11 - 0
src/views/shiYuan/configManage/deviceManage/widget.vue

@@ -167,6 +167,13 @@ export default {
           align: "center",
           sortable: true,
         },
+        {
+          label: "所属区域",
+          prop: "areaName",
+          align: "center",
+          width: 120,
+          sortable: true,
+        },
         {
           label: "设备类型",
           prop: "deviceTypeName",
@@ -178,6 +185,7 @@ export default {
           label: "设备编号",
           prop: "code",
           align: "center",
+          width: 120,
           sortable: true,
         },
         {
@@ -190,6 +198,7 @@ export default {
           label: "制造日期",
           prop: "makeDate",
           align: "center",
+          width: 140,
           sortable: true,
         },
         {
@@ -210,6 +219,7 @@ export default {
           label: "状态",
           prop: "statusName",
           align: "center",
+          width: 80,
           sortable: true,
         },
         // {
@@ -242,6 +252,7 @@ export default {
       reportForm: {
         code: undefined,
         describe: undefined,
+        areaId:'',  //所属区域
         deviceType: "",
         latitude: "",
         leader: undefined,

+ 87 - 52
src/views/shiYuan/monitoringCenter/dayilyReport/widget.vue

@@ -2,27 +2,9 @@
   <div id="planDayilyReport" class="planDayilyReport">
     <div class="filteroption">
       <div>
-        <!-- <span class="spanjg">类型:</span>
-        <el-select
-          v-model="categoryName"
-          clearable
-          filterable
-          style="display: inline-block; margin-left: 5px; width: 140px;"
-          size="small"
-          placeholder="请选择类型"
-          @clear="selectClear"
-          @change="selectChange"
-        >
-          <el-option key="1" label="水厂" value="1" />
-          <el-option key="2" label="管网" value="2" />
-        </el-select>
-        &nbsp;&nbsp; -->
         <span class="spanjg">设备类型:</span>
-        <!-- <el-select ref="site" v-model="deviceType" style="display: inline-block; margin-right: 5px" size="small" placeholder="请选择" @change="bindTsNameChange">
-          <el-option v-for="item in isSeletcSite" :key="item.id" :label="item.name" :value="item.id" />
-        </el-select> -->
         <el-select
-            v-model="deviceType"  @change="bindTsNameChange"
+            v-model="querySearch.deviceType"  @change="bindTsNameChange"
             size="small"
             clearable
             placeholder="请选择设备类型"
@@ -31,7 +13,7 @@
             <el-option v-for="item in isSeletcSite" :key="item.ccode" :label="item.cname" :value="item.ccode" />
         </el-select>
         <span class="spanjg">指标类型:</span>
-        <el-select v-model="type" style="display: inline-block; margin-right: 5px" size="small" placeholder="请选择" @change="bindTstTypeChange">
+        <el-select v-model="querySearch.type" style="display: inline-block; margin-right: 5px" size="small" placeholder="请选择" @change="bindTstTypeChange">
           <el-option v-for="item in types" :key="item.type" :label="item.typeName" :value="item.type" />
         </el-select>
         <!-- <span class="spanjg">指标名称:</span>
@@ -39,11 +21,18 @@
           <el-option v-for="item in indexNames" :key="item.id" :label="item.displayName" :value="item.id" />
         </el-select> -->
         <span class="spanjg" style="margin-left:8px;">日期:</span>
-        <el-date-picker v-model="monthTime" size="small" type="month" placeholder="请选择日期" value-format="yyyy-MM-dd" style="width:140px" />
-        <el-button size="small" type="primary" @click="getDailyReportData">查询</el-button>
+        <el-date-picker v-model="querySearch.startDate" size="small" :type="pickerdate.type" placeholder="请选择开始日期" :picker-options="startOptions" :value-format="pickerdate.format" style="width:140px" />
+        <span> ~</span>
+        <el-date-picker v-model="querySearch.endDate" size="small" :type="pickerdate.type" placeholder="请选择结束日期" :picker-options="endOptions" :value-format="pickerdate.format" style="width:140px" />
+        <el-button size="small" type="primary" @click="getDailyReportData()">查询</el-button>
       </div>
       <div>
-        <export-btn table-id="planDayilyReportTable" />
+        <!-- <export-btn table-id="planDayilyReportTable" /> -->
+        <el-button
+          size="small"
+          type="primary"
+          @click="getDailyReportData(1)"
+        >导出</el-button>
       </div>
     </div>
     <div class="statistics" style="height:calc(100% - 40px)">
@@ -70,31 +59,36 @@
 </template>
 <script>
 import TableItem from '@/components/TableAuto'
-import ExportBtn from '../../components/ExportBtn.vue'
+
 import { reportFormCensus, queryDevice, queryIndexConfiguration } from '@/api/scadaApi'
 import { getSysCommonCode } from '@/api/dataCenter'
 
+import comMixins from '@/views/mixins/comMixins'
+
 export default {
   name: 'ScadaDailyReport',
   components: {
-    TableItem, ExportBtn
+    TableItem
   },
+  mixins: [comMixins],
   props: ['data'],
   data() {
     return {
-      startTime: '',
-      endTime: '',
+      pickerdate: {
+        type: 'date',
+        format: 'yyyy-MM-dd'
+      },
       startOptions: {
         disabledDate: time => {
-          if (this.endTime) {
-            return time.getTime() >= new Date(this.endTime)
+          if (this.querySearch.endDate) {
+            return time.getTime() >= new Date(this.querySearch.endDate)
           }
         }
       },
       endOptions: {
         disabledDate: time => {
-          if (this.startTime) {
-            return new Date(this.startTime) - 1000 * 60 * 60 * 24 > time.getTime()
+          if (this.querySearch.startDate) {
+            return new Date(this.querySearch.startDate) - 1000 * 60 * 60 * 24 > time.getTime()
           }
         }
       },
@@ -115,7 +109,7 @@ export default {
         },
         {
           label: '采集值',
-          prop: 'ave',
+          prop: 'max',
           align: 'center',
           sortable: true
         },
@@ -133,18 +127,28 @@ export default {
         }
       ],
       categoryName: '1',
-      deviceType: '',
+      
       isSeletcSite: [],
-      type: '',
+      
       types: [],
       indexName: [],
       indexNames: [],
       monthTime: '',
-      pageInfo: { current: 1, size: 20, tableTotal: 0 } // 分页数据
+      pageInfo: { current: 1, size: 20, tableTotal: 0 }, // 分页数据
+
+      querySearch: { // 查询参数
+        startDate: '',
+        endDate: '',
+        deviceType: '',
+        type: '1',
+      }
     }
   },
   watch: {
   },
+  created() {
+    this.initDate()
+  },
   mounted: function() {
     const data = this.getTimeSplit()
     this.startTime = data.now
@@ -154,15 +158,33 @@ export default {
     
   },
   methods: {
+    /**
+     * @description 初始化时间
+     */
+     initDate(){
+      this.querySearch.startDate = this.getDiffDay(1)  //this.getCurrentFirstDay()
+      this.querySearch.endDate = this.getDiffDay(1)
+    },
+
     // 获取巡查日报信息
-    getDailyReportData() {
+    getDailyReportData(isexport) {
+      if (this.strIsNull(this.querySearch.startDate) || 
+        this.strIsNull(this.querySearch.endDate))
+      {
+        this.$message.error('请选择开始日期和结束日期')
+        return
+      }
+
       const data = {
         type: this.categoryName,
-        deviceType: this.deviceType,
-        censusDate: this.monthTime,
+        deviceType: this.querySearch.deviceType,
+        startTime: this.querySearch.startDate+" 00:00:00",
+        endTime: this.querySearch.endDate+" 23:59:59",
         censusDateType: '3', // 按天查询
-        indexId: this.indexName.toString()
+        indexTypes: this.querySearch.type   //指标类型
+        //indexId: this.indexName.toString()
       }
+      
       if(data.deviceType == ""){
         this.$message({
             type: "error",
@@ -170,15 +192,28 @@ export default {
           });
         return;
       }
-
-      Object.assign(data, this.pageInfo)
-      reportFormCensus(data).then(res => {
-        if (res.code == 1) {
-          this.dataList = res.result.records.reverse()
-          this.pageInfo.tableTotal = res.result.total
-        }
-        console.log(res)
-      })
+     
+      if(!this.strIsNull(isexport)){
+        Object.assign(data, {export:isexport+""})
+        reportFormCensus(data,data.export).then((res) => {
+          console.log(res)
+          const blob = URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }))
+          const a = document.createElement('a')
+          a.href = blob
+          a.download = '监测日报.xlsx'
+          a.click()
+        })
+      }else{
+        Object.assign(data, this.pageInfo)
+        reportFormCensus(data).then(res => {
+          if (res.code == 1) {
+            this.dataList = res.result.records.reverse()
+            this.pageInfo.tableTotal = res.result.total
+          }
+          console.log(res)
+        })
+      }
+      
     },
     // 获取当前时间
     getTimeSplit() {
@@ -210,7 +245,7 @@ export default {
       this.types = []
       this.indexNames = []
       this.targetIndex = {}
-      this.deviceType = ''
+      this.querySearch.deviceType = ''
       this.type = ''
       this.indexName = []
       this.dataList = []
@@ -224,7 +259,7 @@ export default {
       getSysCommonCode({ pCid: '53400' }).then(res => {
         this.isSeletcSite = res.result[0].codeList
         if(this.isSeletcSite.length>0){
-          this.deviceType = this.isSeletcSite[0].ccode
+          this.querySearch.deviceType = this.isSeletcSite[0].ccode
           this.bindTsNameChange()
           this.getDailyReportData()
         }
@@ -232,7 +267,7 @@ export default {
     },
 
     queryIndexType() {
-      // deviceId: this.deviceType, 
+      // deviceId: this.querySearch.deviceType, 
       queryIndexConfiguration({ size: 10000 }).then(res => {
         const arr = this.process(res.result.records)
         this.types = arr
@@ -241,7 +276,7 @@ export default {
     },
     queryIndexConfiguration() {
       const that = this
-      // deviceId: this.deviceType, 
+      // deviceId: this.querySearch.deviceType, 
       that.indexName = []
       queryIndexConfiguration({ type: this.type, size: 10000 }).then(res => {
         that.indexNames = res.result.records

+ 4 - 2
src/views/shiYuan/monitoringCenter/scadaMonitor/widget.vue

@@ -69,7 +69,7 @@
       stripe
       style="width: 100%"
     >
-      <el-table-column label="序号" align="center" width="50px">
+      <el-table-column label="序号" align="center" width="48px">
         <template slot-scope="scope">
           {{ scope.$index + 1 }}
         </template>
@@ -83,17 +83,19 @@
       <el-table-column
         prop="BVOL"
         label="电池电压"
+        width="78"
         align="center"
         show-overflow-tooltip
       />
       <el-table-column
         prop="ZHZL"
         label="信号质量"
+        width="78"
         align="center"
         show-overflow-tooltip
       />
       
-      <el-table-column fixed="right" label="操作" width="120" align="center">
+      <el-table-column fixed="right" label="操作" width="80" align="center">
         <template slot-scope="scope">
           <el-button type="text" size="small" @click="goto(scope.row, true)">
             <img

+ 4 - 1
src/views/shiYuan/statisticalAnalysis/leakageRate/widget.vue

@@ -99,7 +99,10 @@ export default {
           label: '漏损量(m³)',
           prop: 'billingWaterVolume',
           align: 'center',
-          sortable: true
+          sortable: true,
+          formatter: (row, col, cellValue, index) => {
+           return '0'
+          }
         },
         
         {

+ 73 - 16
src/views/shiYuan/statisticalAnalysis/waterSupplyReport/widget.vue

@@ -3,7 +3,11 @@
   <div id="waterSupplyReport" class="waterSupplyReport">
     <div class="filteroption">
       <div style="display: flex; align-items: center">
-        <span>日期:</span>
+        <span>类型:</span>
+        <el-select v-model="querySearch.totalType" size="small" placeholder="请选择类型"  @change="totalChange"  style="width:160px;" >
+          <el-option v-for="item in reportTypeList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+        <span class="spanjg">日期:</span>
         <el-date-picker v-model="querySearch.startDate" size="small" :type="pickerdate.type" placeholder="请选择开始时间" :picker-options="startOptions" :value-format="pickerdate.format" style="width:140px" />
         <span> ~</span>
         <el-date-picker v-model="querySearch.endDate" size="small" :type="pickerdate.type" placeholder="请选择结束时间" :picker-options="endOptions" :value-format="pickerdate.format" style="width:140px" />
@@ -14,6 +18,13 @@
           @click="reportQuery()"
         >查询</el-button>
       </div>
+      <div>
+        <el-button
+          size="small"
+          type="primary"
+          @click="reportQuery(1)"
+        >导出</el-button>
+      </div>
     </div>
     <div class="tableheight">
       <table-item
@@ -66,7 +77,7 @@ export default {
           }
         }
       },
-      pageInfo: { current: 1, size: 10, tableTotal: 0 }, // 分页数据
+      pageInfo: { current: 1, size: 20, tableTotal: 0 }, // 分页数据
       column: [
         {
           label: '日期',
@@ -111,12 +122,19 @@ export default {
           sortable: true
         },
       ],
+      reportTypeList:[    //统计类型
+        { id: "0", name: "日列表" },
+        { id: "1", name: "日汇总" },
+        { id: "2", name: "月汇总" },
+      ],
       reportTable: [], // table表格数据
       chartData: [], // 图表数据
       userList: [], // 用户下拉
       querySearch: { // 查询参数
         startDate: '',
         endDate: '',
+        totalType: '0'     //0=日、1=日汇总、2=月汇总
+        
       }
     }
   },
@@ -140,20 +158,21 @@ export default {
     /**
      * @description 查询处漏效率指标分析
      */
-    reportQuery() {
+    reportQuery(isexport) {
       this.pageInfo.current = 1
-      this.getData()
+      this.getData(isexport)
     },
 
     /**
      *  @description 查询处漏效率指标分析
      */
-    getData() {
+    getData(isexport) {
       const that = this
       const query = that.pageInfo
       const params = {
-        startDate: that.querySearch.startDate,
-        endDate: that.querySearch.endDate,
+        startDate: that.querySearch.totalType=='2' ? that.getFirstDay(that.querySearch.startDate) : that.querySearch.startDate,
+        endDate: that.querySearch.totalType=='2' ? that.getLastDay(that.querySearch.endDate): that.querySearch.endDate,
+        totalType: that.querySearch.totalType
       }
       if (!((!params.startTime && !params.endTime) || (params.startTime && params.endTime))) {
         this.$message.info('时间段请选择完整!')
@@ -162,15 +181,35 @@ export default {
       Object.assign(query, params)
       console.log('查询参数:' + JSON.stringify(query))
 
-      that.reportTable = []
-      getLeakageRate(query).then((res) => {
-        if(res.code == "1"){
-          that.reportTable = res.result.records
-          that.pageInfo.tableTotal = res.result.total
-        }
-      }).catch((err) => {
-        console.log(err)
-      })
+      if(isexport){
+        Object.assign( params, {export:isexport+""})
+
+        getLeakageRate(params, params.export).then((res) => {
+          console.log(res)
+          const blob = URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }))
+          const a = document.createElement('a')
+          a.href = blob
+          let downName = "日列表供水量报表.xlsx"
+          if(params.totalType == '1')
+          {
+            downName = "日汇总供水量报表.xlsx"
+          }else if(params.totalType == '2'){
+            downName = "月汇总供水量报表.xlsx"
+          }
+          a.download = downName
+          a.click()
+        })
+      }else{
+        that.reportTable = []
+        getLeakageRate(query).then((res) => {
+          if(res.code == "1"){
+            that.reportTable = res.result.records
+            that.pageInfo.tableTotal = res.result.total
+          }
+        }).catch((err) => {
+          console.log(err)
+        })
+      }
     },
 
     /**
@@ -193,6 +232,24 @@ export default {
       this.pageInfo.size = pageSize
       // this.getData()
     },
+
+     /**
+     * @description 统计
+     */
+    totalChange(){
+      if(this.querySearch.totalType == "2"){
+        this.pickerdate = {
+          type: 'month',
+          format: 'yyyy-MM'
+        }
+      }else{
+        this.pickerdate = {
+          type: 'date',
+          format: 'yyyy-MM-dd'
+        }
+      }
+      
+    }
   }
 }
 </script>

+ 1 - 1
src/views/zhpt/index.vue

@@ -34,7 +34,7 @@
                 <el-dropdown-menu slot="dropdown">
                   <div
                     class="dropdown-container"
-                    style="width: 500px; height: 700px; padding: 10px"
+                    style="width: 410px; height: 700px; padding: 10px"
                   >
                     <online-monitor
                       @selectChange="selectChange"