mac
6 days ago
15 changed files with 258 additions and 16 deletions
-
BINpublic/favicon.ico
-
6public/index.html
-
4src/api/chat.ts
-
8src/app.css
-
BINsrc/assets/img/logo.png
-
2src/components/Header/index.tsx
-
13src/components/Menu/index.tsx
-
10src/components/MyTable/index.tsx
-
27src/components/buzzup/BuzzFaceURL.tsx
-
92src/pages/chat/group-list/index.tsx
-
65src/pages/chat/user-list/index.tsx
-
2src/pages/container/index.tsx
-
28src/route/routes.ts
-
4src/utils/axios.ts
-
13src/utils/index.ts
@ -0,0 +1,4 @@ |
|||||
|
import $axios from '@/utils/axios' |
||||
|
|
||||
|
export const chat_userList = (params) => $axios.post('/admin/openImUserList', params) |
||||
|
export const chat_groupList = (params) => $axios.post('/admin/openImGroupList', params) |
Before Width: 64 | Height: 64 | Size: 1.5 KiB After Width: 672 | Height: 469 | Size: 15 KiB |
@ -0,0 +1,27 @@ |
|||||
|
import React from "react" |
||||
|
|
||||
|
interface BuzzFaceURLProps { |
||||
|
faceUrl: string, |
||||
|
name: string, |
||||
|
size?: number |
||||
|
} |
||||
|
|
||||
|
const BuzzFaceURL = (props: BuzzFaceURLProps) => { |
||||
|
const { faceUrl, name, size = 40 } = props |
||||
|
|
||||
|
return faceUrl ? ( |
||||
|
<img src={faceUrl} alt="" style={{ |
||||
|
width: size, height: size, objectFit: 'cover', borderRadius: 5, display: 'flex', justifyContent: 'center', |
||||
|
alignItems: 'center' |
||||
|
}} /> |
||||
|
) : ( |
||||
|
<div style={{ |
||||
|
width: size, height: size, objectFit: 'cover', borderRadius: 5, background: '#FBBA5A', display: 'flex', justifyContent: 'center', |
||||
|
alignItems: 'center' |
||||
|
}}> |
||||
|
{name.toLocaleUpperCase().substring(0, 1)} |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
export default BuzzFaceURL |
@ -0,0 +1,92 @@ |
|||||
|
|
||||
|
import { chat_groupList, chat_userList } from "@/api/chat" |
||||
|
import BuzzFaceURL from "@/components/buzzup/BuzzFaceURL"; |
||||
|
import MyTable from "@/components/MyTable" |
||||
|
import { getTime, isGender, isPlatformId } from "@/utils"; |
||||
|
import React from "react" |
||||
|
|
||||
|
const ChatGroupList = () => { |
||||
|
|
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '头像', |
||||
|
dataIndex: "", |
||||
|
width: 100, |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
<BuzzFaceURL faceUrl={row.groupInfo.faceURL} name={row.groupInfo.groupName} /> |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: '群组名称', |
||||
|
dataIndex: "", |
||||
|
width: 150, |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
{row.groupInfo.groupName} |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: '群组ID', |
||||
|
dataIndex: "", |
||||
|
width: 150, |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
{row.groupInfo.groupID} |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: '群主ID', |
||||
|
dataIndex: "", |
||||
|
width: 150, |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
{row.groupOwnerUserID} |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: '群组人数', |
||||
|
dataIndex: "", |
||||
|
width: 150, |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
{row.groupInfo.memberCount} |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: '创建时间', |
||||
|
dataIndex: "", |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
{getTime(row.groupInfo.createTime)} |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: 'options', |
||||
|
fixed: 'right', |
||||
|
width: 100, |
||||
|
render: (item) => ( |
||||
|
<div className="flex"> |
||||
|
<div className="text-4xl">群成员</div> |
||||
|
<div className="text-4xl">群成员</div> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
] |
||||
|
// 用户头像 用户昵称 用户ID 性别 手机号 在线状态
|
||||
|
return ( |
||||
|
<MyTable |
||||
|
apiFun={chat_groupList} |
||||
|
columns={columns} |
||||
|
/> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
export default ChatGroupList |
@ -0,0 +1,65 @@ |
|||||
|
|
||||
|
import { chat_userList } from "@/api/chat" |
||||
|
import BuzzFaceURL from "@/components/buzzup/BuzzFaceURL"; |
||||
|
import MyTable from "@/components/MyTable" |
||||
|
import { isGender, isPlatformId } from "@/utils"; |
||||
|
import React from "react" |
||||
|
|
||||
|
|
||||
|
const ChatUserList = () => { |
||||
|
|
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '头像', |
||||
|
dataIndex: "", |
||||
|
width: 100, |
||||
|
render: (row) => ( |
||||
|
<div> |
||||
|
<BuzzFaceURL faceUrl={row.faceURL} name={row.nickname} /> |
||||
|
</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: '用户昵称', |
||||
|
dataIndex: "nickname", |
||||
|
width: 300 |
||||
|
}, |
||||
|
{ |
||||
|
title: '用户ID', |
||||
|
dataIndex: "userID", |
||||
|
width: 300 |
||||
|
}, |
||||
|
{ |
||||
|
title: '性别', |
||||
|
dataIndex: "gender", |
||||
|
width: 200, |
||||
|
render: (gender) => ( |
||||
|
<div>{isGender(gender)}</div> |
||||
|
) |
||||
|
}, |
||||
|
{ |
||||
|
title: 'BuzzID', |
||||
|
dataIndex: "publicKey", |
||||
|
width: 200, |
||||
|
// render: (publicKey) => (
|
||||
|
// <div>{isGender(gender)}</div>
|
||||
|
// )
|
||||
|
}, |
||||
|
{ |
||||
|
title: '在线状态', |
||||
|
dataIndex: "platformID", |
||||
|
render: (platformID) => ( |
||||
|
<div>{isPlatformId(platformID)}</div> |
||||
|
) |
||||
|
}, |
||||
|
] |
||||
|
// 用户头像 用户昵称 用户ID 性别 手机号 在线状态
|
||||
|
return ( |
||||
|
<MyTable |
||||
|
apiFun={chat_userList} |
||||
|
columns={columns} |
||||
|
/> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
export default ChatUserList |
Write
Preview
Loading…
Cancel
Save
Reference in new issue