From f3c23d8b06c7ed9f00c60be22f87ad9191ecee3a Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Fri, 2 Dec 2022 15:49:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/i18n/lang/zh.yaml | 2 +- frontend/src/hooks/use-delete-data.ts | 29 +++++++++++++------ .../src/views/app-store/installed/index.vue | 1 + 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/backend/i18n/lang/zh.yaml b/backend/i18n/lang/zh.yaml index 8a95b5685..539a4fcf2 100644 --- a/backend/i18n/lang/zh.yaml +++ b/backend/i18n/lang/zh.yaml @@ -18,6 +18,6 @@ ErrNotSupportType: "系统暂不支持当前类型: {{ .detail }}" ErrNameIsExist: "名称已存在" #app -ErrPortInUsed: "{{ .detail }} 已被占用!" +ErrPortInUsed: "{{ .detail }} 端口已被占用!" ErrAppLimit: "应用超出安装数量限制" ErrAppRequired: "请先安装 {{ .detail }} 应用" \ No newline at end of file diff --git a/frontend/src/hooks/use-delete-data.ts b/frontend/src/hooks/use-delete-data.ts index 55f9e909f..20f13fda5 100644 --- a/frontend/src/hooks/use-delete-data.ts +++ b/frontend/src/hooks/use-delete-data.ts @@ -20,18 +20,29 @@ export const useDeleteData =

( ElMessageBox.confirm(i18n.global.t(`${message}`) + '?', i18n.global.t('commons.msg.deleteTitle'), { confirmButtonText: i18n.global.t('commons.button.confirm'), cancelButtonText: i18n.global.t('commons.button.cancel'), + closeOnClickModal: false, + closeOnPressEscape: false, + showClose: false, type: confirmType, draggable: true, + beforeClose: async (action, instance, done) => { + if (action === 'confirm') { + instance.confirmButtonLoading = true; + instance.cancelButtonLoading = true; + const res = await api(params); + done(); + if (!res) return reject(false); + resolve(true); + ElMessage({ + type: 'success', + message: i18n.global.t('commons.msg.operationSuccess'), + }); + } else { + done(); + } + }, }) - .then(async () => { - const res = await api(params); - if (!res) return reject(false); - ElMessage({ - type: 'success', - message: i18n.global.t('commons.msg.operationSuccess'), - }); - resolve(true); - }) + .then(() => {}) .catch(() => {}); }); }; diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index b75e34734..624613777 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -195,6 +195,7 @@ const openOperate = (row: any, op: string) => { checkRef.value.acceptParams({ items: items }); } else { await useDeleteData(InstalledOp, operateReq, 'app.deleteWarn'); + search(); } }); } else {