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' },