diff --git a/src/components/InvitingPersonnelModal/index.tsx b/src/components/InvitingPersonnelModal/index.tsx index 18077fe..676d3cc 100644 --- a/src/components/InvitingPersonnelModal/index.tsx +++ b/src/components/InvitingPersonnelModal/index.tsx @@ -4,7 +4,7 @@ import { useState, useImperativeHandle, forwardRef, useEffect } from "react"; import { SearchOutlined } from '@ant-design/icons'; import { GetUserList } from '@/api/Home/User'; import { useLocation } from 'react-router-dom'; -import { PostRoomInvite } from '@/api/Meeting'; +import { GetRoomUser, PostRoomInvite } from '@/api/Meeting'; import { storage } from '@/utils'; import Avatar from '@/components/Avatar'; const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { @@ -28,7 +28,7 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { { label: '在线', value: 1 }, { label: '不在线', value: 2 }, ], - optionsValue: [1, 2] + optionsValue: [1] }); const [list, setList] = useState({ data: [], @@ -71,20 +71,24 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { }; // 获取用户列表 const getUserList = async (): Promise => { - await GetUserList({ - pageIndex: list.pageIndex, - pageSize: list.pageSize, - searchKeywod: list.searchKeywod, - isOnline: operation.optionsValue.length === 1 ? operation.optionsValue[0] === 1 ? true : false : '', - }).then(res => { - if (res.code === 200) { + Promise.all([ + GetRoomUser(state.channelId), + GetUserList({ + pageIndex: list.pageIndex, + pageSize: list.pageSize, + searchKeywod: list.searchKeywod, + isOnline: operation.optionsValue.length === 1 ? operation.optionsValue[0] === 1 ? true : false : '', + }) + ]).then(res => { + if (res[0].code === 200 && res[1].code === 200) { setList({ ...list, - total: res.data.total, - data: res.data.items.map((item: any) => { + total: res[1].data.total, + data: res[1].data.items.map((item: any) => { return { ...item, checked: checkedList.find((checkedItem: any) => checkedItem.id === item.id) ? true : false, + disabled: res[0].data.find((row: any) => row.account === item.account) ? true : false } }), }) @@ -130,7 +134,9 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { style={{ flexShrink: 0, margin: '10px 0' }} options={operation.options} value={operation.optionsValue} - onChange={changeOptionsValue} + onChange={(e)=>{ + changeOptionsValue(e) + }} />
{list.data.length ? list.data.map((item: any, index: number) =>
@@ -150,7 +156,7 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { return checkedList } }) - }} defaultChecked={item.checked} disabled={!item.isOnline || item.account === user.account}> + }} defaultChecked={item.checked} disabled={!item.isOnline || item.account === user.account || item.disabled}>
{item.userName}
@@ -162,7 +168,7 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { ...list, pageIndex: e }) - }} pageSize={list.pageSize} current={list.pageIndex} hideOnSinglePage={true} showLessItems={true}/> + }} pageSize={list.pageSize} current={list.pageIndex} hideOnSinglePage={true} showLessItems={true} />
已选成员 diff --git a/src/components/Operation/index.tsx b/src/components/Operation/index.tsx index db9147a..ab34d06 100644 --- a/src/components/Operation/index.tsx +++ b/src/components/Operation/index.tsx @@ -137,7 +137,7 @@ const Operation: React.FC = () => { { setIsTips(e.target.checked) storage.setItem('isTips', e.target.checked) - }} defaultChecked={isTips}>不在提示 + }} defaultChecked={isTips}>不再提示