From 54e00f28524e546cecd0691d19fbcb0bee4af35e Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 10 Apr 2025 19:43:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E7=BC=96=E8=BE=91=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=9D=97/=E6=95=B0=E6=8D=AE=E6=BA=90=E6=97=B6?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E5=88=97=E8=A1=A8=E4=B8=AD=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/src/components/CodeBlockEditor.vue | 14 ++++++++++++- .../sidebar/code-block/CodeBlockList.vue | 1 + .../sidebar/code-block/CodeBlockListPanel.vue | 20 ++++++++++++++++++- .../data-source/DataSourceConfigPanel.vue | 14 ++++++++++++- .../sidebar/data-source/DataSourceList.vue | 1 + .../data-source/DataSourceListPanel.vue | 18 +++++++++++++++++ 6 files changed, 65 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/components/CodeBlockEditor.vue b/packages/editor/src/components/CodeBlockEditor.vue index 7f991bb6..4bcd534a 100644 --- a/packages/editor/src/components/CodeBlockEditor.vue +++ b/packages/editor/src/components/CodeBlockEditor.vue @@ -59,7 +59,7 @@ diff --git a/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue b/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue index 42c22298..2c51df49 100644 --- a/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue +++ b/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue @@ -45,6 +45,8 @@ :values="dataSourceValues" :title="dialogTitle" @submit="submitDataSourceHandler" + @close="editDialogCloseHandler" + @open="editDialogOpenHandler" > @@ -93,6 +95,22 @@ const { dataSourceService } = useServices(); const { editDialog, dataSourceValues, dialogTitle, editable, editHandler, submitDataSourceHandler } = useDataSourceEdit(dataSourceService); +const editDialogOpenHandler = (id: string) => { + if (dataSourceList.value) { + for (const [statusId, status] of dataSourceList.value.nodeStatusMap.entries()) { + status.selected = statusId === id; + } + } +}; + +const editDialogCloseHandler = () => { + if (dataSourceList.value) { + for (const [, status] of dataSourceList.value.nodeStatusMap.entries()) { + status.selected = false; + } + } +}; + const datasourceTypeList = computed(() => [ { text: '基础', type: 'base' },