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,8 +92,9 @@ const MiniMenu = props => { ...@@ -91,8 +92,9 @@ 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);
if (flag === 1) {
setMenuID(result[0].menuID);
switch (result[0].menuType) { switch (result[0].menuType) {
case 'MiniAppMenuGroup': case 'MiniAppMenuGroup':
setNodeType(1); setNodeType(1);
...@@ -114,6 +116,7 @@ const MiniMenu = props => { ...@@ -114,6 +116,7 @@ const MiniMenu = props => {
break; break;
} }
} }
}
setLoading(false); setLoading(false);
// 第一次加载,默认选择第一个组织 // 第一次加载,默认选择第一个组织
// if (treeFlag) { // if (treeFlag) {
......
...@@ -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,9 +427,8 @@ const MiniMenu = props => { ...@@ -427,9 +427,8 @@ const MiniMenu = props => {
setMenuList(arr2 || []); setMenuList(arr2 || []);
// 进页面后默认展示第一条数据 // 进页面后默认展示第一条数据
if (arr2.length > 0) { if (arr2.length > 0) {
if (flag === 1) {
setMenuID(arr2[0].menuID); setMenuID(arr2[0].menuID);
setFlag(flag + 1);
setCurMenuType(arr2[0].menuType); setCurMenuType(arr2[0].menuType);
switch (arr2[0].menuType) { switch (arr2[0].menuType) {
case 'Web4MenuGroup': case 'Web4MenuGroup':
...@@ -442,6 +441,9 @@ const MiniMenu = props => { ...@@ -442,6 +441,9 @@ const MiniMenu = props => {
break; break;
} }
} }
setFlag(flag + 1);
}
} }
}) })
.catch(err => { .catch(err => {
......
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