样式修改
This commit is contained in:
parent
32771816d0
commit
1ba3d8b871
@ -8,7 +8,7 @@ import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx";
|
||||
import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx";
|
||||
// import ListProj from "../../components/list/ListProj.tsx";
|
||||
// import ListProjAgent from "../../components/list/ListProjAgent.tsx";
|
||||
import { MenuProps,Select } from 'antd';
|
||||
import { MenuProps, Select } from 'antd';
|
||||
import {
|
||||
IndexListContext,
|
||||
IndexListDataType,
|
||||
@ -31,7 +31,7 @@ const { Search } = Input;
|
||||
export default function Index() {
|
||||
// 关键字
|
||||
const [keywords, setKeywords] = useState('');
|
||||
const [type,setType] = useState('')
|
||||
const [type, setType] = useState('')
|
||||
// const indexListContext = useContext(IndexListContext);
|
||||
|
||||
|
||||
@ -196,7 +196,7 @@ export default function Index() {
|
||||
// const [newname,setNewname] = useState('')
|
||||
|
||||
const [pathArray, setPathArray] = useState<any>([])
|
||||
const [showSearchBox,setShowSearchBox] = useState(true)
|
||||
const [showSearchBox, setShowSearchBox] = useState(true)
|
||||
useEffect(() => {
|
||||
// const nowname = sessionStorage.getItem('now')
|
||||
console.log('路由名字', location.pathname);
|
||||
@ -329,9 +329,15 @@ export default function Index() {
|
||||
|
||||
}, []);
|
||||
|
||||
// useEffect(() => {
|
||||
// console.log('监听',keywords);
|
||||
// }, [keywords]);
|
||||
useEffect(() => {
|
||||
console.log('监听type',type);
|
||||
nav('/home', {
|
||||
state: {
|
||||
keyword: keywords,
|
||||
name: type
|
||||
}
|
||||
})
|
||||
}, [type]);
|
||||
|
||||
const handleSearch = (value: string) => {
|
||||
console.log(value);
|
||||
@ -339,10 +345,21 @@ export default function Index() {
|
||||
nav('/home', {
|
||||
state: {
|
||||
keyword: value,
|
||||
name:type
|
||||
name: type
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleChange = (e:any) => {
|
||||
console.log(e.target.value);
|
||||
if(e.target.value == ''){
|
||||
nav('/home', {
|
||||
state: {
|
||||
keyword: '',
|
||||
name: type
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{/* <Breadcrumb
|
||||
@ -389,7 +406,7 @@ export default function Index() {
|
||||
<div>当前位置:{now}</div>
|
||||
</div>
|
||||
<div className='line' style={{
|
||||
display:showSearchBox ? 'block' : 'none',
|
||||
display: showSearchBox ? 'block' : 'none',
|
||||
|
||||
}} ></div>
|
||||
<div
|
||||
@ -401,13 +418,17 @@ export default function Index() {
|
||||
display: showSearchBox ? 'none' : 'block'
|
||||
}}
|
||||
></div>
|
||||
<Search placeholder="输入项目名称" onSearch={handleSearch} style={{
|
||||
<Search placeholder="输入项目名称"
|
||||
onSearch={handleSearch}
|
||||
onChange={handleChange}
|
||||
style={{
|
||||
width: '253px',
|
||||
height: '31px',
|
||||
display: showSearchBox ? 'block' : 'none'
|
||||
}} />
|
||||
}}
|
||||
/>
|
||||
<Select
|
||||
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) => {
|
||||
// console.log(`selected ${value}`);
|
||||
setType(value)
|
||||
@ -416,7 +437,7 @@ export default function Index() {
|
||||
nav('/home', {
|
||||
state: {
|
||||
keyword: keywords,
|
||||
name:value
|
||||
name: value
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user