XWWitPark/witpark_jzzs/xw_jzzs_web/public/lib/layer/layer.js

2 lines
21 KiB
JavaScript
Raw Normal View History

2024-09-12 00:10:00 +00:00
/* 2020-9-22 15:23:19 | 版权所有 军懋国兴 */
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(c){"use strict";function t(e){var t=this;t.index=++p.index,t.config=d.extend({},t.config,y.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)}var d,u,e,i,n=c.layui&&layui.define,y={getPath:(e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;0<n;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}()).substring(0,e.lastIndexOf("/")+1),config:{},end:{},beforeEnd:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(e,t){var i=e.currentStyle?e.currentStyle:c.getComputedStyle(e,null);return i[i.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,t,i){}},f=null,p={v:"3.1.1",ie:(i=navigator.userAgent.toLowerCase(),!!(c.ActiveXObject||"ActiveXObject"in c)&&((i.match(/msie\s(\d+)/)||[])[1]||"11")),index:c.layer&&c.layer.v?1e5:0,path:y.getPath,config:function(e){return e=e||{},p.cache=y.config=d.extend({},y.config,e),p.path=y.config.path||p.path,"string"==typeof e.extend&&(e.extend=[e.extend]),y.config.path&&p.ready(),e.extend&&(n?layui.addcss("modules/layer/"+e.extend):y.link("theme/"+e.extend)),this},ready:function(){},alert:function(e,t,i){var n="function"==typeof t;return n&&(i=t),p.open(d.extend({content:e,yes:i},n?{}:t))},confirm:function(e,t,i,n){var a="function"==typeof t;return a&&(n=i,i=t),p.open(d.extend({content:e,btn:y.btn,yes:i,btn2:n},a?{}:t))},msg:function(e,t,i){var n="function"==typeof t,a=y.config.skin,o=(a?a+" "+a+"-msg":"")||"layui-layer-msg",s=h.anim.length-1;return n&&(i=t),p.open(d.extend({content:e,time:3e3,shade:!1,skin:o,title:!1,closeBtn:!1,btn:!1,resize:!1,end:i},n&&!y.config.skin?{skin:o+" layui-layer-hui",anim:s}:(-1!==(t=t||{}).icon&&(void 0!==t.icon||y.config.skin)||(t.skin=o+" "+(t.skin||"layui-layer-hui")),t)))},load:function(e,t){return p.open(d.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,i){return p.open(d.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},i))}};t.pt=t.prototype;var h=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];h.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],t.pt.config={type:0,shade:.3,fixed:!0,move:h[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},t.pt.vessel=function(e,t){var i,n=this.index,a=this.config,o=a.zIndex+n,s="object"===_typeof(a.title),r=a.maxmin&&(1===a.type||2===a.type),l=a.title?'<div class="layui-layer-title" style="'+(s?a.title[1]:"")+'">'+(s?a.title[0]:a.title)+"</div>":"";return a.zIndex=o,t([a.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+n+'" times="'+n+'" style="z-index:'+(o-1)+'; "></div>':"",'<div class="'+h[0]+" layui-layer-"+y.type[a.type]+(0!=a.type&&2!=a.type||a.shade?"":" layui-layer-border")+" "+(a.skin||"")+'" id="'+h[0]+n+'" type="'+y.type[a.type]+'" times="'+n+'" showtime="'+a.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+o+"; width:"+a.area[0]+";height:"+a.area[1]+(a.fixed?"":";position:absolute;")+'">'+(e&&2!=a.type?"":l)+'<div id="'+(a.id||"")+'" class="layui-layer-content'+(0==a.type&&-1!==a.icon?" layui-layer-padding":"")+(3==a.type?" layui-layer-loading"+a.icon:"")+'">'+(0==a.type&&-1!==a.icon?'<i class="layui-layer-ico layui-layer-ico'+a.icon+'"></i>':"")+((1!=a.type||!e)&&a.content||"")+'</div><span class="layui-layer-setwin">'+(i=r?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" style="display: none;" href="javascript:;"></a