2 lines
7.0 KiB
Java
2 lines
7.0 KiB
Java
var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var A=(e,t,n)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&A(e,n,t[n]);if(q)for(var n of q(t))Z.call(t,n)&&A(e,n,t[n]);return e},E=(e,t)=>K(e,Q(t));import{u as y,h as x,d as F,k as f,i as ee,I as te,e as W,ah as d,ar as B,as as i,at as oe,ag as O,F as z,aC as g,aF as p,aH as M,aG as I,G as v,av as H}from"./vue-vendor-C7Zq48Yl.js";import{o as ne,M as le,aX as ae,aY as se,ar as re,aH as ce,aI as ie,T as ue}from"./antd-vue-vendor-BPnV8VqP.js";import{useTimeoutFn as de}from"./useTimeout-DDl4l82I.js";import{Y as R,a as pe,b2 as me,n as fe,d as N}from"./index-BI6CMai0.js";import{B as ge}from"./index-DeEq83Ov.js";const{t:Y}=R(),ye={visible:{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:Y("common.cancelText")},okText:{type:String,default:Y("common.okText")},closeFunc:Function,modalHeaderHeight:Number,modalFooterHeight:Number},V=Object.assign({},ye,{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},visible:{type:Boolean},open:{type:Boolean},width:[String,Number],wrapClassName:{type:String},zIndex:{type:Number},maxHeight:{type:Number},enableComment:{type:Boolean,default:!1}});function be(e){const t=(a,s)=>getComputedStyle(a)[s],n=a=>{if(!a)return;a.setAttribute("data-drag",y(e.draggable));const s=a.querySelector(".ant-modal-header"),l=a.querySelector(".ant-modal");!s||!l||!y(e.draggable)||(s.style.cursor="move",s.onmousedown=r=>{if(!r)return;const c=r.clientX,m=r.clientY,o=document.body.clientWidth,h=document.documentElement.clientHeight,X=l.offsetWidth,G=l.offsetHeight,j=l.offsetLeft,L=o-l.offsetLeft-X,P=l.offsetTop;let k=h-l.offsetTop-G;k<0&&(k=h-l.offsetTop);const S=t(l,"left"),T=t(l,"top");let $=+S,_=+T;S.includes("%")?($=+document.body.clientWidth*(+S.replace(/%/g,"")/100),_=+document.body.clientHeight*(+T.replace(/%/g,"")/100)):($=+S.replace(/px/g,""),_=+T.replace(/px/g,"")),document.onmousemove=function(w){let b=w.clientX-c,C=w.clientY-m;-b>j?b=-j:b>L&&(b=L),-C>P?C=-P:C>k&&(C=k),l.style.cssText+=`;left:${b+$}px;top:${C+_}px;`},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null}})},u=()=>{const a=document.querySelectorAll(".ant-modal-wrap");for(const s of Array.from(a)){if(!s)continue;const l=t(s,"display"),r=s.getAttribute("data-drag");l!=="none"&&(r===null||y(e.destroyOnClose))&&n(s)}};x(()=>{!y(e.visible)||!y(e.draggable)||de(()=>{u()},30)})}function Ce(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ee(e)}const He=F({name:"Modal",inheritAttrs:!1,props:ne(V,["visible"]),emits:["cancel"],setup(e,{slots:t,emit:n}){const{open:u,draggable:a,destroyOnClose:s}=te(e),l=pe();be({visible:u,destroyOnClose:s,draggable:a});const r=c=>{n("cancel",c)};return()=>{let c;const m=E(D(D({},y(l)),e),{onCancel:r});return f(le,m,Ce(c=me(t))?c:{default:()=>[c]})}}}),he=F({name:"ModalClose",components:{Tooltip:ue,FullscreenExitOutlined:ie,FullscreenOutlined:ce,CloseOutlined:re,LeftSquareOutlined:se,RightSquareOutlined:ae},props:{canFullscreen:{type:Boolean,default:!0},fullScreen:{type:Boolean},enableComment:{type:Boolean,default:!1},commentSpan:{type:Number,default:0}},emits:["cancel","fullscreen","comment"],setup(e,{emit:t}){const{prefixCls:n}=fe("basic-modal-close"),{t:u}=R(),a=W(()=>[n,`${n}--custom`,{[`${n}--can-full`]:e.canFullscreen||e.enableComment}]);function s(o){t("cancel",o)}function l(o){o==null||o.stopPropagation(),o==null||o.preventDefault(),(e.commentSpan==0||e.enableComment==!1)&&t("fullscreen")}function r(o){o==null||o.stopPropagation(),o==null||o.preventDefault(),e.fullScreen==!1&&t("fullscreen"),t("comment",!0)}function c(o){o==null||o.stopPropagation(),o==null||o.preventDefault(),t("comment",!1)}const m=W(()=>e.enableComment===!0?!1:e.canFullscreen);return{t:u,getClass:a,prefixCls:n,handleCancel:s,handleFullScreen:l,handleOpenComment:r,handleCloseComment:c,fullScreenStatus:m}}});function ke(e,t,n,u,a,s){const l=d("FullscreenExitOutlined"),r=d("Tooltip"),c=d("FullscreenOutlined"),m=d("RightSquareOutlined"),o=d("LeftSquareOutlined"),h=d("CloseOutlined");return i(),B("div",{class:oe(e.getClass)},[e.fullScreenStatus?(i(),B(z,{key:0},[e.fullScreen?(i(),g(r,{key:0,title:e.t("component.modal.restore"),placement:"bottom"},{default:p(()=>[f(l,{role:"full",onClick:e.handleFullScreen},null,8,["onClick"])]),_:1},8,["title"])):(i(),g(r,{key:1,title:e.t("component.modal.maximize"),placement:"bottom"},{default:p(()=>[f(c,{role:"close",onClick:e.handleFullScreen},null,8,["onClick"])]),_:1},8,["title"]))],64)):O("",!0),e.enableComment?(i(),B(z,{key:1},[e.commentSpan>0?(i(),g(r,{key:0,title:"收起",placement:"bottom"},{default:p(()=>[f(m,{onClick:e.handleCloseComment,style:{"font-size":"16px"}},null,8,["onClick"])]),_:1})):(i(),g(r,{key:1,title:"展开",placement:"bottom"},{default:p(()=>[f(o,{onClick:e.handleOpenComment,style:{"font-size":"16px"}},null,8,["onClick"])]),_:1}))],64)):O("",!0),f(r,{title:e.t("component.modal.close"),placement:"bottom"},{default:p(()=>[f(h,{onClick:e.handleCancel},null,8,["onClick"])]),_:1},8,["title"])],2)}const Ne=N(he,[["render",ke]]),Se=F({name:"BasicModalFooter",props:V,emits:["ok","cancel"],setup(e,{emit:t}){function n(a){t("ok",a)}function u(a){t("cancel",a)}return{handleOk:n,handleCancel:u}}});function Be(e,t,n,u,a,s){const l=d("a-button");return i(),B("div",null,[M(e.$slots,"insertFooter"),e.showCancelBtn?(i(),g(l,I({key:0},e.cancelButtonProps,{onClick:e.handleCancel}),{default:p(()=>[v(H(e.cancelText),1)]),_:1},16,["onClick"])):O("",!0),M(e.$slots,"centerFooter"),e.showOkBtn?(i(),g(l,I({key:1,type:e.okType,onClick:e.handleOk,loading:e.confirmLoading},e.okButtonProps),{default:p(()=>[v(H(e.okText),1)]),_:1},16,["type","onClick","loading"])):O("",!0),M(e.$slots,"appendFooter")])}const je=N(Se,[["render",Be]]),Oe=F({name:"BasicModalHeader",components:{BasicTitle:ge},emits:["dblclick"],props:{helpMessage:{type:[String,Array]},title:{type:String}}});function Fe(e,t,n,u,a,s){const l=d("BasicTitle");return i(),g(l,{helpMessage:e.helpMessage},{default:p(()=>[v(H(e.title),1)]),_:1},8,["helpMessage"])}const Le=N(Oe,[["render",Fe]]);export{Le as M,je as a,V as b,Ne as c,He as d};
|