CoverSelect-723ec630.js 3.5 KB

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