import{s as q}from"./complaint-0f750d86.js";import{e as z}from"./index-b02b5348.js";import{f as k}from"./date-20546ee0.js";import{M as I,n as E,o as O,B as Q,x as S,t as A,u as G,b as J,q as K}from"./ui-ba7aaa7e.js";import{e as W,r as v,l as X,a2 as Y,P as p,a3 as C,a4 as s,f as o,H as r,ab as i,I as f,Q as x,a7 as T,a9 as Z,F as h,aa as D,b as ee}from"./vue-bf422dc1.js";import{_ as te}from"./index-c2dd6a24.js";import"./libs-51817cd7.js";import"./icons-a8498fb6.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";const se={key:0},oe={key:1},ne={class:"form-container"},le=["innerHTML"],ae={name:"RowDetail"},re=W({...ae,setup(ie,{expose:V}){const b=v(!1),e=X({}),B=v(0),m=v(0),g=ee(),L=[{value:"admin",label:"管理员"},{value:"merchant",label:"商户"},{value:"buyer",label:"买家"},{value:"agent",label:"上级卖家"}],M=l=>{const a=L.find(n=>n.value===l);return a?a.label:"未知"},_=v(""),N=async()=>{if(_.value==="")return;const l=await q({id:m.value,content:_.value});l.code===1?(I.success(l.msg),_.value=""):I.error(l.msg)},[H,P]=z();return V({init:l=>{var c;b.value=!0,B.value=l.complaint.user_id,m.value=l.complaint.id,Object.assign(e,l),(g==null?void 0:g.appContext.config.globalProperties.$ws({userId:m.value})).subscribe(`private-group-complaint-${m.value}`).on("message",y=>{e.messages.unshift(y)}),e&&P((c=e==null?void 0:e.complaint)==null?void 0:c.expire_at)}}),(l,a)=>{const n=E,c=O,y=Y("wp-editor"),F=Q,w=S,R=A,U=G,$=J,j=K;return p(),C(j,{visible:b.value,"onUpdate:visible":a[1]||(a[1]=d=>b.value=d),header:"投诉详情",size:"80%"},{default:s(()=>{var d;return[o(c,null,{default:s(()=>[o(n,{label:"订单编号"},{default:s(()=>{var t;return[r(i((t=e==null?void 0:e.complaint)==null?void 0:t.trade_no),1)]}),_:1}),o(n,{label:"举报原因"},{default:s(()=>{var t;return[r(i((t=e==null?void 0:e.complaint)==null?void 0:t.type),1)]}),_:1}),o(n,{label:"投诉说明"},{default:s(()=>{var t;return[r(i((t=e==null?void 0:e.complaint)==null?void 0:t.desc),1)]}),_:1}),o(n,{label:"联系方式 "},{default:s(()=>{var t;return[r(i((t=e==null?void 0:e.complaint)==null?void 0:t.mobile),1)]}),_:1}),o(n,{label:"投诉状态"},{default:s(()=>{var t,u;return[r(i(((t=e==null?void 0:e.complaint)==null?void 0:t.status)===0?"处理中":((u=e==null?void 0:e.complaint)==null?void 0:u.status)==-1?"已撤销":"已处理"),1)]}),_:1}),o(n,{label:"投诉结果 "},{default:s(()=>{var t,u;return[r(i(((t=e==null?void 0:e.complaint)==null?void 0:t.result)==0?"处理中":((u=e==null?void 0:e.complaint)==null?void 0:u.result)==1?"商家胜诉":"买家胜诉"),1)]}),_:1}),o(n,{label:"投诉时间"},{default:s(()=>{var t;return[r(i(f(k)((t=e==null?void 0:e.complaint)==null?void 0:t.create_at)),1)]}),_:1}),o(n,{label:"剩余时间"},{default:s(()=>{var t;return[((t=e==null?void 0:e.complaint)==null?void 0:t.result)==1?(p(),x("span",se,"已结束")):(p(),x("span",oe,i(f(H)),1))]}),_:1})]),_:1}),((d=e==null?void 0:e.complaint)==null?void 0:d.status)===0?(p(),C(w,{key:0},{content:s(()=>[T("div",ne,[o(y,{modelValue:_.value,"onUpdate:modelValue":a[0]||(a[0]=t=>_.value=t),height:"200px",width:"100%",mode:"simple","user-type":"merchant"},null,8,["modelValue"]),o(F,{class:"form-submit",onClick:N},{default:s(()=>[r("发送内容")]),_:1})])]),_:1})):Z("",!0),o($,{title:"聊天内容",class:"message-list"},{default:s(()=>[o(U,{split:!0,style:{height:"500px"},scroll:{type:"virtual"}},{default:s(()=>[(p(!0),x(h,null,D(e==null?void 0:e.messages,(t,u)=>(p(),C(R,{key:u},{content:s(()=>[o(w,{author:M(t==null?void 0:t.type),datetime:f(k)(t.create_at)},{content:s(()=>[T("div",{innerHTML:t.content},null,8,le)]),_:2},1032,["author","datetime"])]),_:2},1024))),128))]),_:1})]),_:1})]}),_:1},8,["visible"])}}});const xe=te(re,[["__scopeId","data-v-12e6ce95"]]);export{xe as default};
