yangyin
2023-12-27 d9dbdb58fc999ba2589cb1360e92c5fb9535a69f
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 ? "报警" : "正常",
@@ -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