diff --git a/other-module/canteen-device/ratio-scale/04-seasoning-settings.html b/other-module/canteen-device/ratio-scale/04-seasoning-settings.html
index c684629..95e2285 100644
--- a/other-module/canteen-device/ratio-scale/04-seasoning-settings.html
+++ b/other-module/canteen-device/ratio-scale/04-seasoning-settings.html
@@ -129,7 +129,15 @@
font-size: 11px; padding: 2px 8px; border-radius: 4px;
background: rgba(74,144,217,0.15); color: #4a90d9; font-weight: 600;
}
- .select-panel__select-wrap { position: relative; }
+ .select-panel__select-wrap { position: relative; flex: 1; }
+ .select-panel__select-row { display: flex; gap: 8px; align-items: center; }
+ .select-panel__btn--reset-inline {
+ padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
+ cursor: pointer; transition: all 0.2s; border: none; font-family: inherit; flex-shrink: 0;
+ background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
+ border: 1px solid rgba(255,255,255,0.1);
+ }
+ .select-panel__btn--reset-inline:hover { background: rgba(255,255,255,0.1); color: #fff; }
.select-panel__select {
width: 100%; padding: 10px 14px; background: #121832;
border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
@@ -220,11 +228,14 @@
选择调料
位置 --
-
-
-
▼
+
+
+
+ ▼
+
+
放置重量:
@@ -351,14 +362,14 @@
function openSelect(pos) {
editingPos = pos;
document.getElementById('posTag').textContent = pos === 0 ? '信息格 (油)' : '位置 ' + pos;
- /* 信息格时调整标题和按钮 */
- var clearBtn = document.querySelector('.select-panel__btn--clear');
+ /* 信息格时调整标题 */
+ var resetBtn = document.getElementById('resetInlineBtn');
if (pos === 0) {
document.querySelector('.select-panel__title').firstChild.textContent = '修改油量 ';
- clearBtn.textContent = '重置';
+ resetBtn.textContent = '恢复默认';
} else {
document.querySelector('.select-panel__title').firstChild.textContent = '选择调料 ';
- clearBtn.textContent = '清空';
+ resetBtn.textContent = '重置';
}
/* 填充下拉选项 */
@@ -414,20 +425,42 @@
showToast('位置 ' + editingPos + ' 已配置为 ' + name + ' (' + weight + 'g)', 1500, 'success');
}
- /* 清空位置 */
+ /* 清空位置(重量归零,保留调料名称) */
function clearSlot() {
if (editingPos === 0) {
- /* 信息格恢复默认重量 */
- config[0] = { name: '油', weight: 1000 };
+ /* 信息格重量归零 */
+ config[0] = { name: '油', weight: 0 };
+ document.getElementById('seasoningWeight').value = '0';
renderGrid();
- closeSelect();
- showToast('油重量已重置为 1000g', 1500, 'success');
+ showToast('油重量已清零', 1500, 'success');
return;
}
- delete config[editingPos];
+ if (config[editingPos] && config[editingPos].name) {
+ config[editingPos].weight = 0;
+ } else {
+ config[editingPos] = { name: '', weight: 0 };
+ }
+ document.getElementById('seasoningWeight').value = '0';
renderGrid();
- closeSelect();
- showToast('位置 ' + editingPos + ' 已清空', 1500, 'success');
+ showToast('位置 ' + editingPos + ' 重量已清零', 1500, 'success');
+ }
+
+ /* 重置调料选择(清除下拉选中,清空重量输入) */
+ function resetSlot() {
+ var select = document.getElementById('seasoningSelect');
+ var weightInput = document.getElementById('seasoningWeight');
+ if (editingPos === 0) {
+ /* 信息格:重量恢复默认值 */
+ select.value = '油';
+ weightInput.value = '1000';
+ config[0] = { name: '油', weight: 1000 };
+ renderGrid();
+ showToast('油重量已恢复默认 1000g', 1500, 'success');
+ return;
+ }
+ select.value = '';
+ weightInput.value = '';
+ showToast('位置 ' + editingPos + ' 调料选择已清除', 1500, 'success');
}
/* 关闭选择 */