feat: 2026-07-12~13 全量更新 - AI对话链路改造+H5 v4/v5+坐席端v5+上下文感知诊断+知识库迭代3
## H5 员工端 v4 (2026-07-13 00:48 已部署)
- 人工按钮三态文案统一为"人工坐席"
- 按钮位置移至发送键和语音按钮上方(垂直堆叠)
- 点按钮直接调 store.shakeAgent(),删除 CallAgentModal 弹窗动画
- 截图快捷键提示改为"截图->粘贴:Alt+Shift+A-Ctrl+V ---> Ctrl+V"
- 移动端隐藏截图提示(CSS 媒体查询)
- AI转人工提示改为"已为您呼叫人工坐席,请稍等!"
- 坐席接入提示改为"坐席正在查看您的信息,请等待处理回复!"
- 删除"摇铃呼叫坐席"入口和文案
- 删除孤儿组件 MessageList.vue + shake 动画 CSS
## H5 员工端 v5 (2026-07-13 02:08 已部署)
- RightPanel v2.1:删除"软件安装"和"资源权限"标签页
- 移除标签栏,智能推荐(DynamicRecommend)直接展示
- 删除 SoftwareDownloads/ApprovalLinks 引用和相关 CSS
## AI 对话链路全栈改造 Phase 1-6 (已部署)
- Phase 1: Dify JSON输出 + 后端blocking解析 + 双WS推送 + 错误降级
- Phase 2: 关键词收窄(~25强意图词) + 两级分类Prompt + 删除前端checkApprovalIntent
- Phase 3: WS扩展(ai_thinking+dynamic_recommend) + ai_structured气泡 + RightPanel v2 + 选项回传
- Phase 4: VisionService接入 + 图片消息融合(5秒窗口) + 降级策略
- Phase 5: 坐席端ai_thinking指示器 + ai_structured/byod_card渲染 + handleNewMessage修复
- Phase 6: diagnosis_stage(6值) + response_time_ms计时 + 慢响应告警(>10s)
## 坐席端 v5 (2026-07-13 01:38 已部署)
- ai_structured/byod_card 只读渲染
- AI思考指示器 UI
- handleNewMessage 透传 msg_type/extra_data 修复
- 布局优化v2.0: QuickReplyBar L1+L2悬浮 + ReplyBox左右分区 + 右栏260/560px切换
- 键盘快捷键v2.3: 纯数字路由 + ESC分层撤销 + Shift+Space用event.code
## 上下文感知智能诊断闭环 (2026-07-12 已部署)
- 三层诊断(API→Script→AI) + 三段排队(VIP→info_locked→not locked)
- 答题插队 + 五场景关闭
- 迁移052(6表+6列) + queue_service + quiz_service + closing_service
- H5前端: QueueWaiting + RightPanel双Tab + InputBar三态 + ResolveConfirmCard
- 坐席前端: pending_close结单流程 + 信息锁定(Dify步骤完成+有效回答率≥70%)
## 知识库迭代3 (2026-07-12 已部署)
- 分诊交互(H5+坐席+Dify独立应用)
- 拓扑预览(ECharts只读)
- 代答排除(4种匹配器: keyword/regex/intent/category)
- 迁移051 + 44文件43测试通过
## 后端变更
- 6个Python文件改造(h5_ai_task.py/h5.py/ai_service.py/closing_service.py等)
- funny_phrase_service.py: shake/connected/keyword 默认文案更新
- session_service.py: 企微消息文案同步
- 新增: queue.py/quiz.py/triage.py/exclusion_rules.py 等API端点
- 新增: diagnostic.py/quiz.py/triage_session.py 等模型
- 新增: closing_service/queue_service/quiz_service/triage_service 等服务
## 文档更新
- CHANGELOG.md: 新增 [未发布] 区全部变更记录
- 项目管理主文档 v2.5: 新增v0.7.3版本 + 已完成看板 + 最近搞定
- 版本记录: 新增v0.7.3条目
- AI对话链路实施计划: Phase 1-6 全部标记✅已实施
- 新增架构图/时序图/类图(mermaid)
## 部署路径修正
- 服务器项目根路径: /opt/wecom-it-desk/
- 所有前端dist均为ro bind mount,只能在宿主机源路径操作
- 服务器nginx /h5/ 是静态文件服务(非proxy_pass)
- elFinder上传二进制不可靠(MD5不匹配),改用base64分块上传
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
// =============================================================================
|
||||
// 企微IT智能服务台 — 管理后台代答排除 API 封装
|
||||
// =============================================================================
|
||||
// 说明:封装 8 个管理 API 调用
|
||||
// =============================================================================
|
||||
|
||||
import request from './index'
|
||||
|
||||
/** 排除规则 */
|
||||
export interface ExclusionRule {
|
||||
id: string
|
||||
rule_name: string
|
||||
rule_description: string | null
|
||||
priority: string
|
||||
match_type: string
|
||||
match_condition: string
|
||||
match_scope: string[]
|
||||
action_type: string
|
||||
transfer_message: string | null
|
||||
status: string
|
||||
hit_count: number
|
||||
created_by: string
|
||||
created_at: string | null
|
||||
updated_at: string | null
|
||||
/** UI 状态:开关切换中标记(非后端字段) */
|
||||
_toggling?: boolean
|
||||
}
|
||||
|
||||
/** 新建/编辑规则参数 */
|
||||
export interface ExclusionRuleFormData {
|
||||
rule_name: string
|
||||
rule_description?: string
|
||||
priority: string
|
||||
match_type: string
|
||||
match_condition: string
|
||||
match_scope: string[]
|
||||
action_type: string
|
||||
transfer_message?: string
|
||||
}
|
||||
|
||||
/** 列表查询参数 */
|
||||
export interface ExclusionRuleQuery {
|
||||
status?: string
|
||||
match_type?: string
|
||||
priority?: string
|
||||
keyword?: string
|
||||
page: number
|
||||
page_size: number
|
||||
}
|
||||
|
||||
/** 测试匹配参数 */
|
||||
export interface ExclusionTestParams {
|
||||
message: string
|
||||
rule_id?: string
|
||||
}
|
||||
|
||||
/** 测试匹配结果 */
|
||||
export interface ExclusionTestResult {
|
||||
matched: boolean
|
||||
matched_detail: string | null
|
||||
rule_name: string | null
|
||||
action_type: string | null
|
||||
}
|
||||
|
||||
/** 统计概要 */
|
||||
export interface ExclusionStats {
|
||||
enabled_count: number
|
||||
disabled_count: number
|
||||
monthly_hits: number
|
||||
monthly_transfers: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排除规则列表
|
||||
* GET /api/admin/exclusion-rules
|
||||
*/
|
||||
export function getExclusionRules(
|
||||
params: ExclusionRuleQuery,
|
||||
): Promise<{ total: number; items: ExclusionRule[] }> {
|
||||
return request.get('/admin/exclusion-rules', { params })
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建排除规则
|
||||
* POST /api/admin/exclusion-rules
|
||||
*/
|
||||
export function createExclusionRule(
|
||||
data: ExclusionRuleFormData,
|
||||
): Promise<ExclusionRule> {
|
||||
return request.post('/admin/exclusion-rules', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取规则详情
|
||||
* GET /api/admin/exclusion-rules/{id}
|
||||
*/
|
||||
export function getExclusionRuleDetail(id: string): Promise<ExclusionRule> {
|
||||
return request.get(`/admin/exclusion-rules/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑排除规则
|
||||
* PUT /api/admin/exclusion-rules/{id}
|
||||
*/
|
||||
export function updateExclusionRule(
|
||||
id: string,
|
||||
data: Partial<ExclusionRuleFormData>,
|
||||
): Promise<ExclusionRule> {
|
||||
return request.put(`/admin/exclusion-rules/${id}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排除规则
|
||||
* DELETE /api/admin/exclusion-rules/{id}
|
||||
*/
|
||||
export function deleteExclusionRule(id: string): Promise<void> {
|
||||
return request.delete(`/admin/exclusion-rules/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/停用规则
|
||||
* POST /api/admin/exclusion-rules/{id}/toggle
|
||||
*/
|
||||
export function toggleExclusionRule(
|
||||
id: string,
|
||||
status: string,
|
||||
): Promise<ExclusionRule> {
|
||||
return request.post(`/admin/exclusion-rules/${id}/toggle`, { status })
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试匹配
|
||||
* POST /api/admin/exclusion-rules/test
|
||||
*/
|
||||
export function testExclusionMatch(
|
||||
params: ExclusionTestParams,
|
||||
): Promise<ExclusionTestResult> {
|
||||
return request.post('/admin/exclusion-rules/test', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取统计概要
|
||||
* GET /api/admin/exclusion-rules/stats
|
||||
*/
|
||||
export function getExclusionStats(): Promise<ExclusionStats> {
|
||||
return request.get('/admin/exclusion-rules/stats')
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// =============================================================================
|
||||
// 企微IT智能服务台 — 拓扑预览 API 封装(管理后台)
|
||||
// =============================================================================
|
||||
// 说明:封装 GET /api/admin/knowledge-iteration/graph 调用
|
||||
// - 不带 issue_name:返回全图(limit 控制节点数)
|
||||
// - 带 issue_name:返回该 Issue 的子图(depth=1)
|
||||
// 响应格式:{ code: 0, data: { nodes: [...], links: [...] } }
|
||||
// 认证:管理员 token(由 api/index.ts 拦截器自动注入)
|
||||
// =============================================================================
|
||||
|
||||
import apiClient from './index'
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 类型定义
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/** 图谱节点 */
|
||||
export interface GraphNode {
|
||||
/** 节点唯一 ID(Neo4j elementId 或 UUID) */
|
||||
id: string
|
||||
/** 节点显示名称 */
|
||||
name: string
|
||||
/** 节点类型:issue | action | relation */
|
||||
type: string
|
||||
/** 节点附加属性 */
|
||||
properties?: Record<string, any>
|
||||
}
|
||||
|
||||
/** 图谱关系(边) */
|
||||
export interface GraphLink {
|
||||
/** 源节点 ID */
|
||||
source: string
|
||||
/** 目标节点 ID */
|
||||
target: string
|
||||
/** 关系类型:LEADS_TO | RELATES_TO | CAN_JUMP_TO | DERIVED_FROM */
|
||||
type: string
|
||||
/** 关系权重(影响线条粗细) */
|
||||
weight?: number
|
||||
}
|
||||
|
||||
/** 图谱完整数据 */
|
||||
export interface GraphData {
|
||||
nodes: GraphNode[]
|
||||
links: GraphLink[]
|
||||
}
|
||||
|
||||
/** fetchGraph 请求参数 */
|
||||
export interface FetchGraphParams {
|
||||
/** 按 Issue 名称筛选子图(留空查全图) */
|
||||
issue_name?: string
|
||||
/** 返回节点数上限,默认 200 */
|
||||
limit?: number
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// API 函数
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 获取知识图谱数据
|
||||
*
|
||||
* - 不传 issue_name:返回全图
|
||||
* - 传 issue_name:返回该 Issue 的子图(depth=1)
|
||||
*
|
||||
* 响应拦截器已自动解包 { code, data } 中的 data,直接返回 GraphData。
|
||||
*/
|
||||
export function fetchGraph(params?: FetchGraphParams): Promise<GraphData> {
|
||||
return apiClient.get('/admin/knowledge-iteration/graph', { params }) as unknown as Promise<GraphData>
|
||||
}
|
||||
Reference in New Issue
Block a user