|
|
|
|
import{_ as qe}from"./post-item.vue_vue_type_style_index_0_lang-c10c9b1f.js";import{_ as Ie}from"./post-skeleton-5a0f0b44.js";import{d as Q,r as l,j as X,o as c,c as v,U as $,a as I,L as t,Y as s,K as N,O as q,Z as K,e as z,M as G,F as Y,$ as Z,n as Te,w as Ue}from"./@vue-f70ab1bd.js";import{u as W}from"./vuex-cc1858c6.js";import{l as J}from"./lodash-3329902d.js";import{g as xe,a as Ee,c as Re,b as Le,_ as ze}from"./index-944cdad3.js";import{p as Ae}from"./content-d22bf7c6.js";import{V as T,P as S}from"./IEnum-ea67d3af.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Be}from"./@vicons-477062ff.js";import{o as Oe,v as Me,j as Fe,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Qe,C as Xe,a as Ye,D as Ze,E as We,F as et,G as tt,H as at,I as ot}from"./naive-ui-f5d716a8.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-44680fda.js";import{b as st,u as lt}from"./vue-router-29025daf.js";import"./formatTime-fb8b4c0f.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-ca358197.js";import"./toggle-selection-93f4ad84.js";import"./axios-707ed124.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-804c4158.js";import"./evtd-b614532e.js";import"./@css-render-66126308.js";import"./vooks-dfdd6eef.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-29a967e9.js";const it={key:0,class:"compose-wrap"},ut={class:"compose-line"},rt={class:"compose-user"},ct={class:"compose-line compose-options"},pt={class:"attachment"},_t={class:"submit-wrap"},dt={class:"attachment-list-wrap"},mt={key:0,class:"attachment-price-wrap"},vt=I("span",null," 附件价格¥",-1),gt={key:0,class:"eye-wrap"},ft={key:1,class:"link-wrap"},yt={key:1,class:"compose-wrap"},ht=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),wt={key:0,class:"login-only-wrap"},bt={key:1,class:"login-wrap"},kt=Q({__name:"compose",emits:["post-success"],setup(ee,{emit:V}){const r=W(),E=l([]),y=l(!1),h=l(!1),f=l(!1),w=l(!1),b=l(""),U=l([]),R=l(),A=l(0),d=l("public/image"),i=l([]),g=l([]),k=l([]),m=l([]),C=l(T.FRIEND),x=l(T.FRIEND),M=[{value:T.PUBLIC,label:"公开"},{value:T.PRIVATE,label:"私密"},{value:T.FRIEND,label:"好友可见"}],P=+"300",B=l("true".toLowerCase()==="true"),F=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",H=l(),ne=()=>{f.value=!f.value,f.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&f.value&&(f.value=!1)},le=J.debounce(a=>{xe({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ie=J.debounce(a=>{Ee({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),E.value=n,y.value=!1}).catch(e=>{y.value=!1})},200),ue=(a,e)=>{y.value||(y.value=!0,e==="@"?le(a):ie(a))},re=a=>{a.length>P||(b.value=a)},D=a=>{d.value=a},ce=a=>{i.value=a},pe=async a=>{var e,n,o,u,_,L;return d.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):d.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((u=a.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!["application/zip"].includes((_=a.file.file)==null?void 0:_.type)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((L=a.file.file)==null?void 0:L.size)>104857600?(window.$message.warning("附件大小不能超<EFBFBD><EFBFBD>
|