From 1c83851ed5f65fba05e2246a16af250073ff3d62 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 29 Feb 2024 11:02:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E7=89=88=E5=88=97=E8=A1=A8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E4=B8=AD=E9=80=89=E6=8B=A9=E7=9A=84=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=8F=AF=E8=83=BD=E5=92=8C=E5=8F=B3=E4=BE=A7=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E6=A8=A1=E7=89=88=E5=88=86=E7=B1=BB=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/component/DeTemplateImport.vue | 21 ++++++++++++++++--- .../src/views/template/index.vue | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/template/component/DeTemplateImport.vue b/core/core-frontend/src/views/template/component/DeTemplateImport.vue index 37dcaaaee5..27aa5e7107 100644 --- a/core/core-frontend/src/views/template/component/DeTemplateImport.vue +++ b/core/core-frontend/src/views/template/component/DeTemplateImport.vue @@ -192,12 +192,27 @@ const editTemplate = () => { nameCheck(nameCheckRequest).then(response => { save(state.templateInfo).then(response => { ElMessage.success(t('编辑成功')) - emits('refresh', { optType: 'refresh' }) + emits('refresh', getRefreshPInfo()) emits('closeEditTemplateDialog') }) }) } +const getRefreshPInfo = () => { + const refreshPid = state.templateInfo.categories[0] + let refreshPName = '' + props.templateCategories.forEach(category => { + if (category.id === refreshPid) { + refreshPName = category.name + } + }) + return { + optType: 'refresh', + refreshPid: refreshPid, + refreshPName: refreshPName + } +} + const importTemplate = () => { const nameCheckRequest = { pid: state.templateInfo.pid, @@ -216,7 +231,7 @@ const importTemplate = () => { }).then(() => { save(state.templateInfo).then(response => { ElMessage.success(t('覆盖成功')) - emits('refresh', { optType: 'refresh' }) + emits('refresh', getRefreshPInfo()) emits('closeEditTemplateDialog') }) }) @@ -225,7 +240,7 @@ const importTemplate = () => { nameCheck(nameCheckRequest).then(response => { save(state.templateInfo).then(response => { ElMessage.success(t('导入成功')) - emits('refresh', { optType: 'refresh' }) + emits('refresh', getRefreshPInfo()) emits('closeEditTemplateDialog') }) }) diff --git a/core/core-frontend/src/views/template/index.vue b/core/core-frontend/src/views/template/index.vue index 58f30d94dc..8b0cf1a500 100644 --- a/core/core-frontend/src/views/template/index.vue +++ b/core/core-frontend/src/views/template/index.vue @@ -370,7 +370,7 @@ const handleClick = (tab, event) => { const importRefresh = params => { if (params.optType === 'refresh') { - showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel) + templateListRef.value.nodeClick({ id: params.refreshPid, name: params.refreshPid }) } else { showTemplateEditDialog('new', null) }