wjx 2 tahun lalu
induk
melakukan
429e485eea

+ 2 - 2
config/proxy.ts

@@ -10,8 +10,8 @@
  export default {
   dev: {
     '/api/': {
-      // target: 'http://test.api.zanxiangwl.com',
-      target: 'http://api.zanxiangwl.com',
+      target: 'http://test.api.zanxiangwl.com',
+      // target: 'http://api.zanxiangwl.com',
       changeOrigin: true,
       pathRewrite: { '/api': '' },
     },

+ 6 - 6
src/pages/launchSystemNew/account/groupLeft.tsx

@@ -10,17 +10,17 @@ import './index.less'
  */
 interface Props {
     onChange?: (groupId?: number) => void
-    groupId?: number
+    value?: number
 }
 const GroupLeft: React.FC<Props> = (props) => {
 
     /*************************/
-    const { onChange } = props
+    const { onChange, value } = props
     const [isNewGrouping, setIsNewGrouping] = useState<boolean>(false);  // 是否新增分组
     const inputRef = useRef<any>(null);
     const [groupData, setGroupData] = useState<{ groupName: string, remark?: string, groupId?: number }>({ groupName: '' }) // 分组添加
     const [selectAccData, setSelectAccData] = useState<{ id: number, mpName: string }[]>([])  // 选中
-    const [groupId, setGroupId] = useState<number>(0)
+    const [groupId, setGroupId] = useState<number>(value || 0)
 
     const addGroup = useAjax((params) => addGroupApi(params))
     const editGroup = useAjax((params) => editGroupApi(params))
@@ -29,10 +29,10 @@ const GroupLeft: React.FC<Props> = (props) => {
     /*************************/
 
     useEffect(() => {
-        if (props?.groupId) {
-            setGroupId(props?.groupId || 0)
+        if (value) {
+            setGroupId(value || 0)
         }
-    }, [props.groupId])
+    }, [value])
 
     /** 点击新增处理聚焦 */
     useEffect(() => {

+ 1 - 1
src/pages/launchSystemNew/account/index.tsx

@@ -70,7 +70,7 @@ const AdAuthorize: React.FC = () => {
         </Tabs>
 
         <div className={style.manage}>
-            {!showLeft && activeKey === '1' && <GroupLeft onChange={(groupId) => setQueryForm({ ...queryForm, groupId })}/>}
+            {!showLeft && activeKey === '1' && <GroupLeft onChange={(groupId) => setQueryForm({ ...queryForm, groupId })} value={queryForm?.groupId}/>}
             
             <div className={style.manage__left} style={showLeft ? { width: '100%' } : { width: 'calc(100% - 200px)' }}>
                 <TableData

+ 62 - 0
src/pages/launchSystemNew/components/teamMembers/index.tsx

@@ -0,0 +1,62 @@
+import { useAjax } from "@/Hook/useAjax"
+import { getAdAccountAllOfMember } from "@/services/launchAdq/adq"
+import { IdcardFilled } from "@ant-design/icons"
+import React, { useEffect, useState } from "react"
+import { useModel } from "umi"
+
+
+interface Props {
+    onChange?: (id?: number) => void
+}
+/**
+ * 选择组员左菜单
+ */
+const TeamMembers: React.FC<Props> = (props) => {
+
+    /*************************/
+    const [userAll, setUserAll] = useState([])
+    const [selectedArr, setSelectedArr] = useState([])
+
+    const userInfo = useModel('@@initialState', model => model.initialState?.currentUser)
+    const [userId, setUserId] = useState<any>(userInfo?.userId?.toString())
+    const allOfMember = useAjax(() => getAdAccountAllOfMember(), { formatResult: true })
+    /*************************/
+
+    /** 获取组员 */ 
+    useEffect(() => {
+        allOfMember.run().then(res => {
+            if (res?.data) {
+                let useAll: any = []
+                res?.data?.forEach((item: { key: { userId: any; nickName: any; }; value: any[]; }) => {
+                    let obj = {
+                        key: item.key.userId,
+                        label: item.key.nickName,
+                        icon: <IdcardFilled />,
+                    }
+                    if (item?.value) {
+                        obj['childrenarr'] = item?.value?.map(item => {
+                            return { key: item.accountId + '_' + item.id, label: item?.remark ? item.accountId + '_' + item?.remark : item.accountId }
+                        })
+                    }
+                    useAll.push(obj)
+                })
+                setUserAll(useAll)
+            }
+        })
+    }, [])
+    
+    /** 选中的组员的子账号 */
+    useEffect(() => {
+        if (userAll.length > 0 && userId) {
+            let newArr: any = userAll?.filter((item: any) => item.key == userId)
+            setSelectedArr(newArr[0]?.childrenarr || [])
+        }
+    }, [userAll, userId])
+
+    return <div>
+
+    </div>
+}
+
+
+export default React.memo(TeamMembers)