You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/web/dist/assets/Messages.c822d4d1.js

2 lines
7.4 KiB

import{d as v,V as n,W as s,Y as i,ah as M,aj as z,al as I,a3 as a,a4 as r,a7 as $,a8 as p,a9 as w,a5 as b,a6 as l,a2 as k,c3 as N,ch as R,ci as q,cj as P,ad as T,ck as H,ae as U,ab as O,aa as A,ai as W,Z as Y,r as x,a1 as Z,cl as G}from"./index.f480f018.js";import{f as J}from"./formatTime.02109bf5.js";import{_ as K}from"./Alert.a854329b.js";import{_ as Q}from"./Thing.eef6b133.js";import{b as X,a as ee,_ as ne}from"./Skeleton.57e98fe3.js";import{_ as te}from"./main-nav.9110259b.js";import{_ as se}from"./List.49bcdf81.js";import{_ as oe}from"./Pagination.1263479e.js";const ae={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},re=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M464 128L240 384l-96-96"},null,-1),ie=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 384l-96-96"},null,-1),le=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128L232 284"},null,-1),ue=[re,ie,le];var ce=v({name:"CheckmarkDoneOutline",render:function(c,_){return n(),s("svg",ae,ue)}});const _e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},de=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1),me=[de];var pe=v({name:"CheckmarkOutline",render:function(c,_){return n(),s("svg",_e,me)}});const he={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ge=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144"},null,-1),ke=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 144L144 368"},null,-1),ve=[ge,ke];var E=v({name:"CloseOutline",render:function(c,_){return n(),s("svg",he,ve)}});const we={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},fe=i("path",{d:"M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ye=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 128l-80-80l-80 80"},null,-1),xe=i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 321V48"},null,-1),$e=[fe,ye,xe];var Ce=v({name:"ShareOutline",render:function(c,_){return n(),s("svg",we,$e)}});const De={class:"sender-wrap"},Fe={key:0,class:"nickname"},Me={class:"username"},Be={key:1,class:"nickname"},je={class:"timestamp"},Ee={class:"timestamp-txt"},be={key:0,class:"brief-content"},Oe=p(" \u67E5\u770B\u8BE6\u60C5 "),Ae={key:1,class:"whisper-content-wrap"},Ve={key:2,class:"requesting-friend-wrap"},Le=p(" \u540C\u610F "),Se=p(" \u62D2\u7EDD "),ze={key:2,class:"status-info"},Ie=p(" \u5DF2\u540C\u610F "),Ne={key:3,class:"status-info"},Re=p(" \u5DF2\u62D2\u7EDD "),qe=v({props:{message:null},setup(e){const c="https://assets.paopao.info/public/avatar/default/admin.png",_=z(),u=t=>{d(t),(t.type===1||t.type===2||t.type===3)&&(t.post&&t.post.id>0?_.push({name:"post",query:{id:t.post_id}}):window.$message.error("\u8BE5\u52A8\u6001\u5DF2\u88AB\u5220\u9664"))},h=t=>{d(t),R({user_id:t.sender_user_id}).then(o=>{t.reply_id=2,window.$message.success("\u5DF2\u540C\u610F\u6DFB\u52A0\u597D\u53CB")}).catch(o=>{console.log(o)})},f=t=>{d(t),q({user_id:t.sender_user_id}).then(o=>{t.reply_id=3,window.$message.success("\u5DF2\u62D2\u7EDD\u6DFB\u52A0\u597D\u53CB")}).catch(o=>{console.log(o)})},d=t=>{t.is_read===0&&P({id:t.id}).then(o=>{t.is_read=1}).catch(o=>{console.log(o)})};return(t,o)=>{const C=T,m=I("router-link"),B=H,g=U,D=K,F=Q;return n(),s("div",{class:N(["message-item",{unread:e.message.is_read===0}]),onClick:o[4]||(o[4]=y=>d(e.message))},[a(F,{"content-indented":""},{avatar:r(()=>[a(C,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:c},null,8,["src"])]),header:r(()=>[i("div",De,[e.message.sender_user.id>0?(n(),s("span",Fe,[a(m,{onClick:o[0]||(o[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:r(()=>[p(w(e.message.sender_user.nickname),1)]),_:1},8,["to"]),i("span",Me," @"+w(e.message.sender_user.username),1)])):(n(),s("span",Be," \u7CFB\u7EDF "))])]),"header-extra":r(()=>[i("span",je,[e.message.is_read===0?(n(),b(B,{key:0,dot:"",processing:""})):l("",!0),i("span",Ee,w(k(J)(e.message.created_on)),1)])]),description:r(()=>[a(D,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:r(()=>[e.message.type!=4?(n(),s("div",be,[p(w(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(n(),s("span",{key:0,onClick:o[1]||(o[1]=$(y=>u(e.message),["stop"])),class:"hash-link view-link"},[a(g,null,{default:r(()=>[a(k(Ce))]),_:1}),Oe])):l("",!0)])):l("",!0),e.message.type===4?(n(),s("div",Ae,w(e.message.content),1)):l("",!0),e.message.type===5?(n(),s("div",Ve,[p(w(e.message.content)+" ",1),e.message.reply_id===1?(n(),s("span",{key:0,onClick:o[2]||(o[2]=$(y=>h(e.message),["stop"])),class:"hash-link view-link"},[a(g,null,{default:r(()=>[a(k(pe))]),_:1}),Le])):l("",!0),e.message.reply_id===1?(n(),s("span",{key:1,onClick:o[3]||(o[3]=$(y=>f(e.message),["stop"])),class:"hash-link view-link"},[a(g,null,{default:r(()=>[a(k(E))]),_:1}),Se])):l("",!0),e.message.reply_id===2?(n(),s("span",ze,[a(g,null,{default:r(()=>[a(k(ce))]),_:1}),Ie])):l("",!0),e.message.reply_id===3?(n(),s("span",Ne,[a(g,null,{default:r(()=>[a(k(E))]),_:1}),Re])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});var Pe=M(qe,[["__scopeId","data-v-44920a13"]]);const Te={class:"content"},He=v({props:{num:{default:1}},setup(e){return(c,_)=>{const u=X;return n(!0),s(A,null,O(new Array(e.num),h=>(n(),s("div",{class:"skeleton-item",key:h},[i("div",Te,[a(u,{text:"",repeat:2}),a(u,{text:"",style:{width:"60%"}})])]))),128)}}});var Ue=M(He,[["__scopeId","data-v-d0b0628c"]]);const We={key:0,class:"skeleton-wrap"},Ye={key:1},Ze={key:0,class:"empty-wrap"},Ge={key:0,class:"pagination-wrap"},Je=v({setup(e){const c=W(),_=Y(),u=x(!1),h=x(+c.query.p||1),f=x(10),d=x(0),t=x([]),o=()=>{u.value=!0,G({page:h.value,page_size:f.value}).then(m=>{u.value=!1,t.value=m.list,d.value=Math.ceil(m.pager.total_rows/f.value)}).catch(m=>{u.value=!1})},C=m=>{h.value=m,o()};return Z(()=>{o()}),(m,B)=>{const g=te,D=Ue,F=ee,y=Pe,V=ne,L=oe,S=se;return n(),s("div",null,[a(g,{title:"\u6D88\u606F"}),a(S,{class:"main-content-wrap messages-wrap",bordered:""},{footer:r(()=>[d.value>1?(n(),s("div",Ge,[a(L,{page:h.value,"onUpdate:page":C,"page-slot":k(_).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:r(()=>[u.value?(n(),s("div",We,[a(D,{num:f.value},null,8,["num"])])):(n(),s("div",Ye,[t.value.length===0?(n(),s("div",Ze,[a(F,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):l("",!0),(n(!0),s(A,null,O(t.value,j=>(n(),b(V,{key:j.id},{default:r(()=>[a(y,{message:j},null,8,["message"])]),_:2},1024))),128))]))]),_:1})])}}});var an=M(Je,[["__scopeId","data-v-532e9e3c"]]);export{an as default};