From aea34c64bd4259e3cd16efc1a6c376ec3b2410b5 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期三, 03 十二月 2025 16:50:28 +0800
Subject: [PATCH] 第一行“使用次数”“寿命比%”仅在“在机”时实时显示,否则显示原始数据。
---
components/mold.vue | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index 5702005..037aa32 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -116,22 +116,32 @@
{{ item.downCount != null ? item.downCount : '' }}
</template>
</td>
- <!--<td class="num">{{ item.useCount != null ? item.useCount : '' }}</td>--><!--浣跨敤娆℃暟-->
+ <!--浣跨敤娆℃暟-->
<td class="num">
<template v-if="idx === 0">
- <!-- 绗竴琛屽疄鏃惰绠椾娇鐢ㄦ鏁� -->
- {{item.currentCjNum != null && item.upCount != null ? (Number(item.currentCjNum) - Number(item.upCount)) : (item.useCount != null ? item.useCount : '') }}
+ <!-- 绗竴琛屽疄鏃惰绠椾娇鐢ㄦ鏁帮紝鑻ヤ负涓嬫満鍒欎笉瀹炴椂鏄剧ず -->
+ <template v-if="!item.downTime">
+ {{item.currentCjNum != null && item.upCount != null ? (Number(item.currentCjNum) - Number(item.upCount)) : (item.useCount != null ? item.useCount : '') }}
+ </template>
+ <template v-else>
+ {{ item.useCount != null ? item.useCount : '' }}
+ </template>
</template>
<template v-else>
{{ item.useCount != null ? item.useCount : '' }}
</template>
</td>
<td class="num">{{ item.useLimit != null ? item.useLimit : '' }}</td>
- <!--<td class="num">{{ item.lifePercent }}</td>-->
+ <!--瀵垮懡姣�%-->
<td class="num">
<template v-if="idx === 0">
- <!-- 绗竴琛屽疄鏃惰绠楀鍛芥瘮% -->
- {{item.currentCjNum != null && item.upCount != null && item.useLimit != null && Number(item.useLimit) > 0 ? Math.round((Number(item.currentCjNum) - Number(item.upCount)) / Number(item.useLimit) * 100) + '%' : (item.lifePercent != null ? item.lifePercent : '') }}
+ <!-- 绗竴琛屽疄鏃惰绠楀鍛芥瘮%锛岃嫢涓轰笅鏈哄垯涓嶅疄鏃舵樉绀� -->
+ <template v-if="!item.downTime">
+ {{item.currentCjNum != null && item.upCount != null && item.useLimit != null && Number(item.useLimit) > 0 ? Math.round((Number(item.currentCjNum) - Number(item.upCount)) / Number(item.useLimit) * 100) + '%' : (item.lifePercent != null ? item.lifePercent : '') }}
+ </template>
+ <template v-else>
+ {{ item.lifePercent != null ? item.lifePercent : '' }}
+ </template>
</template>
<template v-else>
{{ item.lifePercent }}
@@ -147,7 +157,7 @@
</td>
</tr>
<tr v-if="!toolRecords.length">
- <td colspan="11">鏆傛棤鏁版嵁</td>
+ <td colspan="12">鏆傛棤鏁版嵁</td>
</tr>
</tbody>
</table>
@@ -209,7 +219,7 @@
toolModel() { this.isDirty = true; }
},
methods: {
- //鏌ヨ褰撳墠鏁伴噰鏁帮紝浣滀负涓嬪垁璁℃暟瀹炴椂鏄剧ず
+ //鏌ヨ褰撳墠鏁伴噰鏁帮紝浣滀负涓嬪垁璁℃暟瀹炴椂鏄剧ず
async fetchCurrentCjNum(toolNo) {
if (!this.machineNo) return null;
try {
@@ -1193,5 +1203,4 @@
margin-right: 16px;
flex: none !important; /* 鍏抽敭锛氬交搴曠姝lex鎷変几 */
}
-
</style>
\ No newline at end of file
--
Gitblit v1.9.3