1 |
- import{bj as oe,bk as se,d as ie,aP as re,K as X,r as ue,o as d,v as y,w as o,f as e,g as p,c as C,F as ce,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 ve,V as fe,E as he,ea as ye,dT as Ce,p as we,k as ke,_ as Ve,__tla as be}from"./index-89fa41f9.js";import{_ as Ue,__tla as ze}from"./Editor-e4651bd8.js";import{u as G,__tla as Fe}from"./useMessage-fcfad84c.js";import xe,{__tla as Ne}from"./CoverSelect-4941e37e.js";let z,H,J,Se=Promise.all([(()=>{try{return be}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Ne}catch{}})()]).then(async()=>{let V,F,x,N,S,O,P,I,E,j,A,M,q,B,T,D,K;V=G(),F=(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,c){console.log("onSuccess",n,c)},onFailed(n,c){V.alertError(c.message),console.log("onFailed",n,c)},onError(n,c,U){V.alertError(c.message),console.error("onError",n,c,U)},customInsert(n,c){c(n.data.url,"image",n.data.url)}}}}),J=()=>({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),x={class:"select-item"},N=["onClick"],S={class:"news-content"},O=["src"],P={class:"news-content-title"},I={key:0,class:"child"},E=["onClick"],j={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(),c=g,U=re("accountId"),L=F("https://zxpt.newfeifan.cn/admin-api/mp/material/upload-permanent",U),$=b,l=X({get:()=>c.modelValue===null?[{title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}]:c.modelValue,set(s){$("update:modelValue",s)}}),m=ue(0),u=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 f=pe,h=_e,w=ge,ae=ve,k=fe,W=he,le=ye,te=Ce;return d(),y(te,null,{default:o(()=>[e(ae,{width:"40%"},{default:o(()=>[p("div",x,[(d(!0),C(ce,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:v=>m.value=r},[p("div",S,[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(h,{type:"info",circle:"",size:"small",onClick:()=>Q(r)},{default:o(()=>[e(f,{icon:"ep:arrow-down-bold"})]),_:2},1032,["onClick"]),s.isCreating?(d(),y(h,{key:0,type:"danger",circle:"",size:"small",onClick:()=>R(r)},{default:o(()=>[e(f,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])):_("",!0)],10,N)):_("",!0),r>0?(d(),C("div",{key:1,class:Y(["news-main-item father",{activeAddNews:a(m)===r}]),onClick:v=>m.value=r},[p("div",j,[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(h,{key:0,circle:"",type:"info",size:"small",onClick:()=>Q(r)},{default:o(()=>[e(f,{icon:"ep:arrow-down-bold"})]),_:2},1032,["onClick"])):_("",!0),r>0?(d(),y(h,{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,m.value=v-1})(r)},{default:o(()=>[e(f,{icon:"ep:arrow-up-bold"})]),_:2},1032,["onClick"])):_("",!0),s.isCreating?(d(),y(h,{key:2,type:"danger",size:"small",circle:"",onClick:()=>R(r)},{default:o(()=>[e(f,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])],10,E)):_("",!0)]))),128)),e(w,{justify:"center",class:"ope-row"},{default:o(()=>[a(l).length<8&&s.isCreating?(d(),y(h,{key:0,type:"primary",circle:"",onClick:ee},{default:o(()=>[e(f,{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(u).title,"onUpdate:modelValue":i[0]||(i[0]=t=>a(u).title=t),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF08\u5FC5\u586B\uFF09"},null,8,["modelValue"]),e(k,{modelValue:a(u).author,"onUpdate:modelValue":i[1]||(i[1]=t=>a(u).author=t),placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005",style:{"margin-top":"5px"}},null,8,["modelValue"]),e(k,{modelValue:a(u).contentSourceUrl,"onUpdate:modelValue":i[2]||(i[2]=t=>a(u).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(xe,{modelValue:a(u),"onUpdate:modelValue":i[3]||(i[3]=t=>me(u)?u.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(u).digest,"onUpdate:modelValue":i[4]||(i[4]=t=>a(u).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(u).content,"onUpdate:modelValue":i[5]||(i[5]=t=>a(u).content=t),"editor-config":a(L)},null,8,["modelValue","editor-config"])]),_:1})])):_("",!0)]),_:1})]),_:1})}}}),z=Ve(K,[["__scopeId","data-v-3b275aea"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mp/draft/components/NewsForm.vue"]]),H=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}))});export{z as N,Se as __tla,H as a,J as c};
|