NewsForm-5f3b3e18.js 6.0 KB

1
  1. import{b0 as oe,b1 as se,d as ie,bL as re,K as W,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 as l,Z as X,t as Y,P as _,O as me,j as pe,C as _e,i as ge,dR as ve,V as fe,E as he,eb as ye,dU as Ce,p as we,k as ke,_ as Ve,__tla as be}from"./index-00b1998d.js";import{_ as Ue,__tla as ze}from"./Editor-f30dab21.js";import{u as Z,__tla as Fe}from"./useMessage-437e6444.js";import xe,{__tla as Se}from"./CoverSelect-8695fad9.js";let z,G,H,Ne=Promise.all([(()=>{try{return be}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Se}catch{}})()]).then(async()=>{let V,F,x,S,N,O,I,P,E,M,j,A,q,B,T,D,K;V=Z(),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)}}}}),H=()=>({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),x={class:"select-item"},S=["onClick"],N={class:"news-content"},O=["src"],I={class:"news-content-title"},P={key:0,class:"child"},E=["onClick"],M={class:"news-content-item"},j={class:"news-content-item-title"},A={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=Z(),c=g,U=re("accountId"),J=F("https://zxpt.newfeifan.cn/admin-api/mp/material/upload-permanent",U),$=b,a=W({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=W(()=>a.value[m.value]),L=s=>{const i=a.value[s];a.value[s]=a.value[s+1],a.value[s+1]=i,m.value=s+1},Q=async s=>{try{await n.confirm("\u786E\u5B9A\u5220\u9664\u8BE5\u56FE\u6587\u5417?"),a.value.splice(s,1),m.value===s&&(m.value=0)}catch{}},ee=()=>{a.value.push({title:"",thumbMediaId:"",author:"",digest:"",showCoverPic:"",content:"",contentSourceUrl:"",needOpenComment:"",onlyFansCanComment:"",thumbUrl:""}),m.value=a.value.length-1};return(s,i)=>{const f=pe,h=_e,w=ge,le=ve,k=fe,R=he,ae=ye,te=Ce;return d(),y(te,null,{default:o(()=>[e(le,{width:"40%"},{default:o(()=>[p("div",x,[(d(!0),C(ce,null,de(l(a),(t,r)=>(d(),C("div",{key:r},[r===0?(d(),C("div",{key:0,class:X(["news-main father",{activeAddNews:l(m)===r}]),onClick:v=>m.value=r},[p("div",N,[p("img",{class:"material-img",src:t.thumbUrl},null,8,O),p("div",I,Y(t.title),1)]),l(a).length>1?(d(),C("div",P,[e(h,{type:"info",circle:"",size:"small",onClick:()=>L(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:()=>Q(r)},{default:o(()=>[e(f,{icon:"ep:delete"})]),_:2},1032,["onClick"])):_("",!0)])):_("",!0)],10,S)):_("",!0),r>0?(d(),C("div",{key:1,class:X(["news-main-item father",{activeAddNews:l(m)===r}]),onClick:v=>m.value=r},[p("div",M,[p("div",j,Y(t.title),1),p("div",A,[p("img",{class:"material-img",src:t.thumbUrl,width:"100%"},null,8,q)])]),p("div",B,[l(a).length>r+1?(d(),y(h,{key:0,circle:"",type:"info",size:"small",onClick:()=>L(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=a.value[v];a.value[v]=a.value[v-1],a.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:()=>Q(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(()=>[l(a).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(ae,null,{default:o(()=>[l(a).length>0?(d(),C("div",T,[e(w,{gutter:20},{default:o(()=>[e(k,{modelValue:l(u).title,"onUpdate:modelValue":i[0]||(i[0]=t=>l(u).title=t),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF08\u5FC5\u586B\uFF09"},null,8,["modelValue"]),e(k,{modelValue:l(u).author,"onUpdate:modelValue":i[1]||(i[1]=t=>l(u).author=t),placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005",style:{"margin-top":"5px"}},null,8,["modelValue"]),e(k,{modelValue:l(u).contentSourceUrl,"onUpdate:modelValue":i[2]||(i[2]=t=>l(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(R,{span:12},{default:o(()=>[e(xe,{modelValue:l(u),"onUpdate:modelValue":i[3]||(i[3]=t=>me(u)?u.value=t:null),"is-first":l(m)===0},null,8,["modelValue","is-first"])]),_:1}),e(R,{span:12},{default:o(()=>[D,e(k,{rows:8,type:"textarea",modelValue:l(u).digest,"onUpdate:modelValue":i[4]||(i[4]=t=>l(u).digest=t),placeholder:"\u8BF7\u8F93\u5165\u6458\u8981",class:"digest",maxlength:"120"},null,8,["modelValue"])]),_:1})]),_:1}),e(w,null,{default:o(()=>[e(l(Ue),{modelValue:l(u).content,"onUpdate:modelValue":i[5]||(i[5]=t=>l(u).content=t),"editor-config":l(J)},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"]]),G=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}))});export{z as N,Ne as __tla,G as a,H as c};