import { useAjax } from "@/Hook/useAjax" import { IdcardFilled, MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons" import { Select, Menu, Spin, Button, Card, Tabs } from "antd" import React, { useEffect, useState } from "react" import { useModel } from "umi" import style from '../../launchSystemNew/adq/index.less' import { getPicherListApi } from "@/services/operating/account" import Ad from "./ad" import Creative from "./creative" const AdqV3: React.FC = () => { /****************************/ const userInfo = useModel('@@initialState', model => model.initialState?.currentUser) const allOfMember = useAjax(() => getPicherListApi(), { formatResult: true }) const [userAll, setUserAll] = useState([]) const [activeKey, setActiveKey] = useState('1') const [userId, setUserId] = useState(userInfo?.userId?.toString()) const [hide, setHide] = useState(false) const [queryForm, setQueryForm] = useState({ pageNum: 1, pageSize: 20, userId }) /****************************/ // 获取组员 useEffect(() => { allOfMember.run().then(res => { if (res?.data) { let useAll: any = [] res?.data?.forEach((item: { userId: number; nickname: any; }) => { let obj = { key: item.userId, label: item.nickname, icon: , } useAll.push(obj) }) setUserAll(useAll) } }) }, []) // // 初始跳转到自己的名称 useEffect(() => { if (userAll?.length > 0 && userId) { let topEq = userAll?.findIndex((item: any) => item.key == userId) let em: any = document.getElementById('myMenus1') console.log(topEq) if (em) { em.scrollTop = (52 - 4) * topEq } } }, [userId, userAll]) const creativeHandle = (id: number) => { setQueryForm({ ...queryForm, adgroupId: id }) setActiveKey('2') } return
{!hide &&
{//点击菜单 setUserId(e.key) }} selectedKeys={userId} mode="inline" multiple={false} items={userAll} style={{ overflowY: 'auto', height: 'calc(100vh - 150px)', overflowX: 'hidden' }} />
}
{ setActiveKey(activeKey) }}>
} export default AdqV3