支持坐席切换在线状态,转接列表展示状态
侧栏可切换在线/忙碌/离线;转接弹窗显示状态点与标签,列表含在线与忙碌坐席。
This commit is contained in:
+25
-2
@@ -1,7 +1,15 @@
|
||||
import { get, post, put, del, getList, postForm, downloadFile } from './request'
|
||||
|
||||
export interface LoginParams { username: string; password: string }
|
||||
export interface LoginResult { token: string; user_id: number; tenant_id: number; nickname: string; role: string }
|
||||
export interface LoginResult {
|
||||
token: string
|
||||
user_id: number
|
||||
tenant_id: number
|
||||
nickname: string
|
||||
role: string
|
||||
/** online | busy | offline */
|
||||
status?: string
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
id: number; tenant_id: number; channel_id: number; customer_id: number; agent_id: number | null
|
||||
@@ -58,7 +66,13 @@ export interface SessionEvent {
|
||||
id: number; session_id: number; operator_id: number; action: string; detail: string; created_at: string
|
||||
}
|
||||
|
||||
export interface AvailableAgent { id: number; nickname: string; status: string }
|
||||
export interface AvailableAgent {
|
||||
id: number
|
||||
nickname: string
|
||||
/** online | busy | offline | disabled */
|
||||
status: string
|
||||
role?: string
|
||||
}
|
||||
|
||||
export interface Customer {
|
||||
id: number; tenant_id: number; name: string; phone: string; email: string
|
||||
@@ -182,6 +196,15 @@ export interface StatisticsKpis {
|
||||
// Auth
|
||||
export const login = (params: LoginParams) => post<LoginResult>('/login', params)
|
||||
|
||||
export type AgentPresence = 'online' | 'busy' | 'offline'
|
||||
|
||||
export const getMe = () =>
|
||||
get<{ user_id: number; tenant_id: number; nickname: string; role: string; status: string; username?: string }>('/me')
|
||||
|
||||
/** 坐席自行切换在线状态 */
|
||||
export const updateMyStatus = (status: AgentPresence) =>
|
||||
put<{ user_id: number; status: string }>('/me/status', { status })
|
||||
|
||||
// Sessions
|
||||
export const getSessions = (params?: {
|
||||
status?: string
|
||||
|
||||
Reference in New Issue
Block a user