From 181677978b4aeb31d6e2da58bdcd573c98b6c21d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 18 Feb 2025 15:07:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=E4=BB=AA=E8=A1=A8=E6=9D=BF=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=8F=AF=E8=BF=9B=E5=85=A5=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/visualization/DvSidebar.vue | 22 ++++++++++--------- .../src/views/dashboard/index.vue | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/core-frontend/src/components/visualization/DvSidebar.vue b/core/core-frontend/src/components/visualization/DvSidebar.vue index 3fb7b283b3..b3064ddae9 100644 --- a/core/core-frontend/src/components/visualization/DvSidebar.vue +++ b/core/core-frontend/src/components/visualization/DvSidebar.vue @@ -104,17 +104,19 @@ const closeEditComponentName = () => { } const editComponentName = () => { - componentNameEdit.value = true - if (isViewTitle.value) { - inputComponentName.value.name = view.value.title - inputComponentName.value.id = view.value.id - } else { - inputComponentName.value.name = element.value.name - inputComponentName.value.id = element.value.id + if (element.value?.id || view.value?.id) { + componentNameEdit.value = true + if (isViewTitle.value) { + inputComponentName.value.name = view.value.title + inputComponentName.value.id = view.value.id + } else { + inputComponentName.value.name = element.value.name + inputComponentName.value.id = element.value.id + } + nextTick(() => { + componentNameInputAttr.value.focus() + }) } - nextTick(() => { - componentNameInputAttr.value.focus() - }) } const onComponentNameChange = () => { diff --git a/core/core-frontend/src/views/dashboard/index.vue b/core/core-frontend/src/views/dashboard/index.vue index 8d06d8bb3b..bf731bc727 100644 --- a/core/core-frontend/src/views/dashboard/index.vue +++ b/core/core-frontend/src/views/dashboard/index.vue @@ -344,6 +344,7 @@ onUnmounted(() => { :title="t('visualization.dashboard_configuration')" :width="420" aside-position="right" + side-name="canvas" class="left-sidebar" >