|
@@ -100,15 +100,44 @@ function Adq() {
|
|
|
useEffect(() => {
|
|
|
if (userAll?.length > 0 && userInfo?.userId) {
|
|
|
let topEq = userAll?.findIndex((item: any) => item.key == userInfo?.userId)
|
|
|
- let em:any = document.getElementById('myMenus')
|
|
|
+ let em: any = document.getElementById('myMenus')
|
|
|
if (em) {
|
|
|
- em.scrollTop=52 * topEq - 36
|
|
|
+ em.scrollTop = 52 * topEq - 36
|
|
|
}
|
|
|
}
|
|
|
}, [userInfo?.userId, userAll])
|
|
|
+ useEffect(() => {
|
|
|
+ if (userAll?.length > 0 && userId) {
|
|
|
+ let topEq = userAll?.findIndex((item: any) => item.key == userId)
|
|
|
+ let em: any = document.getElementById('myMenus')
|
|
|
+ if (em) {
|
|
|
+ em.scrollTop = 52 * topEq - 36
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, [userId, userAll])
|
|
|
return <Row style={{ position: 'relative' }}>
|
|
|
- <Col id='myMenus' style={{ height: '100%', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
|
|
|
+ <Col style={{ height: '100%', minHeight: 'calc(100vh - 100px)', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
|
|
|
+ <Select
|
|
|
+ placeholder='名称搜索'
|
|
|
+ style={{ width: '100%' }}
|
|
|
+ showSearch
|
|
|
+ filterOption={(input: any, option: any) => {
|
|
|
+ return (option!?.children as unknown as string)?.toLowerCase()?.includes(input?.toLowerCase())
|
|
|
+ }
|
|
|
+
|
|
|
+ } allowClear onChange={(value: any) => {
|
|
|
+ if(value){
|
|
|
+ setUserId(value.toString())
|
|
|
+ }
|
|
|
+ }}>
|
|
|
+ {
|
|
|
+ userAll.map((item: any) => {
|
|
|
+ return <Select.Option value={item.key} key={item.key}>{item.label}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>
|
|
|
<Menus
|
|
|
+ id='myMenus'
|
|
|
theme='light'
|
|
|
onClick={(e: any) => {//点击菜单
|
|
|
setUserId(e.key)
|
|
@@ -117,6 +146,11 @@ function Adq() {
|
|
|
mode="inline"
|
|
|
multiple={false}
|
|
|
items={userAll}
|
|
|
+ style={{
|
|
|
+ overflowY: 'auto',
|
|
|
+ height: 'calc(100vh - 150px)',
|
|
|
+ overflowX: 'hidden'
|
|
|
+ }}
|
|
|
/>
|
|
|
</Col>
|
|
|
<Col span={21} style={{ marginLeft: 150 }}>
|