import{a as D,e as L}from"./api-DyiqpKJK.js";/* empty css                 */import{W as F}from"./WorkflowStudio-cipvlP3c.js";import{v as T,i as w,c as C,x as c,y as a,B as l,E as b,I as i,L as u,u as g,O as _,r as v,aE as S,w as P,G as $,F as k,M as I,a9 as W,K as j}from"./vue-core-C3hq3bxF.js";import{_ as K}from"./FormattedCodeViewer.vue_vue_type_script_setup_true_lang-D-r0d4Is.js";import{f as M,F as U}from"./FloatPagination-x9oqNWsY.js";import{A as G,v as H,B as q,C as J,e as Q,b as X,a as Y}from"./element-ui-CA4rbiJ9.js";import{_ as A}from"./index-BrGO8rHI.js";import{u as Z}from"./ui-components-DQ2lkQGO.js";import"./js-yaml-yTPt38rv.js";import"./elkjs-daFYuoNQ.js";import"./highlightjs-D4ATuRwX.js";/* empty css               */import"./WorkflowEditor-D8-6OZ8Y.js";import"./vue-flow-BEraqp1L.js";import"./code-editor-DFIoHxr7.js";const ee={class:"feedback-item-card"},ae={class:"feedback-item-header"},te={class:"feedback-time"},se={key:1,class:"feedback-comment"},oe={class:"feedback-comment-text full-comment"},le={class:"feedback-comment-text collapsed-comment"},ce={key:2,class:"feedback-meta"},re=T({__name:"FeedbackItemCard",props:{feedback:{}},setup(E){const d=E,r=w(F.TRACE_FOR_INSPECTION),e=C(()=>d.feedback),n=C(()=>e.value.trace_id||e.value.metadata.trace_id),y=()=>{r&&n.value&&(r.traceId=n.value)};return(h,t)=>{const s=G;return a(),c("div",ee,[l("div",ae,[l("span",te,u(g(M)(e.value.created_at)),1),n.value?(a(),c("span",{key:0,class:"feedback-trace-id",onClick:y},u(n.value),1)):i("",!0)]),e.value.rating!==void 0&&e.value.rating!==null?(a(),b(s,{key:0,modelValue:e.value.rating,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value.rating=m),max:5,"show-text":!1,size:"small",disabled:""},null,8,["modelValue"])):i("",!0),e.value.comment?(a(),c("details",se,[t[1]||(t[1]=l("summary",{class:"detail-item-title"},"评论",-1)),l("p",oe,u(e.value.comment),1)])):i("",!0),l("p",le,u(e.value.comment),1),e.value.metadata&&Object.keys(e.value.metadata).length>0?(a(),c("details",ce,[t[2]||(t[2]=l("summary",{class:"detail-item-title"},"元数据",-1)),_(K,{class:"feedback-meta-content",content:e.value.metadata,lang:"json"},null,8,["content"])])):i("",!0)])}}}),ne=A(re,[["__scopeId","data-v-75342bc6"]]),ie=Z({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",clipRule:"evenodd"},child:[]}]}),de={class:"feedback-list-area"},me={class:"trace-alert-text"},ue={class:"feedback-list"},_e=T({__name:"FeedbackPanel",setup(E){const d=v(!1),r=v([]),e=v(0),n=v(20),y=S(),h=C(()=>y.params.id),t=w(F.WORKFLOW_DATA),s=w(F.TRACE_FOR_INSPECTION),m=async p=>{if(h.value){d.value=!0;try{const o={page:String(p||1),page_size:String(n.value)};t?.value?.name&&(o.workflow_name=t?.value?.name),s?.traceId&&(o.trace_id=s.traceId);const f=await D.get("/",{base:L(),params:o});r.value=f.feedbacks||[],e.value=f.total}catch(o){Y.error(o?.message||"加载反馈失败"),console.error("Failed to load feedbacks:",o)}finally{d.value=!1}}},B=()=>{s&&(s.traceId=void 0)};return P([()=>h.value,()=>s?.traceId],([p])=>{p&&m()},{immediate:!0}),(p,o)=>{const f=q,V=J,N=Q,O=X,R=H;return $((a(),c("div",de,[g(s)?.traceId?(a(),b(f,{key:0,class:"trace-alert","show-icon":"",type:"primary",onClose:B},{icon:k(()=>[_(g(ie),{style:{width:"1.25rem",height:"1.25rem"}})]),default:k(()=>[l("p",me,"已筛选TraceID: "+u(g(s).traceId),1)]),_:1})):i("",!0),r.value.length>0?(a(),c(I,{key:1},[l("div",ue,[(a(!0),c(I,null,W(r.value,(x,z)=>(a(),c(I,{key:x.feedback_id},[_(ne,{feedback:x},null,8,["feedback"]),z<r.value.length-1?(a(),b(V,{key:0,class:"feedback-item-divider"})):i("",!0)],64))),128))]),_(U,{class:"float-pagination",total:e.value,"page-size":n.value,reload:m},null,8,["total","page-size"])],64)):(a(),b(O,{key:2,class:"empty-state"},{default:k(()=>[_(N,{type:"primary",onClick:m},{default:k(()=>[...o[0]||(o[0]=[j("重新加载",-1)])]),_:1})]),_:1}))])),[[R,d.value]])}}}),Be=A(_e,[["__scopeId","data-v-d53b686d"]]);export{Be as default};
