From a40e1d56b75ce76505fe1ee32d9320d9d07b8ae3 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Thu, 6 Aug 2026 04:05:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=AB=99=E5=86=85?= =?UTF-8?q?=E4=BF=A1=E6=A8=A1=E5=9D=97=20-=20=E6=B6=88=E6=81=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=92=8C=E7=BE=A4=E7=BB=84=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inbox/inbox.ts | 131 ++++- src/router/index.ts | 27 ++ src/router/map.ts | 2 + src/views/inbox/group/group-config.ts | 57 +++ src/views/inbox/group/index.vue | 493 +++++++++++++++++++ src/views/inbox/message/index.vue | 556 ++++++++++++++++++++++ src/views/inbox/message/message-config.ts | 101 ++++ 7 files changed, 1353 insertions(+), 14 deletions(-) create mode 100644 src/views/inbox/group/group-config.ts create mode 100644 src/views/inbox/group/index.vue create mode 100644 src/views/inbox/message/index.vue create mode 100644 src/views/inbox/message/message-config.ts diff --git a/src/api/inbox/inbox.ts b/src/api/inbox/inbox.ts index 621554ff..2eb0147c 100644 --- a/src/api/inbox/inbox.ts +++ b/src/api/inbox/inbox.ts @@ -16,13 +16,13 @@ export interface InboxListParams { pageSize?: number // 每页数量,默认 20,最大 200 } -/** 站内信消息列表(inbox.list) */ +/** 站内信消息列表(inbox.message.list) */ export function inboxList(data: InboxListParams = {}) { return request({ url: '/system', method: 'post', params: { - method: 'inbox.list', + method: 'inbox.message.list', v, timestamp: Date.now() }, @@ -31,13 +31,13 @@ export function inboxList(data: InboxListParams = {}) { } as any) } -/** 站内信消息详情(inbox.detail) */ +/** 站内信消息详情(inbox.message.detail) */ export function inboxDetail(id: number) { return request({ url: '/system', method: 'post', params: { - method: 'inbox.detail', + method: 'inbox.message.detail', v, timestamp: Date.now() }, @@ -46,13 +46,13 @@ export function inboxDetail(id: number) { } as any) } -/** 站内信对话链查询(inbox.thread) */ +/** 站内信对话链查询(inbox.message.thread) */ export function inboxThread(id: number) { return request({ url: '/system', method: 'post', params: { - method: 'inbox.thread', + method: 'inbox.message.thread', v, timestamp: Date.now() }, @@ -70,13 +70,13 @@ export interface InboxReplyParams { flags?: Record // 处理标记 } -/** 系统回信(inbox.reply) */ +/** 系统回信(inbox.message.reply) */ export function inboxReply(data: InboxReplyParams) { return request({ url: '/system', method: 'post', params: { - method: 'inbox.reply', + method: 'inbox.message.reply', v, timestamp: Date.now() }, @@ -85,13 +85,13 @@ export function inboxReply(data: InboxReplyParams) { } as any) } -/** 手动重推失败消息(inbox.retry) */ +/** 手动重推失败消息(inbox.message.retry) */ export function inboxRetry(id: number) { return request({ url: '/system', method: 'post', params: { - method: 'inbox.retry', + method: 'inbox.message.retry', v, timestamp: Date.now() }, @@ -100,13 +100,13 @@ export function inboxRetry(id: number) { } as any) } -/** 站内信推送统计(inbox.stats) */ +/** 站内信推送统计(inbox.message.stats) */ export function inboxStats(direction?: string) { return request({ url: '/system', method: 'post', params: { - method: 'inbox.stats', + method: 'inbox.message.stats', v, timestamp: Date.now() }, @@ -115,8 +115,14 @@ export function inboxStats(direction?: string) { } as any) } +/** 生成货主绑群码参数 */ +export interface InboxBindCodeParams { + storeId: number // 货主ID + subType?: string // 群子类型编码:after_sales(售后) / finance(财务) / receiving(收货) +} + /** 生成货主绑群码(inbox.bindCode) */ -export function inboxBindCode(storeId: number) { +export function inboxBindCode(data: InboxBindCodeParams) { return request({ url: '/system', method: 'post', @@ -125,7 +131,104 @@ export function inboxBindCode(storeId: number) { v, timestamp: Date.now() }, - data: { storeId }, + data, + isSystemApi: true + } as any) +} + +// ============================================================ +// 群组管理 API +// ============================================================ + +/** 群组列表查询参数 */ +export interface InboxGroupListParams { + groupType?: string // 群类型筛选:store(货主) / warehouse(仓库) / express(快递) + keyword?: string // 群名称模糊搜索 + page?: number // 页码,默认1 + pageSize?: number // 每页条数,默认20,最大100 +} + +/** 拉取当前仓库的群列表(inbox.group.list) */ +export function inboxGroupList(data: InboxGroupListParams = {}) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'inbox.group.list', + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** 禁用/解禁群参数 */ +export interface InboxGroupDisableParams { + id: number // 群记录主键ID + isBlocked?: number // 是否禁用:1=禁用 0=启用,默认1 +} + +/** 禁用或解禁群(inbox.group.disable) */ +export function inboxGroupDisable(data: InboxGroupDisableParams) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'inbox.group.disable', + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** 修改群信息参数 */ +export interface InboxGroupUpdateParams { + id: number // 群记录主键ID + groupType?: string // 群类型:store(货主) / warehouse(仓库) / express(快递) + subType?: string // 群子类型:after_sales(售后) / finance(财务) / receiving(收货) + storeId?: number // 关联货主ID + expressInterfaces?: number[] // 快递接口ID数组,仅groupType=express时生效 + systemExpressCode?: string // 系统快递编码,groupType=express时必填 +} + +/** 修改群信息(inbox.group.update) */ +export function inboxGroupUpdate(data: InboxGroupUpdateParams) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'inbox.group.update', + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** 按群拉取消息列表参数 */ +export interface InboxGroupMessagesParams { + groupId: string // 群ID(必填) + direction?: string // 消息方向筛选:inbound(入站) / outbound(出站) + keyword?: string // 关键词搜索(ext_id / content) + page?: number // 页码,默认1 + pageSize?: number // 每页条数,默认20,最大200 +} + +/** 按群拉取消息列表(inbox.group.messages) */ +export function inboxGroupMessages(data: InboxGroupMessagesParams) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'inbox.group.messages', + v, + timestamp: Date.now() + }, + data, isSystemApi: true } as any) } diff --git a/src/router/index.ts b/src/router/index.ts index e1d15bdf..f9120c1a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -128,6 +128,33 @@ export const constantRoutes: RouteRecordRaw[] = [ } ] }, + { + path: '/inbox', + component: Layout, + meta: { hidden: true }, + children: [ + { + path: 'message', + name: 'InboxMessage', + component: () => import('@/views/inbox/message/index.vue'), + meta: { + title: '站内信消息', + icon: 'chat-line-square', + affix: false + } + }, + { + path: 'group', + name: 'InboxGroup', + component: () => import('@/views/inbox/group/index.vue'), + meta: { + title: '群组管理', + icon: 'connection', + affix: false + } + } + ] + }, { path: '/profile', component: Layout, diff --git a/src/router/map.ts b/src/router/map.ts index 4078f01d..d7fe9f6f 100644 --- a/src/router/map.ts +++ b/src/router/map.ts @@ -69,4 +69,6 @@ export const componentMap: Record = { 'system/setting/printcomputer/index':() => import('@/views/system/setting/printcomputer/index.vue'), 'express/index':() => import('@/views/express/waybill/index.vue'), 'system/setting/storeExpressBindingPolicy/index':() => import('@/views/system/setting/storeExpressBindingPolicy/index.vue'), + 'inbox/message/index': () => import('@/views/inbox/message/index.vue'), + 'inbox/group/index': () => import('@/views/inbox/group/index.vue'), }; \ No newline at end of file diff --git a/src/views/inbox/group/group-config.ts b/src/views/inbox/group/group-config.ts new file mode 100644 index 00000000..a95f2cfe --- /dev/null +++ b/src/views/inbox/group/group-config.ts @@ -0,0 +1,57 @@ +import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config' + +// ============================================================ +// 站内信群组 - ScanBox 筛选字段 +// ============================================================ +export const groupAvailableFields = [ + { + value: 'groupType', + label: '群类型', + type: 'select', + placeholder: '请选择群类型', + operators: ['eq'], + defaultOperator: 'eq', + options: [ + { label: '货主群', value: 'store' }, + { label: '仓库群', value: 'warehouse' }, + { label: '快递群', value: 'express' }, + ], + }, + { + value: 'keyword', + label: '群名称', + type: 'text', + placeholder: '模糊搜索群名称', + operators: ['contains'], + defaultOperator: 'contains', + }, +] + +// ============================================================ +// 站内信群组 - UpperTable 列配置 +// ============================================================ +export const groupColumns = [ + { prop: 'id', label: 'ID', width: '70' }, + { prop: 'group_name', label: '群名称', minWidth: '160', showOverflowTooltip: true }, + { prop: 'group_id', label: '群ID', minWidth: '160', showOverflowTooltip: true }, + { prop: 'group_type', label: '群类型', width: '100' }, + { prop: 'sub_type', label: '子类型', width: '100' }, + { prop: 'store_id', label: '货主ID', width: '90' }, + { prop: 'express_interfaces', label: '快递接口', minWidth: '140', showOverflowTooltip: true }, + { prop: 'system_express_code', label: '系统快递编码', minWidth: '140', showOverflowTooltip: true }, + { prop: 'is_blocked', label: '状态', width: '80' }, + { prop: 'created_at', label: '创建时间', width: '170' }, +] + +// ============================================================ +// 工具栏按钮 +// ============================================================ +export const groupToolbarButtons: ToolbarButtonConfig[] = [ + { + key: 'refresh', + label: '刷新', + type: 'primary', + icon: 'Refresh', + plain: false, + }, +] diff --git a/src/views/inbox/group/index.vue b/src/views/inbox/group/index.vue new file mode 100644 index 00000000..0dd7d568 --- /dev/null +++ b/src/views/inbox/group/index.vue @@ -0,0 +1,493 @@ + + + + + diff --git a/src/views/inbox/message/index.vue b/src/views/inbox/message/index.vue new file mode 100644 index 00000000..4a8408d9 --- /dev/null +++ b/src/views/inbox/message/index.vue @@ -0,0 +1,556 @@ + + + + + diff --git a/src/views/inbox/message/message-config.ts b/src/views/inbox/message/message-config.ts new file mode 100644 index 00000000..becc6dc5 --- /dev/null +++ b/src/views/inbox/message/message-config.ts @@ -0,0 +1,101 @@ +import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config' + +// ============================================================ +// 站内信消息列表 - ScanBox 筛选字段(对齐 inbox.list 实际字段) +// ============================================================ +export const messageAvailableFields = [ + { + value: 'direction', + label: '消息方向', + type: 'select', + placeholder: '请选择消息方向', + operators: ['eq'], + defaultOperator: 'eq', + options: [ + { label: '收件', value: 'inbound' }, + { label: '回信', value: 'outbound' }, + ], + }, + { + value: 'pushStatus', + label: '推送状态', + type: 'select', + placeholder: '请选择推送状态', + operators: ['eq'], + defaultOperator: 'eq', + options: [ + { label: '待推送', value: 0 }, + { label: '推送中', value: 1 }, + { label: '已送达', value: 2 }, + { label: '失败', value: 3 }, + ], + }, + { + value: 'sourceType', + label: '来源类型', + type: 'select', + placeholder: '请选择来源类型', + operators: ['eq'], + defaultOperator: 'eq', + options: [ + { label: 'API', value: 'api' }, + { label: '系统', value: 'system' }, + ], + }, + { + value: 'targetChannel', + label: '目标渠道', + type: 'select', + placeholder: '请选择目标渠道', + operators: ['eq'], + defaultOperator: 'eq', + options: [ + { label: '企业微信', value: 'wecom' }, + { label: '钉钉', value: 'dingtalk' }, + { label: '飞书', value: 'feishu' }, + { label: '仓库API', value: 'warehouse_api' }, + { label: 'Webhook', value: 'webhook' }, + ], + }, + { + value: 'keyword', + label: '关键词', + type: 'text', + placeholder: '搜索 ext_id / content / group_name', + operators: ['contains'], + defaultOperator: 'contains', + }, +] + +// ============================================================ +// 站内信消息列表 - UpperTable 列配置(对齐 inbox.list 实际响应字段) +// ============================================================ +export const messageColumns = [ + { prop: 'id', label: 'ID', width: '70' }, + { prop: 'ext_id', label: '外部ID', minWidth: '160', showOverflowTooltip: true }, + { prop: 'content', label: '正文', minWidth: '220', showOverflowTooltip: true }, + { prop: 'direction', label: '方向', width: '70' }, + { prop: 'source_type', label: '来源', width: '80' }, + { prop: 'target_type', label: '目标类型', width: '90' }, + { prop: 'target_channel', label: '渠道', width: '100' }, + { prop: 'group_name', label: '群名称', minWidth: '140', showOverflowTooltip: true }, + { prop: 'store_name', label: '货主', minWidth: '140', showOverflowTooltip: true }, + { prop: 'push_status', label: '推送状态', width: '90' }, + { prop: 'retry_count', label: '重试', width: '60' }, + { prop: 'parent_id', label: '父消息ID', width: '90' }, + { prop: 'created_at', label: '创建时间', width: '170' }, +] + +// ============================================================ +// 工具栏按钮 +// ============================================================ +export const messageToolbarButtons: ToolbarButtonConfig[] = [ + { + key: 'refresh', + label: '刷新', + type: 'primary', + icon: 'Refresh', + plain: false, + }, +] +