边框调节

This commit is contained in:
zqm
2026-01-04 10:15:39 +08:00
parent f4eaee6c61
commit c448c361c9
3 changed files with 81 additions and 35 deletions

View File

@@ -422,16 +422,7 @@ const onPanelDragEnd = async (event) => {
dragOperationCache.delete(event.dragId);
};
// 监听区域位置更新下降事件
const onAreaPositionUpdate = (event) => {
const id = event.areaId;
const position = event.position;
const area = floatingAreas.value.find(a => a.id === id);
if (area) {
area.left = position.left;
area.top = position.top;
}
};
// 监听区域拖拽状态更新下降事件
const onAreaDragStateUpdate = (event) => {
@@ -570,6 +561,8 @@ const setupEventListeners = () => {
unsubscribeFunctions.push(eventBus.on(EVENT_TYPES.AREA_RESIZE_START, onAreaResizeStart, { componentId: 'dock-layout' }));
unsubscribeFunctions.push(eventBus.on(EVENT_TYPES.AREA_RESIZE_MOVE, onAreaResizeMove, { componentId: 'dock-layout' }));
unsubscribeFunctions.push(eventBus.on(EVENT_TYPES.AREA_RESIZE_END, onAreaResizeEnd, { componentId: 'dock-layout' }));
// Area位置更新事件
unsubscribeFunctions.push(eventBus.on(EVENT_TYPES.AREA_POSITION_UPDATE, onAreaPositionUpdate, { componentId: 'dock-layout' }));
// Resize相关事件
unsubscribeFunctions.push(eventBus.on(EVENT_TYPES.RESIZE_START, () => emit('dragStart'), { componentId: 'dock-layout' }));
@@ -1158,6 +1151,23 @@ const onAreaResizeMove = (event) => {
}
};
// 处理Area位置更新事件
const onAreaPositionUpdate = (event) => {
const { areaId, left, top, width, height } = event;
const area = floatingAreas.value.find(a => a.id === areaId);
if (area) {
area.left = left;
area.top = top;
if (width !== undefined) {
area.width = width;
}
if (height !== undefined) {
area.height = height;
}
}
};
const onAreaResizeEnd = (event) => {
const { areaId, direction, finalPosition } = event;