feat: 2026-07-11 全量更新 - 代办集成+会议室预定+知识迭代修复+UI统一+Bug修复
== 已部署上线 (9项) == - 代办事项真实数据源集成 (企微审批API 8bug修复链) - H5/坐席端 Logo样式统一+绿色背景 - 视频引导页修复 (localStorage key v2) - 坐席端 v9 Vue版本修复 (ElMessage._context) - 截图按钮 v10 修复 (getDisplayMedia user gesture) - 扫码样式恢复+H5扫码登录跳转修复 - H5截图快捷键提示 == 代码完成待部署 (3项) == - 知识迭代3Bug修复 (#8 POST端点/#7 MERGE幂等/#6 过期检查) - 会议室预定-小鱼易联终端 (40文件, 40/40测试通过) - IT资产升级审批推送 (asset_service.py) == 需求文档 (2项) == - 坐席端AI辅助消息框-PRD (4项新功能确认) - 坐席端布局优化建议 v2.0 (7天计划) == 新增文档 == - 日报-2026-07-11.md - 知识迭代Bug修复报告-20260711.md - 会议室预定-部署指南.md - CHANGELOG.md 更新 == 测试 == - test_todo_integration.py: 40/40 - test_meetingroom.py: 40/40 - test_bugfix_ki_suggestions.py: 21/21
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
%% 方案A — 坐席端 Web Speech API 实时转写时序图
|
||||
sequenceDiagram
|
||||
participant U as 坐席
|
||||
participant RB as ReplyBox.vue
|
||||
participant USR as useSpeechRecognition
|
||||
participant SR as SpeechRecognition
|
||||
|
||||
Note over U,SR: 阶段1:初始化
|
||||
RB->>USR: useSpeechRecognition('zh-CN')
|
||||
USR->>USR: 检查 window.SpeechRecognition || webkitSpeechRecognition
|
||||
alt 浏览器不支持
|
||||
USR-->>RB: state.isSupported = false
|
||||
RB->>RB: 语音按钮显示为禁用/隐藏
|
||||
else 浏览器支持
|
||||
USR->>USR: state.isSupported = true
|
||||
end
|
||||
|
||||
Note over U,SR: 阶段2:开始识别
|
||||
U->>RB: 点击语音按钮 🎤
|
||||
RB->>USR: start()
|
||||
USR->>SR: new SpeechRecognition()
|
||||
USR->>SR: lang='zh-CN', continuous=true, interimResults=true
|
||||
USR->>SR: 注册 onresult / onerror / onend 回调
|
||||
USR->>SR: start()
|
||||
SR-->>USR: onstart 触发
|
||||
USR-->>RB: state.isListening = true
|
||||
RB->>RB: 按钮变红 + textarea 显示光标 + 提示"正在聆听..."
|
||||
|
||||
Note over U,SR: 阶段3:实时转写(边说边出字)
|
||||
U->>SR: 说话:"帮我查一下"
|
||||
SR-->>USR: onresult(event) — interimResults (isFinal=false)
|
||||
USR->>USR: state.interimText = "帮我查一下"
|
||||
USR-->>RB: 实时更新 textarea(灰色临时文字)
|
||||
RB->>RB: inputText.value = finalText + interimText
|
||||
|
||||
U->>SR: 继续说话:"帮我查一下密码"
|
||||
SR-->>USR: onresult(event) — final result (isFinal=true)
|
||||
USR->>USR: state.finalText += "帮我查一下密码"
|
||||
USR-->>RB: 确定文字追加到 textarea
|
||||
RB->>RB: inputText.value = finalText
|
||||
|
||||
Note over U,SR: 阶段4:停止识别
|
||||
U->>RB: 再次点击语音按钮
|
||||
RB->>USR: stop()
|
||||
USR->>SR: stop()
|
||||
SR-->>USR: onend 触发
|
||||
USR-->>RB: state.isListening = false
|
||||
RB->>RB: 按钮恢复 + textarea 保持已识别文字
|
||||
|
||||
Note over U,SR: 异常分支
|
||||
alt 识别出错
|
||||
SR-->>USR: onerror(event) — error='not-allowed'
|
||||
USR-->>RB: showToast("麦克风权限被拒绝")
|
||||
end
|
||||
alt 用户长时间不说话
|
||||
SR-->>USR: onend 自动触发(超时停止)
|
||||
USR-->>RB: state.isListening = false
|
||||
end
|
||||
@@ -0,0 +1,82 @@
|
||||
%% 语音识别转文字 — 类图
|
||||
classDiagram
|
||||
class Wx {
|
||||
<<interface>>
|
||||
+config(options: WxConfigOptions) void
|
||||
+ready(callback: Function) void
|
||||
+error(callback: Function) void
|
||||
+startRecord() void
|
||||
+stopRecord(options: object) void
|
||||
+translateVoice(options: object) void
|
||||
}
|
||||
|
||||
class JsapiConfig {
|
||||
+corp_id: string
|
||||
+agent_id: string
|
||||
+timestamp: number
|
||||
+nonce_str: string
|
||||
+signature: string
|
||||
}
|
||||
|
||||
class UseWecomVoiceReturn {
|
||||
+state: VoiceState
|
||||
+init() Promise~void~
|
||||
+startRecording() Promise~void~
|
||||
+stopAndTranslate() Promise~string~
|
||||
+isSupported() boolean
|
||||
}
|
||||
|
||||
class VoiceState {
|
||||
+isReady: boolean
|
||||
+isRecording: boolean
|
||||
+isTranslating: boolean
|
||||
+error: string|null
|
||||
}
|
||||
|
||||
class SpeechRecognition {
|
||||
<<interface>>
|
||||
+lang: string
|
||||
+continuous: boolean
|
||||
+interimResults: boolean
|
||||
+start() void
|
||||
+stop() void
|
||||
+abort() void
|
||||
+onresult: Function
|
||||
+onerror: Function
|
||||
+onend: Function
|
||||
}
|
||||
|
||||
class UseSpeechRecognitionReturn {
|
||||
+state: SpeechState
|
||||
+start() void
|
||||
+stop() void
|
||||
+reset() void
|
||||
}
|
||||
|
||||
class SpeechState {
|
||||
+isListening: boolean
|
||||
+interimText: string
|
||||
+finalText: string
|
||||
+error: string|null
|
||||
+isSupported: boolean
|
||||
}
|
||||
|
||||
class InputBar {
|
||||
+inputText: string
|
||||
+handleVoiceStart() void
|
||||
+handleVoiceEnd() void
|
||||
}
|
||||
|
||||
class ReplyBox {
|
||||
+inputText: string
|
||||
+toggleVoice() void
|
||||
}
|
||||
|
||||
UseWecomVoiceReturn --> VoiceState
|
||||
UseWecomVoiceReturn ..> Wx : uses
|
||||
UseWecomVoiceReturn ..> JsapiConfig : fetches
|
||||
InputBar --> UseWecomVoiceReturn : composes
|
||||
|
||||
UseSpeechRecognitionReturn --> SpeechState
|
||||
UseSpeechRecognitionReturn ..> SpeechRecognition : wraps
|
||||
ReplyBox --> UseSpeechRecognitionReturn : composes
|
||||
@@ -0,0 +1,52 @@
|
||||
%% 方案C — H5端企微 JS-SDK 录音转文字时序图
|
||||
sequenceDiagram
|
||||
participant U as 用户
|
||||
participant IB as InputBar.vue
|
||||
participant UWV as useWecomVoice
|
||||
participant API as /api/wecom/jsapi-config
|
||||
participant WX as 企微服务器
|
||||
participant WV as 企微WebView
|
||||
|
||||
Note over U,WV: 阶段1:初始化(页面加载时,幂等)
|
||||
IB->>UWV: init()
|
||||
UWV->>WV: 检查 window.wx 是否存在
|
||||
alt JS-SDK 未加载
|
||||
UWV->>WV: 动态加载 jweixin-1.2.0.js
|
||||
end
|
||||
UWV->>API: GET /api/wecom/jsapi-config?url=当前页面URL
|
||||
API->>API: get_jsapi_ticket() + sha1 签名
|
||||
API-->>UWV: { corp_id, agent_id, timestamp, nonce_str, signature }
|
||||
UWV->>WV: wx.config({ appId, timestamp, ..., jsApiList: ['startRecord','stopRecord','translateVoice'] })
|
||||
WV-->>UWV: wx.ready() 回调
|
||||
UWV-->>IB: state.isReady = true
|
||||
|
||||
Note over U,WV: 阶段2:录音
|
||||
U->>IB: 按下语音按钮 🎤
|
||||
IB->>UWV: startRecording()
|
||||
UWV->>WV: wx.startRecord()
|
||||
UWV-->>IB: state.isRecording = true
|
||||
IB->>IB: UI 切换为录音状态(按钮变红+提示"松开识别文字")
|
||||
|
||||
Note over U,WV: 阶段3:停止录音+转文字
|
||||
U->>IB: 松开语音按钮
|
||||
IB->>UWV: stopAndTranslate()
|
||||
UWV->>WV: wx.stopRecord()
|
||||
WV-->>UWV: { localId: "wxLocalId_xxx" }
|
||||
UWV-->>IB: state.isTranslating = true
|
||||
UWV->>WV: wx.translateVoice({ localId, isShowProgressTips: 1 })
|
||||
WV->>WX: 上传录音+请求语音识别
|
||||
WX-->>WV: 返回识别文字
|
||||
WV-->>UWV: { translateResult: "帮我重置密码" }
|
||||
UWV-->>IB: 返回识别文字
|
||||
IB->>IB: inputText.value += translateResult
|
||||
IB->>IB: state.isTranslating = false, state.isRecording = false
|
||||
|
||||
Note over U,WV: 异常分支
|
||||
alt 录音超过60秒
|
||||
WV-->>UWV: 自动触发 stopRecord 回调
|
||||
UWV->>UWV: 自动执行 translateVoice
|
||||
end
|
||||
alt 转文字失败
|
||||
WV-->>UWV: fail 回调 { errMsg }
|
||||
UWV-->>IB: showToast("语音识别失败")
|
||||
end
|
||||
Reference in New Issue
Block a user