shenwu 2 gadi atpakaļ
vecāks
revīzija
31f1d8eaa7
1 mainītis faili ar 13 papildinājumiem un 3 dzēšanām
  1. 13 3
      src/pages/launchSystemNew/adq/index.tsx

+ 13 - 3
src/pages/launchSystemNew/adq/index.tsx

@@ -55,7 +55,7 @@ function Adq() {
         // let { activeKey, parma } = props
         // setQueryParmas({ ...queryParmas, ...parma })
         // setActiveKey(activeKey)
-    
+
     }, [queryParmas, activeKey])
     // 获取组员
     useEffect(() => {
@@ -96,8 +96,18 @@ function Adq() {
             }
         }
     }, [queryParmas, selectedArr])
+    // 初始跳转到自己的名称
+    useEffect(() => {
+        if (userAll?.length > 0 && userInfo?.userId) {
+            let topEq = userAll?.findIndex((item: any) => item.key == userInfo?.userId)
+            let em:any = document.getElementById('myMenus')
+            if (em) {
+                em.scrollTop=52 * topEq - 36
+            }
+        }
+    }, [userInfo?.userId, userAll])
     return <Row style={{ position: 'relative' }}>
-        <Col style={{ height: '100%', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
+        <Col id='myMenus' style={{ height: '100%', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
             <Menus
                 theme='light'
                 onClick={(e: any) => {//点击菜单
@@ -171,7 +181,7 @@ function Adq() {
                                                         offset={[-20, 2]}
                                                         style={{ cursor: 'pointer' }}
                                                     >
-                                                        <Tag  style={{ marginRight: 20, marginBottom: 20 }}>{nameEnum[key]}:{queryParmas[key]}</Tag>
+                                                        <Tag style={{ marginRight: 20, marginBottom: 20 }}>{nameEnum[key]}:{queryParmas[key]}</Tag>
                                                     </Badge>
                                                 })
                                             }