/** layui-v2.5.4 MIT License By https://www.layui.com */ ;!function(e){"use strict";var t="optimizeSelectOption";window.top.layui?window.top.layui.use("layer",function(){layui.define(["form"],function(n){n(t,e(t))})}):(console.warn("使用插件:"+t+"页面顶层窗口必须引入layui"),layui.define(["form"],function(e){e(t,{msg:"使用插件:"+t+"页面顶层窗口必须引入layui"})}))}(function(e){function t(e,n,o){n=n||window,e=e.length?e.get(0):e;var i={};if(o&&n.top!==n.self){var l=n.frames.frameElement;i=t(l,n.parent,o)}var a=e.getBoundingClientRect();return{top:a.top+(i.top||0),left:a.left+(i.left||0)}}var n="0.2.0",o=layui.$,i=layui.form,l=(layui.layer,layui.cache.modules.optimizeSelectOption.substr(0,layui.cache.modules.optimizeSelectOption.lastIndexOf("/")));layui.link(l+"/optimizeSelectOption.css?v"+n);var a=[".layui-table-view",".layui-layer-content",".select_option_to_layer"];if(window.top.layer._indexTemp=window.top.layer._indexTemp||{},!i.render.plugFlag){var r=i.render;i.render=function(e,t,n){var i,l=this;return n?layui.each(n,function(t,n){n=o(n);var a=n.parent(),s=a.hasClass("layui-form"),u=a.attr("lay-filter");s?"":a.addClass("layui-form"),u?"":a.attr("lay-filter","tablePlug_form_filter_temp_"+(new Date).getTime()+"_"+Math.floor(1e5*Math.random())),i=r.call(l,e,a.attr("lay-filter")),s?"":a.removeClass("layui-form"),u?"":a.attr("lay-filter",null)}):i=r.call(l,e,t),i},i.render.plugFlag=!0}var s=function(){window.top.layer.close(window.top.layer._indexTemp[e])},u={},c=function(n,i){var l=this;return u.name?(console.warn("针对",n,"的显示优化已经存在,请不要重复渲染!"),l):void o(document).on("click",a.map(function(e){return e+" "+i.triggerElem}).join(","),function(n){function l(){var e=t(u,window,!0),n=e.top,o=e.left;return p?n=n-c.outerHeight()+u.outerHeight()-parseFloat(c.css("bottom")):n+=parseFloat(c.css("top")),n+c.outerHeight()>window.top.innerHeight&&!p&&(p=!0,n-=c.outerHeight()+(2*parseFloat(c.css("top"))-u.outerHeight())),{top:n,left:o}}layui.stope(n),s();var r=o(this),u=r,c="function"==typeof i.dlElem?i.dlElem(r):u.next(),f=u.parent().prev(),p=u.parent().hasClass("layui-form-selectup"),d=l();u.css({backgroundColor:"transparent"}),window.top.layer._indexTemp[e]=window.top.layer.open({type:1,title:!1,closeBtn:0,shade:0,anim:-1,fixed:u.closest(".layui-layer-content").length||window.top!==window.self,isOutAnim:!1,offset:[d.top+"px",d.left+"px"],area:c.outerWidth()+"px",content:'
',skin:"layui-option-layer",success:function(e,t){c.css({top:0,position:"relative"}).appendTo(e.find(".layui-layer-content").css({overflow:"hidden"}).find(".layui-form-selected")),e.width(u.width());var n=window.top.innerHeight-e.outerHeight()-parseFloat(e.css("top"));p&&e.css({top:"auto",bottom:n+"px"}),"function"==typeof i.success&&i.success.call(this,t,e),e.on("mousedown",function(e){layui.stope(e)}),setTimeout(function(){u.parentsUntil(a.join(",")).one("scroll",function(e){s()}),u.parents(a.join(",")).one("scroll",function(e){s()});var e=window;do{var t=e.$||e.layui.$;t&&(t(e.document).one("click",function(e){s()}),t(e.document).one("mousedown",function(e){s()}),t(e).one("resize",function(e){s()}),t(e.document).one("scroll",function(){top!==self&&parent.parent&&s()}))}while(e.self!==e.top&&(e=e.parent))},500)},end:function(){"function"==typeof i.end&&i.end.call(this,f)}})})};return c("layuiSelect",{triggerElem:"div:not(.layui-select-disabled)>.layui-select-title",success:function(e,t){t.find("dl dd").click(function(){s()})},end:function(e){i.render("select",null,e)}}),{version:n,getPosition:t,close:s}});