2025-05-08 11:41:35 +08:00
|
|
|
var me=Object.defineProperty,he=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;var ee=(e,o,l)=>o in e?me(e,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[o]=l,H=(e,o)=>{for(var l in o||(o={}))Ce.call(o,l)&&ee(e,l,o[l]);if(x)for(var l of x(o))Me.call(o,l)&&ee(e,l,o[l]);return e},E=(e,o)=>he(e,ye(o));var A=(e,o,l)=>new Promise((i,a)=>{var c=u=>{try{n(l.next(u))}catch(d){a(d)}},t=u=>{try{n(l.throw(u))}catch(d){a(d)}},n=u=>u.done?i(u.value):Promise.resolve(u.value).then(c,t);n((l=l.apply(e,o)).next())});import{x as se,G as be,d as He,aU as Se,O as ke,N as Fe,a5 as $e,aV as ve,_ as j,u as re,aD as Be,f as ie,aS as Oe,h as Pe,aH as ce,as as Te,w as we}from"./index.js";import{h as q,u as r,d as D,I as Ne,k as S,a9 as N,i as De,f as m,c as k,w as ue,o as Re,b as de,y as B,a6 as y,n as We,Z as M,a4 as P,a5 as g,m as _e,_ as z,ab as O,ad as Ee,F as je,a8 as X,a1 as Le,G as Y,a0 as G,g as Q,z as Ie,aa as te,a7 as ne,ag as oe,ah as ae,r as pe,J as V}from"./vue-72a104e4.js";import{M as Ae,T as Ve,a3 as ze,a4 as qe,Q as Ue,o as U,b as Xe}from"./antd-0b1a4d04.js";import{u as Ye}from"./useWindowSizeFn-c13a0e28.js";const{t:le}=se(),Ge={open:{type:Boolean},scrollTop:{type:Boolean,default:!0},height:{type:Number},minHeight:{type:Number},draggable:{type:Boolean,default:!0},centered:{type:Boolean},cancelText:{type:String,default:le("common.cancelText")},okText:{type:String,default:le("common.okText")},closeFunc:Function},Z=Object.assign({},Ge,{defaultFullscreen:{type:Boolean},canFullscreen:{type:Boolean,default:!0},wrapperFooterOffset:{type:Number,default:0},helpMessage:[String,Array],useWrapper:{type:Boolean,default:!0},loading:{type:Boolean},loadingTip:{type:String},showCancelBtn:{type:Boolean,default:!0},showOkBtn:{type:Boolean,default:!0},wrapperProps:Object,afterClose:Function,bodyStyle:Object,closable:{type:Boolean,default:!0},closeIcon:Object,confirmLoading:{type:Boolean},destroyOnClose:{type:Boolean},footer:Object,getContainer:Function,mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},maskStyle:Object,okType:{type:String,default:"primary"},okButtonProps:Object,cancelButtonProps:Object,title:{type:String},open:{type:Boolean},width:[String,Number],wrapClassName:{type:String},zIndex:{type:Number}});function Je(e){const o=(a,c)=>getComputedStyle(a)[c],l=a=>{if(!a)return;a.setAttribute("data-drag",r(e.draggable));const c=a.querySelector(".ant-modal-header"),t=a.querySelector(".ant-modal");!c||!t||!r(e.draggable)||(c.style.cursor="move",c.onmousedown=n=>{if(!n)return;const u=n.clientX,d=n.clientY,p=document.body.clientWidth,f=document.documentElement.clientHeight,h=t.offsetWidth,b=t.offsetHeight,F=t.offsetLeft,$=p-t.offsetLeft-h,v=t.offsetTop,L=f-t.offsetTop-b,T=o(t,"left"),R=o(t,"top");let W=+T,_=+R;T.includes("%")?(W=+document.body.clientWidth*(+T.replace(/%/g,"")/100),_=+document.body.clientHeight*(+R.replace(/%/g,"")/100)):(W=+T.replace(/px/g,""),_=+R.replace(/px/g,"")),document.onmousemove=function(I){let s=I.clientX-u,C=I.clientY-d;-s>F?s=-F:s>$&&(s=$),-C>v?C=-v:C>L&&(C=L),t.style.cssText+=`;left:${s+W}px;top:${C+_}px;`},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null}})},i=()=>{const a=document.querySelectorAll(".ant-modal-wrap");for(const c of Array.from(a)){if(!c)continue;const t=o(c,"display"),n=c.getAttribute("data-drag");t!=="none"&&(n===null||r(e.destroyOnClose))&&l(c)}};q(()=>{!r(e.open)||!r(e.draggable)||be(()=>{i()},30)})}function Qe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!De(e)}const Ze=D({name:"Modal",inheritAttrs:!1,props:Z,emits:["cancel"],setup(e,{slots:o,emit:l}){const{open:i,draggable:a,destroyOnClose:c}=Ne(e),t=He();Je({open:i,destroyOnClose:c,draggable:a});const n=u=>{l("cancel",u)};return()=>{let u;const d=E(H(H({},r(t)),e),{onCancel:n});return S(Ae,N({class:"custom-modal"},d),Qe(u=Se(o))?u:{default:()=>[u]})}}}),fe=Symbol();function Ke(e){return
|