yangyin
2023-12-26 f025a3827feeebb6f7131a93899a8f7e597a3caa
fix 修改地图
已修改2个文件
187 ■■■■■ 文件已修改
map/index.js 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
map/index.wxml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
map/index.js
@@ -548,7 +548,7 @@
  },
  //点击地图marker 
  tapMapMark: function (e) {
    //  console.log(e,484)
     console.log(e,484)
    var id = e.detail.markerId;
    //  console.log(id)
    //console.log(e)
@@ -576,74 +576,60 @@
      isLoad:false
    })
    // let Record = await that.getKpiByStationID(id)
    let stationLastRecord = await that.getGeneralLastRecordByStationID(id)
    that.setData({
      isLoad:true
    })
    console.log(stationLastRecord,id,528)
    if(stationLastRecord.LastRecordList==null){
      return
    }
    // console.log(markers,540)
    var type=null
    for (var i = 0; i < markers.length; i++) {
      console.log(markers[i].markerInfo,598)
      if ( id == markers[i].StationID) {
        markerTipInfo = markers[i];
        markerTipInfo.markerInfo.Records = stationLastRecord.LastRecordList
      if(id==markers[i].id){
        type=markerTipInfo.markerType
      }
      }
      console.log(type,584)
      if(type=='Station'){
        let stationLastRecord = await that.getGeneralLastRecordByStationID(id)
        markerTipInfo.markerInfo.Records = stationLastRecord
        that.setData({
          markerTipInfo: markerTipInfo
        })
        break;
      } else if (id == markers[i].id) {
        // console.log("ddd")
        markerTipInfo = markers[i];
         console.log(markerTipInfo)
        var ids = markerTipInfo.markerInfo.StationID
        // console.log(ids,520)
        //console.log(markerTipInfo)
        that.refreshMonitorRecords(ids)
      }
      if(type=='FlowMeter'){
        let stationLastRecord = await that.getMonitorKpiInfoByFlowMeterID(id)
        markerTipInfo.markerInfo.Records = stationLastRecord
        that.setData({
          markerTipInfo: markerTipInfo
        })
        //  console.log(that.data.markerTipInfo,532)
        break;
      }
    }
  },
