Files
qhmes/web-dist/js/ModalHeader-Sr8KwhJJ.js
2026-06-16 18:19:57 +08:00

2 lines
12 KiB
Java

var le=Object.defineProperty,oe=Object.defineProperties;var ae=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable;var W=(e,t,n)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))re.call(t,n)&&W(e,n,t[n]);if(R)for(var n of R(t))ce.call(t,n)&&W(e,n,t[n]);return e},x=(e,t)=>oe(e,ae(t));import{useTimeoutFn as se}from"./useTimeout-D5AmIBZw.js";import{f,w as ue,u as b,e as B,a7 as ie,a8 as fe,c as I,C as v,z as i,H as L,F as X,y as g,A as p,K as d,J as de,L as j,E as T,G as M,B as Y}from"./vue-vendor-DNhG1Cve.js";import{cq as k,ad as K,b2 as pe,gO as me,M as ge,aO as be,b1 as ye,T as he,bo as Oe,au as w}from"./index-X7Y8jykP.js";import{b as Se}from"./index-BzChaRPg.js";var Ce={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"};function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.forEach(function(l){ve(e,l,n[l])})}return e}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var D=function(t,n){var o=G({},t,n.attrs);return f(k,G({},o,{icon:Ce}),null)};D.displayName="FullscreenExitOutlined";D.inheritAttrs=!1;var Le={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"};function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.forEach(function(l){Be(e,l,n[l])})}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z=function(t,n){var o=J({},t,n.attrs);return f(k,J({},o,{icon:Le}),null)};z.displayName="FullscreenOutlined";z.inheritAttrs=!1;var ke={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M365.3 518.5l246 178c5.3 3.8 12.7 0 12.7-6.5v-46.9c0-10.2-4.9-19.9-13.2-25.9L465.4 512l145.4-105.2c8.3-6 13.2-15.6 13.2-25.9V334c0-6.5-7.4-10.3-12.7-6.5l-246 178a8.05 8.05 0 000 13z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"left-square",theme:"outlined"};function Q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.forEach(function(l){Fe(e,l,n[l])})}return e}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var q=function(t,n){var o=Q({},t,n.attrs);return f(k,Q({},o,{icon:ke}),null)};q.displayName="LeftSquareOutlined";q.inheritAttrs=!1;var $e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M412.7 696.5l246-178c4.4-3.2 4.4-9.7 0-12.9l-246-178c-5.3-3.8-12.7 0-12.7 6.5V381c0 10.2 4.9 19.9 13.2 25.9L558.6 512 413.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"right-square",theme:"outlined"};function U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),o.forEach(function(l){Pe(e,l,n[l])})}return e}function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=function(t,n){var o=U({},t,n.attrs);return f(k,U({},o,{icon:$e}),null)};N.displayName="RightSquareOutlined";N.inheritAttrs=!1;const{t:Z}=K(),_e={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:Z("common.cancelText")},okText:{type:String,default:Z("common.okText")},closeFunc:Function,modalHeaderHeight:Number,modalFooterHeight:Number},ee=Object.assign({},_e,{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 je(e){const t=(l,c)=>getComputedStyle(l)[c],n=l=>{if(!l)return;l.setAttribute("data-drag",b(e.draggable));const c=l.querySelector(".ant-modal-header"),r=l.querySelector(".ant-modal");!c||!r||!b(e.draggable)||(c.style.cursor="move",c.onmousedown=s=>{if(!s)return;const u=s.clientX,m=s.clientY,a=document.body.clientWidth,O=document.documentElement.clientHeight,te=r.offsetWidth,ne=r.offsetHeight,H=r.offsetLeft,E=a-r.offsetLeft-te,A=r.offsetTop;let S=O-r.offsetTop-ne;S<0&&(S=O-r.offsetTop);const C=t(r,"left"),F=t(r,"top");let $=+C,P=+F;C.includes("%")?($=+document.body.clientWidth*(+C.replace(/%/g,"")/100),P=+document.body.clientHeight*(+F.replace(/%/g,"")/100)):($=+C.replace(/px/g,""),P=+F.replace(/px/g,"")),document.onmousemove=function(V){let y=V.clientX-u,h=V.clientY-m;-y>H?y=-H:y>E&&(y=E),-h>A?h=-A:h>S&&(h=S),r.style.cssText+=`;left:${y+$}px;top:${h+P}px;`},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null}})},o=()=>{const l=document.querySelectorAll(".ant-modal-wrap");for(const c of Array.from(l)){if(!c)continue;const r=t(c,"display"),s=c.getAttribute("data-drag");r!=="none"&&(s===null||b(e.destroyOnClose))&&n(c)}};ue(()=>{!b(e.visible)||!b(e.draggable)||se(()=>{o()},30)})}function Te(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!fe(e)}const We=B({name:"Modal",inheritAttrs:!1,props:pe(ee,["visible"]),emits:["cancel"],setup(e,{slots:t,emit:n}){const{open:o,draggable:l,destroyOnClose:c}=ie(e),r=be();je({visible:o,destroyOnClose:c,draggable:l});const s=u=>{n("cancel",u)};return()=>{let u;const m=x(_(_({},b(r)),e),{onCancel:s});return f(ge,m,Te(u=me(t))?u:{default:()=>[u]})}}}),Me=B({name:"ModalClose",components:{Tooltip:he,FullscreenExitOutlined:D,FullscreenOutlined:z,CloseOutlined:ye,LeftSquareOutlined:q,RightSquareOutlined:N},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}=Oe("basic-modal-close"),{t:o}=K(),l=I(()=>[n,`${n}--custom`,{[`${n}--can-full`]:e.canFullscreen||e.enableComment}]);function c(a){t("cancel",a)}function r(a){a==null||a.stopPropagation(),a==null||a.preventDefault(),(e.commentSpan==0||e.enableComment==!1)&&t("fullscreen")}function s(a){a==null||a.stopPropagation(),a==null||a.preventDefault(),e.fullScreen==!1&&t("fullscreen"),t("comment",!0)}function u(a){a==null||a.stopPropagation(),a==null||a.preventDefault(),t("comment",!1)}const m=I(()=>e.enableComment===!0?!1:e.canFullscreen);return{t:o,getClass:l,prefixCls:n,handleCancel:c,handleFullScreen:r,handleOpenComment:s,handleCloseComment:u,fullScreenStatus:m}}});function we(e,t,n,o,l,c){const r=d("FullscreenExitOutlined"),s=d("Tooltip"),u=d("FullscreenOutlined"),m=d("RightSquareOutlined"),a=d("LeftSquareOutlined"),O=d("CloseOutlined");return i(),v("div",{class:de(e.getClass)},[e.fullScreenStatus?(i(),v(X,{key:0},[e.fullScreen?(i(),g(s,{key:0,title:e.t("component.modal.restore"),placement:"bottom"},{default:p(()=>[f(r,{role:"full",onClick:e.handleFullScreen},null,8,["onClick"])]),_:1},8,["title"])):(i(),g(s,{key:1,title:e.t("component.modal.maximize"),placement:"bottom"},{default:p(()=>[f(u,{role:"close",onClick:e.handleFullScreen},null,8,["onClick"])]),_:1},8,["title"]))],64)):L("",!0),e.enableComment?(i(),v(X,{key:1},[e.commentSpan>0?(i(),g(s,{key:0,title:"收起",placement:"bottom"},{default:p(()=>[f(m,{onClick:e.handleCloseComment,style:{"font-size":"16px"}},null,8,["onClick"])]),_:1})):(i(),g(s,{key:1,title:"展开",placement:"bottom"},{default:p(()=>[f(a,{onClick:e.handleOpenComment,style:{"font-size":"16px"}},null,8,["onClick"])]),_:1}))],64)):L("",!0),f(s,{title:e.t("component.modal.close"),placement:"bottom"},{default:p(()=>[f(O,{onClick:e.handleCancel},null,8,["onClick"])]),_:1},8,["title"])],2)}const xe=w(Me,[["render",we]]),De=B({name:"BasicModalFooter",props:ee,emits:["ok","cancel"],setup(e,{emit:t}){function n(l){t("ok",l)}function o(l){t("cancel",l)}return{handleOk:n,handleCancel:o}}});function ze(e,t,n,o,l,c){const r=d("a-button");return i(),v("div",null,[j(e.$slots,"insertFooter"),e.showCancelBtn?(i(),g(r,Y({key:0},e.cancelButtonProps,{onClick:e.handleCancel}),{default:p(()=>[T(M(e.cancelText),1)]),_:1},16,["onClick"])):L("",!0),j(e.$slots,"centerFooter"),e.showOkBtn?(i(),g(r,Y({key:1,type:e.okType,onClick:e.handleOk,loading:e.confirmLoading},e.okButtonProps),{default:p(()=>[T(M(e.okText),1)]),_:1},16,["type","onClick","loading"])):L("",!0),j(e.$slots,"appendFooter")])}const Ie=w(De,[["render",ze]]),qe=B({name:"BasicModalHeader",components:{BasicTitle:Se},emits:["dblclick"],props:{helpMessage:{type:[String,Array]},title:{type:String}}});function Ne(e,t,n,o,l,c){const r=d("BasicTitle");return i(),g(r,{helpMessage:e.helpMessage},{default:p(()=>[T(M(e.title),1)]),_:1},8,["helpMessage"])}const Xe=w(qe,[["render",Ne]]);export{z as F,Xe as M,D as a,ee as b,Ie as c,xe as d,We as e};