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 => {
}, [flag, clientName]);
// 获取菜单信息
useEffect(() => {
if (flag === 1) {
console.log(flag, 'flag');
if (flag === 2) {
setExpendKey(menuID);
}
getInfo();
......@@ -91,27 +92,29 @@ const MiniMenu = props => {
console.log(result, 'result');
setTreeData(result);
if (result.length > 0) {
setMenuID(result[0].menuID);
setFlag(flag + 1);
switch (result[0].menuType) {
case 'MiniAppMenuGroup':
setNodeType(1);
setAddType(2);
break;
case 'MiniAppMenuGroupTwo':
setNodeType(2);
setAddType(4);
break;
case 'MiniAppMenu':
setNodeType(3);
setAddType(3);
break;
case 'MiniAppMenuThree':
setNodeType(4);
setAddType(4);
break;
default:
break;
if (flag === 1) {
setMenuID(result[0].menuID);
switch (result[0].menuType) {
case 'MiniAppMenuGroup':
setNodeType(1);
setAddType(2);
break;
case 'MiniAppMenuGroupTwo':
setNodeType(2);
setAddType(4);
break;
case 'MiniAppMenu':
setNodeType(3);
setAddType(3);
break;
case 'MiniAppMenuThree':
setNodeType(4);
setAddType(4);
break;
default:
break;
}
}
}
setLoading(false);
......
......@@ -68,7 +68,7 @@ const EditForm = props => {
// },
// ]}
>
<Input placeholder="请输入产品名称" allowClear disabled />
<Input placeholder="请输入产品名称" allowClear />
</Item>
<Item
label="产品说明:"
......@@ -81,7 +81,7 @@ const EditForm = props => {
// },
// ]}
>
<Input placeholder="请输入产品说明" disabled />
<Input placeholder="请输入产品说明" />
</Item>
<Item
label="发布状态:"
......@@ -113,10 +113,7 @@ const EditForm = props => {
]}
>
{/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */}
<Input
placeholder="请输入访问路由,ip加端口号,示例//localhost:3001"
allowClear
/>
<Input placeholder="请输入访问路由,ip加端口号,示例//localhost:3001" allowClear />
</Item>
<Item
......@@ -135,10 +132,7 @@ const EditForm = props => {
/>
</Item>
<div style={{ display: 'flex', marginLeft: '35%' }}>
<Item
wrapperCol={{ span: 8, offset: 8 }}
style={{ marginRight: '30px' }}
>
<Item wrapperCol={{ span: 8, offset: 8 }} style={{ marginRight: '30px' }}>
<Button type="primary" htmlType="submit">
提交
</Button>
......
......@@ -427,20 +427,22 @@ const MiniMenu = props => {
setMenuList(arr2 || []);
// 进页面后默认展示第一条数据
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);
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