From ebd9f0bd44a76a0fba4f82f799b349cdab2b21ca Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期二, 26 十二月 2023 14:52:26 +0800 Subject: [PATCH] fix: 修改监测值 --- monitor/station/index.js | 55 +++++++++++++++++++++++++++++++------------------------ 1 files changed, 31 insertions(+), 24 deletions(-) diff --git a/monitor/station/index.js b/monitor/station/index.js index dcbf4a0..d44fcca 100644 --- a/monitor/station/index.js +++ b/monitor/station/index.js @@ -297,7 +297,7 @@ var machineList = this.data.machineList; var userInfo = app.globalData.userInfo; Request({ - url: Constant.BASE_SERVER_URL + 'Run/RunSpan/Mobile/GetByStationIDOfDay@V1.0', + url: Constant.BASE_SERVER_URL + 'SZJT/Run/Analy/Mobile/GetSpanListByStationIDOfDay@V1.0', method: 'GET', data: { StationID :that.data.stationID, @@ -313,16 +313,23 @@ return; } // - var run_time_array = result.Data; - // - console.log('291琛� ', that.data.historyDate + '鐨勫紑鍋滄満:', run_time_array); - - for (var i = 0; i < machineList.length; i++) { - console.log() - + var run_time_array = result.Data; + // console.log('291琛� ', that.data.historyDate + '鐨勫紑鍋滄満:', run_time_array); + run_time_array.forEach(item => { + item.runTimeSum=0 + item.ChunkList.forEach(chunkItem=>{ + // console.log(chunkItem,321) + if (chunkItem.RunStatus == 1) { + item.runTimeSum += chunkItem.Duration; + } + }) + + }) + // console.log(run_time_array,328) + for (var i = 0; i < machineList.length; i++) { run_time_array.forEach(item => { if(machineList[i].TitleName == item.Name){ - machineList[i].WorkTime = (item.RumTime / 60 / 60).toFixed(1) + machineList[i].WorkTime = (item.runTimeSum/ 60 / 60).toFixed(1) } }); } @@ -347,7 +354,7 @@ var machineListNode = [] records.forEach(item => { if(item.Name == machineList[i].MachineName){ - machineListNode.push(item.Spans) + machineListNode.push(item.ChunkList) } }); // console.log('machineListNode', machineListNode) @@ -693,26 +700,16 @@ getAlarmData: function () { var that = this; var alarmListInfo = that.data.alarmListInfo - var userInfo = app.globalData.userInfo; wx.showLoading({ title: '鍔犺浇涓�...', }) - - let data = { - CorpID:Constant.CorpID, - StationID: that.data.stationID, - StartTime : that.data.startAlarmDate, - EndTime : that.data.endAlarmDate, - PageIndex: that.data.PageIndex, - PageSize: that.data.PageSize - } - // console.log(data,697) +console.log(that.data.stationID,706) Request({ - url: Constant.BASE_SERVER_URL + "Run/MonitorAlarmRecord/Mobile/GetPageListByStationID@V1.1", + url: Constant.BASE_SERVER_URL + "Monitor/Value/Alarm/Record/Std/GetPageListBySignalID@V1.0", method: 'GET', data: { - CorpID:Constant.CorpID, - StationID: that.data.stationID, + + SignalID : that.data.stationID, StartTime: that.data.startAlarmDate, EndTime: that.data.endAlarmDate, PageIndex: that.data.PageIndex, @@ -745,6 +742,16 @@ return; } let result = res.data.Data + if(result.List==null) + { + wx.showToast({ + title: '褰撳墠鏃犳姤璀︽暟鎹�', + }); + that.setData({ + hasAlarmData: false + }); + return; + } if (result.List.length == 0) { wx.showToast({ title: '褰撳墠鏃犳姤璀︽暟鎹�', -- Gitblit v1.9.3