From 55269275e3ea67a907d673dea5c4b159da8c7c88 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 14 Aug 2024 09:04:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvitingPersonnelModal/index.tsx | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/components/InvitingPersonnelModal/index.tsx b/src/components/InvitingPersonnelModal/index.tsx index 10feb4c..52fba6f 100644 --- a/src/components/InvitingPersonnelModal/index.tsx +++ b/src/components/InvitingPersonnelModal/index.tsx @@ -7,10 +7,11 @@ import { useLocation } from 'react-router-dom'; import { GetRoomUser, PostRoomInvite } from '@/api/Meeting'; import { storage } from '@/utils'; import Avatar from '@/components/Avatar'; -let userInfo = JSON.parse(storage.getItem('user') as string) const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeInvitingPersonnelModal: () => { + let userInfo = JSON.parse(storage.getItem('user') as string) + setUser(userInfo) setCheckedList([]) getUserList() setIsInvitingPersonnelModal(true) @@ -19,6 +20,7 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { const { state } = useLocation(); const [isInvitingPersonnelModal, setIsInvitingPersonnelModal] = useState(false); const [isFirstRender, setIsFirstRender] = useState(true); + const [user, setUser] = useState(''); const [optionsValue, setOperationValue] = useState(1); const [list, setList] = useState({ data: [], @@ -146,9 +148,9 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { return checkedList } }) - }} disabled={!item.isOnline || item.account === userInfo.account || item.disabled} checked={item.checked}> + }} disabled={!item.isOnline || item.account === user.account || item.disabled} checked={item.checked}>
- {item.userName}{item.account === userInfo.account ? '(我)' : ''}{item.disabled ? '(已入会)' : ''} + {item.userName}{item.account === user.account ? '(我)' : ''}{item.disabled ? '(已入会)' : ''}
{item.isOnline ? '在线' : '离线'}
) : 暂无数据} @@ -174,17 +176,12 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {