CoverSelect-d41ebda5.js 3.5 KB

1
  1. import{d as W,b7 as D,e as G,aU as P,r as g,f as T,o as i,c as $,k as m,a as t,j as I,a0 as H,i as _,w as e,m as V,R as J,_ as K,q as L,b9 as N,az as O,v as Q,x as X,__tla as Y}from"./index-1e808f2e.js";import{E as Z,__tla as aa}from"./el-image-263fb014.js";import{__tla as ta}from"./el-image-viewer-dddb6285.js";import{W as ra,__tla as ea}from"./main-7080b19d.js";import{U as x,u as la,__tla as sa}from"./useUpload-3083c231.js";import{u as _a,__tla as oa}from"./useMessage-5f9e8917.js";import{_ as ma}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as ua}from"./index.vue_vue_type_script_setup_true_lang-571824c6.js";import{__tla as ia}from"./index-73afebcf.js";import{__tla as ca}from"./main-fae03c69.js";import{__tla as da}from"./main-c2ebd06d.js";import{__tla as pa}from"./main.vue_vue_type_script_setup_true_lang-068c3b56.js";import{__tla as na}from"./index-1a14fda3.js";import{__tla as ha}from"./index-6e04feee.js";import{__tla as ya}from"./formatTime-a348c3be.js";let U,fa=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ya}catch{}})()]).then(async()=>{let u,c,d,p,n;u=l=>(Q("data-v-9d295cb2"),l=l(),X(),l),c=u(()=>m("p",null,"\u5C01\u9762:",-1)),d={class:"thumb-div"},p={class:"thumb-but"},n=u(()=>m("div",{class:"el-upload__tip"},"\u652F\u6301 bmp/png/jpeg/jpg/gif \u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7 2M",-1)),U=ma(W({__name:"CoverSelect",props:{modelValue:{},isFirst:{type:Boolean}},emits:["update:modelValue"],setup(l,{emit:k}){const h=_a(),w={Authorization:"Bearer "+D()},z=l,M=k,r=G({get:()=>z.modelValue,set(a){M("update:modelValue",a)}}),y=P("accountId"),s=g(!1),f=g([]),j=T({type:x.Image,accountId:y}),S=a=>{s.value=!1,r.value.thumbMediaId=a.mediaId,r.value.thumbUrl=a.url},B=a=>la(x.Image,2)(a),C=a=>{if(a.code!==0)return h.error("\u4E0A\u4F20\u51FA\u9519\uFF1A"+a.msg),!1;f.value=[],r.value.thumbMediaId=a.data.mediaId,r.value.thumbUrl=a.data.url},F=a=>{h.error("\u4E0A\u4F20\u5931\u8D25: "+a.message)};return(a,o)=>{const q=Z,A=K,v=L,E=N,R=O;return i(),$("div",null,[c,m("div",d,[t(r).thumbUrl?(i(),I(q,{key:0,style:{width:"300px","max-height":"300px"},src:t(r).thumbUrl,fit:"contain"},null,8,["src"])):(i(),I(A,{key:1,icon:"ep:plus",class:H(["avatar-uploader-icon",a.isFirst?"avatar":"avatar1"])},null,8,["class"])),m("div",p,[_(E,{action:"https://sh.letcgo.com/admin-api/mp/material/upload-permanent",headers:w,multiple:"",limit:1,"file-list":t(f),data:t(j),"before-upload":B,"on-error":F,"on-success":C},{trigger:e(()=>[_(v,{size:"small",type:"primary"},{default:e(()=>[V("\u672C\u5730\u4E0A\u4F20")]),_:1})]),tip:e(()=>[n]),default:e(()=>[_(v,{size:"small",type:"primary",onClick:o[0]||(o[0]=b=>s.value=!0),style:{"margin-left":"5px"}},{default:e(()=>[V(" \u7D20\u6750\u5E93\u9009\u62E9 ")]),_:1})]),_:1},8,["file-list","data"])]),_(R,{title:"\u9009\u62E9\u56FE\u7247",modelValue:t(s),"onUpdate:modelValue":o[1]||(o[1]=b=>J(s)?s.value=b:null),width:"80%","append-to-body":"","destroy-on-close":""},{default:e(()=>[_(t(ra),{type:"image","account-id":t(y),onSelectMaterial:S},null,8,["account-id"])]),_:1},8,["modelValue"])])])}}}),[["__scopeId","data-v-9d295cb2"]])});export{fa as __tla,U as default};