export default {
  methods: {
    backTrackingResolver(gen,active) {
      console.log(gen)
      const models = this.generation.activeModels.find(item => item.generation == gen).models
      console.log(active)
      this.formatRows.forEach(item => {
        const currentGroup = models.find(group => group.groupId == item.groupId)
        console.log(currentGroup)
        const groupIndicatorAll = models.reduce((prev,current)=> {
          const groupIndicator = current.groupIndicator >= 0 ? 0 : ( - current.groupIndicator)
          return prev + groupIndicator
        },0)
        item.groupIndicator = currentGroup.groupIndicator
        item.supplyBestIndicator = currentGroup.bestInIndicator || '/'
        item.supplyRankInBest = currentGroup.rankInBest ? `${currentGroup.rankInBest}/${currentGroup.bestInIndicator}` : '/'
        item.supplyRankInDisenroll = currentGroup.rankInDisenroll ? `${currentGroup.rankInDisenroll}/${groupIndicatorAll}`  : '/'
      })
  return {
        groupIndicator:{
          label:'超缺',
          slot:'underOver'
        },
        supplyBestIndicator:{
          label:'补录组合成绩最高人数'
        },
        supplyRankInBest:{
          label:'补录组合成绩最高人数排名'
        },
        supplyRankInDisenroll:{
          label:'补录人数排名'
        }
      }
    }
  }
}
