moreShopAdmin/build/admin/assets/index.9d3ec683.js

2 lines
21 KiB
JavaScript
Raw Normal View History

2024-10-30 16:26:12 +08:00
import{V as Ze,W as Oe,I as $e,X as Qe,J as ze,K as Re,C as Ie,w as Le,k as Je,b as Xe,Y as He,p as et,q as tt,r as lt,Z as nt,E as at,B as st,M as ot,_ as it,N as ut,O as dt,a as rt}from"./element-plus.4a7d92a3.js";import{_ as ct}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{_ as pt}from"./index.032d57e6.js";import{a as mt,i as re,R as xe,f as Z,d as me,r as T,b as Pe,j as ft}from"./index.7c768626.js";import{P as vt}from"./index.03fbab49.js";import{d as Q,s as ae,r as A,b as ne,t as _t,o,c,U as n,L as a,H as fe,K as B,a as s,T as j,a9 as G,S as te,Q as h,w as O,a3 as Y,u as t,j as U,R as g,Z as gt,a0 as Ue,M as le,V as pe,n as Be,_ as ht,i as yt,aa as Ct,O as De,D as kt,bl as bt,bk as Et}from"./@vue.18505fe0.js";import{u as wt}from"./@vueuse.fbc6a400.js";import{u as Ft}from"./usePaging.6a6670f9.js";const At=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:y}){const C=mt(),m=ae(),f=A(`${re.baseUrl}${re.urlPrefix}/upload/${e.type}`),E=ne(()=>({token:C.token,version:re.version})),d=A(!1),u=A([]),w=(b,S,$)=>{d.value=!0,u.value=_t($)},i=(b,S,$)=>{var N;$.every(L=>L.status=="success")&&((N=m.value)==null||N.clearFiles(),d.value=!1),y("change",S),b.code==xe.SUCCESS&&y("success",b),b.code==xe.FAIL&&b.msg&&Z.msgError(b.msg)},k=(b,S)=>{var $;Z.msgError(`${S.name}\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`),($=m.value)==null||$.abort(S),d.value=!1,y("change",S),y("error",S)},r=()=>{Z.msgError(`\u8D85\u51FA\u4E0A\u4F20\u4E0A\u9650${e.limit}\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20`)},R=()=>{var b;(b=m.value)==null||b.clearFiles(),d.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:m,action:f,headers:E,visible:d,fileList:u,getAccept:M,handleProgress:w,handleSuccess:i,handleError:k,handleExceed:r,handleClose:R}}}),St={class:"upload"},Vt={class:"file-list p-4"},xt={class:"flex-1"};function Bt(e,y,C,m,f,E){const d=Ze,u=Oe,w=$e;return o(),c("div",St,[n(d,{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:a(()=>[fe(e.$slots,"default")]),_:3},8,["action","multiple","limit","headers","data","on-progress","on-success","on-exceed","on-error","accept"]),e.showProgress&&e.fileList.length?(o(),B(w,{key:0,modelValue:e.visible,"onUpdate:modelValue":y[0]||(y[0]=i=>e.visible=i),title:"\u4E0A\u4F20\u8FDB\u5EA6","close-on-click-modal":!1,width:"500px",modal:!1,onClose:e.handleClose},{default:a(()=>[s("div",Vt,[(o(!0),c(j,null,G(e.fileList,(i,k)=>(o(),c("div",{key:k,class:"mb-5"},[s("div",null,te(i.name),1),s("div",xt,[n(u,{percentage:parseInt(i.percentage)},null,8,["percentage"])])]))),128))])]),_:1},8,["modelValue","onClose"])):h("",!0)])}const Dt=me(At,[["render",Bt]]),$t={class:"popover-input__input mr-[10px] flex-1"},zt={class:"popover-input__btns flex-none"},Rt=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:y}){const C=e,m=y,f=A(!1),E=A(!1),d=A(),u=()=>{i(),m("confirm",d.value)},w=()=>{C.disabled||(f.value=!0)},i=()=>{f.value=!1};return O(()=>C.value,k=>{d.value=k},{immediate:!0}),wt(document.documentElement,"click",()=>{E.value||i()}),(k,r)=>{const R=ze,M=Re,b=Ie,S=Le,$=Qe;return o(),c("div",{onMouseenter:r[4]||(r[4]=F=>E.value=!0),onMouseleave:r[5]||(r[5]=F=>E.value=!1)},[n($,{placement:"top",visible:t(f),"onUpdate:visible":r[3]||(r[3]=F=>U(f)?f.value=F:null),