This commit is contained in:
Baobhan Sith
2025-04-25 17:12:36 +08:00
parent 15a98f8ccf
commit e15789d1d3
2 changed files with 13 additions and 2 deletions
@@ -35,7 +35,8 @@ const emit = defineEmits([
'activate-session',
'close-session',
'open-layout-configurator',
'request-add-connection-from-popup' // 新增:声明从弹窗发出的添加请求事件
'request-add-connection-from-popup', // 声明从弹窗发出的添加请求事件
'request-edit-connection-from-popup' // 新增:声明从弹窗发出的编辑请求事件
]);
const activateSession = (sessionId: string) => {
@@ -72,6 +73,14 @@ const handleRequestAddFromPopup = () => {
emit('request-add-connection-from-popup'); // 向上发出事件
};
// 新增:处理从弹窗内部发出的编辑连接请求
const handleRequestEditFromPopup = (connection: any) => { // 假设 WorkspaceConnectionList 传递了连接对象
console.log('[TabBar] Received request-edit-connection from popup component for connection:', connection);
showConnectionListPopup.value = false; // 关闭弹窗
// 向上发出事件,并携带连接信息
emit('request-edit-connection-from-popup', connection);
};
// 新增:处理打开布局配置器的事件
const openLayoutConfigurator = () => {
console.log('[TabBar] Emitting open-layout-configurator event');
@@ -186,8 +195,9 @@ const toggleButtonTitle = computed(() => {
<div class="flex-grow overflow-y-auto border border-border rounded">
<WorkspaceConnectionListComponent
@connect-request="handlePopupConnect"
@open-new-session="handlePopupConnect"
@open-new-session="handlePopupConnect"
@request-add-connection="handleRequestAddFromPopup"
@request-edit-connection="handleRequestEditFromPopup"
class="popup-connection-list"
/>
</div>
@@ -362,6 +362,7 @@ const handleCloseEditorTab = (tabId: string) => {
@close-session="sessionStore.closeSession"
@open-layout-configurator="handleOpenLayoutConfigurator"
@request-add-connection-from-popup="handleRequestAddConnection"
@request-edit-connection-from-popup="handleRequestEditConnection"
/>
<!-- 移除 :class 绑定 -->