From 2db0932f2204ce6859c25bd9073c1e0055a5ba86 Mon Sep 17 00:00:00 2001 From: Vectorune Date: Tue, 11 Nov 2025 16:12:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=81=E6=98=8E=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=88=B7=E6=96=B0=E6=88=96=E9=80=80=E5=87=BA=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E6=AD=A5=EF=BC=8C=E5=90=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E5=BA=94=E9=97=AE=E9=A2=98=EF=BC=88=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E7=BC=93=E5=AD=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataPrint/QueryConditionBox/index.jsx | 2 +- .../GenerateCertificate/ChooseUser.jsx | 30 ++++++++++--------- .../Dashboard/GenerateCertificate/index.jsx | 17 ++++++----- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/page/Dashboard/DataPrint/QueryConditionBox/index.jsx b/src/page/Dashboard/DataPrint/QueryConditionBox/index.jsx index 847d216..069d3eb 100644 --- a/src/page/Dashboard/DataPrint/QueryConditionBox/index.jsx +++ b/src/page/Dashboard/DataPrint/QueryConditionBox/index.jsx @@ -155,7 +155,7 @@ function QueryConditionBox(props) { + onClick={() => navigate('/generate-certificate')}>生成新证明 diff --git a/src/page/Dashboard/GenerateCertificate/ChooseUser.jsx b/src/page/Dashboard/GenerateCertificate/ChooseUser.jsx index 0db9e9b..997cf78 100644 --- a/src/page/Dashboard/GenerateCertificate/ChooseUser.jsx +++ b/src/page/Dashboard/GenerateCertificate/ChooseUser.jsx @@ -51,21 +51,23 @@ const ChooseUser = props => { console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); allowNext(selectedRows.length > 0); setRequest({...request, stuffNumber: selectedRows[0].staffNumber}); - sessionStorage.setItem('chooseUser', selectedRowKeys) - sessionStorage.removeItem('certificateParam'); - sessionStorage.removeItem('targetKeys'); - sessionStorage.removeItem('generate-request'); + //sessionStorage.setItem('chooseUser', selectedRowKeys) + //sessionStorage.removeItem('certificateParam'); + //sessionStorage.removeItem('targetKeys'); + //sessionStorage.removeItem('generate-request'); }, - defaultSelectedRowKeys: () => { - const selectedRowKeys = []; - let selected = sessionStorage.getItem('chooseUser'); - if (selected) { - // 转换为number - selectedRowKeys.push(selected); - allowNext(selectedRowKeys.length > 0); - } - return selectedRowKeys; - } + //defaultSelectedRowKeys: () => { + // const selectedRowKeys = []; + // let selected = sessionStorage.getItem('chooseUser'); + // if (selected) { + // // 转换为number + // selectedRowKeys.push(selected); + // allowNext(selectedRowKeys.length > 0); + // } + // return selectedRowKeys; + //} + // 移除默认选中行的缓存恢复 + defaultSelectedRowKeys: () => [], }; useEffect(() => { diff --git a/src/page/Dashboard/GenerateCertificate/index.jsx b/src/page/Dashboard/GenerateCertificate/index.jsx index d1f482c..c922ac0 100644 --- a/src/page/Dashboard/GenerateCertificate/index.jsx +++ b/src/page/Dashboard/GenerateCertificate/index.jsx @@ -15,14 +15,15 @@ const GenerateCertificate = props => { const navigate = useNavigate(); - const [current, setCurrent] = React.useState(() => { - let nowStep = sessionStorage.getItem('nowStep'); - if (nowStep === null) { - return 0; - } else { - return parseInt(nowStep); - } - }); + //const [current, setCurrent] = React.useState(() => { + // let nowStep = sessionStorage.getItem('nowStep'); + // if (nowStep === null) { + // return 0; + // } else { + // return parseInt(nowStep); + // } + //}); + const [current, setCurrent] = React.useState(0); const [request, setRequest] = React.useState({ ids: [],