控制模式 割刀速度 加入 支持删除 返航点和障碍物点
This commit is contained in:
@@ -1596,11 +1596,41 @@ export default function RobotTaskPage() {
|
||||
|
||||
<span>
|
||||
{t('devices.controlMode')}
|
||||
{robotRealtimePosition?.controlMode == '1' ? (
|
||||
<span style={{ color: '#ff6f6f' }}>{t('devices.localMode')}</span>
|
||||
) : (
|
||||
<span style={{ color: '#9eff9e' }}>{t('devices.remoteMode')}</span>
|
||||
)}
|
||||
{(() => {
|
||||
const mode = robotRealtimePosition?.controlMode || robotRealtimePosition?.control_mode;
|
||||
|
||||
const modeConfig: Record<string, { label: string; color: string }> = {
|
||||
'0': {
|
||||
label: t('devices.controlOff'),
|
||||
color: '#999999',
|
||||
},
|
||||
'1': {
|
||||
label: t('devices.localCpntrol'),
|
||||
color: '#ff6f6f',
|
||||
},
|
||||
'2': {
|
||||
label: t('devices.autoTask'),
|
||||
color: '#9eff9e',
|
||||
},
|
||||
'3': {
|
||||
label: t('devices.remoteControl'),
|
||||
color: '#9eff9e',
|
||||
},
|
||||
};
|
||||
|
||||
const config =
|
||||
mode !== undefined && mode !== null
|
||||
? modeConfig[String(mode)]
|
||||
: undefined;
|
||||
|
||||
return config ? (
|
||||
<span style={{ color: config.color }}>{config.label}</span>
|
||||
) : (
|
||||
<span style={{ color: '#999999' }}>
|
||||
-
|
||||
</span>
|
||||
);
|
||||
})()}
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user