update
This commit is contained in:
@@ -137,6 +137,7 @@ const paneLabels = computed(() => ({
|
|||||||
statusMonitor: t('layout.pane.statusMonitor', '状态监视器'),
|
statusMonitor: t('layout.pane.statusMonitor', '状态监视器'),
|
||||||
commandHistory: t('layout.pane.commandHistory', '命令历史'),
|
commandHistory: t('layout.pane.commandHistory', '命令历史'),
|
||||||
quickCommands: t('layout.pane.quickCommands', '快捷指令'),
|
quickCommands: t('layout.pane.quickCommands', '快捷指令'),
|
||||||
|
dockerManager: t('layout.pane.dockerManager', 'Docker 管理器'), // 添加 dockerManager
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// --- Methods ---
|
// --- Methods ---
|
||||||
@@ -409,6 +410,7 @@ const handleNodeRemove = (payload: { parentNodeId: string | undefined; nodeIndex
|
|||||||
:node="localLayoutTree"
|
:node="localLayoutTree"
|
||||||
:parent-node="null"
|
:parent-node="null"
|
||||||
:node-index="0"
|
:node-index="0"
|
||||||
|
:pane-labels="paneLabels"
|
||||||
@update:node="handleNodeUpdate"
|
@update:node="handleNodeUpdate"
|
||||||
@removeNode="handleNodeRemove"
|
@removeNode="handleNodeRemove"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: -1,
|
default: -1,
|
||||||
},
|
},
|
||||||
|
// 接收来自父组件的面板标签
|
||||||
|
paneLabels: {
|
||||||
|
type: Object as PropType<Record<PaneName, string>>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// --- Emits ---
|
// --- Emits ---
|
||||||
@@ -31,18 +36,6 @@ const { t } = useI18n();
|
|||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
|
|
||||||
// --- Computed ---
|
// --- Computed ---
|
||||||
// 获取面板标签
|
|
||||||
const paneLabels = computed(() => ({
|
|
||||||
connections: t('layout.pane.connections', '连接列表'),
|
|
||||||
terminal: t('layout.pane.terminal', '终端'),
|
|
||||||
commandBar: t('layout.pane.commandBar', '命令栏'),
|
|
||||||
fileManager: t('layout.pane.fileManager', '文件管理器'),
|
|
||||||
editor: t('layout.pane.editor', '编辑器'),
|
|
||||||
statusMonitor: t('layout.pane.statusMonitor', '状态监视器'),
|
|
||||||
commandHistory: t('layout.pane.commandHistory', '命令历史'),
|
|
||||||
quickCommands: t('layout.pane.quickCommands', '快捷指令'),
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 计算当前节点的子节点列表(用于 v-model)
|
// 计算当前节点的子节点列表(用于 v-model)
|
||||||
// 注意:直接修改 props 是不允许的,vuedraggable 需要一个可写的 list
|
// 注意:直接修改 props 是不允许的,vuedraggable 需要一个可写的 list
|
||||||
// 我们通过 emit 事件来通知父组件更新
|
// 我们通过 emit 事件来通知父组件更新
|
||||||
@@ -139,7 +132,7 @@ const handleChildRemove = (payload: { parentNodeId: string | undefined; nodeInde
|
|||||||
<!-- 节点控制栏 -->
|
<!-- 节点控制栏 -->
|
||||||
<div class="node-controls">
|
<div class="node-controls">
|
||||||
<span class="node-info">
|
<span class="node-info">
|
||||||
{{ node.type === 'pane' ? (paneLabels[node.component!] || node.component) : `容器 (${node.direction === 'horizontal' ? '水平' : '垂直'})` }}
|
{{ node.type === 'pane' ? (props.paneLabels[node.component!] || node.component) : `容器 (${node.direction === 'horizontal' ? '水平' : '垂直'})` }}
|
||||||
</span>
|
</span>
|
||||||
<div class="node-actions">
|
<div class="node-actions">
|
||||||
<button v-if="node.type === 'container'" @click="toggleDirection" title="切换方向" class="action-button">
|
<button v-if="node.type === 'container'" @click="toggleDirection" title="切换方向" class="action-button">
|
||||||
@@ -178,6 +171,7 @@ const handleChildRemove = (payload: { parentNodeId: string | undefined; nodeInde
|
|||||||
:node="childNode"
|
:node="childNode"
|
||||||
:parent-node="node"
|
:parent-node="node"
|
||||||
:node-index="index"
|
:node-index="index"
|
||||||
|
:pane-labels="props.paneLabels"
|
||||||
@update:node="handleChildUpdate($event, index)"
|
@update:node="handleChildUpdate($event, index)"
|
||||||
@removeNode="handleChildRemove"
|
@removeNode="handleChildRemove"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -725,7 +725,8 @@
|
|||||||
"editor": "Editor",
|
"editor": "Editor",
|
||||||
"statusMonitor": "Status Monitor",
|
"statusMonitor": "Status Monitor",
|
||||||
"commandHistory": "Command History",
|
"commandHistory": "Command History",
|
||||||
"quickCommands": "Quick Commands"
|
"quickCommands": "Quick Commands",
|
||||||
|
"dockerManager": "Docker Manager"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
|
|||||||
@@ -725,7 +725,8 @@
|
|||||||
"editor": "编辑器",
|
"editor": "编辑器",
|
||||||
"statusMonitor": "状态监视器",
|
"statusMonitor": "状态监视器",
|
||||||
"commandHistory": "命令历史",
|
"commandHistory": "命令历史",
|
||||||
"quickCommands": "快捷指令"
|
"quickCommands": "快捷指令",
|
||||||
|
"dockerManager": "Docker 管理器"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
|
|||||||
Reference in New Issue
Block a user