import{d as E,bB as G,Y as H,aR as T,r as g,e as W,o as m,c as O,g as u,a as t,x,T as P,f as _,w as r,y as I,l as X,j as Y,G as J,bD as K,bk as L,p as N,k as Q,_ as Z,__tla as $}from"./index-8dc1e40a.js";import{E as aa,__tla as ta}from"./el-image-6a48e9f1.js";import{__tla as ea}from"./el-image-viewer-3b8905e6.js";import{W as ra,__tla as la}from"./main-69d14ed2.js";import{U,u as sa,__tla as _a}from"./useUpload-18ed0543.js";import{u as oa,__tla as ua}from"./useMessage-7a27dd80.js";import{__tla as ia}from"./index-64aeaa78.js";import{__tla as ma}from"./index-803dbf9a.js";import{__tla as ca}from"./main-a65bb27b.js";import{__tla as na}from"./main-e9c0874d.js";import{__tla as pa}from"./main-e0b1ced1.js";import{__tla as da}from"./index-e8092043.js";import{__tla as fa}from"./index-df9490d5.js";import{__tla as ya}from"./formatTime-8a155b2e.js";let V,ha=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return ya}catch{}})()]).then(async()=>{let i,c,n,p,d;i=l=>(N("data-v-09ea8c50"),l=l(),Q(),l),c=i(()=>u("p",null,"\u5C01\u9762:",-1)),n={class:"thumb-div"},p={class:"thumb-but"},d=i(()=>u("div",{class:"el-upload__tip"},"\u652F\u6301 bmp/png/jpeg/jpg/gif \u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7 2M",-1)),V=Z(E({__name:"CoverSelect",props:{modelValue:{type:Object,required:!0},isFirst:{type:Boolean,required:!0}},emits:["update:modelValue"],setup(l,{emit:k}){const f=oa(),w={Authorization:"Bearer "+G()},z=l,j=k,e=H({get:()=>z.modelValue,set(a){j("update:modelValue",a)}}),y=T("accountId"),s=g(!1),h=g([]),C=W({type:U.Image,accountId:y}),M=a=>{s.value=!1,e.value.thumbMediaId=a.mediaId,e.value.thumbUrl=a.url},B=a=>sa(U.Image,2)(a),S=a=>{if(a.code!==0)return f.error("\u4E0A\u4F20\u51FA\u9519\uFF1A"+a.msg),!1;h.value=[],e.value.thumbMediaId=a.data.mediaId,e.value.thumbUrl=a.data.url},q=a=>{f.error("\u4E0A\u4F20\u5931\u8D25: "+a.message)};return(a,o)=>{const D=aa,F=Y,v=J,R=K,A=L;return m(),O("div",null,[c,u("div",n,[t(e).thumbUrl?(m(),x(D,{key:0,style:{width:"300px","max-height":"300px"},src:t(e).thumbUrl,fit:"contain"},null,8,["src"])):(m(),x(F,{key:1,icon:"ep:plus",class:P(["avatar-uploader-icon",a.isFirst?"avatar":"avatar1"])},null,8,["class"])),u("div",p,[_(R,{action:"https://zxpt.newfeifan.cn/admin-api/mp/material/upload-permanent",headers:w,multiple:"",limit:1,"file-list":t(h),data:t(C),"before-upload":B,"on-error":q,"on-success":S},{trigger:r(()=>[_(v,{size:"small",type:"primary"},{default:r(()=>[I("\u672C\u5730\u4E0A\u4F20")]),_:1})]),tip:r(()=>[d]),default:r(()=>[_(v,{size:"small",type:"primary",onClick:o[0]||(o[0]=b=>s.value=!0),style:{"margin-left":"5px"}},{default:r(()=>[I(" \u7D20\u6750\u5E93\u9009\u62E9 ")]),_:1})]),_:1},8,["file-list","data"])]),_(A,{title:"\u9009\u62E9\u56FE\u7247",modelValue:t(s),"onUpdate:modelValue":o[1]||(o[1]=b=>X(s)?s.value=b:null),width:"80%","append-to-body":"","destroy-on-close":""},{default:r(()=>[_(t(ra),{type:"image","account-id":t(y),onSelectMaterial:M},null,8,["account-id"])]),_:1},8,["modelValue"])])])}}}),[["__scopeId","data-v-09ea8c50"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mp/draft/components/CoverSelect.vue"]])});export{ha as __tla,V as default};
