From 964ab96fa41fc3f465d3d274fb2121dffd11dc79 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 07 十一月 2024 17:16:44 +0800 Subject: [PATCH] 1、调整总控车间看板右侧图表标题 2、调整分控车间看板刀具寿命管理中的当前寿命颜色标识 --- src/views/mdc/base/SubControlWorkshopSignage.vue | 26 ++++++++++++++++++-------- src/views/mdc/base/MasterControlWorkshopSignage.vue | 6 +++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/views/mdc/base/MasterControlWorkshopSignage.vue b/src/views/mdc/base/MasterControlWorkshopSignage.vue index cf4ac3b..c100666 100644 --- a/src/views/mdc/base/MasterControlWorkshopSignage.vue +++ b/src/views/mdc/base/MasterControlWorkshopSignage.vue @@ -82,15 +82,15 @@ <div class="chart-container" id="right-col-chart1"></div> </div> <div class="col-content"> - <div class="content-title">浠婃棩璁惧寮�鏈虹巼(%)</div> + <div class="content-title">璁惧浠婃棩寮�鏈虹巼锛�%锛�</div> <div class="chart-container" id="right-col-chart2"></div> </div> <div class="col-content"> - <div class="content-title">浠婃棩璁惧鍒╃敤鐜�(%)</div> + <div class="content-title">璁惧浠婃棩鍒╃敤鐜囷紙%锛�</div> <div class="chart-container" id="right-col-chart3"></div> </div> <div class="col-content"> - <div class="content-title">鏈堣澶囧埄鐢ㄧ巼(%)</div> + <div class="content-title">璁惧鏈堝埄鐢ㄧ巼锛�%锛�</div> <div class="chart-container" id="right-col-chart4"></div> </div> </div> diff --git a/src/views/mdc/base/SubControlWorkshopSignage.vue b/src/views/mdc/base/SubControlWorkshopSignage.vue index 2aa8796..49b6eda 100644 --- a/src/views/mdc/base/SubControlWorkshopSignage.vue +++ b/src/views/mdc/base/SubControlWorkshopSignage.vue @@ -134,7 +134,7 @@ <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> @@ -455,20 +455,30 @@ 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) { - return '#FF9A10' - } else { - return '#218A21' + if (record && record.currentLife) { + if (record.currentLife > 10) { + return '#218A21' + } else if (record.currentLife >= 5 && record.currentLife <= 10) { + return '#FF9A10' + } else { + return '#f00' + } } + + // if (record.currentLife / record.ratedLife > 0.8) { + // return '#FF9A10' + // } else { + // return '#218A21' + // } }, mouseEnterItem(e) { -- Gitblit v1.9.3