diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index f563a1cb2..31484f73c 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -748,11 +748,10 @@ const remainingRouter: AppRouteRecordRaw[] = [ ] }, { - // 统一 /im 分组:下分 home(聊天壳)+ manager(Layout 管理壳) path: '/im', name: 'Im', redirect: '/im/home/conversation', - meta: { hidden: false, title: 'IM 即时通讯' }, + meta: { hidden: true, title: 'IM 即时通讯' }, children: [ { path: 'home', @@ -774,132 +773,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ meta: { hidden: true, title: '通讯录' } } ] - }, - { - path: 'manager/message/private', - component: Layout, - name: 'ImManagerPrivateMessage', - redirect: '/im/manager/message/private/index', - meta: { hidden: false }, - children: [ - { - path: 'index', - component: () => import('@/views/im/manager/message/private/index.vue'), - name: 'ImManagerPrivateMessageIndex', - meta: { - canTo: true, - hidden: false, - noTagsView: false, - icon: 'ep:user', - title: '私聊消息' - } - } - ] - }, - { - path: 'manager/message/group', - component: Layout, - name: 'ImManagerGroupMessage', - redirect: '/im/manager/message/group/index', - meta: { hidden: false }, - children: [ - { - path: 'index', - component: () => import('@/views/im/manager/message/group/index.vue'), - name: 'ImManagerGroupMessageIndex', - meta: { - canTo: true, - hidden: false, - noTagsView: false, - icon: 'ep:chat-line-round', - title: '群聊消息' - } - } - ] - }, - { - path: 'manager/friend', - component: Layout, - name: 'ImManagerFriend', - redirect: '/im/manager/friend/index', - meta: { hidden: false }, - children: [ - { - path: 'index', - component: () => import('@/views/im/manager/friend/index.vue'), - name: 'ImManagerFriendIndex', - meta: { - canTo: true, - hidden: false, - noTagsView: false, - icon: 'ep:user', - title: '好友管理' - } - } - ] - }, - { - path: 'manager/group', - component: Layout, - name: 'ImManagerGroup', - redirect: '/im/manager/group/index', - meta: { hidden: false }, - children: [ - { - path: 'index', - component: () => import('@/views/im/manager/group/index.vue'), - name: 'ImManagerGroupIndex', - meta: { - canTo: true, - hidden: false, - noTagsView: false, - icon: 'ep:user-filled', - title: '群管理' - } - } - ] - }, - { - path: 'manager/sensitive-word', - component: Layout, - name: 'ImManagerSensitiveWord', - redirect: '/im/manager/sensitive-word/index', - meta: { hidden: false }, - children: [ - { - path: 'index', - component: () => import('@/views/im/manager/sensitive-word/index.vue'), - name: 'ImManagerSensitiveWordIndex', - meta: { - canTo: true, - hidden: false, - noTagsView: false, - icon: 'ep:warning', - title: '敏感词管理' - } - } - ] - }, - { - path: 'manager/statistics', - component: Layout, - name: 'ImManagerStatistics', - redirect: '/im/manager/statistics/index', - meta: { hidden: false }, - children: [ - { - path: 'index', - component: () => import('@/views/im/manager/statistics/index.vue'), - name: 'ImManagerStatisticsIndex', - meta: { - canTo: true, - hidden: false, - noTagsView: false, - icon: 'ep:trend-charts', - title: '数据看板' - } - } - ] } ] } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index ec54b408b..986c4d53c 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -250,5 +250,12 @@ export enum DICT_TYPE { IOT_OTA_TASK_STATUS = 'iot_ota_task_status', // IoT OTA 任务状态 IOT_OTA_TASK_RECORD_STATUS = 'iot_ota_task_record_status', // IoT OTA 记录状态 IOT_MODBUS_MODE = 'iot_modbus_mode', // IoT Modbus 工作模式 - IOT_MODBUS_FRAME_FORMAT = 'iot_modbus_frame_format' // IoT Modbus 帧格式 + IOT_MODBUS_FRAME_FORMAT = 'iot_modbus_frame_format', // IoT Modbus 帧格式 + + // ========== IM - 即时通讯模块 ========== + IM_MESSAGE_TYPE = 'im_message_type', // IM 消息类型 + IM_MESSAGE_STATUS = 'im_message_status', // IM 消息状态 + IM_GROUP_MESSAGE_RECEIPT_STATUS = 'im_group_message_receipt_status', // IM 群消息回执状态 + IM_FRIEND_STATUS = 'im_friend_status', // IM 好友状态 + IM_GROUP_STATUS = 'im_group_status' // IM 群状态 } diff --git a/src/views/im/manager/friend/index.vue b/src/views/im/manager/friend/index.vue new file mode 100644 index 000000000..7264eed53 --- /dev/null +++ b/src/views/im/manager/friend/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/views/im/manager/group/components/GroupMemberDrawer.vue b/src/views/im/manager/group/components/GroupMemberDrawer.vue new file mode 100644 index 000000000..5a249c9e2 --- /dev/null +++ b/src/views/im/manager/group/components/GroupMemberDrawer.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/views/im/manager/group/index.vue b/src/views/im/manager/group/index.vue new file mode 100644 index 000000000..0ee219433 --- /dev/null +++ b/src/views/im/manager/group/index.vue @@ -0,0 +1,290 @@ + + + diff --git a/src/views/im/manager/message/group/index.vue b/src/views/im/manager/message/group/index.vue new file mode 100644 index 000000000..5984ad3d0 --- /dev/null +++ b/src/views/im/manager/message/group/index.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/src/views/im/manager/message/private/index.vue b/src/views/im/manager/message/private/index.vue new file mode 100644 index 000000000..844f92470 --- /dev/null +++ b/src/views/im/manager/message/private/index.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/im/manager/message/utils.ts b/src/views/im/manager/message/utils.ts new file mode 100644 index 000000000..141b8dd46 --- /dev/null +++ b/src/views/im/manager/message/utils.ts @@ -0,0 +1,28 @@ +// TODO @AI:应该放到 utils 里 +// IM 消息管理共享工具:消息内容预览 / JSON 美化 +// +// 消息类型 / 消息状态都走字典: +// DICT_TYPE.IM_MESSAGE_TYPE - 对应后端 ImMessageTypeEnum +// DICT_TYPE.IM_MESSAGE_STATUS - 对应后端 ImMessageStatusEnum + +/** 消息内容(JSON)取首层 content 字段做列表预览,解析失败时回退原文 */ +export const getContentPreview = (content?: string): string => { + if (!content) return '' + try { + const parsed = JSON.parse(content) + if (typeof parsed === 'object' && parsed.content) return String(parsed.content) + return content + } catch { + return content + } +} + +/** 详情弹窗里把 content JSON 美化成 2 缩进 */ +export const formatJson = (content?: string): string => { + if (!content) return '' + try { + return JSON.stringify(JSON.parse(content), null, 2) + } catch { + return content + } +} diff --git a/src/views/im/manager/sensitive-word/SensitiveWordForm.vue b/src/views/im/manager/sensitive-word/SensitiveWordForm.vue new file mode 100644 index 000000000..db779d987 --- /dev/null +++ b/src/views/im/manager/sensitive-word/SensitiveWordForm.vue @@ -0,0 +1,108 @@ + + + diff --git a/src/views/im/manager/sensitive-word/index.vue b/src/views/im/manager/sensitive-word/index.vue new file mode 100644 index 000000000..bc91f83a7 --- /dev/null +++ b/src/views/im/manager/sensitive-word/index.vue @@ -0,0 +1,216 @@ + + + diff --git a/src/views/im/manager/statistics/components/GroupSizeChart.vue b/src/views/im/manager/statistics/components/GroupSizeChart.vue new file mode 100644 index 000000000..b9b399a1e --- /dev/null +++ b/src/views/im/manager/statistics/components/GroupSizeChart.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/views/im/manager/statistics/components/MessageTrendChart.vue b/src/views/im/manager/statistics/components/MessageTrendChart.vue new file mode 100644 index 000000000..31c5a5796 --- /dev/null +++ b/src/views/im/manager/statistics/components/MessageTrendChart.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/views/im/manager/statistics/components/MessageTypeChart.vue b/src/views/im/manager/statistics/components/MessageTypeChart.vue new file mode 100644 index 000000000..7385c59fb --- /dev/null +++ b/src/views/im/manager/statistics/components/MessageTypeChart.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/views/im/manager/statistics/components/OverviewCards.vue b/src/views/im/manager/statistics/components/OverviewCards.vue new file mode 100644 index 000000000..7951ff07d --- /dev/null +++ b/src/views/im/manager/statistics/components/OverviewCards.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/views/im/manager/statistics/components/TopSendersChart.vue b/src/views/im/manager/statistics/components/TopSendersChart.vue new file mode 100644 index 000000000..52833d34d --- /dev/null +++ b/src/views/im/manager/statistics/components/TopSendersChart.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/views/im/manager/statistics/components/UserTrendChart.vue b/src/views/im/manager/statistics/components/UserTrendChart.vue new file mode 100644 index 000000000..7428c0d2a --- /dev/null +++ b/src/views/im/manager/statistics/components/UserTrendChart.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/views/im/manager/statistics/index.vue b/src/views/im/manager/statistics/index.vue new file mode 100644 index 000000000..d850263ce --- /dev/null +++ b/src/views/im/manager/statistics/index.vue @@ -0,0 +1,60 @@ + + + + +