mirror of https://github.com/rocboss/paopao-ce
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.
58 lines
29 KiB
58 lines
29 KiB
var Ne=Object.defineProperty,je=Object.defineProperties;var Me=Object.getOwnPropertyDescriptors;var be=Object.getOwnPropertySymbols;var Ve=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var we=(i,l,t)=>l in i?Ne(i,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[l]=t,X=(i,l)=>{for(var t in l||(l={}))Ve.call(l,t)&&we(i,t,l[t]);if(be)for(var t of be(l))qe.call(l,t)&&we(i,t,l[t]);return i},ee=(i,l)=>je(i,Me(l));import{l as he,p as ve,m as j,o as q,d as T,u as fe,q as ue,bC as Le,s as L,y as De,h as z,aa as se,e as He,I as xe,i as Ke,t as $e,K as Ee,J as W,z as We,N as Je,bu as Ge,bD as Qe,n as Be,bE as Ye,r as k,A as Ze,bF as Xe,bG as et,aM as tt,bH as st,k as Fe,V as c,W as g,Y as C,bI as ot,ah as oe,a6 as $,a3 as a,a4 as r,a8 as E,bJ as nt,_ as at,Z as re,al as ge,a9 as D,a5 as I,a2 as e,bK as it,ae as ce,aj as Ae,am as lt,ab as ie,a7 as J,bL as ut,ad as ye,$ as rt,a1 as ke,bM as ct,bN as pt,bO as dt,af as _t,bP as mt,bQ as vt,bR as ht,bS as ft,bT as gt,bU as yt,bV as kt,bW as Ct,an as bt,bX as wt,bp as xt,ag as $t,ai as Et,S as Bt,bY as Ft,bZ as Pt,b_ as Dt}from"./index.f480f018.js";import{_ as At}from"./InputGroup.f69c4956.js";import{f as le}from"./formatTime.02109bf5.js";import{p as Ce,a as Ie,H as It,C as zt,B as Rt,_ as Tt,b as St,c as Ot}from"./content.ef1e095a.js";import{_ as ze}from"./Thing.eef6b133.js";import{_ as Ut}from"./post-skeleton.39a35f5b.js";import{l as Nt,I as jt,_ as Mt,V as te}from"./IEnum.bfd96c78.js";import{_ as Vt,a as qt,b as Lt,c as Ht}from"./Upload.efe3adfd.js";import{M as Kt}from"./MoreHorizFilled.80db5156.js";import{_ as Wt}from"./main-nav.9110259b.js";import{_ as Jt}from"./List.49bcdf81.js";import{a as Gt,_ as Qt}from"./Skeleton.57e98fe3.js";var Yt=he("divider",`
|
|
position: relative;
|
|
display: flex;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
font-size: 16px;
|
|
color: var(--n-text-color);
|
|
transition:
|
|
color .3s var(--n-bezier),
|
|
background-color .3s var(--n-bezier);
|
|
`,[ve("vertical",`
|
|
margin-top: 24px;
|
|
margin-bottom: 24px;
|
|
`,[ve("no-title",`
|
|
display: flex;
|
|
align-items: center;
|
|
`)]),j("title",`
|
|
display: flex;
|
|
align-items: center;
|
|
margin-left: 12px;
|
|
margin-right: 12px;
|
|
white-space: nowrap;
|
|
font-weight: var(--n-font-weight);
|
|
`),q("title-position-left",[j("line",[q("left",{width:"28px"})])]),q("title-position-right",[j("line",[q("right",{width:"28px"})])]),q("dashed",[j("line",`
|
|
background-color: #0000;
|
|
height: 0px;
|
|
width: 100%;
|
|
border-style: dashed;
|
|
border-width: 1px 0 0;
|
|
`)]),q("vertical",`
|
|
display: inline-block;
|
|
height: 1em;
|
|
margin: 0 8px;
|
|
vertical-align: middle;
|
|
width: 1px;
|
|
`),j("line",`
|
|
border: none;
|
|
transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier);
|
|
height: 1px;
|
|
width: 100%;
|
|
margin: 0;
|
|
`),ve("dashed",[j("line",{backgroundColor:"var(--n-color)"})]),q("dashed",[j("line",{borderColor:"var(--n-color)"})]),q("vertical",{backgroundColor:"var(--n-color)"})]);const Zt=Object.assign(Object.assign({},ue.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean});var Xt=T({name:"Divider",props:Zt,setup(i){const{mergedClsPrefixRef:l,inlineThemeDisabled:t}=fe(i),u=ue("Divider","-divider",Yt,Le,i,l),f=L(()=>{const{common:{cubicBezierEaseInOut:p},self:{color:_,textColor:n,fontWeight:b}}=u.value;return{"--n-bezier":p,"--n-color":_,"--n-text-color":n,"--n-font-weight":b}}),d=t?De("divider",void 0,f,i):void 0;return{mergedClsPrefix:l,cssVars:t?void 0:f,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){var i;const{$slots:l,titlePlacement:t,vertical:u,dashed:f,cssVars:d,mergedClsPrefix:p}=this;return(i=this.onRender)===null||i===void 0||i.call(this),z("div",{role:"separator",class:[`${p}-divider`,this.themeClass,{[`${p}-divider--vertical`]:u,[`${p}-divider--no-title`]:!l.default,[`${p}-divider--dashed`]:f,[`${p}-divider--title-position-${t}`]:l.default&&t}],style:d},u?null:z("div",{class:`${p}-divider__line ${p}-divider__line--left`}),!u&&l.default?z(se,null,z("div",{class:`${p}-divider__title`},this.$slots),z("div",{class:`${p}-divider__line ${p}-divider__line--right`})):null)}});const Re=He("n-popconfirm"),Te={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Pe=Qe(Te);var es=T({name:"NPopconfirmPanel",props:Te,setup(i){const{localeRef:l}=xe("Popconfirm"),{inlineThemeDisabled:t}=fe(),{mergedClsPrefixRef:u,mergedThemeRef:f,props:d}=Ke(Re),p=L(()=>{const{common:{cubicBezierEaseInOut:n},self:{fontSize:b,iconSize:h,iconColor:v}}=f.value;return{"--n-bezier":n,"--n-font-size":b,"--n-icon-size":h,"--n-icon-color":v}}),_=t?De("popconfirm-panel",void 0,p,d):void 0;return Object.assign(Object.assign({},xe("Popconfirm")),{mergedClsPrefix:u,cssVars:t?void 0:p,localizedPositiveText:L(()=>i.positiveText||l.value.positiveText),localizedNegativeText:L(()=>i.negativeText||l.value.negativeText),positiveButtonProps:$e(d,"positiveButtonProps"),negativeButtonProps:$e(d,"negativeButtonProps"),handlePositiveClick(n){i.onPositiveClick(n)},handleNegativeClick(n){i.onNegativeClick(n)},themeClass:_==null?void 0:_.themeClass,onRender:_==null?void 0:_.onRender})},render(){var i;const{mergedClsPrefix:l,showIcon:t,$slots:u}=this,f=Ee(u.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&z(W,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&z(W,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(i=this.onRender)===null||i===void 0||i.call(this),z("div",{class:[`${l}-popconfirm__panel`,this.themeClass],style:this.cssVars},We(u.default,d=>t||d?z("div",{class:`${l}-popconfirm__body`},t?z("div",{class:`${l}-popconfirm__icon`},Ee(u.icon,()=>[z(Je,{clsPrefix:l},{default:()=>z(Ge,null)})])):null,d):null),f?z("div",{class:[`${l}-popconfirm__action`]},f):null)}}),ts=he("popconfirm",[j("body",`
|
|
font-size: var(--n-font-size);
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: nowrap;
|
|
position: relative;
|
|
`,[j("icon",`
|
|
display: flex;
|
|
font-size: var(--n-icon-size);
|
|
color: var(--n-icon-color);
|
|
transition: color .3s var(--n-bezier);
|
|
margin: 0 8px 0 0;
|
|
`)]),j("action",`
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
`,[Be("&:not(:first-child)","margin-top: 8px"),he("button",[Be("&:not(:last-child)","margin-right: 8px;")])])]);const ss=Object.assign(Object.assign(Object.assign({},ue.props),st),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function});var Se=T({name:"Popconfirm",props:ss,__popover__:!0,setup(i){const{mergedClsPrefixRef:l}=fe(),t=ue("Popconfirm","-popconfirm",ts,Ye,i,l),u=k(null);function f(_){const{onPositiveClick:n,"onUpdate:show":b}=i;Promise.resolve(n?n(_):!0).then(h=>{var v;h!==!1&&((v=u.value)===null||v===void 0||v.setShow(!1),b&&Fe(b,!1))})}function d(_){const{onNegativeClick:n,"onUpdate:show":b}=i;Promise.resolve(n?n(_):!0).then(h=>{var v;h!==!1&&((v=u.value)===null||v===void 0||v.setShow(!1),b&&Fe(b,!1))})}return Ze(Re,{mergedThemeRef:t,mergedClsPrefixRef:l,props:i}),Object.assign(Object.assign({},{setShow(_){var n;(n=u.value)===null||n===void 0||n.setShow(_)},syncPosition(){var _;(_=u.value)===null||_===void 0||_.syncPosition()}}),{mergedTheme:t,popoverInstRef:u,handlePositiveClick:f,handleNegativeClick:d})},render(){const{$slots:i,$props:l,mergedTheme:t}=this;return z(tt,et(l,Pe,{theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:i.activator||i.trigger,default:()=>{const u=Xe(l,Pe);return z(es,Object.assign(Object.assign({},u),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),i)}})}});const os={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ns=C("path",{d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16z",fill:"currentColor"},null,-1),as=[ns];var is=T({name:"Bookmark",render:function(l,t){return c(),g("svg",os,as)}});const ls={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},us=C("path",{d:"M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8c-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64c.54 54.21-18.63 104.26-58.61 153c-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z",fill:"currentColor"},null,-1),rs=[us];var cs=T({name:"Heart",render:function(l,t){return c(),g("svg",ls,rs)}});const ps={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ds=ot('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16"></path><path d="M10 11v6"></path><path d="M14 11v6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12"></path><path d="M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"></path></g>',1),_s=[ds];var Oe=T({name:"Trash",render:function(l,t){return c(),g("svg",ps,_s)}});const ms={class:"reply-compose-wrap"},vs={class:"reply-switch"},hs={key:0,class:"reply-input-wrap"},fs=E(" \u56DE\u590D "),gs=T({props:{commentId:{default:0},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(i,{expose:l,emit:t}){const u=i,f=k(),d=k(!1),p=k(""),_=k(!1),n=h=>{d.value=h,h?setTimeout(()=>{var v;(v=f.value)==null||v.focus()},10):(_.value=!1,p.value="",t("reset"))},b=()=>{_.value=!0,nt({comment_id:u.commentId,at_user_id:u.atUserid,content:p.value}).then(h=>{n(!1),window.$message.success("\u8BC4\u8BBA\u6210\u529F"),t("reload")}).catch(h=>{_.value=!1})};return l({switchReply:n}),(h,v)=>{const A=at,s=W,B=At;return c(),g("div",ms,[C("div",vs,[d.value?$("",!0):(c(),g("span",{key:0,class:"show",onClick:v[0]||(v[0]=x=>n(!0))}," \u56DE\u590D ")),d.value?(c(),g("span",{key:1,class:"hide",onClick:v[1]||(v[1]=x=>n(!1))}," \u53D6\u6D88 ")):$("",!0)]),d.value?(c(),g("div",hs,[a(B,null,{default:r(()=>[a(A,{ref_key:"inputInstRef",ref:f,size:"small",placeholder:u.atUsername?"@"+u.atUsername:"\u8BF7\u8F93\u5165\u56DE\u590D\u5185\u5BB9..",maxlength:"100",value:p.value,"onUpdate:value":v[2]||(v[2]=x=>p.value=x),"show-count":"",clearable:""},null,8,["placeholder","value"]),a(s,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:b},{default:r(()=>[fs]),_:1},8,["loading"])]),_:1})])):$("",!0)])}}});var ys=oe(gs,[["__scopeId","data-v-3616e66c"]]);const ks={class:"reply-item"},Cs={class:"header-wrap"},bs={class:"username"},ws={class:"reply-name"},xs={class:"timestamp"},$s=E(" \u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F "),Es={class:"base-wrap"},Bs={class:"content"},Fs={key:0,class:"reply-switch"},Ps=T({props:{reply:null},emits:["focusReply","reload"],setup(i,{emit:l}){const t=i,u=re(),f=()=>{l("focusReply",t.reply)},d=()=>{it({id:t.reply.id}).then(p=>{window.$message.success("\u5220\u9664\u6210\u529F"),setTimeout(()=>{l("reload")},50)}).catch(p=>{console.log(p)})};return(p,_)=>{const n=ge("router-link"),b=ce,h=W,v=Se;return c(),g("div",ks,[C("div",Cs,[C("div",bs,[a(n,{class:"user-link",to:{name:"user",query:{username:t.reply.user.username}}},{default:r(()=>[E(D(t.reply.user.username),1)]),_:1},8,["to"]),C("span",ws,D(t.reply.at_user_id>0?"\u56DE\u590D":":"),1),t.reply.at_user_id>0?(c(),I(n,{key:0,class:"user-link",to:{name:"user",query:{username:t.reply.at_user.username}}},{default:r(()=>[E(D(t.reply.at_user.username),1)]),_:1},8,["to"])):$("",!0)]),C("div",xs,[E(D(t.reply.ip_loc?t.reply.ip_loc+" \xB7 ":t.reply.ip_loc)+" "+D(e(le)(t.reply.created_on))+" ",1),e(u).state.userInfo.is_admin||e(u).state.userInfo.id===t.reply.user.id?(c(),I(v,{key:0,"negative-text":"\u53D6\u6D88","positive-text":"\u786E\u8BA4",onPositiveClick:d},{trigger:r(()=>[a(h,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:r(()=>[a(b,null,{default:r(()=>[a(e(Oe))]),_:1})]),_:1})]),default:r(()=>[$s]),_:1})):$("",!0)])]),C("div",Es,[C("div",Bs,D(t.reply.content),1),e(u).state.userInfo.id>0?(c(),g("div",Fs,[C("span",{class:"show",onClick:f}," \u56DE\u590D ")])):$("",!0)])])}}});var Ds=oe(Ps,[["__scopeId","data-v-1e3df20d"]]);const As={class:"comment-item"},Is={class:"nickname-wrap"},zs={class:"username-wrap"},Rs={class:"opt-wrap"},Ts={class:"timestamp"},Ss=E(" \u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F "),Os=["innerHTML"],Us={class:"reply-wrap"},Ns=T({props:{comment:null},emits:["reload"],setup(i,{emit:l}){const t=i,u=re(),f=Ae(),d=k(0),p=k(""),_=k(),n=L(()=>{let B=Object.assign({texts:[],imgs:[]},t.comment);return B.contents.map(x=>{(+x.type==1||+x.type==2)&&B.texts.push(x),+x.type==3&&B.imgs.push(x)}),B}),b=(B,x)=>{let R=B.target;if(R.dataset.detail){const S=R.dataset.detail.split(":");S.length===2&&(u.commit("refresh"),S[0]==="tag"?window.$message.warning("\u8BC4\u8BBA\u5185\u7684\u65E0\u6548\u8BDD\u9898"):f.push({name:"user",query:{username:S[1]}}))}},h=B=>{var x,R;d.value=B.user_id,p.value=((x=B.user)==null?void 0:x.username)||"",(R=_.value)==null||R.switchReply(!0)},v=()=>{l("reload")},A=()=>{d.value=0,p.value=""},s=()=>{ut({id:n.value.id}).then(B=>{window.$message.success("\u5220\u9664\u6210\u529F"),setTimeout(()=>{v()},50)}).catch(B=>{})};return(B,x)=>{const R=ye,S=ge("router-link"),H=ce,K=W,M=Se,G=Ie,Q=Ds,Y=ys,o=ze;return c(),g("div",As,[a(o,{"content-indented":""},lt({avatar:r(()=>[a(R,{round:"",size:30,src:e(n).user.avatar},null,8,["src"])]),header:r(()=>[C("span",Is,[a(S,{onClick:x[0]||(x[0]=J(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(n).user.username}}},{default:r(()=>[E(D(e(n).user.nickname),1)]),_:1},8,["to"])]),C("span",zs," @"+D(e(n).user.username),1)]),"header-extra":r(()=>[C("div",Rs,[C("span",Ts,D(e(n).ip_loc?e(n).ip_loc+" \xB7 ":e(n).ip_loc)+" "+D(e(le)(e(n).created_on)),1),e(u).state.userInfo.is_admin||e(u).state.userInfo.id===e(n).user.id?(c(),I(M,{key:0,"negative-text":"\u53D6\u6D88","positive-text":"\u786E\u8BA4",onPositiveClick:s},{trigger:r(()=>[a(K,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:r(()=>[a(H,null,{default:r(()=>[a(e(Oe))]),_:1})]),_:1})]),default:r(()=>[Ss]),_:1})):$("",!0)])]),footer:r(()=>[e(n).imgs.length>0?(c(),I(G,{key:0,imgs:e(n).imgs},null,8,["imgs"])):$("",!0),C("div",Us,[(c(!0),g(se,null,ie(e(n).replies,m=>(c(),I(Q,{key:m.id,reply:m,onFocusReply:h,onReload:v},null,8,["reply"]))),128))]),e(u).state.userInfo.id>0?(c(),I(Y,{key:1,ref_key:"replyComposeRef",ref:_,"comment-id":e(n).id,"at-userid":d.value,"at-username":p.value,onReload:v,onReset:A},null,8,["comment-id","at-userid","at-username"])):$("",!0)]),_:2},[e(n).texts.length>0?{name:"description",fn:r(()=>[(c(!0),g(se,null,ie(e(n).texts,m=>(c(),g("span",{key:m.id,class:"comment-text",onClick:x[1]||(x[1]=J(U=>b(U,e(n).id),["stop"])),innerHTML:e(Ce)(m.content).content},null,8,Os))),128))])}:void 0]),1024)])}}});var js=oe(Ns,[["__scopeId","data-v-6b2cb186"]]);const Ms=i=>(ct("data-v-0702a552"),i=i(),pt(),i),Vs={key:0,class:"compose-wrap"},qs={class:"compose-line"},Ls={class:"compose-user"},Hs={class:"compose-line compose-options"},Ks={class:"attachment"},Ws={class:"submit-wrap"},Js=E(" \u53D6\u6D88 "),Gs=E(" \u53D1\u5E03 "),Qs={class:"attachment-list-wrap"},Ys={key:1,class:"compose-wrap"},Zs=Ms(()=>C("div",{class:"login-wrap"},[C("span",{class:"login-banner"}," \u767B\u5F55\u540E\uFF0C\u7CBE\u5F69\u66F4\u591A")],-1)),Xs={class:"login-wrap"},eo=E(" \u767B\u5F55 "),to=E(" \u6CE8\u518C "),so=T({props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(i,{emit:l}){const t=i,u=re(),f=k([]),d=k(!1),p=k(!1),_=k(!1),n=k(""),b=k(),h=k("public/image"),v=k([]),A=k([]),s="/v1/attachment",B=k(),x=Nt.exports.debounce(y=>{rt({k:y}).then(w=>{let F=[];w.map(P=>{F.push({label:P,value:P})}),f.value=F,p.value=!1}).catch(w=>{p.value=!1})},200),R=(y,w)=>{p.value||(p.value=!0,w==="@"&&x(y))},S=y=>{y.length>200||(n.value=y)},H=y=>{h.value=y},K=y=>{v.value=y},M=async y=>{var w,F;return h.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((w=y.file.file)==null?void 0:w.type)?(window.$message.warning("\u56FE\u7247\u4EC5\u5141\u8BB8 png/jpg/gif \u683C\u5F0F"),!1):h.value==="image"&&((F=y.file.file)==null?void 0:F.size)>10485760?(window.$message.warning("\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC710MB"),!1):!0},G=({file:y,event:w})=>{var F;try{let P=JSON.parse((F=w.target)==null?void 0:F.response);P.code===0&&h.value==="public/image"&&A.value.push({id:y.id,content:P.data.content})}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},Q=({file:y,event:w})=>{var F;try{let P=JSON.parse((F=w.target)==null?void 0:F.response);if(P.code!==0){let V=P.msg||"\u4E0A\u4F20\u5931\u8D25";P.details&&P.details.length>0&&P.details.map(N=>{V+=":"+N}),window.$message.error(V)}}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},Y=({file:y})=>{let w=A.value.findIndex(F=>F.id===y.id);w>-1&&A.value.splice(w,1)},o=()=>{d.value=!0},m=()=>{var y;d.value=!1,(y=b.value)==null||y.clear(),v.value=[],n.value="",A.value=[]},U=()=>{if(n.value.trim().length===0){window.$message.warning("\u8BF7\u8F93\u5165\u5185\u5BB9\u54E6");return}let{users:y}=Ce(n.value);const w=[];let F=100;w.push({content:n.value,type:2,sort:F}),A.value.map(P=>{F++,w.push({content:P.content,type:3,sort:F})}),_.value=!0,dt({contents:w,post_id:t.postId,users:Array.from(new Set(y))}).then(P=>{window.$message.success("\u53D1\u5E03\u6210\u529F"),_.value=!1,l("post-success"),m()}).catch(P=>{_.value=!1})},ne=y=>{u.commit("triggerAuth",!0),u.commit("triggerAuthKey",y)};return ke(()=>{B.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(y,w)=>{const F=ye,P=Mt,V=ce,N=W,pe=Vt,de=qt,_e=_t,ae=Lt,me=Ht;return c(),g("div",null,[e(u).state.userInfo.id>0?(c(),g("div",Vs,[C("div",qs,[C("div",Ls,[a(F,{round:"",size:30,src:e(u).state.userInfo.avatar},null,8,["src"])]),a(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:f.value,prefix:["@"],loading:p.value,value:n.value,disabled:t.lock===1,"onUpdate:value":S,onSearch:R,onFocus:o,placeholder:t.lock===1?"\u6CE1\u6CE1\u5DF2\u88AB\u9501\u5B9A\uFF0C\u56DE\u590D\u529F\u80FD\u5DF2\u5173\u95ED":"\u5FEB\u6765\u8BC4\u8BBA\u4E24\u53E5\u5427..."},null,8,["options","loading","value","disabled","placeholder"])]),d.value?(c(),I(me,{key:0,ref_key:"uploadRef",ref:b,abstract:"","list-type":"image",multiple:!0,max:9,action:s,headers:{Authorization:B.value},data:{type:h.value},onBeforeUpload:M,onFinish:G,onError:Q,onRemove:Y,"onUpdate:fileList":K},{default:r(()=>[C("div",Hs,[C("div",Ks,[a(pe,{abstract:""},{default:r(({handleClick:Z})=>[a(N,{disabled:v.value.length>0&&h.value==="public/video"||v.value.length===9,onClick:()=>{H("public/image"),Z()},quaternary:"",circle:"",type:"primary"},{icon:r(()=>[a(V,{size:"20",color:"var(--primary-color)"},{default:r(()=>[a(e(jt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),a(_e,{trigger:"hover",placement:"bottom"},{trigger:r(()=>[a(de,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:n.value.length/200*100},null,8,["percentage"])]),default:r(()=>[E(" "+D(n.value.length)+" / 200 ",1)]),_:1})]),C("div",Ws,[a(N,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:m},{default:r(()=>[Js]),_:1}),a(N,{loading:_.value,onClick:U,type:"primary",secondary:"",size:"small",round:""},{default:r(()=>[Gs]),_:1},8,["loading"])])]),C("div",Qs,[a(ae)])]),_:1},8,["headers","data"])):$("",!0)])):(c(),g("div",Ys,[Zs,C("div",Xs,[a(N,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=Z=>ne("signin"))},{default:r(()=>[eo]),_:1}),a(N,{strong:"",secondary:"",round:"",type:"info",onClick:w[1]||(w[1]=Z=>ne("signup"))},{default:r(()=>[to]),_:1})])]))])}}});var oo=oe(so,[["__scopeId","data-v-0702a552"]]);const no={class:"username-wrap"},ao=E(" \u7F6E\u9876 "),io=E(" \u79C1\u5BC6 "),lo=E(" \u597D\u53CB\u53EF\u89C1 "),uo={key:0,class:"options"},ro={key:0},co=["innerHTML"],po={class:"timestamp"},_o={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=T({props:{post:null},emits:["reload"],setup(i,{emit:l}){const t=i,u=re(),f=Ae(),d=k(!1),p=k(!1),_=k(!1),n=k(!1),b=k(!1),h=k(!1),v=k(!1),A=k(te.PUBLIC),s=L({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},t.post);return o.contents.map(m=>{(+m.type==1||+m.type==2)&&o.texts.push(m),+m.type==3&&o.imgs.push(m),+m.type==4&&o.videos.push(m),+m.type==6&&o.links.push(m),+m.type==7&&o.attachments.push(m),+m.type==8&&o.charge_attachments.push(m)}),o},set:o=>{t.post.upvote_count=o.upvote_count,t.post.comment_count=o.comment_count,t.post.collection_count=o.collection_count}}),B=L(()=>{let o=[{label:"\u5220\u9664",key:"delete"}];return s.value.is_lock===0?o.push({label:"\u9501\u5B9A",key:"lock"}):o.push({label:"\u89E3\u9501",key:"unlock"}),u.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"\u7F6E\u9876",key:"stick"}):o.push({label:"\u53D6\u6D88\u7F6E\u9876",key:"unstick"})),s.value.visibility===te.PUBLIC?o.push({label:"\u516C\u5F00",key:"vpublic",children:[{label:"\u79C1\u5BC6",key:"vprivate"},{label:"\u597D\u53CB\u53EF\u89C1",key:"vfriend"}]}):s.value.visibility===te.PRIVATE?o.push({label:"\u79C1\u5BC6",key:"vprivate",children:[{label:"\u516C\u5F00",key:"vpublic"},{label:"\u597D\u53CB\u53EF\u89C1",key:"vfriend"}]}):o.push({label:"\u597D\u53CB\u53EF\u89C1",key:"vfriend",children:[{label:"\u516C\u5F00",key:"vpublic"},{label:"\u79C1\u5BC6",key:"vprivate"}]}),o}),x=o=>{f.push({name:"post",query:{id:o}})},R=(o,m)=>{if(o.target.dataset.detail){const U=o.target.dataset.detail.split(":");if(U.length===2){u.commit("refresh"),U[0]==="tag"?f.push({name:"home",query:{q:U[1],t:"tag"}}):f.push({name:"user",query:{username:U[1]}});return}}x(m)},S=o=>{switch(o){case"delete":_.value=!0;break;case"lock":case"unlock":n.value=!0;break;case"stick":case"unstick":b.value=!0;break;case"vpublic":A.value=0,h.value=!0;break;case"vprivate":A.value=1,h.value=!0;break;case"vfriend":A.value=2,h.value=!0;break}},H=()=>{ht({id:s.value.id}).then(o=>{window.$message.success("\u5220\u9664\u6210\u529F"),f.replace("/"),setTimeout(()=>{u.commit("refresh")},50)}).catch(o=>{v.value=!1})},K=()=>{ft({id:s.value.id}).then(o=>{l("reload"),o.lock_status===1?window.$message.success("\u9501\u5B9A\u6210\u529F"):window.$message.success("\u89E3\u9501\u6210\u529F")}).catch(o=>{v.value=!1})},M=()=>{gt({id:s.value.id}).then(o=>{l("reload"),o.top_status===1?window.$message.success("\u7F6E\u9876\u6210\u529F"):window.$message.success("\u53D6\u6D88\u7F6E\u9876\u6210\u529F")}).catch(o=>{v.value=!1})},G=()=>{yt({id:s.value.id,visibility:A.value}).then(o=>{l("reload"),window.$message.success("\u4FEE\u6539\u53EF\u89C1\u6027\u6210\u529F")}).catch(o=>{v.value=!1})},Q=()=>{kt({id:s.value.id}).then(o=>{d.value=o.status,o.status?s.value=ee(X({},s.value),{upvote_count:s.value.upvote_count+1}):s.value=ee(X({},s.value),{upvote_count:s.value.upvote_count-1})}).catch(o=>{console.log(o)})},Y=()=>{Ct({id:s.value.id}).then(o=>{p.value=o.status,o.status?s.value=ee(X({},s.value),{collection_count:s.value.collection_count+1}):s.value=ee(X({},s.value),{collection_count:s.value.collection_count-1})}).catch(o=>{console.log(o)})};return ke(()=>{u.state.userInfo.id>0&&(mt({id:s.value.id}).then(o=>{d.value=o.status}).catch(o=>{console.log(o)}),vt({id:s.value.id}).then(o=>{p.value=o.status}).catch(o=>{console.log(o)}))}),(o,m)=>{const U=ye,ne=ge("router-link"),y=bt,w=ce,F=W,P=wt,V=xt,N=Tt,pe=Ie,de=St,_e=Ot,ae=Xt,me=$t,Z=ze;return c(),g("div",{class:"detail-item",onClick:m[6]||(m[6]=O=>x(e(s).id))},[a(Z,null,{avatar:r(()=>[a(U,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:r(()=>[a(ne,{onClick:m[0]||(m[0]=J(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:r(()=>[E(D(e(s).user.nickname),1)]),_:1},8,["to"]),C("span",no," @"+D(e(s).user.username),1),e(s).is_top?(c(),I(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:r(()=>[ao]),_:1})):$("",!0),e(s).visibility==e(te).PRIVATE?(c(),I(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[io]),_:1})):$("",!0),e(s).visibility==e(te).FRIEND?(c(),I(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[lo]),_:1})):$("",!0)]),"header-extra":r(()=>[e(u).state.userInfo.is_admin||e(u).state.userInfo.id===e(s).user.id?(c(),g("div",uo,[a(P,{placement:"bottom-end",trigger:"click",size:"small",options:e(B),onSelect:S},{default:r(()=>[a(F,{quaternary:"",circle:""},{icon:r(()=>[a(w,null,{default:r(()=>[a(e(Kt))]),_:1})]),_:1})]),_:1},8,["options"])])):$("",!0),a(V,{show:_.value,"onUpdate:show":m[1]||(m[1]=O=>_.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A\u5220\u9664\u8BE5\u6CE1\u6CE1\u52A8\u6001\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:H},null,8,["show"]),a(V,{show:n.value,"onUpdate:show":m[2]||(m[2]=O=>n.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A"+(e(s).is_lock?"\u89E3\u9501":"\u9501\u5B9A")+"\u8BE5\u6CE1\u6CE1\u52A8\u6001\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:K},null,8,["show","content"]),a(V,{show:b.value,"onUpdate:show":m[3]||(m[3]=O=>b.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A"+(e(s).is_top?"\u53D6\u6D88\u7F6E\u9876":"\u7F6E\u9876")+"\u8BE5\u6CE1\u6CE1\u52A8\u6001\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:M},null,8,["show","content"]),a(V,{show:h.value,"onUpdate:show":m[4]||(m[4]=O=>h.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A\u5C06\u8BE5\u6CE1\u6CE1\u52A8\u6001\u53EF\u89C1\u5EA6\u4FEE\u6539\u4E3A"+(A.value==0?"\u516C\u5F00":A.value==1?"\u79C1\u5BC6":"\u597D\u53CB\u53EF\u89C1")+"\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:G},null,8,["show","content"])]),footer:r(()=>[a(N,{attachments:e(s).attachments},null,8,["attachments"]),a(N,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),a(pe,{imgs:e(s).imgs},null,8,["imgs"]),a(de,{videos:e(s).videos,full:!0},null,8,["videos"]),a(_e,{links:e(s).links},null,8,["links"]),C("div",po,[E(" \u53D1\u5E03\u4E8E "+D(e(le)(e(s).created_on))+" ",1),e(s).ip_loc?(c(),g("span",_o,[a(ae,{vertical:""}),E(" "+D(e(s).ip_loc),1)])):$("",!0),e(s).created_on!=e(s).latest_replied_on?(c(),g("span",mo,[a(ae,{vertical:""}),E(" \u6700\u540E\u56DE\u590D "+D(e(le)(e(s).latest_replied_on)),1)])):$("",!0)])]),action:r(()=>[C("div",vo,[a(me,{justify:"space-between"},{default:r(()=>[C("div",{class:"opt-item hover",onClick:J(Q,["stop"])},[a(w,{size:"20",class:"opt-item-icon"},{default:r(()=>[d.value?$("",!0):(c(),I(e(It),{key:0})),d.value?(c(),I(e(cs),{key:1,color:"red"})):$("",!0)]),_:1}),E(" "+D(e(s).upvote_count),1)],8,ho),C("div",fo,[a(w,{size:"20",class:"opt-item-icon"},{default:r(()=>[a(e(zt))]),_:1}),E(" "+D(e(s).comment_count),1)]),C("div",{class:"opt-item hover",onClick:J(Y,["stop"])},[a(w,{size:"20",class:"opt-item-icon"},{default:r(()=>[p.value?$("",!0):(c(),I(e(Rt),{key:0})),p.value?(c(),I(e(is),{key:1,color:"#ff7600"})):$("",!0)]),_:1}),E(" "+D(e(s).collection_count),1)],8,go)]),_:1})])]),default:r(()=>[e(s).texts.length>0?(c(),g("div",ro,[(c(!0),g(se,null,ie(e(s).texts,O=>(c(),g("span",{key:O.id,class:"post-text",onClick:m[5]||(m[5]=J(Ue=>R(Ue,e(s).id),["stop"])),innerHTML:e(Ce)(O.content).content},null,8,co))),128))])):$("",!0)]),_:1})])}}});const ko={key:0,class:"detail-wrap"},Co={key:1,class:"empty-wrap"},bo={key:1},wo={key:0,class:"skeleton-wrap"},xo={key:1},$o={key:0,class:"empty-wrap"},Eo=T({setup(i){const l=Et(),t=k({}),u=k(!1),f=k(!1),d=k([]),p=L(()=>+l.query.id),_=()=>{t.value={id:0},u.value=!0,Ft({id:p.value}).then(b=>{u.value=!1,t.value=b,n()}).catch(b=>{u.value=!1})},n=(b=!1)=>{d.value.length===0&&(f.value=!0),Pt({id:t.value.id}).then(h=>{d.value=h.list,f.value=!1,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(h=>{f.value=!1})};return ke(()=>{_()}),Bt(p,()=>{p.value>0&&l.name==="post"&&_()}),(b,h)=>{const v=Wt,A=yo,s=Gt,B=Dt,x=Qt,R=oo,S=Ut,H=js,K=Jt;return c(),g("div",null,[a(v,{title:"\u6CE1\u6CE1\u8BE6\u60C5",back:!0}),a(K,{class:"main-content-wrap",bordered:""},{default:r(()=>[a(x,null,{default:r(()=>[a(B,{show:u.value},{default:r(()=>[t.value.id>1?(c(),g("div",ko,[a(A,{post:t.value,onReload:_},null,8,["post"])])):(c(),g("div",Co,[a(s,{size:"large",description:"\u6682\u65E0\u6570\u636E"})]))]),_:1},8,["show"])]),_:1}),t.value.id>0?(c(),I(x,{key:0},{default:r(()=>[a(R,{lock:t.value.is_lock,"post-id":t.value.id,onPostSuccess:h[0]||(h[0]=M=>n(!0))},null,8,["lock","post-id"])]),_:1})):$("",!0),t.value.id>0?(c(),g("div",bo,[f.value?(c(),g("div",wo,[a(S,{num:5})])):(c(),g("div",xo,[d.value.length===0?(c(),g("div",$o,[a(s,{size:"large",description:"\u6682\u65E0\u8BC4\u8BBA\uFF0C\u5FEB\u6765\u62A2\u6C99\u53D1"})])):$("",!0),(c(!0),g(se,null,ie(d.value,M=>(c(),I(x,{key:M.id},{default:r(()=>[a(H,{comment:M,onReload:n},null,8,["comment"])]),_:2},1024))),128))]))])):$("",!0)]),_:1})])}}});var jo=oe(Eo,[["__scopeId","data-v-41747510"]]);export{jo as default};
|