导航修改

This commit is contained in:
xixi 2024-07-31 17:07:19 +08:00
parent d503e448b6
commit 547c63f2bb
3 changed files with 91 additions and 35 deletions

View File

@ -36,6 +36,8 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
keyword: props.keywords, keyword: props.keywords,
name: props.type, name: props.type,
chargeAdditionals: props.chargeAdditionals, chargeAdditionals: props.chargeAdditionals,
progress: props.progress,
authorId: props.authorId
} }
}) })
}}> }}>

View File

@ -22,4 +22,6 @@ export interface IMenuWithTopButton {
keywords?:string; keywords?:string;
type?:string ; type?:string ;
chargeAdditionals?:string; chargeAdditionals?:string;
progress?:string;
authorId?:string;
} }

View File

@ -31,8 +31,10 @@ import { useLocation } from 'react-router-dom';
import { get } from '../../util/AjaxUtils.ts' import { get } from '../../util/AjaxUtils.ts'
import gpsImg from '../../static/right/gps.png' import gpsImg from '../../static/right/gps.png'
import backImg from '../../static/right/back.png' import backImg from '../../static/right/back.png'
import { Link } from "react-router-dom"; // import { Link } from "react-router-dom";
import { Input, Breadcrumb, message } from 'antd'; import { Input,
// Breadcrumb,
message } from 'antd';
const { Search } = Input; const { Search } = Input;
@ -287,7 +289,7 @@ export default function Index() {
// 新建项目路由名字 // 新建项目路由名字
// const [newname,setNewname] = useState('') // const [newname,setNewname] = useState('')
const [pathArray, setPathArray] = useState<any>([]) // const [pathArray, setPathArray] = useState<any>([])
const [showSearchBox, setShowSearchBox] = useState(true) const [showSearchBox, setShowSearchBox] = useState(true)
@ -295,114 +297,114 @@ export default function Index() {
// const nowname = sessionStorage.getItem('now') // const nowname = sessionStorage.getItem('now')
if (location.pathname.includes('/home')) { if (location.pathname.includes('/home')) {
setNow('首页') setNow('首页')
setPathArray([{ title: '首页' }]) // setPathArray([{ title: '首页' }])
setShowSearchBox(true) setShowSearchBox(true)
} else if (location.pathname.includes('/proj-create')) { } else if (location.pathname.includes('/proj-create')) {
setShowSearchBox(false) setShowSearchBox(false)
setNow('创建项目') setNow('创建项目')
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: '创建项目' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: '创建项目' }])
// /config-mod-list /config-menu-list /config-mod-show // /config-mod-list /config-menu-list /config-mod-show
} else if (location.pathname.includes('/proj-edit') && !location.pathname.includes('/config-mod-show') && !location.pathname.includes('/config-mod-edit') && !location.pathname.includes('/step') && !location.pathname.includes('/config-loginpage') && !location.pathname.includes('/config-mod-save') && !location.pathname.includes('/config-mod-list') && !location.pathname.includes('/config-menu-list')) { } else if (location.pathname.includes('/proj-edit') && !location.pathname.includes('/config-mod-show') && !location.pathname.includes('/config-mod-edit') && !location.pathname.includes('/step') && !location.pathname.includes('/config-loginpage') && !location.pathname.includes('/config-mod-save') && !location.pathname.includes('/config-mod-list') && !location.pathname.includes('/config-menu-list')) {
setNow('编辑项目') setNow('编辑项目')
setShowSearchBox(false) setShowSearchBox(false)
// setEditname(location.pathname) // setEditname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: '编辑项目' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: '编辑项目' }])
} else if (location.pathname.includes('/proj-new')) { } else if (location.pathname.includes('/proj-new')) {
setNow('新建项目') setNow('新建项目')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: '新建项目' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: '新建项目' }])
} else if (location.pathname.includes('/proj-efree')) { } else if (location.pathname.includes('/proj-efree')) {
setNow('编辑项目') setNow('编辑项目')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: '编辑项目' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: '编辑项目' }])
} else if (location.pathname.includes('/proj-eall')) { } else if (location.pathname.includes('/proj-eall')) {
setNow('编辑项目') setNow('编辑项目')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}> </Link> }, { title: '编辑项目' }]) // setPathArray([{ title: <Link to={'/home'}>首页 </Link> }, { title: '编辑项目' }])
} else if (location.pathname.includes('/proj-edit/step1')) { } else if (location.pathname.includes('/proj-edit/step1')) {
setNow('标题简介') setNow('标题简介')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '标题简介' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '标题简介' }])
} else if (location.pathname.includes('/proj-edit/step2')) { } else if (location.pathname.includes('/proj-edit/step2')) {
setNow('标题简介') setNow('标题简介')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '基本信息' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '基本信息' }])
} else if (location.pathname.includes('/proj-edit/config-loginpage')) { } else if (location.pathname.includes('/proj-edit/config-loginpage')) {
setNow('登录界面设置') setNow('登录界面设置')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '登录界面设置' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '登录界面设置' }])
} else if (location.pathname.includes('/proj-edit/config-mod-list')) { } else if (location.pathname.includes('/proj-edit/config-mod-list')) {
setNow('系统菜单管理') setNow('系统菜单管理')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '系统菜单管理' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '系统菜单管理' }])
} else if (location.pathname.includes('/proj-edit/config-menu-list')) { } else if (location.pathname.includes('/proj-edit/config-menu-list')) {
setNow('系统菜单顺序') setNow('系统菜单顺序')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '系统菜单顺序' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '系统菜单顺序' }])
} else if (location.pathname.includes('/step3')) { } else if (location.pathname.includes('/step3')) {
setNow('软件功能特点') setNow('软件功能特点')
setShowSearchBox(false) setShowSearchBox(false)
// setNewname(location.pathname) // setNewname(location.pathname)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '软件功能特点' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '软件功能特点' }])
} else if (location.pathname.includes('/proj-edit/config-mod-save')) { } else if (location.pathname.includes('/proj-edit/config-mod-save')) {
setNow('添加菜单') setNow('添加菜单')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '添加菜单' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '添加菜单' }])
} else if (location.pathname.includes('/proj-edit/config-mod-edit')) { } else if (location.pathname.includes('/proj-edit/config-mod-edit')) {
setNow('编辑菜单') setNow('编辑菜单')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-2) }}></a> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '编辑菜单' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-2) }}>编辑项目</a> }, { title: <a onClick={() => { nav(-1) }}>系统菜单管理</a> }, { title: '编辑菜单' }])
// /config-mod-edit /config-mod-show // /config-mod-edit /config-mod-show
} else if (location.pathname.includes('/proj-edit/config-mod-show')) { } else if (location.pathname.includes('/proj-edit/config-mod-show')) {
setNow('查看菜单') setNow('查看菜单')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-2) }}></a> }, { title: <a onClick={() => { nav(-1) }}></a> }, { title: '查看菜单' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-2) }}>编辑项目</a> }, { title: <a onClick={() => { nav(-1) }}>系统菜单管理</a> }, { title: '查看菜单' }])
// /config-mod-edit // /config-mod-edit
} else if (location.pathname.includes('/product-release')) { } else if (location.pathname.includes('/product-release')) {
setNow('首页') setNow('首页')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: '首页' }]) // setPathArray([{ title: '首页' }])
// /config-mod-edit /product-release /transaction-order // /config-mod-edit /product-release /transaction-order
} else if (location.pathname.includes(' /transaction-order')) { } else if (location.pathname.includes(' /transaction-order')) {
setNow('首页') setNow('首页')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: '首页' }]) // setPathArray([{ title: '首页' }])
// /config-mod-edit /product-release /transaction-order // /config-mod-edit /product-release /transaction-order
} else if (location.pathname.includes(' /copyright-goods')) { } else if (location.pathname.includes(' /copyright-goods')) {
setNow('首页') setNow('首页')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: '首页' }]) // setPathArray([{ title: '首页' }])
// /config-mod-edit /product-release /transaction-order // /config-mod-edit /product-release /transaction-order
} else if (location.pathname.includes(' /trading-goods')) { } else if (location.pathname.includes(' /trading-goods')) {
setNow('首页') setNow('首页')
setShowSearchBox(false) setShowSearchBox(false)
setPathArray([{ title: '首页' }]) // setPathArray([{ title: '首页' }])
// /config-mod-edit /product-release /transaction-order // /config-mod-edit /product-release /transaction-order
} }
}, [location.pathname]) }, [location.pathname])
@ -428,9 +430,9 @@ export default function Index() {
// if (location.pathname.includes('/home')) { // if (location.pathname.includes('/home')) {
if (!keywords && !type && !chargeAdditionals && !progress) { if (!keywords && !type && !chargeAdditionals && !progress) {
setKeywords('') setKeywords('')
setType('') setType(null)
setchargeAdditionals('') setchargeAdditionals(null)
setprogress('') setprogress(null)
} }
if (location.pathname.includes('/home')) { if (location.pathname.includes('/home')) {
nav('/home', { nav('/home', {
@ -498,6 +500,8 @@ export default function Index() {
keywords={keywords} keywords={keywords}
type={type ? type : ""} type={type ? type : ""}
chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""} chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""}
progress={progress ? progress : ""}
authorId={authorId ? authorId : ""}
/> />
<div className='belongPeopleMenu'> <div className='belongPeopleMenu'>
<div className='belongPeopleMenu-title'> <div className='belongPeopleMenu-title'>
@ -534,7 +538,7 @@ export default function Index() {
} }
}} }}
style={{ background: authorId == item.projOwnerId ? '#FF9F08' : '', color: authorId == item.projOwnerId ? '#FFF' : '' }} style={{ background: authorId == item.projOwnerId ? '#FF9F08' : '', color: authorId == item.projOwnerId ? '#FFF' : '' }}
title={ item.name} // 添加 title 属性以显示完整文本 title={item.name} // 添加 title 属性以显示完整文本
> >
:{item.name} :{item.name}
</div> </div>
@ -572,7 +576,7 @@ export default function Index() {
</div> </div>
</div> </div>
<div style={{ display: belongArray.length > 0 ? 'none' : 'block', height: 230 }}> <div style={{ display: belongArray.length > 0 ? 'none' : 'block', height: 230 }}>
<div style={{width:230,height:230,display:'flex',alignItems:'center',justifyContent:'center'}}> <div style={{ width: 230, height: 230, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Empty <Empty
description="暂无数据" description="暂无数据"
/> />
@ -631,7 +635,6 @@ export default function Index() {
/> />
<Select <Select
value={type} value={type}
style={{ height: '31px', width: '183px', marginLeft: 20, display: showSearchBox ? 'block' : 'none' }} style={{ height: '31px', width: '183px', marginLeft: 20, display: showSearchBox ? 'block' : 'none' }}
onChange={(value: string) => { onChange={(value: string) => {
// console.log(`selected ${value}`); // console.log(`selected ${value}`);
@ -650,13 +653,13 @@ export default function Index() {
}} }}
options={[ options={[
// { value: '', label: '全部类型' },
{ value: 'FREE', label: '免费试用' }, { value: 'FREE', label: '免费试用' },
{ value: 'MATERIAL', label: '写材料' }, { value: 'MATERIAL', label: '写材料' },
{ value: 'ALL', label: '全托管' }, { value: 'ALL', label: '全托管' },
]} ]}
// defaultValue=""
placeholder={'选择类型'} placeholder='选择类型'
/> />
<Select <Select
value={chargeAdditionals} value={chargeAdditionals}
@ -730,14 +733,63 @@ export default function Index() {
}}></div> }}></div>
<div className='nowPosition'> <div className='nowPosition'>
<img src={backImg} alt="" /> <img src={backImg} alt="" />
<div> <div style={{ display: now == '首页' ? 'block' : 'none' }}>
<Breadcrumb {/* <Breadcrumb
separator="|" separator="|"
// items={[ // items={[
// { title: <Link to={'/home'}>首页</Link> }, // { title: <Link to={'/home'}>首页</Link> },
// ]} // ]}
items={pathArray} items={pathArray}
/> /> */}
<span></span>
</div>
<div style={{ display: now == '创建项目' ? 'block' : 'none' }}>
{/* <Breadcrumb
separator="|"
// items={[
// { title: <Link to={'/home'}>首页</Link> },
// ]}
items={pathArray}
/> */}
<span style={{ cursor: 'pointer' }}
onClick={() => {
nav('/home', {
state: {
keyword: keywords,
name: type,
chargeAdditionals: chargeAdditionals,
progress: progress,
authorId: authorId
}
})
}}
></span>
<span style={{ marginLeft: 10, marginRight: 10 }}>|</span>
<span></span>
</div>
<div style={{ display: now == '编辑项目' ? 'block' : 'none' }}>
{/* <Breadcrumb
separator="|"
// items={[
// { title: <Link to={'/home'}>首页</Link> },
// ]}
items={pathArray}
/> */}
<span style={{ cursor: 'pointer' }}
onClick={() => {
nav('/home', {
state: {
keyword: keywords,
name: type,
chargeAdditionals: chargeAdditionals,
progress: progress,
authorId: authorId
}
})
}}
></span>
<span style={{ marginLeft: 10, marginRight: 10 }}>|</span>
<span></span>
</div> </div>
</div> </div>
</div> </div>