feat: 新增批量更新元素类型的转换提示,如普通点->动作点
This commit is contained in:
parent
388f4ea1e6
commit
616992e855
@ -76,10 +76,10 @@
|
||||
<span class="item-name">{{ getItemName(item) }}</span>
|
||||
<span class="item-type">{{ getItemType(item) }}</span>
|
||||
<div class="changes">
|
||||
<a-tag v-if="getPointChanges(item).length" color="blue">
|
||||
<a-tag v-if="getPointChanges(item).length" color="blue" class="change-tag">
|
||||
点位: {{ getPointChanges(item).join(', ') }}
|
||||
</a-tag>
|
||||
<a-tag v-if="getRouteChanges(item).length" color="green">
|
||||
<a-tag v-if="getRouteChanges(item).length" color="green" class="change-tag">
|
||||
路线: {{ getRouteChanges(item).join(', ') }}
|
||||
</a-tag>
|
||||
</div>
|
||||
@ -208,10 +208,14 @@ const getPointChanges = (item: MapPen) => {
|
||||
const currentType = item.point?.type;
|
||||
if (currentType === pointType.value) return [];
|
||||
|
||||
const currentTypeName = Object.keys(MapPointType).find(
|
||||
key => MapPointType[key as keyof typeof MapPointType] === currentType
|
||||
);
|
||||
const newTypeName = Object.keys(MapPointType).find(
|
||||
key => MapPointType[key as keyof typeof MapPointType] === pointType.value
|
||||
);
|
||||
return [`类型: ${newTypeName}`];
|
||||
|
||||
return [`类型: ${currentTypeName || '未知'} → ${newTypeName}`];
|
||||
};
|
||||
|
||||
// 获取路线变更描述
|
||||
@ -221,10 +225,13 @@ const getRouteChanges = (item: MapPen) => {
|
||||
const changes: string[] = [];
|
||||
|
||||
if (routePassType.value !== undefined && item.route?.pass !== routePassType.value) {
|
||||
const currentPassName = Object.keys(MapRoutePassType).find(
|
||||
key => MapRoutePassType[key as keyof typeof MapRoutePassType] === item.route?.pass
|
||||
);
|
||||
const newPassName = Object.keys(MapRoutePassType).find(
|
||||
key => MapRoutePassType[key as keyof typeof MapRoutePassType] === routePassType.value
|
||||
);
|
||||
changes.push(`通行: ${newPassName}`);
|
||||
changes.push(`通行: ${currentPassName || '未知'} → ${newPassName}`);
|
||||
}
|
||||
|
||||
return changes;
|
||||
@ -357,6 +364,25 @@ defineOptions({
|
||||
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: '';
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-right: 4px;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-bottom: 4px solid currentColor;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user