1 |
- import{c_ as oe,c$ as se,d as ie,i as re,e as R,r as ce,o as c,C as y,A as n,f as e,B as m,c as C,F as ue,Q as de,a,ac as X,E as Y,a2 as _,a1 as me,_ as pe,J as _e,K as he,dT as ve,a8 as fe,H as ge,e8 as ye,dW as Ce,L as we,M as ke,__tla as Ve}from"./index-a9d538d5.js";import{_ as Ue,__tla as be}from"./style.css_vue_type_style_index_0_src_true_lang-0456a07b.js";import{u as $,__tla as Fe}from"./useMessage-d5cbbfad.js";import Se,{__tla as xe}from"./CoverSelect-4e2c5e02.js";import{_ as Ie}from"./_plugin-vue_export-helper-1b428a4d.js";let b,q,D,Ne=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return xe}catch{}})()]).then(async()=>{let V,F,S,x,I,N,z,M,O,A,P,E,j,B,T,W,H;V=$(),F=(h,U)=>({MENU_CONF:{uploadImage:{server:h,maxFileSize:5242880,maxNumberOfFiles:10,allowedFileTypes:["image/*"],meta:{accountId:U,type:"image"},metaWithUrl:!0,headers:{Accept:"*",Authorization:"Bearer "+oe(),"tenant-id":se()},withCredentials:!0,timeout:5e3,fieldName:"file",onBeforeUpload:d=>d,onProgress(d){},onSuccess(d,p){},onFailed(d,p){V.alertError(p.message)},onError(d,p,J){V.alertError(p.message)},customInsert(d,p){p(d.data.url,"image",d.data.url)}}}}),D=()=>({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),S={class:"select-item"},x=["onClick"],I={class:"news-content"},N=["src"],z={class:"news-content-title"},M={key:0,class:"child"},O=["onClick"],A={class:"news-content-item"},P={class:"news-content-item-title"},E={class:"news-content-item-img"},j=["src"],B={class:"child"},T={key:0},W=(h=>(we("data-v-1886bf9c"),h=h(),ke(),h))(()=>m("p",null,"\u6458\u8981:",-1)),H=ie({name:"NewsForm",__name:"NewsForm",props:{isCreating:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(h,{emit:U}){const d=$(),p=h,J=re("accountId"),G=F("https://pt.letcgo.com/admin-api/mp/material/upload-permanent",J),Z=U,l=R({get:()=>p.modelValue===null?[{title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}]:p.modelValue,set(o){Z("update:modelValue",o)}}),u=ce(0),r=R(()=>l.value[u.value]),K=o=>{const s=l.value[o];l.value[o]=l.value[o+1],l.value[o+1]=s,u.value=o+1},L=async o=>{try{await d.confirm("\u786E\u5B9A\u5220\u9664\u8BE5\u56FE\u6587\u5417?"),l.value.splice(o,1),u.value===o&&(u.value=0)}catch{}},ee=()=>{l.value.push({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),u.value=l.value.length-1};return(o,s)=>{const f=pe,g=_e,w=he,ae=ve,k=fe,Q=ge,le=ye,te=Ce;return c(),y(te,null,{default:n(()=>[e(ae,{width:"40%"},{default:n(()=>[m("div",S,[(c(!0),C(ue,null,de(a(l),(t,i)=>(c(),C("div",{key:i},[i===0?(c(),C("div",{key:0,class:X(["news-main father",{activeAddNews:a(u)===i}]),onClick:v=>u.value=i},[m("div",I,[m("img",{class:"material-img",src:t.thumbUrl},null,8,N),m("div",z,Y(t.title),1)]),a(l).length>1?(c(),C("div",M,[e(g,{type:"info",circle:"",size:"small",onClick:()=>K(i)},{default:n(()=>[e(f,{icon:"ep:arrow-down-bold"})]),_:2},1032,["onClick"]),o.isCreating?(c(),y(g,{key:0,type:"danger",circle:"",size:"small",onClick:()=>L(i)},{default:n(()=>[e(f,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])):_("",!0)],10,x)):_("",!0),i>0?(c(),C("div",{key:1,class:X(["news-main-item father",{activeAddNews:a(u)===i}]),onClick:v=>u.value=i},[m("div",A,[m("div",P,Y(t.title),1),m("div",E,[m("img",{class:"material-img",src:t.thumbUrl,width:"100%"},null,8,j)])]),m("div",B,[a(l).length>i+1?(c(),y(g,{key:0,circle:"",type:"info",size:"small",onClick:()=>K(i)},{default:n(()=>[e(f,{icon:"ep:arrow-down-bold"})]),_:2},1032,["onClick"])):_("",!0),i>0?(c(),y(g,{key:1,type:"info",circle:"",size:"small",onClick:()=>(v=>{const ne=l.value[v];l.value[v]=l.value[v-1],l.value[v-1]=ne,u.value=v-1})(i)},{default:n(()=>[e(f,{icon:"ep:arrow-up-bold"})]),_:2},1032,["onClick"])):_("",!0),o.isCreating?(c(),y(g,{key:2,type:"danger",size:"small",circle:"",onClick:()=>L(i)},{default:n(()=>[e(f,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])],10,O)):_("",!0)]))),128)),e(w,{justify:"center",class:"ope-row"},{default:n(()=>[a(l).length<8&&o.isCreating?(c(),y(g,{key:0,type:"primary",circle:"",onClick:ee},{default:n(()=>[e(f,{icon:"ep:plus"})]),_:1})):_("",!0)]),_:1})])]),_:1}),e(le,null,{default:n(()=>[a(l).length>0?(c(),C("div",T,[e(w,{gutter:20},{default:n(()=>[e(k,{modelValue:a(r).title,"onUpdate:modelValue":s[0]||(s[0]=t=>a(r).title=t),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF08\u5FC5\u586B\uFF09"},null,8,["modelValue"]),e(k,{modelValue:a(r).author,"onUpdate:modelValue":s[1]||(s[1]=t=>a(r).author=t),placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005",style:{"margin-top":"5px"}},null,8,["modelValue"]),e(k,{modelValue:a(r).contentSourceUrl,"onUpdate:modelValue":s[2]||(s[2]=t=>a(r).contentSourceUrl=t),placeholder:"\u8BF7\u8F93\u5165\u539F\u6587\u5730\u5740",style:{"margin-top":"5px"}},null,8,["modelValue"])]),_:1}),e(w,{gutter:20},{default:n(()=>[e(Q,{span:12},{default:n(()=>[e(Se,{modelValue:a(r),"onUpdate:modelValue":s[3]||(s[3]=t=>me(r)?r.value=t:null),"is-first":a(u)===0},null,8,["modelValue","is-first"])]),_:1}),e(Q,{span:12},{default:n(()=>[W,e(k,{rows:8,type:"textarea",modelValue:a(r).digest,"onUpdate:modelValue":s[4]||(s[4]=t=>a(r).digest=t),placeholder:"\u8BF7\u8F93\u5165\u6458\u8981",class:"digest",maxlength:"120"},null,8,["modelValue"])]),_:1})]),_:1}),e(w,null,{default:n(()=>[e(a(Ue),{modelValue:a(r).content,"onUpdate:modelValue":s[5]||(s[5]=t=>a(r).content=t),"editor-config":a(G)},null,8,["modelValue","editor-config"])]),_:1})])):_("",!0)]),_:1})]),_:1})}}}),b=Ie(H,[["__scopeId","data-v-1886bf9c"]]),q=Object.freeze(Object.defineProperty({__proto__:null,default:b},Symbol.toStringTag,{value:"Module"}))});export{b as N,Ne as __tla,q as a,D as c};
|