moreShopAdmin/build/admin/assets/index.30ca9d2e.js

2 lines
21 KiB
JavaScript
Raw Normal View History

2024-11-19 14:40:16 +08:00
import{V as Ke,W as Ze,I as De,X as Oe,J as $e,K as ze,C as Re,w as Le,k as Qe,b as Je,Y as Xe,p as He,q as et,r as tt,Z as lt,E as nt,B as st,M as ot,_ as at,N as it,O as ut,a as dt}from"./element-plus.91c68cc0.js";import{_ as rt}from"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import{_ as ct}from"./index.22ace1f3.js";import{a as mt,i as de,R as Ve,f as Z,d as me,r as T,b as Pe,j as pt}from"./index.0e5577f4.js";import{P as ft}from"./index.395bb96e.js";import{d as Q,s as se,r as A,b as ne,t as vt,o as i,c as m,U as s,L as o,H as pe,K as B,a,T as j,a9 as G,S as te,Q as _,w as O,a3 as Y,u as t,j as I,R as y,Z as gt,a0 as Ue,M as le,V as ce,n as xe,_ as yt,i as _t,aa as Ct,O as Be,D as ht}from"./@vue.76ce7aa3.js";import{u as kt}from"./@vueuse.9ffef7f8.js";import{u as bt}from"./usePaging.f8c888e4.js";const Et=Q({components:{},props:{type:{type:String,default:"image"},multiple:{type:Boolean,default:!0},limit:{type:Number,default:10},data:{type:Object,default:()=>({})},showProgress:{type:Boolean,default:!1}},emits:["change","error","success"],setup(e,{emit:C}){const h=mt(),f=se(),v=A(`${de.baseUrl}${de.urlPrefix}/upload/${e.type}`),E=ne(()=>({token:h.token,version:de.version})),c=A(!1),r=A([]),w=(b,S,$)=>{c.value=!0,r.value=vt($)},u=(b,S,$)=>{var N;$.every(P=>P.status=="success")&&((N=f.value)==null||N.clearFiles(),c.value=!1),C("change",S),b.code==Ve.SUCCESS&&C("success",b),b.code==Ve.FAIL&&b.msg&&Z.msgError(b.msg)},k=(b,S)=>{var $;Z.msgError(`${S.name}\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`),($=f.value)==null||$.abort(S),c.value=!1,C("change",S),C("error",S)},d=()=>{Z.msgError(`\u8D85\u51FA\u4E0A\u4F20\u4E0A\u9650${e.limit}\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20`)},R=()=>{var b;(b=f.value)==null||b.clearFiles(),c.value=!1},M=ne(()=>{switch(e.type){case"image":return".jpg,.png,.gif,.jpeg";case"video":return".wmv,.avi,.mpg,.mpeg,.3gp,.mov,.mp4,.flv,.rmvb,.mkv";default:return"*"}});return{uploadRefs:f,action:v,headers:E,visible:c,fileList:r,getAccept:M,handleProgress:w,handleSuccess:u,handleError:k,handleExceed:d,handleClose:R}}}),wt={class:"upload"},Ft={class:"file-list p-4"},At={class:"flex-1"};function St(e,C,h,f,v,E){const c=Ke,r=Ze,w=De;return i(),m("div",wt,[s(c,{ref:"uploadRefs",action:e.action,multiple:e.multiple,limit:e.limit,"show-file-list":!1,headers:e.headers,data:e.data,"on-progress":e.handleProgress,"on-success":e.handleSuccess,"on-exceed":e.handleExceed,"on-error":e.handleError,accept:e.getAccept},{default:o(()=>[pe(e.$slots,"default")]),_:3},8,["action","multiple","limit","headers","data","on-progress","on-success","on-exceed","on-error","accept"]),e.showProgress&&e.fileList.length?(i(),B(w,{key:0,modelValue:e.visible,"onUpdate:modelValue":C[0]||(C[0]=u=>e.visible=u),title:"\u4E0A\u4F20\u8FDB\u5EA6","close-on-click-modal":!1,width:"500px",modal:!1,onClose:e.handleClose},{default:o(()=>[a("div",Ft,[(i(!0),m(j,null,G(e.fileList,(u,k)=>(i(),m("div",{key:k,class:"mb-5"},[a("div",null,te(u.name),1),a("div",At,[s(r,{percentage:parseInt(u.percentage)},null,8,["percentage"])])]))),128))])]),_:1},8,["modelValue","onClose"])):_("",!0)])}const Vt=me(Et,[["render",St]]),xt={class:"popover-input__input mr-[10px] flex-1"},Bt={class:"popover-input__btns flex-none"},Dt=Q({__name:"index",props:{value:{type:String},type:{type:String,default:"text"},width:{type:[Number,String],default:"300px"},placeholder:String,disabled:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},limit:{type:Number,default:200},showLimit:{type:Boolean,default:!1},teleported:{type:Boolean,default:!0}},emits:["confirm"],setup(e,{emit:C}){const h=e,f=C,v=A(!1),E=A(!1),c=A(),r=()=>{u(),f("confirm",c.value)},w=()=>{h.disabled||(v.value=!0)},u=()=>{v.value=!1};return O(()=>h.value,k=>{c.value=k},{immediate:!0}),kt(document.documentElement,"click",()=>{E.value||u()}),(k,d)=>{const R=$e,M=ze,b=Re,S=Le,$=Oe;return i(),m("div",{onMouseenter:d[4]||(d[4]=F=>E.value=!0),onMouseleave:d[5]||(d[5]=F=>E.value=!1)},[s($,{placement:"top",visible:t(v),"onUpdate:visible":d[3]||(d[3]=F=>I(v)?v.value=F:null),width:e.width