Files
Simon bea288e414 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
2026-07-11 23:13:10 +08:00

2 lines
10 KiB
JavaScript

import{a1 as F,aP as Z,ao as C,aO as f,s as $,a6 as P,a3 as d,aq as A,ak as k,a4 as B,aj as v,a8 as p,al as L,an as N,am as I,D as ee,a2 as M,b as te,F as ne,P as ae,ap as oe,af as se,ay as ie,ah as re,ai as le,aQ as S,L as ue,a9 as V,C as ce,aR as H,E as de}from"./index-DtOTKM3Z.js";/* empty css */import{T as j,N as ve,S as pe,a as fe}from"./index-BDaAU9Ak.js";import{C as me}from"./index-Bt5n-keb.js";async function _e(i){return await F.get(`/itportal/automation/sessions/${i}`)}async function ye(i,c){return await F.post(`/itportal/automation/actions/${i}/confirm`,c)}async function we(i,c){return await F.post(`/itportal/automation/sessions/${i}/resolved`,c)}function J(){return localStorage.getItem("h5_token")||""}function ke(i){const c=J(),r=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${r}//${n}/ws/automation/${i}?token=${encodeURIComponent(c)}`}const be=Z("automation",()=>{const i=C(null),c=C(!1),r=C(null),n=C(!1),a=C(null),l=C([]),m=C(null),T=f(()=>{var o;return((o=i.value)==null?void 0:o.status)==="resolved"}),x=f(()=>{var o;return((o=i.value)==null?void 0:o.status)==="handoff"});async function u(o){c.value=!0;try{i.value=await _e(o)}finally{c.value=!1}}async function t(o,g){await ye(o,g),m.value=null,a.value&&await u(a.value)}async function s(o,g){await we(o,g),a.value&&await u(a.value)}function b(o){_();const g=ke(o),U=J(),D=new WebSocket(g,[`bearer.${U}`]);r.value=D,a.value=o,D.onopen=()=>{n.value=!0},D.onmessage=E=>{try{const e=JSON.parse(E.data);y(e)}catch(e){console.error("[automation H5 WS] 消息解析失败",e)}},D.onclose=()=>{n.value=!1},D.onerror=()=>{n.value=!1}}function _(){r.value&&(r.value.close(),r.value=null),n.value=!1,a.value=null}function y(o){var g;if(!(o.session_id&&a.value&&o.session_id!==a.value))switch(o.type){case"automation.progress":l.value.push({type:o.type,time:W(),data:o.data}),a.value&&u(a.value);break;case"automation.action_required":m.value=((g=o.data)==null?void 0:g.action)||null,a.value&&u(a.value);break;case"automation.resolved":a.value&&u(a.value),$("问题已解决");break;case"automation.takeover":m.value=null,a.value&&u(a.value);break;case"automation.error":l.value.push({type:o.type,time:W(),data:o.data}),$("自动化处置出现异常");break}}function W(){return new Date().toISOString()}return{currentSession:i,loading:c,wsConnected:n,progressEvents:l,pendingAction:m,isResolved:T,isHandoff:x,fetchSession:u,confirmAction:t,resolveSession:s,connectWs:b,disconnectWs:_}}),ge={key:0,class:"confirm-body"},he={class:"risk-row"},Se={class:"action-title"},Ce={class:"action-desc"},$e={key:0,class:"payload-block"},Ae={class:"payload-pre"},Te={key:1,class:"confirm-body"},xe=P({__name:"ActionConfirmDialog",props:{visible:{type:Boolean},action:{}},emits:["confirm","cancel","update:visible"],setup(i,{emit:c}){const r=i,n=c,a=f({get:()=>r.visible,set:t=>n("update:visible",t)}),l=f(()=>{var t,s;switch((t=r.action)==null?void 0:t.risk_level){case"read":return"只读";case"low":return"低风险";case"write":return"写操作";case"high":return"高危";default:return((s=r.action)==null?void 0:s.risk_level)||"未知"}}),m=f(()=>{var t;switch((t=r.action)==null?void 0:t.risk_level){case"read":return"primary";case"low":return"success";case"write":return"warning";case"high":return"danger";default:return"primary"}}),T=f(()=>{var t,s;try{return JSON.stringify((t=r.action)==null?void 0:t.payload,null,2)}catch{return String((s=r.action)==null?void 0:s.payload)}});function x(){n("confirm",{confirmed:!0})}function u(){n("cancel")}return(t,s)=>{const b=j,_=ee;return d(),A(_,{show:a.value,"onUpdate:show":s[0]||(s[0]=y=>a.value=y),title:"高危操作确认","show-confirm-button":!0,"show-cancel-button":!0,"confirm-button-text":"确认执行","cancel-button-text":"暂不执行","confirm-button-color":"#ee0a24",onConfirm:x,onCancel:u},{default:k(()=>[i.action?(d(),B("div",ge,[v("div",he,[p(b,{type:m.value,mark:""},{default:k(()=>[L(N(l.value),1)]),_:1},8,["type"])]),v("div",Se,N(i.action.title),1),v("div",Ce,N(i.action.description),1),i.action.payload?(d(),B("div",$e,[s[1]||(s[1]=v("div",{class:"block-label"},"操作参数",-1)),v("pre",Ae,N(T.value),1)])):I("",!0),s[2]||(s[2]=v("p",{class:"warn-tip"},"该操作将实际执行,请确认信息无误后再继续。",-1))])):(d(),B("div",Te,[...s[3]||(s[3]=[v("p",{class:"warn-tip"},"暂无动作详情。",-1)])]))]),_:1},8,["show"])}}}),De=M(xe,[["__scopeId","data-v-871c5ac9"]]),Be={class:"resolve-feedback"},Le={class:"desc"},Ne={class:"btns"},Re=P({__name:"ResolveFeedback",props:{visible:{type:Boolean},session:{}},emits:["feedback","update:visible"],setup(i,{emit:c}){const r=i,n=c,a=f({get:()=>r.visible,set:u=>n("update:visible",u)}),l=C(""),m=f(()=>{var _;const u=(_=r.session)==null?void 0:_.auto_close_at;if(!u)return"稍后";const t=new Date(u).getTime()-Date.now();if(t<=0)return"即将";const s=Math.floor(t/6e4),b=Math.floor(t%6e4/1e3);return s>0?`${s}${b}`:`${b}`});function T(u){n("feedback",{satisfied:u,note:l.value||void 0}),l.value="",a.value=!1}function x(){n("update:visible",!1)}return(u,t)=>{const s=te,b=ne,_=ae;return d(),A(_,{show:a.value,"onUpdate:show":t[3]||(t[3]=y=>a.value=y),position:"bottom",round:"",style:{padding:"20px"},onClose:x},{default:k(()=>[v("div",Be,[t[8]||(t[8]=v("div",{class:"title"},"问题已解决 🎉",-1)),v("p",Le,[t[4]||(t[4]=L(" 本次自动化处置已完成。如无异议,会话将在 ",-1)),v("b",null,N(m.value),1),t[5]||(t[5]=L(" 后自动关闭(静默关单)。 ",-1))]),t[9]||(t[9]=v("div",{class:"question"},"本次服务是否解决了您的问题?",-1)),v("div",Ne,[p(s,{type:"primary",block:"",onClick:t[0]||(t[0]=y=>T(!0))},{default:k(()=>[...t[6]||(t[6]=[L("已解决,满意",-1)])]),_:1}),p(s,{block:"",class:"btn-secondary",onClick:t[1]||(t[1]=y=>T(!1))},{default:k(()=>[...t[7]||(t[7]=[L("仍未解决",-1)])]),_:1})]),p(b,{modelValue:l.value,"onUpdate:modelValue":t[2]||(t[2]=y=>l.value=y),type:"textarea",rows:"2",placeholder:"补充意见(可选)",class:"note-field"},null,8,["modelValue"])])]),_:1},8,["show"])}}}),We=M(Re,[["__scopeId","data-v-613c2db3"]]),Ee={class:"auto-progress"},Ie={class:"content"},Ue=P({__name:"AutomationProgress",setup(i){const c=oe(),r=se(),n=be(),a=f(()=>c.params.id||""),l=f(()=>n.currentSession),m=C(!1);ie(()=>a.value,()=>{m.value=!1});const T=f(()=>{var e;return((e=l.value)==null?void 0:e.title)||"自动化处置"}),x=f(()=>{var e;return`${Math.round((((e=l.value)==null?void 0:e.confidence)||0)*100)}%`}),u=f(()=>{var e;return(e=l.value)!=null&&e.auto_close_at?E(l.value.auto_close_at):"-"});re(async()=>{if(!a.value){$("缺少会话参数");return}await n.fetchSession(a.value),n.connectWs(a.value)}),le(()=>n.disconnectWs());async function t(e){const h=n.pendingAction;if(h)try{await n.confirmAction(h.id,e),$(e.confirmed?"已确认执行":"已取消执行")}catch{$("操作失败,请重试")}}async function s(){const e=n.pendingAction;if(e)try{await n.confirmAction(e.id,{confirmed:!1}),$("已取消执行")}catch{$("操作失败,请重试")}}async function b(e){if(a.value)try{await n.resolveSession(a.value,e),m.value=!0,$("感谢反馈")}catch{$("提交失败,请重试")}}function _(){r.back()}const y=f(()=>{var e;return W(((e=l.value)==null?void 0:e.status)||"")});function W(e){switch(e){case"created":return"已创建";case"running":return"执行中";case"paused":return"已暂停";case"resolved":return"已解决";case"handoff":return"已转人工";case"error":return"异常";case"closed":return"已关闭";default:return e||"未知"}}function o(e){switch(e.risk_level){case"read":return"只读";case"low":return"低风险";case"write":return"写操作";case"high":return"高危";default:return e.risk_level}}function g(e){switch(e.risk_level){case"read":return"primary";case"low":return"success";case"write":return"warning";case"high":return"danger";default:return"primary"}}function U(e){switch(e.status){case"pending":case"awaiting_approval":return"待确认";case"approved":return"已通过";case"rejected":return"已取消";case"running":return"执行中";case"done":case"executed":return"已完成";case"failed":return"失败";case"skipped":return"已跳过";default:return e.status}}function D(e){switch(e.type){case"automation.progress":return"处置进展更新";case"automation.action_required":return"需要您确认高危操作";case"automation.resolved":return"问题已解决";case"automation.takeover":return"已转人工坐席";case"automation.error":return"处置异常";default:return e.type}}function E(e){try{return new Date(e).toLocaleString("zh-CN",{hour12:!1})}catch{return e}}return(e,h)=>{const z=ve,G=ue,R=ce,q=me,O=pe,Q=fe,K=j,X=de;return d(),B("div",Ee,[p(z,{title:T.value,"left-arrow":"",onClickLeft:_},null,8,["title"]),v("div",Ie,[S(n).loading?(d(),A(G,{key:0,class:"page-loading",type:"spinner",color:"#07c160"})):S(n).currentSession?(d(),B(V,{key:1},[p(q,{inset:"",class:"block"},{default:k(()=>[p(R,{title:"状态",value:y.value},null,8,["value"]),p(R,{title:"场景",value:l.value.scenario_key||"-"},null,8,["value"]),p(R,{title:"置信度",value:x.value},null,8,["value"]),l.value.auto_close_at?(d(),A(R,{key:0,title:"自动关单",value:u.value},null,8,["value"])):I("",!0)]),_:1}),h[1]||(h[1]=v("div",{class:"section-title"},"处置进展",-1)),p(Q,{direction:"vertical",active:S(n).progressEvents.length},{default:k(()=>[(d(!0),B(V,null,H(S(n).progressEvents,(w,Y)=>(d(),A(O,{key:Y,title:D(w)},{default:k(()=>[L(N(E(w.time)),1)]),_:2},1032,["title"]))),128)),S(n).progressEvents.length?I("",!0):(d(),A(O,{key:0,title:"正在初始化自动化处置…"}))]),_:1},8,["active"]),h[2]||(h[2]=v("div",{class:"section-title"},"执行动作",-1)),p(q,{inset:""},{default:k(()=>[(d(!0),B(V,null,H(l.value.actions,w=>(d(),A(R,{key:w.id,title:w.title,label:w.description,value:U(w)},{icon:k(()=>[p(K,{type:g(w),class:"act-tag"},{default:k(()=>[L(N(o(w)),1)]),_:2},1032,["type"])]),_:2},1032,["title","label","value"]))),128)),l.value.actions.length?I("",!0):(d(),A(R,{key:0,title:"暂无动作"}))]),_:1}),p(De,{visible:!!S(n).pendingAction,action:S(n).pendingAction,onConfirm:t,onCancel:s},null,8,["visible","action"]),p(We,{visible:S(n).isResolved&&!m.value,session:S(n).currentSession,onFeedback:b,"onUpdate:visible":h[0]||(h[0]=w=>{w||(m.value=!0)})},null,8,["visible","session"])],64)):(d(),A(X,{key:2,description:"会话不存在或已结束"}))])])}}}),qe=M(Ue,[["__scopeId","data-v-213ffba2"]]);export{qe as default};