From 387fdc6d364145a1445ca9d5809614f865091d0d Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 31 十月 2025 16:44:15 +0800
Subject: [PATCH] 优化
---
components/mold.vue | 50 +++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 39 insertions(+), 11 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index a6c4dfa..7238f47 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -4,26 +4,29 @@
<view class="top-section-grid">
<view class="form-cell">
<label class="form-label">鍒�鍏风紪鍙凤細</label>
- <input class="input" v-model="selectedToolNo" placeholder="璇烽�氳繃鍒�鍏风洰褰曢�夋嫨" disabled />
+ <input class="input small-font" v-model="selectedToolNo" placeholder="璇烽�氳繃鍒�鍏风洰褰曢�夋嫨" disabled />
<button class="btn-blue" @click="openToolDialog" :disabled="loadingTools">鍒�鍏风洰褰�</button>
</view>
<view class="form-cell">
<label class="form-label">璁剧疆浣跨敤涓婇檺锛�</label>
- <input class="input" type="number" v-model="useLimitInput" placeholder="姣忔鎹㈠垁鍚庢墜濉�" :disabled="!selectedToolNo || loadingForm" />
+ <input class="input small-font" type="number" v-model="useLimitInput" placeholder="姣忔鎹㈠垁鍚庢墜濉�" :disabled="!selectedToolNo || loadingForm" />
</view>
<!-- 鏂板锛氬鍛芥瘮棰勮鍊艰緭鍏ユ -->
<view class="form-cell">
<label class="form-label">瀵垮懡姣旈璀﹀�硷細</label>
- <input class="input"
- 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>
- <input class="input" v-model="toolName" placeholder="鍒�鍏峰甫鍑�" disabled />
+ <input class="input small-font" v-model="toolName" placeholder="鍒�鍏峰甫鍑�" disabled />
<label class="form-label" style="margin-left: 16px;">瑙勬牸鍨嬪彿锛�</label>
- <input class="input" v-model="toolModel" placeholder="鍒�鍏峰甫鍑�" disabled />
+ <input class="input small-font" v-model="toolModel" placeholder="鍒�鍏峰甫鍑�" disabled />
</view>
</view>
@@ -143,7 +146,7 @@
// 鑷姩淇濆瓨鐩稿叧
autoSaveTimer: null,
isDirty: false, // 琛ㄥ崟鏄惁鏈夋湭淇濆瓨鍙樻洿
- autoSaveIntervalMs: 60 * 1000, // 榛樿 1 鍒嗛挓
+ autoSaveIntervalMs: 5 * 60 * 1000, // 榛樿 5 鍒嗛挓
autoSaveEnabled: true,
autoSaveActionName: 'handleUpTool' // 鑷姩瑙﹀彂鐨勬柟娉曞悕锛屽彲鏀逛负鑷畾涔変繚瀛樻柟娉�
};
@@ -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 = '';
}
@@ -663,6 +666,11 @@
border-radius: 6px;
background: #f8f8f8;
}
+
+ /* 鏂板锛氬皬瀛椾綋鏍峰紡 */
+ .input.small-font {
+ font-size: 1vw; /* 璋冨皬瀛椾綋 */
+ }
.form-select {
width: 12vw;
@@ -929,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