//获取泵站kpi
 getKpiByStationID(stationID){
    let that = this
    return new Promise(function (resolve, reject){
      Request({
        url: Constant.BASE_SERVER_URL + "Monitor/MonitorPoint/Mobile/GetKpiByStationID@V1.0",
        method: 'GET',
        data: {
          CorpID: that.data.currentCorpID,
          StationID  :stationID,
          Count:2
        },
        header: {
          'content-type': 'application/json'
        },
        success:res=>{
          let result = res.data
          if(result.Code != 0){
            result = []
            resolve(result)
            return
          }
          resolve(result.Data || [])
        },
        fail:err=>{
          reject(err)
        }
      if(type=='PressMeter'){
        let stationLastRecord = await that.getMonitorKpiInfoByPressMeterID(id)
        markerTipInfo.markerInfo.Records = stationLastRecord
        that.setData({
          markerTipInfo: markerTipInfo
      })
      }
      if(type=='gongdan'){
        var FormType=markerTipInfo.markerInfo.FormType
        var FormID=markerTipInfo.markerInfo.FormID
        let stationLastRecord = await that.getRepairStatusInfo(FormType,FormID)
        console.log(stationLastRecord,628)
        markerTipInfo.markerInfo = stationLastRecord
        that.setData({
          markerTipInfo: markerTipInfo
    })
      }
    console.log(markerTipInfo.markerType,625)
  },
  //获取泵站最近一条数据
  getGeneralLastRecordByStationID(stationID){
    let that = this
    return new Promise(function (resolve, reject){
      Request({
        url: Constant.BASE_SERVER_URL + "SZJT/Map/Mobile/GetMonitorKpiInfoByStationID@V1.0",
@@ -669,7 +655,90 @@
      })
    })
  },
 //获取流量计 最近一条数据
 getMonitorKpiInfoByFlowMeterID(FlowMeterID){
  return new Promise(function (resolve, reject){
    Request({
      url: Constant.BASE_SERVER_URL + "SZJT/Map/Mobile/GetMonitorKpiInfoByFlowMeterID@V1.0",
      method: 'GET',
      data: {
        FlowMeterID  :FlowMeterID ,
      },
      header: {
        'content-type': 'application/json'
      },
      success:res=>{
        let result = res.data
        if(result.Code != 0){
          result = []
          resolve(result)
          return
        }
        resolve(result.Data || [])
      },
      fail:err=>{
        reject(err)
      }
    })
  })
},
 //获取压力计 最近一条数据
 getMonitorKpiInfoByPressMeterID(PressMeterID ){
  return new Promise(function (resolve, reject){
    Request({
      url: Constant.BASE_SERVER_URL + "SZJT/Map/Mobile/GetMonitorKpiInfoByPressMeterID@V1.0",
      method: 'GET',
      data: {
        PressMeterID   :PressMeterID  ,
      },
      header: {
        'content-type': 'application/json'
      },
      success:res=>{
        let result = res.data
        if(result.Code != 0){
          result = []
          resolve(result)
          return
        }
        resolve(result.Data || [])
      },
      fail:err=>{
        reject(err)
      }
    })
  })
},
 //获取工单 最近一条数据
 getRepairStatusInfo(FormType,FormID){
  return new Promise(function (resolve, reject){
    Request({
      url: Constant.BASE_SERVER_URL + "SZJT/Map/Mobile/GetRepairStatusInfo@V1.0",
      method: 'GET',
      data: {
        FormType :FormType ,
        FormID :FormID
      },
      header: {
        'content-type': 'application/json'
      },
      success:res=>{
        let result = res.data
        if(result.Code != 0){
          result = []
          resolve(result)
          return
        }
        resolve(result.Data || [])
      },
      fail:err=>{
        reject(err)
      }
    })
  })
},
  //隐藏对话框
  hideModal: function () {
    this.setData({
map/index.wxml
@@ -55,15 +55,15 @@
        <view class="action text-blue" bindtap="hideModal">取消</view>
      </view>
      <view wx:if="{{markerTipInfo.markerType!='gongdan'}}">
        <view wx:if="{{markerTipInfo.markerInfo.Records.length>0}}">
          <view data-id="{{Records.ID}}" data-name="{{Records.SignalList[0].Name}}" data-unit="{{Records.SignalList[0].UnitValue}}" bindtap="gotoSinglePointPage" class="record_tr"
            wx:for="{{markerTipInfo.markerInfo.Records}}" wx:key="index" wx:for-item="Records">
            <view class="name">{{Records.SignalList[0].Name?Records.SignalList[0].Name:''}}</view>
            <view class="value">{{Records.SignalList[0].DataValue}}</view>
            <view class="unit">{{Records.SignalList[0].UnitValue?Records.SignalList[0].UnitValue:''}}</view>
        <view wx:if="{{markerTipInfo.markerInfo.Records.LastRecordList.length>0}}">
          <view data-id="{{Records.SignalID}}" data-name="{{Records.Name}}" data-unit="{{Records.UnitName}}" bindtap="gotoSinglePointPage" class="record_tr"
            wx:for="{{markerTipInfo.markerInfo.Records.LastRecordList}}" wx:key="index" wx:for-item="Records">
            <view class="name">{{Records.Name?Records.Name:''}}</view>
            <view class="value">{{Records.DataValue}}</view>
            <view class="unit">{{Records.UnitName?Records.UnitName:''}}</view>
          </view>
        </view>
        <view wx:else="{{markerTipInfo.markerInfo.Records.length==0}}" class="zanWuShuju">
        <view wx:else="{{markerTipInfo.markerInfo.Records.LastRecordList.length==0}}" class="zanWuShuju">
          暂无监控数据
        </view>
        <view wx:if="{{link_box}}" class="block_list_url">