1 |
- import{ap as q,d as J,r as u,e as C,k as L,o as p,q as K,w as M,g as y,v as P,a as t,c as f,O as b,f as N,N as Q,m as X,am as B,B as Y,H as Z,p as $,j as aa,__tla as ea}from"./index-2eab2d23.js";import{_ as ta,__tla as la}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5a63038a.js";import{R as D,__tla as sa}from"./TabNews-e6b53f0c.js";import ra,{__tla as ua}from"./main-6787445e.js";import ca,{__tla as na}from"./MsgList-c21f97c7.js";import{g as oa,__tla as ia}from"./index-77b79bc7.js";import{u as _a,__tla as pa}from"./useMessage-171aa63e.js";import{_ as da}from"./_plugin-vue_export-helper-1b428a4d.js";let S,w,U,ma=Promise.all([(()=>{try{return ea}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return pa}catch{}})()]).then(async()=>{let h,z,x,j,T,H;w=c=>q.get({url:"/mp/message/page",params:c}),h=c=>($("data-v-d01ad444"),c=c(),aa(),c),z={key:0},x=[h(()=>y("span",{class:"el-table__empty-text"},"\u70B9\u51FB\u52A0\u8F7D\u66F4\u591A",-1))],j={key:1,class:"el-table__empty-block"},T=[h(()=>y("span",{class:"el-table__empty-text"},"\u6CA1\u6709\u66F4\u591A\u4E86",-1))],H={class:"msg-send"},S=da(J({name:"WxMsg",__name:"main",props:{userId:{type:Number,required:!0}},setup(c){const A=_a(),k=c,d=u(-1),m=u(!1),I=u(!0),_=u([]),n=C({pageNo:1,pageSize:14,accountId:d}),i=C({nickname:"\u7528\u6237",avatar:"/admin-ui-vue3/assets/profile-61ae42a9.jpg",accountId:d}),O=u(!1),e=u({type:D.Text,accountId:-1,articles:[]}),V=u(null),s=u(null);L(async()=>{var l,r;const a=await oa(k.userId);i.nickname=((l=a.nickname)==null?void 0:l.length)>0?a.nickname:i.nickname,i.avatar=((r=i.avatar)==null?void 0:r.length)>0?a.avatar:i.avatar,d.value=a.accountId,e.value.accountId=a.accountId,G()});const E=async()=>{var l;if(!t(e))return;e.value.type===D.News&&e.value.articles&&e.value.articles.length>1&&(e.value.articles=[e.value.articles[0]],A.success("\u56FE\u6587\u6D88\u606F\u6761\u6570\u9650\u5236\u5728 1 \u6761\u4EE5\u5185\uFF0C\u5DF2\u9ED8\u8BA4\u53D1\u9001\u7B2C\u4E00\u6761"));const a=await(r=>q.post({url:"/mp/message/send",data:r}))({userId:k.userId,...e.value});O.value=!1,_.value=[..._.value,a],await W(),(l=V.value)==null||l.clear()},F=()=>{n.pageNo++,R(n,null)},R=async(a,l=null)=>{var g;m.value=!0;let r=await w(Object.assign({pageNo:a.pageNo,pageSize:a.pageSize,userId:k.userId,accountId:a.accountId},l));const v=((g=s.value)==null?void 0:g.scrollHeight)??0,o=r.list.reverse();_.value=[...o,..._.value],m.value=!1,(o.length<n.pageSize||o.length===0)&&(I.value=!1),n.pageNo=a.pageNo,n.pageSize=a.pageSize,n.pageNo===1?await W():o.length!==0&&(await B(),v!==0&&s.value&&(s.value.scrollTop=s.value.scrollHeight-v-100))},G=()=>{R(n)},W=async()=>{await B(),s.value&&(s.value.scrollTop=s.value.scrollHeight)};return(a,l)=>{const r=Y,v=ta,o=Z;return p(),K(v,null,{default:M(()=>[y("div",{class:"msg-div",ref_key:"msgDivRef",ref:s},[P(y("div",null,null,512),[[o,t(m)]]),t(m)?b("",!0):(p(),f("div",z,[t(I)?(p(),f("div",{key:0,class:"el-table__empty-block",onClick:F},x)):b("",!0),t(I)?b("",!0):(p(),f("div",j,T))])),N(ca,{list:t(_),"account-id":t(d),user:t(i)},null,8,["list","account-id","user"])],512),P((p(),f("div",H,[N(t(ra),{ref_key:"replySelectRef",ref:V,modelValue:t(e),"onUpdate:modelValue":l[0]||(l[0]=g=>Q(e)?e.value=g:null)},null,8,["modelValue"]),N(r,{type:"success",class:"send-but",onClick:E},{default:M(()=>[X("\u53D1\u9001(S)")]),_:1})])),[[o,t(O)]])]),_:1})}}}),[["__scopeId","data-v-d01ad444"]]),U=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}))});export{S as W,ma as __tla,w as g,U as m};
|