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/Home-37cbe774.js

2 lines
12 KiB

2 years ago
import{_ as $e}from"./post-item.vue_vue_type_style_index_0_lang-09a3d19d.js";import{_ as qe}from"./post-skeleton-fdd699ea.js";import{d as Q,r as l,j as X,o as _,c as y,Y as T,a as q,L as t,$ as s,K as N,O as $,a0 as G,e as E,M as J,F as Y,a2 as W,n as xe,w as Ie}from"./@vue-ca177dbe.js";import{u as ee}from"./vuex-d28e9067.js";import{l as Z}from"./lodash-94eb5868.js";import{g as ze,a as Ue,c as Re,b as Ae,_ as Ee}from"./index-71354138.js";import{p as Le}from"./content-3f1d28f2.js";import{V as z,P as S}from"./IEnum-a180d93e.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Fe}from"./@vicons-6d35273b.js";import{o as Be,v as Oe,j as Me,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Ze,C as Qe,a as Xe,D as Ye,E as We,F as et,G as tt,H as at,I as ot}from"./naive-ui-2035804c.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{b as st,u as lt}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./nonesir-video-db921567.js";const it=V=>{const x=new FileReader,i=p=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(p),I=()=>{const p=new Uint8Array(x.result).subarray(0,4);let m="";for(let c=0;c<p.length;c++)m+=p[c].toString(16);switch(m){case"504b0304":case"504b0506":case"504b0708":return i("application/zip");case"504b030414":return i("application/x-zip-compressed");case"504b0508":return i("application/x-zip");case"504b5370":return i("application/octet-stream");default:return!1}};return new Promise((p,m)=>{x.onloadend=()=>{const c=V.type;p(c===""||c==="application/octet-stream"?I():i(c))},x.readAsArrayBuffer(V.slice(0,4))})},rt={key:0,class:"compose-wrap"},ut={class:"compose-line"},ct={class:"compose-user"},pt={class:"compose-line compose-options"},_t={class:"attachment"},dt={class:"submit-wrap"},mt={class:"attachment-list-wrap"},vt={key:0,class:"attachment-price-wrap"},gt=q("span",null," 附件价格¥",-1),ft={key:0,class:"eye-wrap"},yt={key:1,class:"link-wrap"},ht={key:1,class:"compose-wrap"},wt=q("div",{class:"login-wrap"},[q("span",{class:"login-banner"}," 登录后,精彩更多")],-1),bt={key:0,class:"login-only-wrap"},kt={key:1,class:"login-wrap"},Ct=Q({__name:"compose",emits:["post-success"],setup(V,{emit:x}){const i=ee(),I=l([]),p=l(!1),m=l(!1),c=l(!1),w=l(!1),b=l(""),U=l([]),A=l(),L=l(0),g=l("public/image"),r=l([]),h=l([]),k=l([]),f=l([]),C=l(z.FRIEND),R=l(z.FRIEND),O=[{value:z.PUBLIC,label:"公开"},{value:z.PRIVATE,label:"私密"},{value:z.FRIEND,label:"好友可见"}],P=+"300",F=l("true".toLowerCase()==="true"),M=l("true".toLowerCase()==="true"),B=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",K=l(),ne=()=>{c.value=!c.value,c.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&c.value&&(c.value=!1)},le=Z.debounce(a=>{ze({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,p.value=!1}).catch(e=>{p.value=!1})},200),ie=Z.debounce(a=>{Ue({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,p.value=!1}).catch(e=>{p.value=!1})},200),re=(a,e)=>{p.value||(p.value=!0,e==="@"?le(a):ie(a))},ue=a=>{a.length>P||(b.value=a)},D=a=>{g.value=a},ce=a=>{r.value=a},pe=async a=>{var e,n,o,u,v;return g.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):g.value==="image"&&((n=a.file.file)==nul