Преглед на файлове

1、报警类型增加通知人,2、漏控一张图,3、曲线

zjz преди 1 година
родител
ревизия
7e97845486

+ 7 - 0
src/components/TableAuto/index.vue

@@ -379,6 +379,13 @@ export default {
       }
     }
   },
+  updated() {
+    if (this.summary) {
+      this.$nextTick(() => {
+        this.$refs.multipleTable.doLayout()
+      })
+    }
+  },
   methods: {
     filterTag(value, row, column) {
       return row[column.property] === value

+ 17 - 12
src/views/currentSystem/regionalMetering/DMAHomePage/index.vue

@@ -113,12 +113,15 @@ export default {
       const myChart = this.$echarts.init(document.getElementById('yearPMA'))
       const myChart2 = this.$echarts.init(document.getElementById('yearSTA'))
       const myChart3 = this.$echarts.init(document.getElementById('monthSTA'))
-      const option_start_y = [0,0,0,0,0,0,0,0,0,0,0,0]; 
-      const option_center_y = [0,0,0,0,0,0,0,0,0,0,0,0]; 
-      const option_end_y = [0,0,0,0,0,0,0,0,0,0,0,0]; 
-      const option_start_y2 = [0,0,0,0,0,0,0,0,0,0,0,0]; 
-      const option_center_y2 = [0,0,0,0,0,0,0,0,0,0,0,0]; 
-      const option_end_y2 = [0,0,0,0,0,0,0,0,0,0,0,0]
+      const option_start_y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+      const option_center_y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+      const option_end_y = ['', '', '', '', '', '', '', '', '', '', '', '']
+      const option_start_y2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+      const option_center_y2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+      const option_end_y2 = ['', '', '', '', '', '', '', '', '', '', '', '']
+
+      debugger
+
       this.LeakNrwYear.map(item => {
         if (item.statisticalDate.split('-')[0] == this.startYear) {
           // option_start_y.push(item.leakageRate) // 漏损率
@@ -140,11 +143,11 @@ export default {
           option_end_y2[index] = item.poorProductionRate // 产销差
         }
       })
-      // option_start_y.reverse(); 
-      // option_start_y2.reverse(); 
-      // option_center_y.reverse(); 
-      // option_center_y2.reverse(); 
-      // option_end_y.reverse(); 
+      // option_start_y.reverse();
+      // option_start_y2.reverse();
+      // option_center_y.reverse();
+      // option_center_y2.reverse();
+      // option_end_y.reverse();
       // option_end_y2.reverse()
       const option = { // 产销差
         color: ['#F4AF47', '#2EC1EF', '#2D74E7'],
@@ -169,7 +172,9 @@ export default {
           formatter(params) {
             var reVal = ''
             for (const i in params) {
-              reVal += params[i].marker + params[i].seriesName + ':' + params[i].value + '%' + '<br/>'
+              if (params[i].value != '') {
+                reVal += params[i].marker + params[i].seriesName + ':' + params[i].value + '%' + '<br/>'
+              }
             }
             return reVal
           }

+ 2 - 2
src/views/currentSystem/regionalMetering/DMAManage/index.vue

@@ -939,8 +939,8 @@ export default {
       if (this.siteType == '上月漏损率') {
         const data = {
           dmaId: this.dmaId,
-          startTime: '2021-01-01 00:00:00', // this.timeYear + '-01-01 00:00:00',
-          endTime: '2021-12-31 00:00:00' // this.timeYear + '-12-31 00:00:00'
+          startTime: this.timeYear + '-01-01 00:00:00', // startTime: '2021-01-01 00:00:00', // this.timeYear + '-01-01 00:00:00',
+          endTime: this.timeYear + '-12-31 00:00:00' // endTime: '2021-12-31 00:00:00' // this.timeYear + '-12-31 00:00:00'
         }
         getWaterSupply(data).then(res => {
           this.loading = false

+ 3 - 1
src/views/currentSystem/regionalMetering/components/mapTool.vue

@@ -184,7 +184,8 @@ export default {
       },
       infoTemplate: {
         '上月漏损率': { value: 0, unit: '%', canClick: true },
-        '上月供水量': { value: 0, unit: '吨', canClick: true },
+        '上月供水量': { value: 0, unit: 'm³', canClick: true },
+        '上月售水量': { value: 0, unit: 'm³', canClick: false },
         '监测点数': { value: 0, unit: '个', canClick: false },
         '漏点数': { value: 0, unit: '个', canClick: false },
         '出口压力': { value: 0, unit: 'MPa', canClick: true },
@@ -410,6 +411,7 @@ export default {
         const dmaData = await getDmaData(sites[i].attributes.id)
         this.infoTemplate['上月漏损率'].value = dmaData.result.lastMonthLeakageRate
         this.infoTemplate['上月供水量'].value = dmaData.result.lastMonthWater
+        this.infoTemplate['上月售水量'].value = dmaData.result.lastMonthSalesWater
         this.infoTemplate['监测点数'].value = dmaData.result.monitorCount
         this.infoTemplate['漏点数'].value = dmaData.result.leakCount
         this.infoTemplate['出口压力'].value = dmaData.result.outPress

+ 1 - 1
src/views/currentSystem/regionalMetering/statisticalReport/monthlyStatement.vue

@@ -382,7 +382,7 @@ export default {
      */
     strIsNull(strVal) {
       strVal = strVal || ''
-      return typeof strVal == 'undefined' || strVal == null || strVal == ''
+      return typeof strVal === 'undefined' || strVal == null || strVal == ''
     },
 
     /**

+ 175 - 170
src/views/zhpt/scada/dayUseWater/widget.vue

@@ -1,183 +1,139 @@
 <template>
-  <div
-    v-way="wayFun('mainDiv')"
-    style="width: 100%; height: 100%; padding: 8px"
-  >
-    <el-row>
-      <el-form
-        ref="ruleForm"
-        :model="ruleForm"
-        :rules="rules"
-        style="
+  <div id="dayUseWater" class="dayUseWater">
+    <div class="filteroption">
+      <el-row>
+        <el-form
+          ref="ruleForm"
+          :model="ruleForm"
+          :rules="rules"
+          style="
           display: flex;
           flex-wrap: wrap;
           justify-content: flex-start;
           align-items: flex-start;
         "
-      >
-        <el-form-item
-          label="类型:"
-          style="width: 205px; display: inline-block; margin-bottom: 6px"
         >
-          <el-select
-            v-model="categoryName"
-            filterable
-            style="display: inline-block; width: 140px"
-            size="small"
-            placeholder="请选择类型"
-            @change="selectChange"
+          <el-form-item
+            label="类型:"
+            style="width: 205px; display: inline-block; margin-bottom: 6px"
           >
-            <el-option key="1" label="水厂" value="1" />
-            <el-option key="2" label="管网" value="2" />
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="设备名称:"
-          prop="site"
-          style="width: 360px; display: inline-block; margin-bottom: 6px"
-        >
-          <el-select
-            ref="site"
-            v-model="ruleForm.site"
-            style="display: inline-block; width: 240px"
-            size="small"
-            placeholder="请选择"
-            @change="bindTsNameChange"
+            <el-select
+              v-model="categoryName"
+              filterable
+              style="display: inline-block; width: 140px"
+              size="small"
+              placeholder="请选择类型"
+              @change="selectChange"
+            >
+              <el-option key="1" label="水厂" value="1" />
+              <el-option key="2" label="管网" value="2" />
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="设备名称:"
+            prop="site"
+            style="width: 360px; display: inline-block; margin-bottom: 6px"
           >
-            <el-option
-              v-for="item in isSeletcSite"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            />
-          </el-select>
-        </el-form-item>
+            <el-select
+              ref="site"
+              v-model="ruleForm.site"
+              style="display: inline-block; width: 240px"
+              size="small"
+              placeholder="请选择"
+              @change="bindTsNameChange"
+            >
+              <el-option
+                v-for="item in isSeletcSite"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              />
+            </el-select>
+          </el-form-item>
 
-        <el-form-item
-          label="指标名称:"
-          prop="type"
-          style="width: 240px; display: inline-block; margin-bottom: 6px"
-        >
-          <el-select
-            v-model="ruleForm.indexName"
-            collapse-tags
-            style="display: inline-block; width: 140px"
-            size="small"
-            placeholder="请选择"
-            disabled
+          <el-form-item
+            label="指标名称:"
+            prop="type"
+            style="width: 240px; display: inline-block; margin-bottom: 6px"
           >
-            <el-option
-              v-for="item in indexNames"
-              :key="item.variableCode"
-              :label="item.displayName"
-              :value="item.variableCode"
+            <el-select
+              v-model="ruleForm.indexName"
+              collapse-tags
+              style="display: inline-block; width: 140px"
+              size="small"
+              placeholder="请选择"
+              disabled
+            >
+              <el-option
+                v-for="item in indexNames"
+                :key="item.variableCode"
+                :label="item.displayName"
+                :value="item.variableCode"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="统计日期:"
+            prop="times"
+            style="display: inline-block; width: 440px; margin-bottom: 6px"
+          >
+            <el-date-picker
+              v-model="ruleForm.times"
+              size="small"
+              type="daterange"
+              align="right"
+              unlink-panels
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              format="yyyy-MM-dd"
+              value-format="yyyy-MM-dd"
             />
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="统计日期:"
-          prop="times"
-          style="display: inline-block; width: 440px; margin-bottom: 6px"
-        >
-          <el-date-picker
-            v-model="ruleForm.times"
-            size="small"
-            type="daterange"
-            align="right"
-            unlink-panels
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            format="yyyy-MM-dd"
-            value-format="yyyy-MM-dd"
-          />
-        </el-form-item>
-        <el-form-item
-          style="display: inline-block; width: 300px; margin-bottom: 6px"
-        >
-          <el-button
-            size="small"
-            type="primary"
-            @click="monitorHisToryQuery('ruleForm')"
-          >查询</el-button>
-          <el-button
-            size="small"
-            type="primary"
-            @click="statisticsScadaExport('ruleForm')"
-          >导出</el-button>
-        </el-form-item>
-      </el-form>
-    </el-row>
-    <div style="height: calc(100% - 35px)">
-      <el-table
-        id="siteMonitor"
-        v-loading="loading"
-        class="mapTable"
-        :data="dayUseWaterData"
-        :total="tableTotal"
-        :summary-method="getSummaries"
-        show-summary
-        border
-        style="width: 100%; height:calc(100% - 80px); margin-top: 20px"
-      >
-        <el-table-column type="index" align="center" width="50" label="序号" />
-        <el-table-column
-          prop="deviceName"
-          align="center"
-          label="设备名称"
-          sortable="custom"
-          show-overflow-tooltip
-        />
-        <el-table-column
-          prop="codeName"
-          align="center"
-          label="统计指标名称"
-          sortable="custom"
-          show-overflow-tooltip
-        />
-        <el-table-column
-          prop="endTime"
-          align="center"
-          label="监测时间"
-          sortable="custom"
-          show-overflow-tooltip
-        >
-          <template slot-scope="scope">
-            {{ scope.row.endTime.split(" ")[0] }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="difference"
-          align="center"
-          sortable="custom"
-          :label="'日用量(m³)'"
-        />
-      </el-table>
-      <el-row style="margin-top: 0px">
-        <el-col :span="24">
-          <el-pagination
-            ref="pagination"
-            small
-            layout="total, sizes, prev, pager, next, jumper"
-            :pager-count="5"
-            :current-page="pageInfo.current"
-            :page-sizes="[10,40, 80, 120, 200]"
-            style="margin-top: 4px"
-            :page-size="pageInfo.size"
-            :total="tableTotal"
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-          />
-        </el-col>
+          </el-form-item>
+          <el-form-item
+            style="display: inline-block; width: 300px; margin-bottom: 6px"
+          >
+            <el-button
+              size="small"
+              type="primary"
+              @click="monitorHisToryQuery('ruleForm')"
+            >查询</el-button>
+            <el-button
+              size="small"
+              type="primary"
+              @click="statisticsScadaExport('ruleForm')"
+            >导出</el-button>
+          </el-form-item>
+        </el-form>
       </el-row>
     </div>
+    <div class="tableheight">
+      <table-item
+        ref="customerReportDateTable"
+        :table-data="dayUseWaterData"
+        :column="column"
+        :for-id="true"
+        :pagination="true"
+        :pagesize="pageInfo.size"
+        :currentpage="pageInfo.current"
+        :border="true"
+        :multiple="true"
+        :total="tableTotal"
+        :fixed="true"
+        :isdelete="false"
+        :is-select="false"
+        :stripe="true"
+        :get-summaries="getSummaries"
+        :summary="true"
+        @handleCurrentChange="handleCurrentChange"
+        @handleSizeChange="handleSizeChange"
+      />
+    </div>
   </div>
 </template>
 <script>
-import elementResizeDetectorMaker from 'element-resize-detector'
-import TableItem from '@/components/Table'
-import Echarts from 'echarts'
-import ExportBtn from '@/views/zhpt/wxreportforms/components/ExportBtn'
+import TableItem from '@/components/TableAuto'
+
 import {
   queryDevice,
   queryIndexConfiguration,
@@ -187,7 +143,7 @@ import {
 import { getSysCommonCode } from '@/api/dataCenter'
 export default {
   name: 'AnalysisResult',
-  components: { TableItem, Echarts, ExportBtn },
+  components: { TableItem },
   directives: {
     way(el, bind) {
       if (typeof bind.value === 'function') bind.value(el)
@@ -196,14 +152,39 @@ export default {
   data() {
     return {
       dayUseWaterData: [], // 表格数据
-      tabsItem: [],
+      column: [
+        {
+          label: '设备名称',
+          prop: 'deviceName',
+          align: 'center',
+          sortable: true
+        },
+        {
+          label: '统计指标名称',
+          prop: 'codeName',
+          align: 'center',
+          sortable: true
+        },
+        {
+          label: '监测时间',
+          prop: 'endTime',
+          align: 'center',
+          sortable: true
+        },
+        {
+          label: '日用量(m³)',
+          prop: 'difference',
+          align: 'center',
+          sortable: true
+        }
+      ],
       activeName: '',
       monitorLable: '',
       tableLoading: false,
       nameUnit: '',
       total: 0,
       loading: false,
-      pageInfo: { current: 1, size: 40 }, // 分页数据
+      pageInfo: { current: 1, size: 10 }, // 分页数据
       ruleForm: {
         site: '',
         indexName: '',
@@ -261,6 +242,7 @@ export default {
       this.queryDevice() // 绑定测站名称
     })
   },
+
   methods: {
     /**
      * 合计
@@ -270,7 +252,7 @@ export default {
       const { columns, data } = param
       const sums = []
       columns.forEach((column, index) => {
-        if (index === 0) {
+        if (index === 1) {
           sums[index] = '合计'
           return
         }
@@ -469,10 +451,33 @@ export default {
       this.queryDevice()
     }
   }
+
 }
 </script>
-<style scoped="less">
-.el-table__footer-wrapper {
-  margin-bottom: 32px;
+<style lang='scss'>
+.dayUseWater{
+  height: 100%;
+  width: 100%;
+  padding: 5px;
+  position: absolute;
+
+  .filteroption {
+    width: 100%;
+    height: 40px;
+    font-size: 14px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+
+    .spanjg{
+      margin-left: 10px;
+    }
+  }
+
+  .tableheight {
+    margin-top: 4px;
+    height: calc(100% - 50px);
+  }
 }
+
 </style>

+ 9 - 0
src/views/zhpt/scada/scadaMonitor/craftConfig.js

@@ -57,3 +57,12 @@ export const deviceConfig = {
     typename: '流量计'
   }
 }
+
+// 开关量
+export const deviceStateConfig = {
+  '20': { // 设备状态
+    '0': '停止',
+    '1': '开启'
+  }
+}
+

+ 10 - 3
src/views/zhpt/scada/scadaMonitor/widget.vue

@@ -573,7 +573,10 @@ export default {
               var ddr = dr[item2].scada
               if (!ddr) continue
               var value = ddr.value
-              ddi.children[1].innerHTML = value == 'null' ? '-' : value
+              const accuracy = Number((dr.accuracy || '') == '' ? '2' : dr.accuracy)
+              var scadaValue = value !== '' ? parseFloat(value).toFixed(accuracy) + '' : '-'
+
+              ddi.children[1].innerHTML = scadaValue == 'null' ? '-' : scadaValue
               ddi.children[3].classList.value =
                 'scadaLayer-float-arrow' + (ddr.mark || 1)
             }
@@ -820,15 +823,19 @@ export default {
       this.tableLoading = true
       var pages = this.$refs.pagination2
       var [zbx, times] = this.siteHistiryQuery
+
+      var startDate = times[0].split(' ')[0] + ' 00:00:00'
+      var endDate = times[1].split(' ')[0] + ' 23:59:59'
+
       var parm = this.siteType.replace(/\#/g, '%23')
       request({
         url:
           '/tofly-scada/scada/page?code=' +
           parm +
           '&start=' +
-          times[0] +
+         startDate +
           '&end=' +
-          times[1] +
+          endDate +
           // '&statisticsType=' + 1 +
           '&current=' +
           pages.internalCurrentPage +

+ 28 - 5
src/views/zhpt/scada/waringTypeManage/WaterDetail.vue

@@ -122,6 +122,25 @@
           />
         </div>
       </div>
+      <div class="flexDiv">
+        <span class="flexTitle">消息联系人:</span>
+        <div class="flexInfo">
+          <el-select
+            v-model="reportForm.noticeUser"
+            size="small"
+            filterable
+            clearable
+            multiple="true"
+            collapse-tags
+            placeholder=""
+            :disabled="isLook"
+            style="width:100%"
+            @change="AlarmChange"
+          >
+            <el-option v-for="item in userList" :key="item.id" :label="item.realName" :value="item.id" />
+          </el-select>
+        </div>
+      </div>
       <div class="flexDivMax">
         <span class="flexTitle">消息通知模版:</span>
         <div class="flexInfo">
@@ -169,11 +188,15 @@ export default {
       deviceList: [],
       userList: [],
       example: [
-        { name: '客户编号', code: '${YHBH}' },
-        { name: '客户姓名', code: '${YHXM}' },
-        { name: '客户地址', code: '${YHDZ}' },
-        { name: '客户电话', code: '${LXDH}' },
-        { name: '当前时间', code: ' ${TIME}' }
+        { name: '设备名称', code: '#SBMC#' },
+        { name: '设备编码', code: '#SBBM#' },
+        { name: '指标编码', code: '#ZBMC#' },
+        { name: '指标名称', code: '#ZBBM#' },
+        { name: '时间', code: '#TIME#' },
+        { name: '上限', code: '#BJSX#' },
+        { name: '下限', code: '#BJXX#' },
+        { name: '采集值', code: '#BJZ#' },
+        { name: '超标', code: '#BJCB#' }
       ]
     }
   },

+ 13 - 2
src/views/zhpt/scada/waringTypeManage/widget.vue

@@ -213,7 +213,8 @@ export default {
         liaisonPhone: undefined,
         reportLower: undefined,
         msgTemplate: undefined,
-        reportUpper: undefined
+        reportUpper: undefined,
+        noticeUser: undefined
       },
       dialogDetail: false, // 控制详情页面的显示
       // 详情数据
@@ -316,8 +317,14 @@ export default {
           that.$message.error('获取信息出错!')
           return
         }
+
         // 数据总数
         that.pageInfo.tableTotal = res.result.total
+        res.result.records.forEach(item => {
+          item.noticeUser = item.noticeUser.split(',').map(item=>{
+            return parseInt(item);
+          })
+        })
         that.buildsiteData = res.result.records
       })
     },
@@ -344,6 +351,9 @@ export default {
       //   this.$message.error('请输入设备档案编号')
       //   return
       // }
+
+      console.log('参数:', this.reportForm)
+      this.reportForm.noticeUser = this.reportForm.noticeUser.toString()
       addAlarmManageList(this.reportForm).then(res => {
         if (res.code == 1) {
           that.$message.success('新增成功')
@@ -365,6 +375,7 @@ export default {
       //   this.$message.error('请输入变量编码')
       //   return
       // }
+      this.editData.noticeUser = this.editData.noticeUser.toString()
       updateAlarmManageList(this.editData).then(res => {
         if (res.code == 1) {
           that.$message.success('修改成功')
@@ -402,7 +413,7 @@ export default {
      */
     strIsNull(strVal) {
       strVal = strVal || ''
-      return typeof strVal == 'undefined' || strVal == null || strVal == ''
+      return typeof strVal === 'undefined' || strVal == null || strVal == ''
     },
 
     /**