Commit 0a1f20c2 authored by 田翔's avatar 田翔

fix: 代码修复

parent 17d39cb4
Pipeline #81763 failed with stages
...@@ -26,6 +26,8 @@ const themes = [ ...@@ -26,6 +26,8 @@ const themes = [
{ name: '农饮水主题背景' }, { name: '农饮水主题背景' },
] ]
const urlArray = []
const Right = () => { const Right = () => {
const { shema, setShema } = useContext(GlobalStore) const { shema, setShema } = useContext(GlobalStore)
...@@ -130,14 +132,17 @@ const Right = () => { ...@@ -130,14 +132,17 @@ const Right = () => {
const mapTreeMoblie = (org) => { const mapTreeMoblie = (org) => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0; const haveChildren = Array.isArray(org.children) && org.children.length > 0;
if (!haveChildren && ['flutter', 'MobileGCK'].includes(org?.product)) { if (!haveChildren && ['flutter'].includes(org?.product)) {
return null return null
} }
if (!haveChildren) {
urlArray.push(org)
}
if (org.key) { if (org.key) {
if (haveChildren) { if (haveChildren) {
return ( return (
<TreeNode <TreeNode
value={org.pageUrl || org.menuID} value={org.menuID}
title={org.text} title={org.text}
icon={org.key ? <MobileOutlined /> : <FolderFilled />} icon={org.key ? <MobileOutlined /> : <FolderFilled />}
disabled disabled
...@@ -146,11 +151,11 @@ const Right = () => { ...@@ -146,11 +151,11 @@ const Right = () => {
</TreeNode> </TreeNode>
); );
} }
return <TreeNode value={org.pageUrl || org.menuID} title={org.text} icon={<MobileOutlined />} disabled />; return <TreeNode value={org.menuID} title={org.text} icon={<MobileOutlined />} disabled />;
} }
return haveChildren ? ( return haveChildren ? (
<TreeNode <TreeNode
value={org.pageUrl || org.menuID} value={org.menuID}
title={org.text} title={org.text}
icon={org.key ? <MobileOutlined /> : <FolderFilled />} icon={org.key ? <MobileOutlined /> : <FolderFilled />}
disabled disabled
...@@ -159,7 +164,7 @@ const Right = () => { ...@@ -159,7 +164,7 @@ const Right = () => {
</TreeNode> </TreeNode>
) : ( ) : (
<TreeNode <TreeNode
value={org.pageUrl || org.menuID} value={org.menuID}
title={org.text} title={org.text}
icon={ icon={
org.menuType == 'MiniAppMenuGroup' || org.menuType == 'MiniAppMenuGroupTwo' ? ( org.menuType == 'MiniAppMenuGroup' || org.menuType == 'MiniAppMenuGroupTwo' ? (
...@@ -304,7 +309,10 @@ const Right = () => { ...@@ -304,7 +309,10 @@ const Right = () => {
treeDefaultExpandAll treeDefaultExpandAll
treeIcon treeIcon
// onSearch={(value) => cardSettingOther(value, 'url')} // onSearch={(value) => cardSettingOther(value, 'url')}
onChange={(value) => cardSettingOther(value, 'url')} onChange={(value) => {
let item = urlArray.find(v => v.menuID === value)
cardSettingOther(item.product + item.pageUrl, 'url')
}}
> >
{moblieList.map(i => mapTreeMoblie(i))} {moblieList.map(i => mapTreeMoblie(i))}
</TreeSelect> </TreeSelect>
......
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