From a55922beaccab2c3cb416d0e72caadea463a34ba Mon Sep 17 00:00:00 2001
From: chenwenchang <479999519@qq.com>
Date: Thu, 7 Nov 2024 17:23:48 +0800
Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E4=B8=B4=E6=97=B6=E5=AF=86?=
=?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9=E7=BB=93=E6=9E=9C=E9=A1=B5=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=20#7031=20#=20Reviewed,=20transaction=20id:=2023165?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../index/Index.vue | 56 ++++++++++++-------
1 file changed, 35 insertions(+), 21 deletions(-)
diff --git a/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue b/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue
index c7dfcafa65..49184491f1 100644
--- a/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue
+++ b/dbm-ui/frontend/src/views/temporary-paassword-modify/index/Index.vue
@@ -16,12 +16,22 @@
+
+ {{ t('查看详情') }}
+
{{ t('密码正在修改中,请稍等') }}
@@ -136,33 +146,34 @@
},
);
- const currentScope = getCurrentScope();
const rootId = ref('');
- const modifyResult = ref
();
+ const modifyResult = ref('');
- const { run: queryAsyncModifyResultRun, loading: queryLoading } = useRequest(queryAsyncModifyResult, {
+ // 轮询
+ const { isActive, resume, pause } = useTimeoutPoll(() => {
+ queryAsyncModifyResultRun({
+ root_id: rootId.value,
+ });
+ }, 2000);
+
+ const { run: queryAsyncModifyResultRun } = useRequest(queryAsyncModifyResult, {
manual: true,
onSuccess({ data, status }) {
- modifyResult.value = data;
- // 设置轮询
- if (currentScope?.active) {
- !isActive.value && ['PENDING', 'RUNNING', 'FINISHED'].includes(status) && resume();
- } else {
+ /**
+ * 设置轮询
+ * FINISHED: 完成态
+ * FAILED: 失败态
+ * REVOKED: 取消态
+ */
+ if (['FINISHED', 'FAILED', 'REVOKED'].includes(status)) {
+ modifyResult.value = data;
pause();
+ return;
}
- },
- onError() {
- modifyResult.value = {} as ModifyAdminPassword;
+ !isActive.value && resume();
},
});
- // 轮询
- const { isActive, resume, pause } = useTimeoutPoll(() => {
- queryAsyncModifyResultRun({
- root_id: rootId.value,
- });
- }, 10000);
-
const { run: modifyAdminPasswordRun, loading: submitting } = useRequest(modifyAdminPassword, {
manual: true,
onSuccess(data) {
@@ -238,17 +249,20 @@
border-radius: 2px;
.submitting-mask {
+ display: flex;
padding: 90px 0 138px;
- text-align: center;
+ flex-direction: column;
+ align-items: center;
.submitting-icon {
+ margin-bottom: 18px;
font-size: 64px;
color: @primary-color;
animation: rotate 2s linear infinite;
}
.submitting-text {
- margin-top: 36px;
+ margin-top: 18px;
font-size: 24px;
color: #313238;
}