import{d as L,b8 as O,L as P,aU as Q,r as g,f as T,o as m,c as W,h as u,a as t,x,a0 as G,g as _,w as r,q as I,Q as H,k as J,D as K,ba as N,az as R,p as X,l as Y,_ as Z,__tla as $}from"./index-7d5b26d3.js";import{E as aa,__tla as ta}from"./el-image-c9079635.js";import{__tla as ea}from"./el-image-viewer-2f0c9a58.js";import{W as ra,__tla as la}from"./main-6e566452.js";import{U,u as sa,__tla as _a}from"./useUpload-8fce1b59.js";import{u as oa,__tla as ua}from"./useMessage-c81eaa5b.js";import{__tla as ia}from"./index-966eea36.js";import{__tla as ma}from"./index-cdb8fe72.js";import{__tla as ca}from"./main-a6251aa9.js";import{__tla as na}from"./main-21b2f3a7.js";import{__tla as pa}from"./main-0e4d12b4.js";import{__tla as da}from"./index-7f060851.js";import{__tla as ha}from"./index-4dabe3cf.js";import{__tla as fa}from"./formatTime-5152c108.js";let V,ya=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 ha}catch{}})(),(()=>{try{return fa}catch{}})()]).then(async()=>{let i,c,n,p,d;i=l=>(X("data-v-09ea8c50"),l=l(),Y(),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(L({__name:"CoverSelect",props:{modelValue:{type:Object,required:!0},isFirst:{type:Boolean,required:!0}},emits:["update:modelValue"],setup(l,{emit:z}){const h=oa(),w={Authorization:"Bearer "+O()},M=l,k=z,e=P({get:()=>M.modelValue,set(a){k("update:modelValue",a)}}),f=Q("accountId"),s=g(!1),y=g([]),j=T({type:U.Image,accountId:f}),q=a=>{s.value=!1,e.value.thumbMediaId=a.mediaId,e.value.thumbUrl=a.url},B=a=>sa(U.Image,2)(a),C=a=>{if(a.code!==0)return h.error("\u4E0A\u4F20\u51FA\u9519\uFF1A"+a.msg),!1;y.value=[],e.value.thumbMediaId=a.data.mediaId,e.value.thumbUrl=a.data.url},S=a=>{h.error("\u4E0A\u4F20\u5931\u8D25: "+a.message)};return(a,o)=>{const D=aa,F=J,v=K,A=N,E=R;return m(),W("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:G(["avatar-uploader-icon",a.isFirst?"avatar":"avatar1"])},null,8,["class"])),u("div",p,[_(A,{action:"https://sh.letcgo.com/admin-api/mp/material/upload-permanent",headers:w,multiple:"",limit:1,"file-list":t(y),data:t(j),"before-upload":B,"on-error":S,"on-success":C},{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"])]),_(E,{title:"\u9009\u62E9\u56FE\u7247",modelValue:t(s),"onUpdate:modelValue":o[1]||(o[1]=b=>H(s)?s.value=b:null),width:"80%","append-to-body":"","destroy-on-close":""},{default:r(()=>[_(t(ra),{type:"image","account-id":t(f),onSelectMaterial:q},null,8,["account-id"])]),_:1},8,["modelValue"])])])}}}),[["__scopeId","data-v-09ea8c50"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/mp/draft/components/CoverSelect.vue"]])});export{ya as __tla,V as default};
