From 72b2a73aef0b4daa0ac5fd351f800577e37e1f40 Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Fri, 12 Aug 2022 10:42:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../offline/containers/statuscode.jsx | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx b/code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx index e14f667..09154ab 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx @@ -63,7 +63,11 @@ const Statuscode = (props) => { const codegetStatus = () => { searchData.current = { ...query, ...search } dispatch(offline.getStatus(searchData.current)).then((res) => { - + }); + } + function banned(row){ + dispatch(offline.putStatueBanned({statusId: row.id,forbidden: !row.forbidden,})).then(() => { + dispatch(offline.getStatus(searchData.current)) }); } const columns = [ @@ -115,19 +119,7 @@ const Statuscode = (props) => { {row.forbidden ? ( @@ -137,19 +129,7 @@ const Statuscode = (props) => { arrowPointAtCenter={false} showArrow={true} position="topRight" - onConfirm={() => { - dispatch( - offline.putStatueBanned( - { - statusId: row.id, - forbidden: !row.forbidden, - }, - row.forbidden - ) - ).then(() => { - codegetStatus(); - }); - }} + onConfirm={() => banned(row)} >