急停 发送的模式切换 接收障碍物信息 纵览界面 返航和任务表格数据 优化 状态界面加入人员跟随和 系统模式 还未对接系统模式 任务监控界面加入障碍物
This commit is contained in:
@@ -17,6 +17,8 @@ import { getStationRegions } from '@/api/stationManage';
|
||||
import { Reorder } from 'motion/react';
|
||||
import { MapEditorView } from './MapEditorView';
|
||||
import type { ViewStats } from './WayLineView';
|
||||
import { backToRestPointCommand } from '@/api/mapEdit';
|
||||
|
||||
|
||||
const { Text, Title } = Typography;
|
||||
const { RangePicker } = DatePicker;
|
||||
@@ -61,7 +63,6 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
|
||||
// 设备数据
|
||||
const [devices, setDevices] = useState([]);
|
||||
const [deleteLoading, setDeleteLoading] = useState(false);
|
||||
|
||||
|
||||
|
||||
@@ -430,10 +431,11 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
if (!rt) return null;
|
||||
return {
|
||||
...rt,
|
||||
longitude: rt.lng,
|
||||
latitude: rt.lat,
|
||||
fix_status: rt.fixStatus,
|
||||
controlMode: rt.controlMode ?? targetRobot?.lastRunningStatus?.controlMode,
|
||||
longitude: rt?.lng,
|
||||
latitude: rt?.lat,
|
||||
fix_status: rt?.fixStatus,
|
||||
controlMode: rt?.controlMode ?? targetRobot?.lastRunningStatus?.controlMode,
|
||||
sm: rt?.sm,
|
||||
};
|
||||
}, [realtimeMap, targetRobot]);
|
||||
|
||||
@@ -1361,6 +1363,23 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
return (routeList || []).filter(rt => ids.has(rt.id));
|
||||
}, [regionList, dispatchRegionIds, routeList]);
|
||||
|
||||
const handleAutoBack = () => {
|
||||
const payload = {
|
||||
deviceId: selectedMachineSn,
|
||||
orgId: currentStation?.orgId,
|
||||
siteId: stationId,
|
||||
}
|
||||
backToRestPointCommand(payload).then(res => {
|
||||
if (res.code == 200) {
|
||||
messageApi.success(t('devices.fixed2ReturnHomeFixed2CommandIssuedFixed2'));
|
||||
} else {
|
||||
messageApi.error(res.msg || t('devices.fixed2ReturnHomeFixed2CommandIssuedFixed2Failed2'));
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('返回休息点失败', err);
|
||||
})
|
||||
}
|
||||
|
||||
// 选中的路径对象列表(用于拖拽排序显示)
|
||||
const selectedRouteObjects = useMemo(() => {
|
||||
// 根据 dispatchRouteIds 的顺序返回路径对象
|
||||
@@ -1801,6 +1820,39 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
})()}
|
||||
</span>
|
||||
|
||||
<span>
|
||||
{t('devices.systemMode')}
|
||||
{(() => {
|
||||
const mode = robotRealtimePosition?.sm || robotRealtimePosition?.sm;
|
||||
|
||||
const modeConfig: Record<string, { label: string; color: string }> = {
|
||||
|
||||
'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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1855,6 +1907,7 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
}}
|
||||
onMouseEnter={e => e.currentTarget.style.background = 'rgba(255,255,255,0.3)'}
|
||||
onMouseLeave={e => e.currentTarget.style.background = 'rgba(255,255,255,0.18)'}
|
||||
onClick={handleAutoBack}
|
||||
>
|
||||
<EnvironmentOutlined />
|
||||
{t('devices.features.autoback')}
|
||||
@@ -2810,7 +2863,7 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
||||
</div>
|
||||
<Button onClick={handleDispatchCancel}>{t('common.cancel')}</Button>
|
||||
|
||||
<Button type="primary" style={{ flex: 1 }} loading={dispatchLoading} onClick={handleDispatchTask}>
|
||||
<Button type="primary" style={{ flex: 1 }} loading={dispatchLoading} onClick={handleDispatchTask} disabled={dispatchLoading}>
|
||||
{dispatchMode === 'immediate' ? t('devices.taskExecuteNow') : t('devices.taskSaveSchedule')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user