1 |
- import{bi as oe,bj as se,d as ie,aO as re,J as Y,r as ue,o as u,q as y,w as n,f as e,g as m,c as C,F as ce,n as de,a,Y as Z,t as D,O as _,N as me,_ as pe,B as _e,i as he,dN as fe,U as ve,E as ge,e7 as ye,dQ as Ce,p as we,j as ke,__tla as Ve}from"./index-2eab2d23.js";import{_ as Ue,__tla as be}from"./style.css_vue_type_style_index_0_src_true_lang-2706eaa9.js";import{u as G,__tla as Fe}from"./useMessage-171aa63e.js";import Ne,{__tla as xe}from"./CoverSelect-4a522a9e.js";import{_ as Ie}from"./_plugin-vue_export-helper-1b428a4d.js";let b,H,K,Oe=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return xe}catch{}})()]).then(async()=>{let V,F,N,x,I,O,S,z,E,P,j,M,A,B,T,q,J;V=G(),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,Q){V.alertError(p.message)},customInsert(d,p){p(d.data.url,"image",d.data.url)}}}}),K=()=>({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),N={class:"select-item"},x=["onClick"],I={class:"news-content"},O=["src"],S={class:"news-content-title"},z={key:0,class:"child"},E=["onClick"],P={class:"news-content-item"},j={class:"news-content-item-title"},M={class:"news-content-item-img"},A=["src"],B={class:"child"},T={key:0},q=(h=>(we("data-v-1886bf9c"),h=h(),ke(),h))(()=>m("p",null,"\u6458\u8981:",-1)),J=ie({name:"NewsForm",__name:"NewsForm",props:{isCreating:{type:Boolean},modelValue:{}},emits:["update:modelValue"],setup(h,{emit:U}){const d=G(),p=h,Q=re("accountId"),L=F("https://zxpt.newfeifan.cn/admin-api/mp/material/upload-permanent",Q),$=U,l=Y({get:()=>p.modelValue===null?[{title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}]:p.modelValue,set(o){$("update:modelValue",o)}}),c=ue(0),r=Y(()=>l.value[c.value]),R=o=>{const s=l.value[o];l.value[o]=l.value[o+1],l.value[o+1]=s,c.value=o+1},W=async o=>{try{await d.confirm("\u786E\u5B9A\u5220\u9664\u8BE5\u56FE\u6587\u5417?"),l.value.splice(o,1),c.value===o&&(c.value=0)}catch{}},ee=()=>{l.value.push({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),c.value=l.value.length-1};return(o,s)=>{const v=pe,g=_e,w=he,ae=fe,k=ve,X=ge,le=ye,te=Ce;return u(),y(te,null,{default:n(()=>[e(ae,{width:"40%"},{default:n(()=>[m("div",N,[(u(!0),C(ce,null,de(a(l),(t,i)=>(u(),C("div",{key:i},[i===0?(u(),C("div",{key:0,class:Z(["news-main father",{activeAddNews:a(c)===i}]),onClick:f=>c.value=i},[m("div",I,[m("img",{class:"material-img",src:t.thumbUrl},null,8,O),m("div",S,D(t.title),1)]),a(l).length>1?(u(),C("div",z,[e(g,{type:"info",circle:"",size:"small",onClick:()=>R(i)},{default:n(()=>[e(v,{icon:"ep:arrow-down-bold"})]),_:2},1032,["onClick"]),o.isCreating?(u(),y(g,{key:0,type:"danger",circle:"",size:"small",onClick:()=>W(i)},{default:n(()=>[e(v,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])):_("",!0)],10,x)):_("",!0),i>0?(u(),C("div",{key:1,class:Z(["news-main-item father",{activeAddNews:a(c)===i}]),onClick:f=>c.value=i},[m("div",P,[m("div",j,D(t.title),1),m("div",M,[m("img",{class:"material-img",src:t.thumbUrl,width:"100%"},null,8,A)])]),m("div",B,[a(l).length>i+1?(u(),y(g,{key:0,circle:"",type:"info",size:"small",onClick:()=>R(i)},{default:n(()=>[e(v,{icon:"ep:arrow-down-bold"})]),_:2},1032,["onClick"])):_("",!0),i>0?(u(),y(g,{key:1,type:"info",circle:"",size:"small",onClick:()=>(f=>{const ne=l.value[f];l.value[f]=l.value[f-1],l.value[f-1]=ne,c.value=f-1})(i)},{default:n(()=>[e(v,{icon:"ep:arrow-up-bold"})]),_:2},1032,["onClick"])):_("",!0),o.isCreating?(u(),y(g,{key:2,type:"danger",size:"small",circle:"",onClick:()=>W(i)},{default:n(()=>[e(v,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])],10,E)):_("",!0)]))),128)),e(w,{justify:"center",class:"ope-row"},{default:n(()=>[a(l).length<8&&o.isCreating?(u(),y(g,{key:0,type:"primary",circle:"",onClick:ee},{default:n(()=>[e(v,{icon:"ep:plus"})]),_:1})):_("",!0)]),_:1})])]),_:1}),e(le,null,{default:n(()=>[a(l).length>0?(u(),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(X,{span:12},{default:n(()=>[e(Ne,{modelValue:a(r),"onUpdate:modelValue":s[3]||(s[3]=t=>me(r)?r.value=t:null),"is-first":a(c)===0},null,8,["modelValue","is-first"])]),_:1}),e(X,{span:12},{default:n(()=>[q,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(L)},null,8,["modelValue","editor-config"])]),_:1})])):_("",!0)]),_:1})]),_:1})}}}),b=Ie(J,[["__scopeId","data-v-1886bf9c"]]),H=Object.freeze(Object.defineProperty({__proto__:null,default:b},Symbol.toStringTag,{value:"Module"}))});export{b as N,Oe as __tla,H as a,K as c};
|