refactor: 移除操作类型显示名称函数,直接使用操作类型字符串,优化代码简洁性;更新编辑器服务以支持关联存储位置
This commit is contained in:
parent
a1e126c471
commit
0c44af67a0
@ -118,26 +118,6 @@ const getTaskOperations = (task: BinTaskItem) => {
|
||||
return operations;
|
||||
};
|
||||
|
||||
// 获取操作类型的显示名称
|
||||
const getOperationDisplayName = (operationType: string): string => {
|
||||
const operationNames: Record<string, string> = {
|
||||
Load: '装载',
|
||||
JackLoad: '装载',
|
||||
Unload: '卸载',
|
||||
JackUnload: '卸载',
|
||||
Move: '移动',
|
||||
Pick: '拾取',
|
||||
Place: '放置',
|
||||
Scan: '扫描',
|
||||
Check: '检查',
|
||||
Wait: '等待',
|
||||
Charge: '充电',
|
||||
Clean: '清理',
|
||||
};
|
||||
|
||||
return operationNames[operationType] || operationType || '未知操作';
|
||||
};
|
||||
|
||||
// 获取当前动作点对应的库位任务数据
|
||||
const binTaskData = computed(() => {
|
||||
try {
|
||||
@ -302,7 +282,7 @@ const binTaskData = computed(() => {
|
||||
class="task-operation"
|
||||
>
|
||||
<a-typography-text class="operation-title">
|
||||
{{ getOperationDisplayName(operationType) }}
|
||||
{{ operationType }}
|
||||
</a-typography-text>
|
||||
<div class="operation-summary">
|
||||
<span class="operation-type">{{ operation.operation || '未知操作' }}</span>
|
||||
|
@ -236,7 +236,21 @@ export class EditorService extends Meta2d {
|
||||
if (!points?.length) return;
|
||||
await Promise.all(
|
||||
points.map(async (v) => {
|
||||
const { id, name, desc, x, y, type, extensionType, robots, actions, properties, deviceId, enabled } = v;
|
||||
const {
|
||||
id,
|
||||
name,
|
||||
desc,
|
||||
x,
|
||||
y,
|
||||
type,
|
||||
extensionType,
|
||||
robots,
|
||||
actions,
|
||||
associatedStorageLocations,
|
||||
properties,
|
||||
deviceId,
|
||||
enabled,
|
||||
} = v;
|
||||
// 只有在导入场景文件时才进行反向坐标转换
|
||||
let finalX = x;
|
||||
let finalY = y;
|
||||
@ -247,7 +261,13 @@ export class EditorService extends Meta2d {
|
||||
}
|
||||
await this.addPoint({ x: finalX, y: finalY }, type, id);
|
||||
this.setValue(
|
||||
{ id, label: name, desc, properties, point: { type, extensionType, robots, actions, deviceId, enabled } },
|
||||
{
|
||||
id,
|
||||
label: name,
|
||||
desc,
|
||||
properties,
|
||||
point: { type, extensionType, robots, actions, associatedStorageLocations, deviceId, enabled },
|
||||
},
|
||||
{ render: false, history: false, doEvent: false },
|
||||
);
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user