From 387fdc6d364145a1445ca9d5809614f865091d0d Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 31 十月 2025 16:44:15 +0800
Subject: [PATCH] 优化
---
components/mold.vue | 35 +++++++++++++++++++++++++++++------
1 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index c69da35..7238f47 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -14,10 +14,13 @@
<!-- 鏂板锛氬鍛芥瘮棰勮鍊艰緭鍏ユ -->
<view class="form-cell">
<label class="form-label">瀵垮懡姣旈璀﹀�硷細</label>
- <input class="input small-font"
- v-model="lifeWarnInput"
- placeholder="濡�0.9鎴�90鎴�90%"
- :disabled="!selectedToolNo || loadingForm" />
+ <view class="input-with-suffix">
+ <input class="input small-font"
+ v-model="lifeWarnInput"
+ placeholder="濡�0.9鎴�90"
+ :disabled="!selectedToolNo || loadingForm" />
+ <span class="input-suffix">%</span>
+ </view>
</view>
<view class="form-cell">
<label class="form-label">鍒�鍏峰悕绉帮細</label>
@@ -303,7 +306,7 @@
if (tool.lifeWarn !== undefined && tool.lifeWarn !== null) {
// 鏍煎紡鍖栦负鐧惧垎姣斿瓧绗︿覆
const warn = Number(tool.lifeWarn);
- this.lifeWarnInput = warn <= 1 ? `${(warn * 100).toFixed(0)}%` : `${warn.toFixed(0)}%`;
+ this.lifeWarnInput = warn <= 1 ? (warn * 100).toFixed(0) : warn.toFixed(0);
} else {
this.lifeWarnInput = '';
}
@@ -570,7 +573,7 @@
// 鏂板锛氳嚜鍔ㄥ~鍏呭鍛芥瘮棰勮鍊�
if (order.modlLifeWorning !== undefined && order.modlLifeWorning !== null) {
const warn = Number(order.modlLifeWorning);
- this.lifeWarnInput = warn <= 1 ? `${(warn * 100).toFixed(0)}%` : `${warn.toFixed(0)}%`;
+ this.lifeWarnInput = warn <= 1 ? (warn * 100).toFixed(0) : warn.toFixed(0);
} else {
this.lifeWarnInput = '';
}
@@ -934,4 +937,24 @@
.tool-desc {
margin-top: 2vh;
}
+
+ .input-with-suffix {
+ position: relative;
+ display: flex;
+ align-items: center;
+ }
+
+ .input-with-suffix .input {
+ width: 10vw;
+ margin-right: 8px;
+ padding-right: 24px; /* 涓哄悗缂�鐣欏嚭绌洪棿 */
+ }
+
+ .input-suffix {
+ position: absolute;
+ right: 16px; /* 璋冩暣鍒拌緭鍏ユ鍐呭彸渚� */
+ color: #666;
+ font-size: 0.9vw;
+ pointer-events: none; /* 闃叉骞叉壈杈撳叆 */
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3