|
|
|
@ -55,6 +55,17 @@ const AppHandleModal = ({ appInfo, visible, type, onChangeVisible, onClose, onRe
|
|
|
|
const { info } = useSelector(state => state.ideContainer);
|
|
|
|
const { info } = useSelector(state => state.ideContainer);
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
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 () => {
|
|
|
|
const onOk = async () => {
|
|
|
|
await form.validate();
|
|
|
|
await form.validate();
|
|
|
|
const formData = form.getFields();
|
|
|
|
const formData = form.getFields();
|
|
|
|
@ -75,16 +86,6 @@ const AppHandleModal = ({ appInfo, visible, type, onChangeVisible, onClose, onRe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 编辑
|
|
|
|
// 编辑
|
|
|
|
else {
|
|
|
|
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);
|
|
|
|
const res: any = await editApp(formData);
|
|
|
|
if (res.code === 200) Message.success('编辑成功');
|
|
|
|
if (res.code === 200) Message.success('编辑成功');
|
|
|
|
else Message.error(res.message);
|
|
|
|
else Message.error(res.message);
|
|
|
|
@ -271,7 +272,6 @@ const SideBar: React.FC<SideBarProps> = ({ selected, identity, subMenuData, onMe
|
|
|
|
|
|
|
|
|
|
|
|
// 同时更新本地 menu 状态以触发重新渲染
|
|
|
|
// 同时更新本地 menu 状态以触发重新渲染
|
|
|
|
setMenu(prevMenu => {
|
|
|
|
setMenu(prevMenu => {
|
|
|
|
console.log('prevMenu:', prevMenu);
|
|
|
|
|
|
|
|
const newMenu = [...prevMenu];
|
|
|
|
const newMenu = [...prevMenu];
|
|
|
|
newMenu[activeKey] = { ...newMenu[activeKey], children: currentMenu[index].children };
|
|
|
|
newMenu[activeKey] = { ...newMenu[activeKey], children: currentMenu[index].children };
|
|
|
|
return newMenu;
|
|
|
|
return newMenu;
|
|
|
|
|