feat(manage): 完善设备管理/支付配置/订单/审计日志模块
- 设备管理: 自营设备固定 source=DIRECT, 第三方设备固定 source=PARTNER, 门店终端管理跳转带 storeOrgId 筛选
- 支付配置: 支持平台全局/渠道/代理商/门店四个层级, 列表显示层级标签与所属组织
- 订单管理: 显示渠道/代理商/门店名称, 设备列显示MAC地址
- 审计日志: 新增审计日志和橘视厅调用日志页面及菜单图标SQL
- 门店管理: 兼容 manage 接口统一返回格式 data:{page:{list}}
This commit is contained in:
50
src/api/manage/auditLog.ts
Normal file
50
src/api/manage/auditLog.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import http from '@/utils/httpRequest'
|
||||
import type { ManageListResponse, ManagePageParams } from './types'
|
||||
|
||||
/**
|
||||
* 审计日志(管理后台操作审计)
|
||||
*/
|
||||
export interface AuditLogItem {
|
||||
id: number
|
||||
/** 操作人ID */
|
||||
actorUserId: number
|
||||
/** 操作人名 */
|
||||
name?: string
|
||||
/** 请求方法 */
|
||||
method?: string
|
||||
/** 接口路径 */
|
||||
api?: string
|
||||
/** 请求参数 */
|
||||
param?: string
|
||||
/** 中文描述 */
|
||||
paramDesc?: string
|
||||
/** 操作结果 */
|
||||
result?: string
|
||||
/** 变更前 */
|
||||
before?: string
|
||||
/** 变更后 */
|
||||
after?: string
|
||||
/** 操作原因 */
|
||||
reason?: string
|
||||
ip?: string
|
||||
/** 设备信息 */
|
||||
deviceInfo?: string
|
||||
/** 工单号 */
|
||||
ticketNo?: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 审计日志查询参数
|
||||
*/
|
||||
export interface AuditLogListParams extends ManagePageParams {
|
||||
actorUserId?: number
|
||||
api?: string
|
||||
method?: string
|
||||
ticketNo?: string
|
||||
}
|
||||
|
||||
/** 审计日志列表 */
|
||||
export function getAuditLogList(params?: AuditLogListParams): Promise<ManageListResponse<AuditLogItem>> {
|
||||
return http.get(http.adornUrl('/manage/audit-log/list'), { params: http.adornParams(params || {}) }).then(res => res.data)
|
||||
}
|
||||
@@ -114,6 +114,13 @@ export interface DayCardOrderItem {
|
||||
/** 非表字段 */
|
||||
partnerName?: string
|
||||
deviceMac?: string
|
||||
/** 设备MAC(deviceMac 为空时用此字段) */
|
||||
mac?: string
|
||||
deviceSn?: string
|
||||
agentOrgId?: number
|
||||
/** 组织路径快照 */
|
||||
orgPathSnapshot?: string
|
||||
channelOrderNo?: string
|
||||
}
|
||||
|
||||
/** 订单列表参数 */
|
||||
|
||||
@@ -32,21 +32,21 @@ export interface DeviceInfo {
|
||||
channelOrgId?: number
|
||||
channelName?: string
|
||||
agentOrgName?: string
|
||||
/** 设备来源:PLATFORM-平台 / PARTNER-第三方接口注册 */
|
||||
/** 设备来源:DIRECT-自营 / PARTNER-第三方接口注册 */
|
||||
source?: string
|
||||
/** 合作伙伴UUID(source=PARTNER 时) */
|
||||
partnerId?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端列表查询参数
|
||||
* 终端保存/更新数据
|
||||
*/
|
||||
export interface DeviceListParams extends ManagePageParams {
|
||||
storeOrgId?: number
|
||||
status?: string
|
||||
deviceName?: string
|
||||
mac?: string
|
||||
/** 设备来源:PLATFORM / PARTNER */
|
||||
/** 设备来源:DIRECT / PARTNER */
|
||||
source?: string
|
||||
/** 合作伙伴UUID(source=PARTNER 时筛选) */
|
||||
partnerId?: string
|
||||
@@ -68,9 +68,25 @@ export interface DeviceSaveData {
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/** 下划线转驼峰(兼容后端返回 snake_case 字段,统一为前端驼峰访问) */
|
||||
function toCamelCase (obj: any): any {
|
||||
if (!obj || typeof obj !== 'object' || Array.isArray(obj)) return obj
|
||||
const result: any = {}
|
||||
for (const key in obj) {
|
||||
result[key.replace(/_([a-z])/g, (_, c) => c.toUpperCase())] = obj[key]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/** 终端分页列表 */
|
||||
export function getDeviceList(params?: DeviceListParams): Promise<ManageListResponse<DeviceInfo>> {
|
||||
return http.get(http.adornUrl('/manage/device/list'), { params: http.adornParams(params || {}) }).then(res => res.data)
|
||||
return http.get(http.adornUrl('/manage/device/list'), { params: http.adornParams(params || {}) }).then(res => {
|
||||
const body = res.data as any
|
||||
if (body && body.data && body.data.page && Array.isArray(body.data.page.list)) {
|
||||
body.data.page.list = body.data.page.list.map(toCamelCase)
|
||||
}
|
||||
return body
|
||||
})
|
||||
}
|
||||
|
||||
/** 终端详情 */
|
||||
|
||||
@@ -26,3 +26,5 @@ export * from './partner'
|
||||
export * from './content-package'
|
||||
export * from './partner-card'
|
||||
export * from './openapiCallLog'
|
||||
export * from './auditLog'
|
||||
export * from './jstCallLog'
|
||||
|
||||
50
src/api/manage/jstCallLog.ts
Normal file
50
src/api/manage/jstCallLog.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import http from '@/utils/httpRequest'
|
||||
import type { ManageListResponse, ManagePageParams } from './types'
|
||||
|
||||
/**
|
||||
* 橘视厅调用日志(设备调用橘视厅 API 的日志)
|
||||
*/
|
||||
export interface JstCallLogItem {
|
||||
id: number
|
||||
/** 请求URL */
|
||||
apiPath: string
|
||||
/** 请求方法 */
|
||||
requestMethod?: string
|
||||
/** 请求体 */
|
||||
requestBody?: string
|
||||
/** 响应体 */
|
||||
responseBody?: string
|
||||
/** HTTP状态码 */
|
||||
responseCode?: number
|
||||
/** 是否成功(1=成功,0=失败) */
|
||||
success: number
|
||||
/** 耗时(ms) */
|
||||
duration?: number
|
||||
/** 错误信息 */
|
||||
errorMessage?: string
|
||||
/** 关联设备MAC */
|
||||
mac?: string
|
||||
/** 关联设备SN */
|
||||
deviceSn?: string
|
||||
/** 关联设备UID */
|
||||
deviceUid?: string
|
||||
/** 设备所属门店 */
|
||||
storeOrgName?: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 橘视厅调用日志查询参数
|
||||
*/
|
||||
export interface JstCallLogListParams extends ManagePageParams {
|
||||
mac?: string
|
||||
beginTime?: string
|
||||
endTime?: string
|
||||
apiPath?: string
|
||||
requestBody?: string
|
||||
}
|
||||
|
||||
/** 橘视厅调用日志列表 */
|
||||
export function getJstCallLogList(params?: JstCallLogListParams): Promise<ManageListResponse<JstCallLogItem>> {
|
||||
return http.get(http.adornUrl('/manage/jst/call-log/list'), { params: http.adornParams(params || {}) }).then(res => res.data)
|
||||
}
|
||||
@@ -2,11 +2,16 @@ import http from '@/utils/httpRequest'
|
||||
import type { ManageListResponse, ManageResponse, ManagePageParams } from './types'
|
||||
|
||||
/**
|
||||
* 微信支付配置信息
|
||||
* 微信支付配置(按层级:平台全局/渠道/代理商/门店,三选一留空=全局)
|
||||
*/
|
||||
export interface PayConfigInfo {
|
||||
id: number
|
||||
partnerId: number | null
|
||||
/** 渠道组织ID(渠道级配置) */
|
||||
channelOrgId?: number
|
||||
/** 代理商组织ID(代理商级配置) */
|
||||
agentOrgId?: number
|
||||
/** 门店组织ID(门店级配置) */
|
||||
storeOrgId?: number
|
||||
appId: string
|
||||
mchId: string
|
||||
apiV3Key: string
|
||||
@@ -15,22 +20,31 @@ export interface PayConfigInfo {
|
||||
notifyUrl: string
|
||||
status: string
|
||||
remark: string
|
||||
/** join 名称(后端返回) */
|
||||
channelName?: string
|
||||
agentOrgName?: string
|
||||
storeName?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付配置列表查询参数
|
||||
*/
|
||||
export interface PayConfigListParams extends ManagePageParams {
|
||||
partnerId?: number
|
||||
channelOrgId?: number
|
||||
agentOrgId?: number
|
||||
storeOrgId?: number
|
||||
status?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付配置保存/更新数据
|
||||
* 配置层级三选一:channelOrgId/agentOrgId/storeOrgId,都留空=平台全局
|
||||
*/
|
||||
export interface PayConfigSaveData {
|
||||
id?: number
|
||||
partnerId?: number
|
||||
channelOrgId?: number
|
||||
agentOrgId?: number
|
||||
storeOrgId?: number
|
||||
appId: string
|
||||
mchId: string
|
||||
apiV3Key: string
|
||||
@@ -47,7 +61,7 @@ export function getPayConfigList(params?: PayConfigListParams): Promise<ManageLi
|
||||
}
|
||||
|
||||
/** 支付配置详情 */
|
||||
export function getPayConfigInfo(id: number): Promise<ManageResponse<{ config?: PayConfigInfo }>> {
|
||||
export function getPayConfigInfo(id: number): Promise<ManageResponse<PayConfigInfo>> {
|
||||
return http.get(http.adornUrl(`/manage/payconfig/info/${id}`), { params: http.adornParams() }).then(res => res.data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user