| | |
| | | }, |
| | | //点击地图marker |
| | | tapMapMark: function (e) { |
| | | // console.log(e,484) |
| | | console.log(e,484) |
| | | var id = e.detail.markerId; |
| | | // console.log(id) |
| | | //console.log(e) |
| | |
| | | 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", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | //获取流量计 最近一条数据 |
| | | 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({ |