From 55b62554219465112478ae6d554d8543edd82963 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Mon, 17 Aug 2026 22:12:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(inbox):=20=E7=BE=A4=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B8=85=E7=A9=BA=E7=BE=A4=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=93=8D=E4=BD=9C=EF=BC=88inbox.group.reset?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inbox/inbox.ts | 20 ++++++++++++++++++++ src/views/inbox/group/index.vue | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/api/inbox/inbox.ts b/src/api/inbox/inbox.ts index bd5b9904..0b9bc0ab 100644 --- a/src/api/inbox/inbox.ts +++ b/src/api/inbox/inbox.ts @@ -215,6 +215,26 @@ export function inboxGroupUpdate(data: InboxGroupUpdateParams) { } as any) } +/** 清空群类型配置参数 */ +export interface InboxGroupResetParams { + id: number // 群记录主键ID +} + +/** 清空群类型配置(inbox.group.reset) */ +export function inboxGroupReset(data: InboxGroupResetParams) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'inbox.group.reset', + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + /** 按群拉取消息列表参数 */ export interface InboxGroupMessagesParams { groupId: string // 群ID(必填) diff --git a/src/views/inbox/group/index.vue b/src/views/inbox/group/index.vue index 9da9dfbe..88da91af 100644 --- a/src/views/inbox/group/index.vue +++ b/src/views/inbox/group/index.vue @@ -93,6 +93,7 @@ {{ row.is_blocked ? '启用' : '禁用' }} 消息 + 清空配置 @@ -237,6 +238,7 @@ import { inboxGroupDisable, inboxGroupUpdate, inboxGroupMessages, + inboxGroupReset, inboxBindCode, } from '@/api/inbox/inbox' import { loadStores, loadExpressInterfaces } from '@/api/index/index' @@ -561,6 +563,22 @@ async function handleToggleDisable(row: any) { } catch { /* 用户取消 */ } } +// ==================== 清空群类型配置 ==================== + +async function handleResetGroupConfig(row: any) { + try { + await ElMessageBox.confirm( + `确定要清空群组「${row.group_name}」的群类型配置吗?群类型/子类型/货主/快递接口/系统快递编码将被清空,AI 自动回复将关闭,仅保留群创建时信息。`, + '清空配置确认', + { type: 'warning', confirmButtonText: '清空', confirmButtonClass: 'el-button--danger' } + ) + const res: any = await inboxGroupReset({ id: row.id }) + if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) { + ElMessage.success(res.data?.message || res.message || '群类型配置已清空'); fetchData() + } else { ElMessage.error(res?.message || '清空失败') } + } catch { /* 用户取消 */ } +} + // ==================== 群消息 ==================== const messagesDialogVisible = ref(false)