From 31ab39a665b9d44a1465b0c86715f8d076fb9b8e Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 31 十月 2025 16:53:25 +0800
Subject: [PATCH] 优化界面
---
components/mold.vue | 96 +++++++++++++++++++++++++++++++++++-------------
1 files changed, 70 insertions(+), 26 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index 69176fd..320c9a4 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -2,28 +2,40 @@
<view class="page">
<!-- 鍒�鍏烽�夋嫨鍖� -->
<view class="top-section-grid">
- <view class="form-cell">
- <label class="form-label">鍒�鍏风紪鍙凤細</label>
- <input class="input small-font" v-model="selectedToolNo" placeholder="璇烽�氳繃鍒�鍏风洰褰曢�夋嫨" disabled />
- <button class="btn-blue" @click="openToolDialog" :disabled="loadingTools">鍒�鍏风洰褰�</button>
+ <!-- 绗竴琛� -->
+ <view class="form-row">
+ <view class="form-cell">
+ <label class="form-label">鍒�鍏风紪鍙凤細</label>
+ <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 small-font" type="number" v-model="useLimitInput" placeholder="姣忔鎹㈠垁鍚庢墜濉�" :disabled="!selectedToolNo || loadingForm" />
+ </view>
+ <!-- 鏂板锛氬鍛芥瘮棰勮鍊艰緭鍏ユ -->
+ <view class="form-cell">
+ <label class="form-label">瀵垮懡姣旈璀﹀�硷細</label>
+ <view class="input-with-unit">
+ <input class="input small-font"
+ v-model="lifeWarnInput"
+ placeholder="濡�0.9鎴�90"
+ :disabled="!selectedToolNo || loadingForm" />
+ <span class="unit-text">%</span>
+ </view>
+ </view>
</view>
- <view class="form-cell">
- <label class="form-label">璁剧疆浣跨敤涓婇檺锛�</label>
- <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 small-font"
- v-model="lifeWarnInput"
- placeholder="濡�0.9鎴�90鎴�90%"
- :disabled="!selectedToolNo || loadingForm" />
- </view>
- <view class="form-cell">
- <label class="form-label">鍒�鍏峰悕绉帮細</label>
- <input class="input small-font" v-model="toolName" placeholder="鍒�鍏峰甫鍑�" disabled />
- <label class="form-label" style="margin-left: 16px;">瑙勬牸鍨嬪彿锛�</label>
- <input class="input small-font" v-model="toolModel" placeholder="鍒�鍏峰甫鍑�" disabled />
+
+ <!-- 绗簩琛� -->
+ <view class="form-row">
+ <view class="form-cell">
+ <label class="form-label">鍒�鍏峰悕绉帮細</label>
+ <input class="input small-font" v-model="toolName" placeholder="鍒�鍏峰甫鍑�" disabled />
+ </view>
+ <view class="form-cell">
+ <label class="form-label">瑙勬牸鍨嬪彿锛�</label>
+ <input class="input small-font" v-model="toolModel" placeholder="鍒�鍏峰甫鍑�" disabled />
+ </view>
</view>
</view>
@@ -303,7 +315,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 +582,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 = '';
}
@@ -634,15 +646,30 @@
/* 鍘熸牱淇濇寔锛屾湭鏀瑰姩鏍峰紡锛屽彧鎻掑叆浜嗕竴涓緭鍏ユ */
.top-section-grid {
display: flex;
+ flex-direction: column;
justify-content: center;
- align-items: flex-end;
- gap: 32px;
+ align-items: center;
+ gap: 16px;
margin-bottom: 2vh;
width: 95vw;
max-width: 1600px;
margin-left: auto;
margin-right: auto;
}
+
+ /* 鏂板锛氳〃鍗曡鏍峰紡 */
+ .form-row {
+ display: flex;
+ justify-content: center;
+ align-items: flex-end;
+ gap: 32px;
+ margin-bottom: 16px;
+ width: 100%;
+ }
+
+ .form-row:last-child {
+ margin-bottom: 0;
+ }
.form-cell {
display: flex;
@@ -666,7 +693,7 @@
/* 鏂板锛氬皬瀛椾綋鏍峰紡 */
.input.small-font {
- font-size: 0.8vw; /* 璋冨皬瀛椾綋 */
+ font-size: 1vw; /* 璋冨皬瀛椾綋 */
}
.form-select {
@@ -934,4 +961,21 @@
.tool-desc {
margin-top: 2vh;
}
+
+ /* 鏂板锛氬甫鍗曚綅鐨勮緭鍏ユ鏍峰紡 */
+ .input-with-unit {
+ display: flex;
+ align-items: center;
+ }
+
+ .input-with-unit .input {
+ width: 10vw;
+ margin-right: 8px;
+ }
+
+ .unit-text {
+ color: #666;
+ font-size: 0.9vw;
+ white-space: nowrap;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3