2 lines
21 KiB
JavaScript
2 lines
21 KiB
JavaScript
|
import{S as Oe,T as Ze,I as $e,U as Qe,J as ze,K as Re,C as Ie,w as Le,k as Je,b as Xe,V as He,p as et,q as tt,r as lt,W as nt,E as at,B as st,M as ot,X as it,N as ut,O as dt,a as rt}from"./element-plus.73c9e9a6.js";import{_ as ct}from"./index.vue_vue_type_script_setup_true_lang.317e431e.js";import{_ as pt}from"./index.b3eba7ba.js";import{a as mt,m as re,R as Ve,f as O,d as me,r as j,b as Pe,n as ft}from"./index.bd5cd373.js";import{P as vt}from"./index.fa58e261.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,a9 as G,S as te,Q as h,w as Z,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.663bc523.js";import{u as wt}from"./@vueuse.4b5afb22.js";import{u as Ft}from"./usePaging.77fa9d39.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==Ve.SUCCESS&&y("success",b),b.code==Ve.FAIL&&b.msg&&O.msgError(b.msg)},k=(b,S)=>{var $;O.msgError(`${S.name}\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`),($=m.value)==null||$.abort(S),d.value=!1,y("change",S),y("error",S)},r=()=>{O.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"},xt={class:"file-list p-4"},Vt={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",xt,[(o(!0),c(T,null,G(e.fileList,(i,k)=>(o(),c("div",{key:k,class:"mb-5"},[s("div",null,te(i.name),1),s("div",Vt,[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 Z(()=>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),width
|