-
-
{{ getItemName(item) }}
-
{{ getItemType(item) }}
-
-
- 点位: {{ getPointChanges(item).join(', ') }}
-
-
- 路线: {{ getRouteChanges(item).join(', ') }}
-
+
+
+
路线编辑 ({{ lineItems.length }} 个)
+
+
+
+
+ {{ key }}
+
+
+
+
+
+
+
+
+
预览更改
+
+
+
{{ getItemName(item) }}
+
{{ getItemType(item) }}
+
+
+ 点位: {{ getPointChanges(item).join(', ') }}
+
+
+ 路线: {{ getRouteChanges(item).join(', ') }}
+
+
+
+
+
+
+
+
充电点 ({{ chargingPoints.length }} 个)
+
批量绑定机器人
+
+
+
停靠点 ({{ parkingPoints.length }} 个)
+
批量绑定机器人
+
+
+
无符合条件的点位
+
仅充电点和停靠点支持批量绑定机器人。
+
+
+
@@ -315,28 +340,28 @@ defineOptions({
.selection-info {
margin-bottom: 16px;
}
-
+
.edit-section {
margin-bottom: 16px;
padding: 12px;
border-radius: 6px;
-
+
h4 {
margin: 0 0 12px 0;
font-size: 14px;
}
}
-
+
.preview-section {
h4 {
margin: 0 0 12px 0;
font-size: 14px;
}
-
+
.preview-list {
max-height: 150px;
overflow-y: auto;
-
+
.preview-item {
display: flex;
align-items: center;
@@ -344,32 +369,32 @@ defineOptions({
margin-bottom: 6px;
border-radius: 4px;
font-size: 12px;
-
+
.item-name {
font-weight: 500;
margin-right: 10px;
min-width: 80px;
}
-
+
.item-type {
margin-right: 10px;
min-width: 100px;
}
-
+
.changes {
flex: 1;
-
+
.ant-tag {
margin-right: 6px;
margin-bottom: 2px;
font-size: 11px;
}
-
+
.change-tag {
font-weight: 500;
border: 1px solid currentColor;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
-
+
// 突出显示箭头符号
&::before {
content: '';
@@ -395,22 +420,22 @@ defineOptions({
.edit-section {
background: theme.get-color(fill3);
border: 1px solid theme.get-color(border2);
-
+
h4 {
color: theme.get-color(primary);
}
}
-
+
.preview-section {
h4 {
color: theme.get-color(success);
}
-
+
.preview-list {
.preview-item {
background: theme.get-color(bg_component);
border: 1px solid theme.get-color(border1);
-
+
.item-type {
color: theme.get-color(text3);
}
diff --git a/src/components/modal/robot-bind-modal.vue b/src/components/modal/robot-bind-modal.vue
index c964ab1..0e3cfb1 100644
--- a/src/components/modal/robot-bind-modal.vue
+++ b/src/components/modal/robot-bind-modal.vue
@@ -12,13 +12,23 @@ const editor = inject(props.token)!;
export type RobotBindModalRef = Ref;
type Ref = {
- open: (pen: MapPen) => void;
+ open: (pen: MapPen | MapPen[]) => void;
};
+const targetPens = ref
([]);
const open: Ref['open'] = (pen) => {
- if (!pen?.id) return;
+ if (!pen) return;
+ const pens = Array.isArray(pen) ? pen : [pen];
+ if (pens.length === 0) return;
+
keyword.value = '';
- id.value = pen.id;
- selected.value = pen.point?.robots ?? [];
+ targetPens.value = pens;
+
+ if (pens.length === 1) {
+ selected.value = pens[0].point?.robots ?? [];
+ } else {
+ selected.value = [];
+ }
+
show.value = true;
};
defineExpose[({ open });
@@ -28,11 +38,15 @@ const keyword = ref('');
const robots = computed(() => editor.value.robots.filter(({ label }) => label.includes(keyword.value)));
-const id = ref('');
const selected = ref([]);
const submit = () => {
- editor.value.updatePoint(id.value, { robots: toRaw(selected.value) });
+ const robotIds = toRaw(selected.value);
+ targetPens.value.forEach((pen) => {
+ if (pen.id) {
+ editor.value.updatePoint(pen.id, { robots: robotIds });
+ }
+ });
show.value = false;
};
]