TabImage-ce08097d.js 3.6 KB

1
  1. import{d as S,b7 as T,e as W,r as k,f as D,o as c,c as m,a as r,k as n,t as F,l as G,i as e,w as l,j as P,m as j,R as $,_ as H,q as J,s as K,az as L,E as N,b9 as O,v as Q,x as X,__tla as Y}from"./index-1e808f2e.js";import{W as Z,__tla as aa}from"./main-7080b19d.js";import{u as ta,U as ea,__tla as la}from"./useUpload-3083c231.js";import{u as ra,__tla as sa}from"./useMessage-5f9e8917.js";import{_ as _a}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as oa}from"./index.vue_vue_type_script_setup_true_lang-571824c6.js";import{__tla as ca}from"./index-73afebcf.js";import{__tla as ua}from"./main-fae03c69.js";import{__tla as ia}from"./el-image-263fb014.js";import{__tla as ma}from"./el-image-viewer-dddb6285.js";import{__tla as na}from"./main-c2ebd06d.js";import{__tla as da}from"./main.vue_vue_type_script_setup_true_lang-068c3b56.js";import{__tla as pa}from"./index-1a14fda3.js";import{__tla as fa}from"./index-6e04feee.js";import{__tla as ya}from"./formatTime-a348c3be.js";let w,ha=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return ya}catch{}})()]).then(async()=>{let d,p,f,y;d={key:0,class:"select-item"},p=["src"],f={key:0,class:"item-name"},y=(s=>(Q("data-v-675b1d7d"),s=s(),X(),s))(()=>n("span",null,[n("div",{class:"el-upload__tip"},"\u652F\u6301 bmp/png/jpeg/jpg/gif \u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7 2M")],-1)),w=_a(S({__name:"TabImage",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:x}){const U=ra(),z={Authorization:"Bearer "+T()},A=s,C=x,a=W({get:()=>A.modelValue,set:t=>C("update:modelValue",t)}),_=k(!1),h=k([]),u=D({accountId:a.value.accountId,type:"image",title:"",introduction:""}),M=t=>ta(ea.Image,2)(t),q=t=>{if(t.code!==0)return U.error("\u4E0A\u4F20\u51FA\u9519\uFF1A"+t.msg),!1;h.value=[],u.title="",u.introduction="",v(t.data)},B=()=>{a.value.mediaId=null,a.value.url=null,a.value.name=null},v=t=>{_.value=!1,a.value.mediaId=t.mediaId,a.value.url=t.url,a.value.name=t.name};return(t,o)=>{const g=H,i=J,I=K,E=L,V=N,R=O;return c(),m("div",null,[r(a).url?(c(),m("div",d,[n("img",{class:"material-img",src:r(a).url},null,8,p),r(a).name?(c(),m("p",f,F(r(a).name),1)):G("",!0),e(I,{class:"ope-row",justify:"center"},{default:l(()=>[e(i,{type:"danger",circle:"",onClick:B},{default:l(()=>[e(g,{icon:"ep:delete"})]),_:1})]),_:1})])):(c(),P(I,{key:1,style:{"text-align":"center"},align:"middle"},{default:l(()=>[e(V,{span:12,class:"col-select"},{default:l(()=>[e(i,{type:"success",onClick:o[0]||(o[0]=b=>_.value=!0)},{default:l(()=>[j(" \u7D20\u6750\u5E93\u9009\u62E9 "),e(g,{icon:"ep:circle-check"})]),_:1}),e(E,{title:"\u9009\u62E9\u56FE\u7247",modelValue:r(_),"onUpdate:modelValue":o[1]||(o[1]=b=>$(_)?_.value=b:null),width:"90%","append-to-body":"","destroy-on-close":""},{default:l(()=>[e(r(Z),{type:"image","account-id":r(a).accountId,onSelectMaterial:v},null,8,["account-id"])]),_:1},8,["modelValue"])]),_:1}),e(V,{span:12,class:"col-add"},{default:l(()=>[e(R,{action:"/dev-api/admin-api/mp/material/upload-temporary",headers:z,multiple:"",limit:1,"file-list":r(h),data:r(u),"before-upload":M,"on-success":q},{tip:l(()=>[y]),default:l(()=>[e(i,{type:"primary"},{default:l(()=>[j("\u4E0A\u4F20\u56FE\u7247")]),_:1})]),_:1},8,["file-list","data"])]),_:1})]),_:1}))])}}}),[["__scopeId","data-v-675b1d7d"]])});export{ha as __tla,w as default};