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