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) }