| | |
| | | export default { |
| | | props: { |
| | | loading: Boolean, |
| | | sceneType: Number, |
| | | subtasks: { |
| | | type: Array, |
| | | default: () => [] |
| | |
| | | completedTimes: 0, |
| | | reviewTimes: 0 |
| | | }; |
| | | this.monitorObjList.forEach((m) => { |
| | | _res.total++; |
| | | const times = parseInt(m.extension1); |
| | | if (times) { |
| | | _res.completedScenes++; |
| | | _res.completedTimes += times; |
| | | _res.reviewTimes += times - 1; |
| | | |
| | | // Fixme 2025.5.30: 目前此处的监管版本信息钟记录的任务完成次数有偏差,所以暂时先改为通过巡查任务本身进行统计 |
| | | /**************************************************************************************/ |
| | | // this.monitorObjList.forEach((m) => { |
| | | // if (this.sceneType == undefined || m.sceneTypeId == this.sceneType) { |
| | | // _res.total++; |
| | | // const times = parseInt(m.extension1); |
| | | // if (times) { |
| | | // _res.completedScenes++; |
| | | // _res.completedTimes += times; |
| | | // _res.reviewTimes += times - 1; |
| | | // } |
| | | // } |
| | | // }); |
| | | /**************************************************************************************/ |
| | | |
| | | /**************************************************************************************/ |
| | | _res.total = this.monitorObjList.filter( |
| | | (m) => this.sceneType == undefined || m.sceneTypeId == this.sceneType |
| | | ).length; |
| | | _res.completedTimes = this.subtasks.length; |
| | | const map = new Map(); |
| | | const uniqueArr = []; |
| | | for (let item of this.subtasks) { |
| | | if (!map.has(item.data.sceneId)) { |
| | | map.set(item.data.sceneId, true); |
| | | uniqueArr.push(item); |
| | | } |
| | | }); |
| | | } |
| | | _res.completedScenes = uniqueArr.length; |
| | | _res.reviewTimes = _res.completedTimes - _res.completedScenes; |
| | | |
| | | /**************************************************************************************/ |
| | | return _res; |
| | | } |
| | | }, |