| | |
| | | <tr> |
| | | <td>当前寿命</td> |
| | | <template v-for="(item,index) in toolLife.brandList"> |
| | | <td :style="{backgroundColor:getToolCurrentLifeDataBgColor(item)}"> |
| | | <td :style="{backgroundColor:getToolCurrentLifeDataBgColor(toolLife.lifeList[index][listIndex])}"> |
| | | {{toolLife.lifeList[index][listIndex]?toolLife.lifeList[index][listIndex]?toolLife.lifeList[index][listIndex].currentLife:'':''}} |
| | | </td> |
| | | </template> |
| | |
| | | lifeList.push(currentBrandLifeList) |
| | | }) |
| | | this.maxBrandToolLifeListLength = Object.assign([], lifeList).sort((a, b) => b.length - a.length)[0].length |
| | | console.log('brandList', brandList) |
| | | console.log('lifeList', lifeList) |
| | | console.log('maxBrandToolLifeListLength', this.maxBrandToolLifeListLength) |
| | | // console.log('brandList', brandList) |
| | | // console.log('lifeList', lifeList) |
| | | // console.log('maxBrandToolLifeListLength', this.maxBrandToolLifeListLength) |
| | | this.toolLife = { brandList, lifeList } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getToolCurrentLifeDataBgColor(record) { |
| | | if (record.currentLife / record.ratedLife > 0.8) { |
| | | if (record && record.currentLife) { |
| | | if (record.currentLife > 10) { |
| | | return '#218A21' |
| | | } else if (record.currentLife >= 5 && record.currentLife <= 10) { |
| | | return '#FF9A10' |
| | | } else { |
| | | return '#218A21' |
| | | return '#f00' |
| | | } |
| | | } |
| | | |
| | | // if (record.currentLife / record.ratedLife > 0.8) { |
| | | // return '#FF9A10' |
| | | // } else { |
| | | // return '#218A21' |
| | | // } |
| | | }, |
| | | |
| | | mouseEnterItem(e) { |