diff --git a/client/package.json b/client/package.json index 93eb292..413500f 100644 --- a/client/package.json +++ b/client/package.json @@ -1,7 +1,7 @@ { "name": "device-management-client", "private": true, - "version": "2.1.0", + "version": "2.2.0", "type": "module", "scripts": { "dev": "vite", diff --git a/client/src/App.jsx b/client/src/App.jsx index 8d64e20..eff22ff 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -127,7 +127,7 @@ function App() { { key: 'personnel', icon: , label: '人员管理' }, ...(user?.role === 'admin' ? [{ key: 'accounts', icon: , label: '账户管理' }] : []), { key: 'notifications', icon: , label: '通知管理' }, - { key: 'download', icon: , label: '软件下载' }, + { key: 'download', icon: , label: '软件下载' } ] // 移动端底部导航(5个核心入口) diff --git a/client/src/pages/About.jsx b/client/src/pages/About.jsx index 849cc5b..5803afd 100644 --- a/client/src/pages/About.jsx +++ b/client/src/pages/About.jsx @@ -5,7 +5,7 @@ function About() { return (
-

影视星河 · 设备管理系统 v2.1

+

影视星河 · 设备管理系统 v2.2

软件概述

@@ -62,12 +62,17 @@ function About() {

版本信息

    -
  • 当前版本:v2.1
  • +
  • 当前版本:v2.2
  • 发布日期:2026年8月
  • 许可证:MIT License

更新日志

+

v2.2(2026年8月)

+
    +
  1. 添加群聊删除人员的功能
  2. +
  3. 修复创建群聊显示框闪退的bug
  4. +

v2.1(2026年8月)

  1. 添加用户修改密码功能
  2. diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx index da83da7..39da754 100644 --- a/client/src/pages/Dashboard.jsx +++ b/client/src/pages/Dashboard.jsx @@ -120,7 +120,7 @@ function Dashboard({ onNavigate }) {

    系统信息

    -

    系统版本:v2.1

    +

    系统版本:v2.2

    系统名称:设备管理系统

    diff --git a/client/src/pages/Messages.jsx b/client/src/pages/Messages.jsx index 4c31073..ad51a1a 100644 --- a/client/src/pages/Messages.jsx +++ b/client/src/pages/Messages.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, useRef } from 'react' import { Card, Button, Input, List, Badge, Modal, Form, Select, Tabs, Avatar, Empty, message, Popconfirm, Space, Tag, Tooltip } from 'antd' -import { PlusOutlined, SendOutlined, TeamOutlined, UserOutlined, ArrowLeftOutlined, DeleteOutlined } from '@ant-design/icons' +import { PlusOutlined, SendOutlined, TeamOutlined, UserOutlined, ArrowLeftOutlined, DeleteOutlined, SettingOutlined, UserDeleteOutlined } from '@ant-design/icons' import axios from 'axios' const { TextArea } = Input @@ -25,6 +25,7 @@ function Messages({ user }) { const [inputValue, setInputValue] = useState('') const [sending, setSending] = useState(false) const [createVisible, setCreateVisible] = useState(false) + const [membersVisible, setMembersVisible] = useState(false) const [createForm] = Form.useForm() const [creating, setCreating] = useState(false) const bottomRef = useRef(null) @@ -148,6 +149,31 @@ function Messages({ user }) { const canDelete = (conv) => conv.type === 'direct' || conv.creator_id === user?.id + // 群主移除群成员 + const handleRemoveMember = async (memberId) => { + try { + const res = await axios.delete(`/api/chat/conversations/${activeConv.id}/members/${memberId}`) + if (res.data.success) { + message.success(res.data.message) + setMembersVisible(false) + // 刷新会话列表与当前会话 + const list = await axios.get('/api/chat/conversations') + if (list.data.success) { + setConversations(list.data.data) + const conv = list.data.data.find(c => c.id === activeConv.id) + if (conv) { + setActiveConv(conv) + activeConvRef.current = conv + } else { + closeConversation() + } + } + } + } catch (err) { + message.error(err.response?.data?.message || '操作失败') + } + } + const otherOptions = allUsers.filter(u => u.id !== user?.id).map(u => ({ value: u.id, label: ( @@ -234,6 +260,11 @@ function Messages({ user }) { {activeConv.member_count}人 )} + {activeConv.type === 'group' && activeConv.creator_id === user?.id && ( + + )}
{messages.length === 0 && } @@ -267,6 +298,103 @@ function Messages({ user }) {
) + // ============ 发起对话 / 建群弹窗 ============ + // 注意:这里必须用普通 JSX 变量而非内部函数组件, + // 否则轮询重新渲染时组件类型变化会导致弹窗被卸载重建(闪退) + const createModal = ( + setCreateVisible(false)} + footer={null} + width={480} + > +
+ + + + + + - - ) - }, - { - key: 'group', - label: '创建群聊', - children: ( - <> - - - - -