| | |
| | | <!-- 新增:寿命比预警值输入框 --> |
| | | <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> |
| | |
| | | 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 = ''; |
| | | } |
| | |
| | | // 新增:自动填充寿命比预警值 |
| | | 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 = ''; |
| | | } |
| | |
| | | |
| | | /* 新增:小字体样式 */ |
| | | .input.small-font { |
| | | font-size: 0.7vw; /* 调小字体 */ |
| | | font-size: 1vw; /* 调小字体 */ |
| | | } |
| | | |
| | | .form-select { |
| | |
| | | .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> |