| | |
| | | pointParas: null, |
| | | historyChart: null, |
| | | realTimeChart: null, |
| | | |
| | | formatType:null, |
| | | isInitialHistoryData: false, //是否初始化过历史记录 |
| | | isInitialAlarmData: false, //是否初始化警报记录 |
| | | |
| | |
| | | realChartHeight: app.globalData.screenSize.height * 1.5 - 120, |
| | | historyChartWidth: app.globalData.screenSize.width, |
| | | historyChartHeight: app.globalData.screenSize.height * 2.5 - 50, |
| | | formatType:options.formatType |
| | | }); |
| | | }, |
| | | //初始化数据(实时数据) |
| | |
| | | loadingHidden: false, |
| | | loadingInfo: "数据请求中,请稍等..." |
| | | }); |
| | | //console.log(Constant.BASE_SERVER_URL + "Monitor/GeneralRecord/GetDayRecordBySingle") |
| | | //console.log(that.data.pointID, util.formatDay(new Date())) |
| | | var formatType=that.data.formatType |
| | | console.log(formatType,161) |
| | | var path=null |
| | | if(formatType==1){ |
| | | path="Monitor/Record/Real/Std/GetBySignalIDOfDay@V2.0" |
| | | } |
| | | if(formatType!=1){ |
| | | path="Monitor/Record/Real/Std/GetBySignalIDOfDay@V1.0" |
| | | } |
| | | Request({ |
| | | url: Constant.BASE_SERVER_URL + "Monitor/Record/Real/Std/GetBySignalIDOfDay@V2.0", |
| | | url: Constant.BASE_SERVER_URL + path, |
| | | method: 'GET', |
| | | data: { |
| | | |
| | |
| | | } |
| | | }); |
| | | var last_record = real_time_records[real_time_records.length - 1]; |
| | | last_record.DataValue = parseFloat(last_record.DataValue).toFixed(2) |
| | | // last_record.DataValue = parseFloat(last_record.DataValue).toFixed(2) |
| | | // console.log(last_record); |
| | | //获取监控当天的监控指及状态 |
| | | var monitorList = [] |
| | |
| | | |
| | | |
| | | //console.log(monitorList,241) |
| | | // console.log(last_record.DataValue,240) |
| | | that.setData({ |
| | | loadingHidden: true, |
| | | real_time_records: real_time_records, |
| | | monitorList: monitorList.reverse(), |
| | | currentRecordParas: { |
| | | HistoryRecordValue: '', |
| | | RecordValue: parseFloat(Number(last_record.DataValue).toFixed(2)), |
| | | RecordValue: last_record.DataValue, |
| | | RecordTime: util.functions.sub(last_record.DataTime, 0, 10), |
| | | RecordStatus: last_record.DataStatus, |
| | | RecordStatusName: alarm_number > 0 ? "报警" : "正常", |
| | |
| | | } |
| | | |
| | | var newAlarmRecords = result.Data; |
| | | // console.log(newAlarmRecords, '356行') |
| | | console.log(newAlarmRecords, '356行') |
| | | if (newAlarmRecords == null || newAlarmRecords.length == 0) |
| | | return; |
| | | var last_alarm_record = newAlarmRecords[0]; |
| | |
| | | var m_chartRecordList = TransChartRecordPoint([last_record]); |
| | | g_realTimeChartRecords.push(m_chartRecordList[0]); |
| | | // console.log(g_realTimeChartRecords,418) |
| | | console.log(barec1,777) |
| | | if (barec1 == null) { |
| | | util.popup.showModal('图表提示', '图表加载错误,请点击刷新重试') |
| | | return; |
| | |
| | | loadingHidden: false, |
| | | loadingInfo: "数据请求中,请稍等..." |
| | | }); |
| | | var formatType=that.data.formatType |
| | | var path=null |
| | | if(formatType==1){ |
| | | path="Monitor/Record/Real/Std/GetBySignalIDOfDay@V2.0" |
| | | } |
| | | if(formatType!=1){ |
| | | path="Monitor/Record/Real/Std/GetBySignalIDOfDay@V1.0" |
| | | } |
| | | Request({ |
| | | url: Constant.BASE_SERVER_URL + "Monitor/Record/Real/Std/GetBySignalIDOfDay@V2.0", |
| | | url: Constant.BASE_SERVER_URL + path, |
| | | method: 'GET', |
| | | data: { |
| | | |
| | |
| | | monitorAlam.push(monitorList[a]) |
| | | } |
| | | } |
| | | |
| | | that.setData({ |
| | | isMonitorChange: isMonitorChange, |
| | | monitorAlam: monitorAlam |