From f025a3827feeebb6f7131a93899a8f7e597a3caa Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 26 十二月 2023 18:02:32 +0800
Subject: [PATCH] fix 修改地图

---
 map/index.js |  191 ++++++++++++++++++++++++++++++++---------------
 1 files changed, 130 insertions(+), 61 deletions(-)

diff --git a/map/index.js b/map/index.js
index e6090b8..5e9dd5e 100644
--- a/map/index.js
+++ b/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
-        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)
-        that.setData({
-          markerTipInfo: markerTipInfo
-        })
-        //  console.log(that.data.markerTipInfo,532)
-        break;
+      markerTipInfo = markers[i];
+      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
+        })
+    
+      }
+      if(type=='FlowMeter'){
+        let stationLastRecord = await that.getMonitorKpiInfoByFlowMeterID(id)
+        markerTipInfo.markerInfo.Records = stationLastRecord
+        that.setData({
+          markerTipInfo: markerTipInfo
+        })
+   
+      }
+      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)
   },
-//鑾峰彇娉电珯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)
-        }
-      })
-    })
-  },
+
   //鑾峰彇娉电珯鏈�杩戜竴鏉℃暟鎹�
   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({

--
Gitblit v1.9.3