From 606cdde2f051f5abf7ec9fbf6926cafa61a4e931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Thu, 31 Oct 2024 11:23:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=BD=91=E7=BB=9C=E8=AF=B7=E6=B1=82=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/backend/module/index.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/web/src/views/backend/module/index.ts b/web/src/views/backend/module/index.ts index 9293dbc8..8415a452 100644 --- a/web/src/views/backend/module/index.ts +++ b/web/src/views/backend/module/index.ts @@ -267,6 +267,7 @@ export const execInstall = (uid: string, id: number, extend: anyObj = {}) => { state.common.dialogTitle = i18n.global.t('module.Installation complete') state.common.moduleState = moduleInstallState.INSTALLED state.common.type = 'done' + onRefreshTableData() }) .catch((res) => { if (loginExpired(res)) return @@ -306,11 +307,11 @@ export const execInstall = (uid: string, id: number, extend: anyObj = {}) => { zIndex: 9999, }) state.dialog.common = false + onRefreshTableData() } }) .finally(() => { state.loading.common = false - onRefreshTableData() }) } @@ -321,15 +322,25 @@ const terminalTaskExecComplete = (res: number, type: string) => { }) if (state.common.waitInstallDepend.length == 0) { state.common.dependInstallState = 'success' + + // 仅在命令全部执行完毕才刷新数据 + if (router.currentRoute.value.name === 'moduleStore/moduleStore') { + onRefreshTableData() + } } } else { const terminal = useTerminal() terminal.toggle(true) state.common.dependInstallState = 'fail' + + // 有命令执行失败了,刷新一次数据 + if (router.currentRoute.value.name === 'moduleStore/moduleStore') { + onRefreshTableData() + } } + // 连续安装模块的情况中,首个模块的命令执行完毕时,自动启动了热更新 if (router.currentRoute.value.name === 'moduleStore/moduleStore') { - onRefreshTableData() closeHotUpdate('modules') } } @@ -386,7 +397,6 @@ export const onDisable = (confirmConflict = false) => { } state.common.uid = state.goodsInfo.uid execCommand(commandsData) - onRefreshTableData() } else if (res.code == -3) { // 更新 onInstall(state.goodsInfo.uid, state.goodsInfo.purchased) @@ -396,6 +406,7 @@ export const onDisable = (confirmConflict = false) => { message: res.msg, zIndex: 9999, }) + onRefreshTableData() } }) .finally(() => {