Commit 6ccdfc00 by 周志凯

add multiply progress

1 parent 977ac7c4
...@@ -1534,7 +1534,7 @@ ...@@ -1534,7 +1534,7 @@
: 0; : 0;
} }
}); });
console.log('list',_this[processKey]) // console.log('list',_this[processKey])
}; };
_this.webSocketObj[wsUrl].onerror = function(event) { _this.webSocketObj[wsUrl].onerror = function(event) {
console.log("设备WebSocket:发生错误 "); console.log("设备WebSocket:发生错误 ");
...@@ -2034,7 +2034,8 @@ ...@@ -2034,7 +2034,8 @@
}) })
}, },
dealMessage(msg) { dealMessage(msg) {
const { dates, mallIds, mallNames, status, stepCount, counter } = msg // scheduleType
const { dates, mallIds, mallNames, status, stepCount, scheduleType, counter } = msg
var self = this var self = this
var resObj = {} var resObj = {}
resObj.dates = dates resObj.dates = dates
...@@ -2046,6 +2047,7 @@ ...@@ -2046,6 +2047,7 @@
resObj.totalPage = 0 resObj.totalPage = 0
resObj.current = 0 resObj.current = 0
resObj.curPageSize = 0 resObj.curPageSize = 0
resObj.scheduleType = scheduleType
if (counter) { if (counter) {
// dataNum dateMallNum step totalData totalDate totalMall totalMallDateProduct // dataNum dateMallNum step totalData totalDate totalMall totalMallDateProduct
resObj.totalNum = counter.dateMallNum resObj.totalNum = counter.dateMallNum
...@@ -2054,15 +2056,20 @@ ...@@ -2054,15 +2056,20 @@
resObj.curPageSize = counter.dataNum resObj.curPageSize = counter.dataNum
} }
if (self.results.length) { if (self.results.length) {
self.results.forEach(item => { const isSameScheduleType = self.results.some(item => item.scheduleType === scheduleType)
isSameScheduleType
? self.results.forEach(item => {
//
item.progress = self.floatToPercent(stepCount) item.progress = self.floatToPercent(stepCount)
if (counter) { if (counter) {
item.totalNum = counter.dateMallNum // item.totalNum = counter.dateMallNum
item.totalPage = counter.totalMallDateProduct // item.totalPage = counter.totalMallDateProduct
item.current = counter.dataNum item.current = counter.dataNum
item.curPageSize = counter.totalData item.curPageSize = counter.totalData
} }
}) })
: self.results.push(resObj)
resObj = {}
} else { } else {
self.results.push(resObj) self.results.push(resObj)
resObj = {} resObj = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!