From d9dbdb58fc999ba2589cb1360e92c5fb9535a69f Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期三, 27 十二月 2023 17:37:24 +0800 Subject: [PATCH] fix: 修改监测 --- monitor/singlePoint/index.js | 35 +++++++++++++++++++++++++++-------- 1 files changed, 27 insertions(+), 8 deletions(-) diff --git a/monitor/singlePoint/index.js b/monitor/singlePoint/index.js index 1469a28..c2cef42 100644 --- a/monitor/singlePoint/index.js +++ b/monitor/singlePoint/index.js @@ -84,7 +84,7 @@ pointParas: null, historyChart: null, realTimeChart: null, - + formatType:null, isInitialHistoryData: false, //鏄惁鍒濆鍖栬繃鍘嗗彶璁板綍 isInitialAlarmData: false, //鏄惁鍒濆鍖栬鎶ヨ褰� @@ -147,6 +147,7 @@ realChartHeight: app.globalData.screenSize.height * 1.5 - 120, historyChartWidth: app.globalData.screenSize.width, historyChartHeight: app.globalData.screenSize.height * 2.5 - 50, + formatType:options.formatType }); }, //鍒濆鍖栨暟鎹�(瀹炴椂鏁版嵁) @@ -156,10 +157,17 @@ 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: { @@ -210,7 +218,7 @@ } }); 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 = [] @@ -237,13 +245,14 @@ //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 ? "鎶ヨ" : "姝e父", @@ -550,7 +559,7 @@ } 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]; @@ -773,6 +782,7 @@ 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; @@ -1022,8 +1032,16 @@ 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: { @@ -1559,6 +1577,7 @@ monitorAlam.push(monitorList[a]) } } + that.setData({ isMonitorChange: isMonitorChange, monitorAlam: monitorAlam -- Gitblit v1.9.3