任务开关

This commit is contained in:
ywb
2026-05-27 14:49:40 +08:00
parent c1601c0a85
commit fcf5649d8c
5 changed files with 209 additions and 28 deletions
+68
View File
@@ -920,3 +920,71 @@ a:hover { text-decoration: underline; }
gap: 16px;
margin-top: 12px;
}
/* ========== 任务步骤控制开关 ========== */
.toggle-grid {
display: flex;
flex-direction: column;
gap: 12px;
}
.toggle-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 14px;
background: #0a0a0a;
border: 1px solid #1a1a1a;
border-radius: 8px;
transition: border-color 0.2s;
}
.toggle-item:hover {
border-color: #333;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
flex-shrink: 0;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background-color: #333;
border-radius: 24px;
transition: 0.3s;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: #888;
border-radius: 50%;
transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
background-color: #2e7d32;
}
.toggle-switch input:checked + .toggle-slider:before {
transform: translateX(20px);
background-color: #4caf50;
}
.toggle-label {
font-size: 14px;
font-weight: 600;
color: #e0e0e0;
min-width: 140px;
}
.toggle-hint {
font-size: 12px;
color: #666;
}
+13 -1
View File
@@ -21,6 +21,12 @@ createApp({
errorMsg: '',
waitingStep: false,
stepLabel: '',
// 任务步骤控制开关
armInitEnabled: true,
agvMoveEnabled: true,
qrScanEnabled: true,
frontPhotoEnabled: true,
backPhotoEnabled: true,
}
},
computed: {
@@ -114,7 +120,13 @@ createApp({
await fetch(API + '/api/mission/start', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
body: JSON.stringify({
arm_init: this.armInitEnabled,
agv_move: this.agvMoveEnabled,
qr_scan: this.qrScanEnabled,
front_photo: this.frontPhotoEnabled,
back_photo: this.backPhotoEnabled,
})
})
this.missionState = 'running'
},