feat: 新增站内信模块 - 消息列表和群组管理页面

This commit is contained in:
liufumingren 2026-08-06 04:05:19 +08:00
parent 63b81aad31
commit a40e1d56b7
7 changed files with 1353 additions and 14 deletions

View File

@ -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<string, unknown> // 处理标记
}
/** 系统回信(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)
}

View File

@ -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,

View File

@ -69,4 +69,6 @@ export const componentMap: Record<string, any> = {
'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'),
};

View File

@ -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,
},
]

View File

@ -0,0 +1,493 @@
<template>
<div class="order-sub-container">
<scan-box
ref="scanBox"
cache-key="inbox:group"
width="250px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:available-fields="availableFields"
@condition-change="handleConditionChange"
@reset="handleConditionReset"
@condition-clear="handleConditionClear"
>
<template #filter-header>
<div style="padding: 8px 0">
<el-button type="primary" size="small" style="width: 100%" @click="showBindDialog">
生成绑群码
</el-button>
</div>
</template>
</scan-box>
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button>
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
</div>
</div>
<div class="split-stack">
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="群组列表"
default-align="center"
table-id="inbox-group-list"
:data="tableData"
:columns="columns"
:table-size="tableSize"
:pagination="upperPagination"
:show-index="true"
:loading="loading"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="handleRefresh"
>
<template #column-group_type="{ row }">
<el-tag size="small" :type="groupTypeTagType(row.group_type)">
{{ groupTypeLabel(row.group_type) }}
</el-tag>
</template>
<template #column-sub_type="{ row }">
{{ subTypeLabel(row.sub_type) }}
</template>
<template #column-express_interfaces="{ row }">
<template v-if="row.express_interfaces && row.express_interfaces.length">
<el-tag v-for="(iface, idx) in row.express_interfaces" :key="idx" size="small" style="margin: 1px 2px">
{{ iface }}
</el-tag>
</template>
<span v-else>-</span>
</template>
<template #column-is_blocked="{ row }">
<el-tag size="small" :type="row.is_blocked ? 'danger' : 'success'">
{{ row.is_blocked ? '已禁用' : '启用' }}
</el-tag>
</template>
<template #empty>
<div class="empty-tip">暂无群组数据</div>
</template>
</upper-table>
</div>
</div>
</div>
<!-- ========== 弹窗 ========== -->
<!-- 生成绑群码弹窗 -->
<el-dialog v-model="bindDialogVisible" title="生成绑群码" width="550px" destroy-on-close @closed="resetBindForm">
<el-form ref="bindFormRef" :model="bindForm" :rules="bindRules" label-width="100px" size="small">
<el-form-item label="选择货主" prop="storeId">
<el-select v-model="bindForm.storeId" placeholder="请选择货主" filterable style="width: 100%" :loading="storeLoading">
<el-option v-for="store in storeList" :key="store.id" :label="store.name" :value="store.id" />
</el-select>
</el-form-item>
<el-form-item label="子类型">
<el-select v-model="bindForm.subType" placeholder="可选" clearable style="width: 100%">
<el-option label="售后" value="after_sales" />
<el-option label="财务" value="finance" />
<el-option label="收货" value="receiving" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="bindDialogVisible = false">取消</el-button>
<el-button type="primary" size="small" :loading="bindLoading" @click="handleGenerateCode">生成</el-button>
</template>
</el-dialog>
<!-- 绑群码结果弹窗 -->
<el-dialog v-model="resultDialogVisible" title="绑群码已生成" width="480px" destroy-on-close>
<div class="result-content">
<div class="result-tip">绑群码 5 分钟有效,请将以下码发送给货主,货主可在对应 IM 工具中使用该码完成群组绑定。</div>
<div class="result-code-box">
<span class="result-code">{{ generatedCode }}</span>
<el-button type="primary" size="small" @click="handleCopyGeneratedCode">复制</el-button>
</div>
</div>
<template #footer>
<el-button size="small" @click="resultDialogVisible = false">关闭</el-button>
</template>
</el-dialog>
<!-- 编辑群信息弹窗 -->
<el-dialog v-model="editDialogVisible" title="编辑群信息" width="600px" destroy-on-close @closed="resetEditForm">
<el-form ref="editFormRef" :model="editForm" :rules="editRules" label-width="110px" size="small">
<el-form-item label="群ID"><el-input :model-value="editForm.groupId" disabled /></el-form-item>
<el-form-item label="群名称"><el-input :model-value="editForm.groupName" disabled /></el-form-item>
<el-form-item label="群类型" prop="groupType">
<el-select v-model="editForm.groupType" style="width: 100%" @change="onEditGroupTypeChange">
<el-option label="货主群" value="store" />
<el-option label="仓库群" value="warehouse" />
<el-option label="快递群" value="express" />
</el-select>
</el-form-item>
<el-form-item v-if="editForm.groupType !== 'express'" label="子类型">
<el-select v-model="editForm.subType" placeholder="可选" clearable style="width: 100%">
<el-option label="售后" value="after_sales" />
<el-option label="财务" value="finance" />
<el-option label="收货" value="receiving" />
</el-select>
</el-form-item>
<el-form-item v-if="editForm.groupType === 'store'" label="关联货主" prop="storeId">
<el-select v-model="editForm.storeId" placeholder="请选择货主" filterable clearable style="width: 100%" :loading="storeLoading">
<el-option v-for="store in storeList" :key="store.id" :label="store.name" :value="store.id" />
</el-select>
</el-form-item>
<el-form-item v-if="editForm.groupType === 'express'" label="快递接口" prop="expressInterfaces">
<el-select v-model="editForm.expressInterfaces" placeholder="请选择快递接口(空=全部)" multiple filterable style="width: 100%" />
</el-form-item>
<el-form-item v-if="editForm.groupType === 'express'" label="系统快递编码" prop="systemExpressCode">
<el-input v-model="editForm.systemExpressCode" placeholder="请输入系统快递编码" />
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="editDialogVisible = false">取消</el-button>
<el-button type="primary" size="small" :loading="editLoading" @click="handleSubmitEdit">保存</el-button>
</template>
</el-dialog>
<!-- 群消息弹窗 -->
<el-dialog v-model="messagesDialogVisible" :title="`群消息 - ${currentGroupName}`" width="900px" destroy-on-close>
<div class="msg-filter-bar">
<el-select v-model="msgFilter.direction" placeholder="消息方向" clearable size="small" style="width: 120px" @change="fetchGroupMessages">
<el-option label="入站" value="inbound" />
<el-option label="出站" value="outbound" />
</el-select>
<el-input v-model="msgFilter.keyword" placeholder="搜索 ext_id / content" clearable size="small" style="width: 200px; margin-left: 8px" @keyup.enter="fetchGroupMessages" @clear="fetchGroupMessages" />
<el-button size="small" style="margin-left: 8px" @click="fetchGroupMessages">查询</el-button>
</div>
<div v-loading="msgLoading" class="msg-table-wrapper">
<el-table :data="msgTableData" border stripe size="small" style="width: 100%" max-height="400">
<el-table-column prop="id" label="ID" width="70" align="center" />
<el-table-column prop="ext_id" label="外部ID" min-width="140" show-overflow-tooltip />
<el-table-column prop="direction" label="方向" width="80" align="center">
<template #default="{ row: r }">
<el-tag :type="r.direction === 'inbound' ? 'primary' : 'success'" size="small">
{{ r.direction === 'inbound' ? '入站' : '出站' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="content" label="内容" min-width="200" show-overflow-tooltip />
<el-table-column prop="created_at" label="时间" width="170" show-overflow-tooltip />
</el-table>
</div>
<div class="msg-pagination-wrapper">
<el-pagination
v-model:current-page="msgPagination.currentPage" v-model:page-size="msgPagination.pageSize"
:total="msgPagination.total" :page-sizes="[20, 50, 100, 200]"
layout="total, sizes, prev, pager, next, jumper" size="small"
@size-change="onMsgPageSizeChange" @current-change="onMsgPageChange"
/>
</div>
<template #footer>
<el-button size="small" @click="messagesDialogVisible = false">关闭</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
import {
inboxGroupList,
inboxGroupDisable,
inboxGroupUpdate,
inboxGroupMessages,
inboxBindCode,
} from '@/api/inbox/inbox'
import { storeList as fetchStoreList } from '@/api/storeWarehouse.store/storeWarehouse'
import { groupAvailableFields, groupColumns } from './group-config'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
// ==================== 常量 ====================
const groupTypeLabelMap: Record<string, string> = { store: '货主群', warehouse: '仓库群', express: '快递群' }
const groupTypeTagTypeMap: Record<string, string> = { store: 'primary', warehouse: 'warning', express: 'success' }
const subTypeLabelMap: Record<string, string> = { after_sales: '售后', finance: '财务', receiving: '收货' }
function groupTypeLabel(t: string) { return groupTypeLabelMap[t] ?? t ?? '-' }
function groupTypeTagType(t: string) { return groupTypeTagTypeMap[t] ?? 'info' }
function subTypeLabel(s: string) { return subTypeLabelMap[s] ?? s ?? '-' }
// ==================== 配置 ====================
const availableFields = groupAvailableFields
const columns = groupColumns
const tableSize = 'small'
// ==================== 数据状态 ====================
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const loading = ref(false)
const tableData = ref<any[]>([])
const currentConditions = ref<Record<string, any>>({})
const selectedRow = ref<any>(null)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const upperPagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
// ==================== ScanBox 事件 ====================
function handleConditionChange(conditions: Record<string, any>) {
currentConditions.value = conditions ?? {}
pagination.currentPage = 1
upperPagination.currentPage = 1
fetchData()
}
function handleConditionReset() { currentConditions.value = {}; pagination.currentPage = 1; upperPagination.currentPage = 1; fetchData() }
function handleConditionClear() { currentConditions.value = {}; pagination.currentPage = 1; upperPagination.currentPage = 1; fetchData() }
function handleRowClick(row: any) { selectedRow.value = row }
// ==================== 数据查询 ====================
function buildWhereFromConditions(conditions: Record<string, any>) {
const where: Record<string, any> = {}
for (const [key, cond] of Object.entries(conditions)) {
if (cond === undefined || cond === null || cond === '') continue
if (typeof cond === 'object' && cond.value !== undefined) where[key] = cond.value
else where[key] = cond
}
return where
}
async function fetchData() {
loading.value = true
try {
const where = buildWhereFromConditions(currentConditions.value)
const params: any = { page: pagination.currentPage, pageSize: pagination.pageSize, ...where }
const res: any = await inboxGroupList(params)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
const data = res.data ?? res
tableData.value = data.list ?? []
const total = data.total ?? 0
pagination.total = total; upperPagination.total = total
} else {
tableData.value = []; pagination.total = 0; upperPagination.total = 0
ElMessage.error(res?.message || '获取群组列表失败')
}
} catch (error) {
console.error('获取群组列表失败:', error)
tableData.value = []; pagination.total = 0; upperPagination.total = 0
} finally { loading.value = false }
}
function handleRefresh() { fetchData() }
function handlePageChange(page: number) { pagination.currentPage = page; upperPagination.currentPage = page; fetchData() }
function handlePageSizeChange(size: number) { pagination.pageSize = size; upperPagination.pageSize = size; pagination.currentPage = 1; upperPagination.currentPage = 1; fetchData() }
// ==================== 生成绑群码 ====================
const bindDialogVisible = ref(false)
const bindLoading = ref(false)
const storeLoading = ref(false)
const bindFormRef = ref<FormInstance>()
const storeList = ref<any[]>([])
const bindForm = reactive({ storeId: null as number | null, subType: '' as string })
const bindRules: FormRules = { storeId: [{ required: true, message: '请选择货主', trigger: 'change' }] }
const resultDialogVisible = ref(false)
const generatedCode = ref('')
function showBindDialog() { bindForm.storeId = null; bindForm.subType = ''; bindDialogVisible.value = true; loadStoreList() }
function resetBindForm() { bindFormRef.value?.resetFields() }
async function loadStoreList() {
storeLoading.value = true
try {
const res: any = await fetchStoreList({})
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) storeList.value = res.data?.list ?? res.data ?? []
} catch { /* ignore */ } finally { storeLoading.value = false }
}
async function handleGenerateCode() {
const valid = await bindFormRef.value?.validate().catch(() => false)
if (!valid) return
bindLoading.value = true
try {
const params: any = { storeId: bindForm.storeId! }
if (bindForm.subType) params.subType = bindForm.subType
const res: any = await inboxBindCode(params)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
generatedCode.value = res.data?.code ?? ''
bindDialogVisible.value = false; resultDialogVisible.value = true
} else { ElMessage.error(res?.message || '生成绑群码失败') }
} catch { ElMessage.error('生成绑群码失败') } finally { bindLoading.value = false }
}
function handleCopyGeneratedCode() {
navigator.clipboard.writeText(generatedCode.value).then(() => ElMessage.success('已复制到剪贴板')).catch(() => ElMessage.warning('复制失败,请手动复制'))
}
// ==================== 编辑群信息 ====================
const editDialogVisible = ref(false)
const editLoading = ref(false)
const editFormRef = ref<FormInstance>()
const editingRow = ref<any>(null)
const editForm = reactive({ groupId: '', groupName: '', groupType: '' as string, subType: '' as string, storeId: null as number | null, expressInterfaces: [] as number[], systemExpressCode: '' as string })
const editRules: FormRules = { systemExpressCode: [{ validator: (_r, _v, cb) => { if (editForm.groupType === 'express' && !editForm.systemExpressCode) cb(new Error('快递类型时系统快递编码不能为空')); else cb() }, trigger: 'blur' }] }
function handleEdit(row: any) {
editingRow.value = row
editForm.groupId = row.group_id ?? ''; editForm.groupName = row.group_name ?? ''
editForm.groupType = row.group_type ?? ''; editForm.subType = row.sub_type ?? ''
editForm.storeId = row.store_id ?? null
editForm.expressInterfaces = Array.isArray(row.express_interfaces) ? [...row.express_interfaces] : []
editForm.systemExpressCode = row.system_express_code ?? ''
editDialogVisible.value = true; loadStoreList()
}
function resetEditForm() { editFormRef.value?.resetFields(); editingRow.value = null }
function onEditGroupTypeChange() {
if (editForm.groupType !== 'express') { editForm.expressInterfaces = []; editForm.systemExpressCode = '' }
if (editForm.groupType !== 'store') editForm.storeId = null
}
async function handleSubmitEdit() {
const valid = await editFormRef.value?.validate().catch(() => false)
if (!valid) return
editLoading.value = true
try {
const params: any = { id: editingRow.value.id }
if (editForm.groupType) params.groupType = editForm.groupType
if (editForm.groupType !== 'express' && editForm.subType) params.subType = editForm.subType
if (editForm.groupType === 'store' && editForm.storeId) params.storeId = editForm.storeId
if (editForm.groupType === 'express') { params.expressInterfaces = editForm.expressInterfaces; params.systemExpressCode = editForm.systemExpressCode }
const res: any = await inboxGroupUpdate(params)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
ElMessage.success(res.data?.message || res.message || '群信息修改成功')
editDialogVisible.value = false; fetchData()
} else { ElMessage.error(res?.message || '修改失败') }
} catch { ElMessage.error('修改失败') } finally { editLoading.value = false }
}
// ==================== 禁用/启用 ====================
async function handleToggleDisable(row: any) {
const action = row.is_blocked ? '启用' : '禁用'
try {
await ElMessageBox.confirm(`确定要${action}群组「${row.group_name}」吗?`, `${action}确认`, { type: 'warning' })
const res: any = await inboxGroupDisable({ id: row.id, isBlocked: row.is_blocked ? 0 : 1 })
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
ElMessage.success(res.data?.message || res.message || `群已${action}`); fetchData()
} else { ElMessage.error(res?.message || `${action}失败`) }
} catch { /* 用户取消 */ }
}
// ==================== 群消息 ====================
const messagesDialogVisible = ref(false)
const msgLoading = ref(false)
const currentGroupId = ref('')
const currentGroupName = ref('')
const msgTableData = ref<any[]>([])
const msgFilter = reactive({ direction: '' as string, keyword: '' as string })
const msgPagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
function handleViewMessages(row: any) {
currentGroupId.value = row.group_id; currentGroupName.value = row.group_name
msgFilter.direction = ''; msgFilter.keyword = ''
msgPagination.currentPage = 1; msgPagination.pageSize = 20; msgTableData.value = []
messagesDialogVisible.value = true; fetchGroupMessages()
}
async function fetchGroupMessages() {
msgLoading.value = true
try {
const params: any = { groupId: currentGroupId.value, page: msgPagination.currentPage, pageSize: msgPagination.pageSize }
if (msgFilter.direction) params.direction = msgFilter.direction
if (msgFilter.keyword) params.keyword = msgFilter.keyword
const res: any = await inboxGroupMessages(params)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
const data = res.data ?? res; msgTableData.value = data.list ?? []; msgPagination.total = data.pagination?.total ?? 0
} else { msgTableData.value = []; msgPagination.total = 0; ElMessage.error(res?.message || '获取群消息失败') }
} catch { msgTableData.value = []; msgPagination.total = 0 } finally { msgLoading.value = false }
}
function onMsgPageChange(page: number) { msgPagination.currentPage = page; fetchGroupMessages() }
function onMsgPageSizeChange(size: number) { msgPagination.pageSize = size; msgPagination.currentPage = 1; fetchGroupMessages() }
onMounted(() => { fetchData() })
</script>
<style scoped lang="scss">
.order-sub-container {
display: flex;
height: 100%;
width: 100%;
background-color: #f0f2f5;
:deep(.scan-box-container) {
flex: 0 0 250px;
flex-shrink: 0;
height: 100%;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
}
}
.split-stack {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
:deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
}
}
}
.result-content {
text-align: center;
.result-tip { font-size: 13px; color: #606266; margin-bottom: 16px; }
.result-code-box {
display: flex; align-items: center; justify-content: center; gap: 12px;
padding: 16px; background: #f5f7fa; border-radius: 6px;
.result-code { font-size: 20px; font-weight: 700; color: #409eff; letter-spacing: 2px; font-family: monospace; }
}
}
.msg-filter-bar { display: flex; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #ebeef5; }
.msg-table-wrapper { margin-bottom: 0; }
.msg-pagination-wrapper { display: flex; justify-content: flex-end; margin-top: 10px; }
.empty-tip { color: #909399; font-size: 13px; padding: 16px; text-align: center; }
}
</style>

View File

@ -0,0 +1,556 @@
<template>
<div class="order-sub-container">
<scan-box
ref="scanBox"
cache-key="inbox:message"
width="250px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:available-fields="availableFields"
@condition-change="handleConditionChange"
@reset="handleConditionReset"
@condition-clear="handleConditionClear"
/>
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button>
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
<el-tag v-if="queryTime > 0" size="small" effect="plain">{{ queryTime }}ms</el-tag>
</div>
</div>
<div class="split-stack">
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="站内信消息列表"
default-align="center"
table-id="inbox-message-list"
:data="tableData"
:columns="columns"
:table-size="tableSize"
:pagination="upperPagination"
:show-index="true"
:loading="loading"
:query-time="queryTime"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="handleRefresh"
>
<template #column-direction="{ row }">
<el-tag :type="row.direction === 'inbound' ? 'primary' : 'success'" size="small">
{{ row.direction === 'inbound' ? '收件' : '回信' }}
</el-tag>
</template>
<template #column-source_type="{ row }">
<el-tag size="small" :type="row.source_type === 'api' ? '' : 'info'">
{{ row.source_type === 'api' ? 'API' : row.source_type ?? '-' }}
</el-tag>
</template>
<template #column-target_type="{ row }">
<el-tag size="small" :type="row.target_type === 'api' ? '' : 'info'">
{{ row.target_type ?? '-' }}
</el-tag>
</template>
<template #column-target_channel="{ row }">
<el-tag v-if="row.target_channel" size="small" :type="channelTagType(row.target_channel)">
{{ channelLabel(row.target_channel) }}
</el-tag>
<span v-else>-</span>
</template>
<template #column-push_status="{ row }">
<template v-if="row.direction === 'outbound'">
<el-tag size="small" :type="pushStatusTagType(row.push_status)">
{{ pushStatusLabel(row.push_status) }}
</el-tag>
</template>
<span v-else>-</span>
</template>
<template #empty>
<div class="empty-tip">暂无站内信消息数据</div>
</template>
</upper-table>
</div>
</div>
</div>
<!-- ========== 弹窗 ========== -->
<!-- 消息详情弹窗 -->
<el-dialog v-model="detailVisible" title="消息详情" width="750px" destroy-on-close>
<div v-if="detailData" class="detail-content">
<el-descriptions :column="2" border size="small">
<el-descriptions-item label="消息ID">{{ detailData.id }}</el-descriptions-item>
<el-descriptions-item label="外部ID">{{ detailData.ext_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="仓库ID">{{ detailData.warehouse_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="货主">{{ detailData.store_name ?? detailData.store_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="消息方向">
<el-tag :type="detailData.direction === 'inbound' ? 'primary' : 'success'" size="small">
{{ detailData.direction === 'inbound' ? '收件' : '回信' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="父消息ID">{{ detailData.parent_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="来源类型">
<el-tag size="small">{{ detailData.source_type ?? '-' }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="目标类型">
<el-tag size="small">{{ detailData.target_type ?? '-' }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="目标渠道">
<el-tag v-if="detailData.target_channel" size="small">{{ channelLabel(detailData.target_channel) }}</el-tag>
<span v-else>-</span>
</el-descriptions-item>
<el-descriptions-item label="群名称">{{ detailData.group_name ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="群ID">{{ detailData.group_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="用户名">{{ detailData.user_name ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="用户ID">{{ detailData.user_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="推送状态">
<template v-if="detailData.direction === 'outbound'">
<el-tag size="small" :type="pushStatusTagType(detailData.push_status)">
{{ pushStatusLabel(detailData.push_status) }}
</el-tag>
</template>
<span v-else>-</span>
</el-descriptions-item>
<el-descriptions-item label="已重试次数">{{ detailData.direction === 'outbound' ? (detailData.retry_count ?? 0) : '-' }}</el-descriptions-item>
<el-descriptions-item label="工单ID">{{ detailData.work_order_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="工单号">{{ detailData.work_order_no ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ detailData.created_at ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="更新时间">{{ detailData.updated_at ?? '-' }}</el-descriptions-item>
<el-descriptions-item v-if="detailData.content" label="正文" :span="2">
<div class="content-text">{{ detailData.content }}</div>
</el-descriptions-item>
<el-descriptions-item v-if="detailData.flags && Object.keys(detailData.flags).length" label="处理标记" :span="2">
<pre class="json-pre">{{ JSON.stringify(detailData.flags, null, 2) }}</pre>
</el-descriptions-item>
<el-descriptions-item v-if="detailData.push_response" label="推送响应" :span="2">
<pre class="json-pre">{{ JSON.stringify(detailData.push_response, null, 2) }}</pre>
</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
<!-- 回信弹窗 -->
<el-dialog v-model="replyVisible" title="系统回信" width="550px" destroy-on-close @closed="resetReplyForm">
<el-form ref="replyFormRef" :model="replyForm" :rules="replyRules" label-width="100px" size="small">
<el-form-item label="原消息ID">
<el-input :model-value="replyForm.parentId" disabled />
</el-form-item>
<el-form-item label="目标渠道" prop="targetChannel">
<el-select v-model="replyForm.targetChannel" placeholder="请选择目标渠道" style="width: 100%">
<el-option label="企业微信" value="wecom" />
<el-option label="钉钉" value="dingtalk" />
<el-option label="飞书" value="feishu" />
<el-option label="仓库API" value="warehouse_api" />
<el-option label="Webhook" value="webhook" />
</el-select>
</el-form-item>
<el-form-item label="目标类型">
<el-select v-model="replyForm.targetType" placeholder="可选" clearable style="width: 100%">
<el-option label="IM" value="im" />
<el-option label="API" value="api" />
<el-option label="Webhook" value="webhook" />
</el-select>
</el-form-item>
<el-form-item label="扩展数据">
<el-input v-model="replyForm.extDataJson" type="textarea" :rows="4" placeholder='JSON 格式' />
</el-form-item>
<el-form-item label="处理标记">
<el-input v-model="replyForm.flagsJson" type="textarea" :rows="3" placeholder='JSON 格式' />
</el-form-item>
</el-form>
<template #footer>
<el-button size="small" @click="replyVisible = false">取消</el-button>
<el-button type="primary" size="small" :loading="replyLoading" @click="handleSubmitReply">确认回信</el-button>
</template>
</el-dialog>
<!-- 对话链弹窗 -->
<el-dialog v-model="threadVisible" title="对话链" width="800px" destroy-on-close>
<div v-if="threadData.length" class="thread-content">
<el-timeline>
<el-timeline-item
v-for="item in threadData"
:key="item.id"
:timestamp="item.created_at"
placement="top"
:type="item.direction === 'inbound' ? 'primary' : 'success'"
>
<el-card shadow="hover" size="small">
<div class="thread-card-header">
<el-tag :type="item.direction === 'inbound' ? 'primary' : 'success'" size="small">
{{ item.direction === 'inbound' ? '收件' : '回信' }}
</el-tag>
<el-tag v-if="item.target_channel" size="small" style="margin-left: 8px">
{{ channelLabel(item.target_channel) }}
</el-tag>
<el-tag v-if="item.direction === 'outbound'" size="small" style="margin-left: 8px" :type="pushStatusTagType(item.push_status)">
{{ pushStatusLabel(item.push_status) }}
</el-tag>
</div>
<div class="thread-card-body">
<p v-if="item.content" class="thread-content-text">{{ item.content }}</p>
<p v-if="item.ext_id" class="thread-meta">外部ID: {{ item.ext_id }}</p>
<p v-if="item.group_name" class="thread-meta">群: {{ item.group_name }}</p>
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</div>
<div v-else v-loading="threadLoading" class="thread-empty">暂无对话链数据</div>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import {
inboxList,
inboxDetail,
inboxThread,
inboxReply,
inboxRetry,
inboxStats,
} from '@/api/inbox/inbox'
import { messageAvailableFields, messageColumns } from './message-config'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
// ==================== 常量 ====================
const channelLabelMap: Record<string, string> = {
wecom: '企业微信', dingtalk: '钉钉', feishu: '飞书',
warehouse_api: '仓库API', webhook: 'Webhook',
}
const channelTagTypeMap: Record<string, string> = {
wecom: 'success', dingtalk: 'primary', feishu: '',
warehouse_api: 'warning', webhook: 'danger',
}
const pushStatusLabelMap: Record<number, string> = { 0: '待推送', 1: '推送中', 2: '已送达', 3: '失败' }
const pushStatusTagTypeMap: Record<number, string> = { 0: 'info', 1: 'warning', 2: 'success', 3: 'danger' }
function channelLabel(c: string) { return channelLabelMap[c] ?? c ?? '-' }
function channelTagType(c: string) { return channelTagTypeMap[c] ?? 'info' }
function pushStatusLabel(s: number) { return pushStatusLabelMap[s] ?? '未知' }
function pushStatusTagType(s: number) { return pushStatusTagTypeMap[s] ?? 'info' }
// ==================== 配置 ====================
const availableFields = messageAvailableFields
const columns = messageColumns
const tableSize = 'small'
// ==================== 数据状态 ====================
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const loading = ref(false)
const queryTime = ref(0)
const tableData = ref<any[]>([])
const currentConditions = ref<Record<string, any>>({})
const selectedRow = ref<any>(null)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const upperPagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
// ==================== ScanBox 事件 ====================
function handleConditionChange(conditions: Record<string, any>) {
currentConditions.value = conditions ?? {}
pagination.currentPage = 1
upperPagination.currentPage = 1
fetchData()
}
function handleConditionReset() {
currentConditions.value = {}
pagination.currentPage = 1
upperPagination.currentPage = 1
fetchData()
}
function handleConditionClear() {
currentConditions.value = {}
pagination.currentPage = 1
upperPagination.currentPage = 1
fetchData()
}
function handleRowClick(row: any) {
selectedRow.value = row
}
// ==================== 数据查询 ====================
function buildWhereFromConditions(conditions: Record<string, any>) {
const where: Record<string, any> = {}
for (const [key, cond] of Object.entries(conditions)) {
if (cond === undefined || cond === null || cond === '') continue
if (typeof cond === 'object' && cond.value !== undefined) {
where[key] = cond.value
} else {
where[key] = cond
}
}
return where
}
async function fetchData() {
loading.value = true
const start = Date.now()
try {
const where = buildWhereFromConditions(currentConditions.value)
const params: any = {
page: pagination.currentPage,
pageSize: pagination.pageSize,
...where,
}
const res: any = await inboxList(params)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
const data = res.data ?? res
tableData.value = data.list ?? data.items ?? []
const total = data.total ?? data.pagination?.total ?? 0
pagination.total = total
upperPagination.total = total
} else {
tableData.value = []
pagination.total = 0
upperPagination.total = 0
ElMessage.error(res?.message || '获取消息列表失败')
}
} catch (error) {
console.error('获取消息列表失败:', error)
tableData.value = []
pagination.total = 0
upperPagination.total = 0
} finally {
queryTime.value = Date.now() - start
loading.value = false
}
}
async function fetchStats() {
// stats in background - not blocking
try {
const res: any = await inboxStats()
// parse stats if needed
} catch { /* ignore */ }
}
function handleRefresh() {
fetchData()
fetchStats()
}
function handlePageChange(page: number) {
pagination.currentPage = page
upperPagination.currentPage = page
fetchData()
}
function handlePageSizeChange(size: number) {
pagination.pageSize = size
upperPagination.pageSize = size
pagination.currentPage = 1
upperPagination.currentPage = 1
fetchData()
}
// ==================== 详情 ====================
const detailVisible = ref(false)
const detailData = ref<any>(null)
async function handleViewDetail(row: any) {
detailVisible.value = true
detailData.value = null
try {
const res: any = await inboxDetail(row.id)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
detailData.value = res.data ?? res
} else {
ElMessage.error(res?.message || '获取详情失败')
}
} catch { ElMessage.error('获取详情失败') }
}
// ==================== 回信 ====================
const replyVisible = ref(false)
const replyLoading = ref(false)
const replyFormRef = ref<FormInstance>()
const replyForm = reactive({ parentId: 0, targetChannel: '', targetType: '', extDataJson: '', flagsJson: '' })
const replyRules: FormRules = { targetChannel: [{ required: true, message: '请选择目标渠道', trigger: 'change' }] }
function handleOpenReply(row: any) {
replyForm.parentId = row.id
replyForm.targetChannel = row.target_channel ?? ''
replyForm.targetType = ''
replyForm.extDataJson = ''
replyForm.flagsJson = ''
replyVisible.value = true
}
function resetReplyForm() { replyFormRef.value?.resetFields() }
async function handleSubmitReply() {
const valid = await replyFormRef.value?.validate().catch(() => false)
if (!valid) return
replyLoading.value = true
try {
const data: any = { parentId: replyForm.parentId, targetChannel: replyForm.targetChannel }
if (replyForm.targetType) data.targetType = replyForm.targetType
if (replyForm.extDataJson) {
try { data.extData = JSON.parse(replyForm.extDataJson) }
catch { ElMessage.warning('扩展数据 JSON 格式不正确'); replyLoading.value = false; return }
}
if (replyForm.flagsJson) {
try { data.flags = JSON.parse(replyForm.flagsJson) }
catch { ElMessage.warning('处理标记 JSON 格式不正确'); replyLoading.value = false; return }
}
const res: any = await inboxReply(data)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
ElMessage.success('回信成功')
replyVisible.value = false
fetchData()
} else { ElMessage.error(res?.message || '回信失败') }
} catch { ElMessage.error('回信失败') }
finally { replyLoading.value = false }
}
// ==================== 重推 ====================
async function handleRetry(row: any) {
try {
const res: any = await inboxRetry(row.id)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
ElMessage.success('重推成功')
fetchData()
} else { ElMessage.error(res?.message || '重推失败') }
} catch { ElMessage.error('重推失败') }
}
// ==================== 对话链 ====================
const threadVisible = ref(false)
const threadLoading = ref(false)
const threadData = ref<any[]>([])
async function handleViewThread(row: any) {
threadVisible.value = true
threadData.value = []
threadLoading.value = true
try {
const res: any = await inboxThread(row.id)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
threadData.value = Array.isArray(res.data?.thread) ? res.data.thread : (Array.isArray(res.data) ? res.data : [])
} else { ElMessage.error(res?.message || '获取对话链失败') }
} catch { ElMessage.error('获取对话链失败') }
finally { threadLoading.value = false }
}
onMounted(() => {
fetchData()
fetchStats()
})
</script>
<style scoped lang="scss">
.order-sub-container {
display: flex;
height: 100%;
width: 100%;
background-color: #f0f2f5;
:deep(.scan-box-container) {
flex: 0 0 250px;
flex-shrink: 0;
height: 100%;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
}
}
.split-stack {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
:deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
}
}
}
.detail-content {
.content-text {
background: #f5f7fa;
padding: 10px 14px;
border-radius: 4px;
font-size: 13px;
line-height: 1.6;
color: #303133;
word-break: break-all;
}
.json-pre {
background: #f5f7fa;
padding: 10px;
border-radius: 4px;
font-size: 12px;
max-height: 200px;
overflow: auto;
margin: 0;
}
}
.thread-content {
max-height: 500px;
overflow-y: auto;
.thread-card-header { display: flex; align-items: center; margin-bottom: 8px; }
.thread-card-body {
.thread-content-text { font-size: 13px; color: #303133; margin: 0 0 6px 0; line-height: 1.5; }
.thread-meta { margin: 2px 0; font-size: 12px; color: #909399; }
}
}
.thread-empty { text-align: center; padding: 40px; color: #909399; }
.empty-tip { color: #909399; font-size: 13px; padding: 16px; }
}
</style>

View File

@ -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,
},
]