From 566a8ed287b78dba41676b11f6fc1fe79b93953f Mon Sep 17 00:00:00 2001 From: ZLY Date: Sun, 28 Sep 2025 15:08:26 +0800 Subject: [PATCH] =?UTF-8?q?pref(sidebar):=20=E4=BC=98=E5=8C=96=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=A0=8F=E5=BA=94=E7=94=A8=E7=BC=96=E8=BE=91=E6=98=AF?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E6=95=B0=E6=8D=AE=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ideContainer/sideBar.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/ideContainer/sideBar.tsx b/src/pages/ideContainer/sideBar.tsx index 2735003..f745ffb 100644 --- a/src/pages/ideContainer/sideBar.tsx +++ b/src/pages/ideContainer/sideBar.tsx @@ -55,6 +55,17 @@ const AppHandleModal = ({ appInfo, visible, type, onChangeVisible, onClose, onRe const { info } = useSelector(state => state.ideContainer); const [form] = Form.useForm(); + if (type === 'EDIT' && appInfo) { + form.setFieldsValue({ + id: appInfo?.id, + name: appInfo?.name, + description: appInfo?.description, + published: appInfo?.published === 1, + logo: 'scene04.png', // 先写死 + sceneId: info.id + }); + } + const onOk = async () => { await form.validate(); const formData = form.getFields(); @@ -75,16 +86,6 @@ const AppHandleModal = ({ appInfo, visible, type, onChangeVisible, onClose, onRe } // 编辑 else { - if (appInfo) { - form.setFieldsValue({ - id: appInfo?.id, - name: appInfo?.name, - description: appInfo?.description, - published: appInfo?.published === 1, - logo: 'scene04.png', // 先写死 - sceneId: info.id - }); - } const res: any = await editApp(formData); if (res.code === 200) Message.success('编辑成功'); else Message.error(res.message); @@ -271,7 +272,6 @@ const SideBar: React.FC = ({ selected, identity, subMenuData, onMe // 同时更新本地 menu 状态以触发重新渲染 setMenu(prevMenu => { - console.log('prevMenu:', prevMenu); const newMenu = [...prevMenu]; newMenu[activeKey] = { ...newMenu[activeKey], children: currentMenu[index].children }; return newMenu;