Commit 66d003f4 authored by 邓超's avatar 邓超

fix: 修复web配置保存bug

parent cad8e02b
Pipeline #44644 passed with stages
in 6 minutes 46 seconds
...@@ -67,7 +67,8 @@ const MiniMenu = props => { ...@@ -67,7 +67,8 @@ const MiniMenu = props => {
}, [flag, clientName]); }, [flag, clientName]);
// 获取菜单信息 // 获取菜单信息
useEffect(() => { useEffect(() => {
if (flag === 1) { console.log(flag, 'flag');
if (flag === 2) {
setExpendKey(menuID); setExpendKey(menuID);
} }
getInfo(); getInfo();
...@@ -91,27 +92,29 @@ const MiniMenu = props => { ...@@ -91,27 +92,29 @@ const MiniMenu = props => {
console.log(result, 'result'); console.log(result, 'result');
setTreeData(result); setTreeData(result);
if (result.length > 0) { if (result.length > 0) {
setMenuID(result[0].menuID);
setFlag(flag + 1); setFlag(flag + 1);
switch (result[0].menuType) { if (flag === 1) {
case 'MiniAppMenuGroup': setMenuID(result[0].menuID);
setNodeType(1); switch (result[0].menuType) {
setAddType(2); case 'MiniAppMenuGroup':
break; setNodeType(1);
case 'MiniAppMenuGroupTwo': setAddType(2);
setNodeType(2); break;
setAddType(4); case 'MiniAppMenuGroupTwo':
break; setNodeType(2);
case 'MiniAppMenu': setAddType(4);
setNodeType(3); break;
setAddType(3); case 'MiniAppMenu':
break; setNodeType(3);
case 'MiniAppMenuThree': setAddType(3);
setNodeType(4); break;
setAddType(4); case 'MiniAppMenuThree':
break; setNodeType(4);
default: setAddType(4);
break; break;
default:
break;
}
} }
} }
setLoading(false); setLoading(false);
......
...@@ -68,7 +68,7 @@ const EditForm = props => { ...@@ -68,7 +68,7 @@ const EditForm = props => {
// }, // },
// ]} // ]}
> >
<Input placeholder="请输入产品名称" allowClear disabled /> <Input placeholder="请输入产品名称" allowClear />
</Item> </Item>
<Item <Item
label="产品说明:" label="产品说明:"
...@@ -81,7 +81,7 @@ const EditForm = props => { ...@@ -81,7 +81,7 @@ const EditForm = props => {
// }, // },
// ]} // ]}
> >
<Input placeholder="请输入产品说明" disabled /> <Input placeholder="请输入产品说明" />
</Item> </Item>
<Item <Item
label="发布状态:" label="发布状态:"
...@@ -113,10 +113,7 @@ const EditForm = props => { ...@@ -113,10 +113,7 @@ const EditForm = props => {
]} ]}
> >
{/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */} {/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */}
<Input <Input placeholder="请输入访问路由,ip加端口号,示例//localhost:3001" allowClear />
placeholder="请输入访问路由,ip加端口号,示例//localhost:3001"
allowClear
/>
</Item> </Item>
<Item <Item
...@@ -135,10 +132,7 @@ const EditForm = props => { ...@@ -135,10 +132,7 @@ const EditForm = props => {
/> />
</Item> </Item>
<div style={{ display: 'flex', marginLeft: '35%' }}> <div style={{ display: 'flex', marginLeft: '35%' }}>
<Item <Item wrapperCol={{ span: 8, offset: 8 }} style={{ marginRight: '30px' }}>
wrapperCol={{ span: 8, offset: 8 }}
style={{ marginRight: '30px' }}
>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
提交 提交
</Button> </Button>
......
...@@ -427,20 +427,22 @@ const MiniMenu = props => { ...@@ -427,20 +427,22 @@ const MiniMenu = props => {
setMenuList(arr2 || []); setMenuList(arr2 || []);
// 进页面后默认展示第一条数据 // 进页面后默认展示第一条数据
if (arr2.length > 0) { if (arr2.length > 0) {
setMenuID(arr2[0].menuID); if (flag === 1) {
setMenuID(arr2[0].menuID);
setCurMenuType(arr2[0].menuType);
switch (arr2[0].menuType) {
case 'Web4MenuGroup':
setNodeType(2);
setAddType(2);
break;
default:
setNodeType(1);
setAddType(1);
break;
}
}
setFlag(flag + 1); setFlag(flag + 1);
setCurMenuType(arr2[0].menuType);
switch (arr2[0].menuType) {
case 'Web4MenuGroup':
setNodeType(2);
setAddType(2);
break;
default:
setNodeType(1);
setAddType(1);
break;
}
} }
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment