1import{d as M,u as S,a as P,Y as V,o as G,Q as I,c as i,e as n,x as Y,y as q,t as c,f as l,g as h,i as b,F as x,r as k,z as H,A as J,J as Q,h as f,l as C,j as _,G as W,m as K,b as a,n as E,_ as X}from"./SJbfgcT0.js";import{s as Z}from"./YslIL_is.js";const ee={class:"page-inner",style:{"max-width":"800px"}},te={class:"ticket-detail-header"},se={style:{flex:"1"}},ne={style:{"font-size":"16px","font-weight":"600"}},le={style:{"font-size":"12px",color:"var(--muted)"}},ie={key:0,class:"card",style:{"text-align":"center",padding:"40px",color:"var(--muted)"}},ae={key:1,class:"card",style:{"margin-bottom":"16px"}},re={class:"chat-list"},oe={style:{display:"flex","flex-direction":"column","align-items":"flex-end"}},de={class:"msg-meta",style:{"text-align":"right"}},ce={class:"chat-msg msg-user",style:{"white-space":"pre-wrap"}},ue={key:0,class:"msg-attach-list msg-attach-user"},pe=["href","title"],me=["src","alt"],fe={key:1,class:"msg-attach-file"},ge=["href","title"],_e=["src","alt"],ye={key:1,class:"msg-attach-file"},ve={key:0,class:"chat-input-wrap"},he=["disabled"],be={key:0,class:"reply-preview-list"},xe=["src","alt"],ke={key:1,class:"reply-preview-file"},we=["disabled","onClick"],Ue={style:{display:"flex","align-items":"center",gap:"10px"}},Re=["disabled"],Le=["disabled"],$e={key:1,style:{"text-align":"center",padding:"16px","font-size":"13px",color:"var(--muted)"}},ze={key:2,class:"card",style:{"text-align":"center",padding:"40px",color:"var(--muted)"}},Ce=M({__name:"[id]",setup(Ee){const B={bug:"Bug",feature_request:"åè½è¯·æ±",question:"é®é¢å¨è¯¢",complaint:"æè¯",illegal_content:"è¿æ³ä¸è¯ä¿¡æ¯ä¸¾æ¥",other:"å
¶ä»"},N=S(),R=P(),g=K(),y=C(()=>Number(N.params.id)),r=_(null),w=_(!1),p=_(!1),m=_(""),d=_([]);function v(t){if(!t)return"";try{const e=typeof window<"u"?window.location.origin:"http://localhost",o=new URL(t,e);return o.pathname+o.search+o.hash}catch{return t}}function L(t){return/\.(png|jpe?g|gif|webp|bmp)$/i.test(t||"")}function j(t){const e=t.target,o=Array.from(e.files||[]);for(const s of o){if(d.value.length>=5){g.error("æå¤ 5 个éä»¶");break}if(s.size>5*1024*1024){g.error(`${s.name} è¶
è¿ 5MB`);continue}if(!["image/jpeg","image/png","application/pdf"].includes(s.type)){g.error(`${s.name} 䏿¯æçç±»å`);continue}const z=s.type.startsWith("image/")?URL.createObjectURL(s):null;d.value.push({file:s,previewUrl:z})}e.value=""}function F(t){const e=d.value[t];e?.previewUrl&&URL.revokeObjectURL(e.previewUrl),d.value.splice(t,1)}V(()=>{d.value.forEach(t=>{t.previewUrl&&URL.revokeObjectURL(t.previewUrl)})});const T=C(()=>!!r.value?.responses?.some(t=>t.is_admin_response));function U(t){if(!t)return"";const e=new Date(t);if(Number.isNaN(e.getTime()))return t;const o=s=>String(s).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function D(t,e){return t==="closed"?"å·²å
³é":t==="resolved"?"已解å³":t==="in_progress"?e?"å·²åå¤":"å¤çä¸":"å¾
å¤ç"}function O(t){return t==="closed"?"badge-gray":t==="resolved"?"badge-green":t==="in_progress"?"badge-amber":"badge-gray"}async function $(){w.value=!0;try{const t=await R(`/feedback/my-feedbacks/${y.value}/`,{method:"GET"});t?r.value={...t,type_label:B[t.type]||t.type}:r.value=null}catch{r.value=null}finally{w.value=!1}}async function A(){const t=m.value.trim();if(!(!t&&d.value.length===0)){p.value=!0;try{const e=new FormData;e.append("message",t);for(const o of d.value)e.append("attachments",o.file);await R(`/feedback/feedbacks/${y.value}/respond/`,{method:"POST",body:e}),m.value="",d.value.forEach(o=>{o.previewUrl&&URL.revokeObjectURL(o.previewUrl)}),d.value=[],g.success("åå¤å·²åé"),await $()}catch(e){g.error(e instanceof Error?e.message:"åé失败")}finally{p.value=!1}}}return G($),I(()=>{Z({title:`å·¥å #${y.value} â è¶
ç®GEO`,description:"å个工å详æ
ãåå²åå¤ä¸éä»¶ã",noindex:!0})}),(t,e)=>{const o=W;return a(),i("div",ee,[n("div",te,[Y(o,{to:"/tickets",class:"back-btn"},{default:q(()=>[...e[1]||(e[1]=[n("span",{class:"icon icon-sm"},[n("i",{class:"ri-arrow-left-line"})],-1),f("è¿åå·¥åå表 ",-1)])]),_:1}),n("div",se,[n("div",ne,c(l(r)?.title||"å è½½ä¸..."),1),n("div",le," å·¥å #"+c(l(y))+" · "+c(l(r)?.type_label)+" · åå»ºäº "+c(l(r)?U(l(r).created_at):""),1)]),l(r)?(a(),i("span",{key:0,class:h(["badge",O(l(r).status)])},c(D(l(r).status,l(T))),3)):b("",!0)]),l(w)?(a(),i("div",ie,[...e[2]||(e[2]=[n("i",{class:"ri-loader-4-line spin",style:{"font-size":"24px"}},null,-1),n("div",{style:{"margin-top":"8px"}},"å è½½ä¸...",-1)])])):l(r)?(a(),i("div",ae,[n("div",re,[n("div",oe,[n("div",de," ä½ Â· "+c(U(l(r).created_at)),1),n("div",ce,c(l(r).description),1),l(r).attachments?.length?(a(),i("div",ue,[(a(!0),i(x,null,k(l(r).attachments,s=>(a(),i("a",{key:s.id,href:v(s.file),target:"_blank",rel:"noopener",class:"msg-attach",title:s.file_name},[L(s.file_name)?(a(),i("img",{key:0,src:v(s.file),alt:s.file_name},null,8,me)):(a(),i("span",fe,[e[3]||(e[3]=n("i",{class:"ri-file-text-line"},null,-1)),f(c(s.file_name),1)]))],8,pe))),128))])):b("",!0)]),(a(!0),i(x,null,k(l(r).responses,s=>(a(),i("div",{key:s.id,style:E([{display:"flex","flex-direction":"column"},{alignItems:s.is_admin_response?"flex-start":"flex-end"}])},[n("div",{class:"msg-meta",style:E({textAlign:s.is_admin_response?"left"
1:"right"})},c(s.is_admin_response?"è¶
ç®GEO 客æ":"ä½ ")+" · "+c(U(s.created_at)),5),n("div",{class:h(["chat-msg",s.is_admin_response?"msg-admin":"msg-user"]),style:{"white-space":"pre-wrap"}},c(s.message),3),s.attachments?.length?(a(),i("div",{key:0,class:h(["msg-attach-list",s.is_admin_response?"msg-attach-admin":"msg-attach-user"])},[(a(!0),i(x,null,k(s.attachments,u=>(a(),i("a",{key:u.id,href:v(u.file),target:"_blank",rel:"noopener",class:"msg-attach",title:u.file_name},[L(u.file_name)?(a(),i("img",{key:0,src:v(u.file),alt:u.file_name},null,8,_e)):(a(),i("span",ye,[e[4]||(e[4]=n("i",{class:"ri-file-text-line"},null,-1)),f(c(u.file_name),1)]))],8,ge))),128))],2)):b("",!0)],4))),128))]),l(r).status!=="closed"?(a(),i("div",ve,[H(n("textarea",{"onUpdate:modelValue":e[0]||(e[0]=s=>Q(m)?m.value=s:null),class:"form-textarea",style:{"min-height":"80px","margin-bottom":"10px"},placeholder:"è¾å
¥åå¤å
容...",disabled:l(p)},null,8,he),[[J,l(m)]]),l(d).length?(a(),i("div",be,[(a(!0),i(x,null,k(l(d),(s,u)=>(a(),i("div",{key:u,class:"reply-preview"},[s.previewUrl?(a(),i("img",{key:0,src:s.previewUrl,alt:s.file.name},null,8,xe)):(a(),i("span",ke,[e[5]||(e[5]=n("i",{class:"ri-file-text-line"},null,-1)),f(c(s.file.name),1)])),n("button",{type:"button",class:"reply-preview-del",disabled:l(p),onClick:z=>F(u),title:"ç§»é¤"},[...e[6]||(e[6]=[n("i",{class:"ri-close-line"},null,-1)])],8,we)]))),128))])):b("",!0),n("div",Ue,[n("label",{class:h(["btn btn-ghost btn-sm",{disabled:l(p)||l(d).length>=5}]),style:{margin:"0"}},[e[7]||(e[7]=n("i",{class:"ri-attachment-2"},null,-1)),e[8]||(e[8]=f("éä»¶ ",-1)),n("input",{type:"file",accept:"image/jpeg,image/png,application/pdf",multiple:"",style:{display:"none"},disabled:l(p)||l(d).length>=5,onChange:j},null,40,Re)],2),e[10]||(e[10]=n("span",{style:{"font-size":"12px",color:"var(--muted)"}},"å¾ç / PDF · æå¤ 5 个 · å个 â¤5MB",-1)),e[11]||(e[11]=n("div",{style:{flex:"1"}},null,-1)),n("button",{class:"btn btn-primary btn-sm",disabled:l(p)||!l(m).trim()&&l(d).length===0,onClick:A},[e[9]||(e[9]=n("i",{class:"ri-send-plane-line"},null,-1)),f(c(l(p)?"åéä¸...":"åéåå¤"),1)],8,Le)])])):(a(),i("div",$e," 该工åå·²å
³é "))])):(a(),i("div",ze,[...e[12]||(e[12]=[n("i",{class:"ri-error-warning-line",style:{"font-size":"36px"}},null,-1),n("div",{style:{"margin-top":"12px"}},"æªæ¾å°è¯¥å·¥å",-1)])]))])}}}),je=X(Ce,[["__scopeId","data-v-11a806d9"]]);export{je as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.