From 9647fadf5cd583cd5db3a71607de6dca885e6b6c Mon Sep 17 00:00:00 2001 From: wb-672209 Date: Fri, 7 Jul 2023 15:51:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(hotfix):=E8=A1=A5=E4=B8=81=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=A8=A1=E5=9D=97=20=E7=83=AD=E8=A1=A5=E4=B8=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=20=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E5=8A=9F=E8=83=BD=E6=8A=A5=E9=94=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E6=B7=BB=E5=8A=A0=E6=88=90=E5=8A=9F=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/hotfix/FormalHotfixList/index.jsx | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/sysom_web/src/pages/hotfix/FormalHotfixList/index.jsx b/sysom_web/src/pages/hotfix/FormalHotfixList/index.jsx index 492c2ccf..175e9413 100644 --- a/sysom_web/src/pages/hotfix/FormalHotfixList/index.jsx +++ b/sysom_web/src/pages/hotfix/FormalHotfixList/index.jsx @@ -46,7 +46,6 @@ const FormalHotfixList = () => { const intl = useIntl(); const [loadings, setLoadings] = useState([]); const [disabled, setDisabled] = useState([]); - const [messageApi, contextHolder] = message.useMessage(); const enterLoading = async (record) => { setLoadings((prevLoadings) => { @@ -59,8 +58,29 @@ const FormalHotfixList = () => { newdisabled[record.id] = true; return newdisabled; }); - const res = await postOneclickDeployment(record); - if (res) { + const res = await postOneclickDeployment(record).then(res=>{ + if (res) { + setLoadings((prevLoadings) => { + const newLoadings = [...prevLoadings]; + newLoadings[record.id] = false; + return newLoadings; + }); + setDisabled((prevLoadings) => { + const newdisabled = [...prevLoadings]; + newdisabled[record.id] = false; + return newdisabled; + }); + if(res.code === 200){ + message.success('部署成功!'); + message.success(res.data.msg); + }else{ + message.error('部署失败!'); + } + } else{ + message.error('部署有问题!'); + } + }).catch((res)=>{ + message.error('部署有问题,请查找原因后再部署!'); setLoadings((prevLoadings) => { const newLoadings = [...prevLoadings]; newLoadings[record.id] = false; @@ -71,18 +91,8 @@ const FormalHotfixList = () => { newdisabled[record.id] = false; return newdisabled; }); - if(res.code === 200){ - messageApi.open({ - type: 'success', - content: res.data.msg, - }); - }else{ - messageApi.open({ - type: 'error', - content: res.data.msg, - }); - } - } + }); + }; const columns = [ -- Gitee