layui.define(["table","tableFilter","tableChild","tableMerge"],function(exports){var tableFilter=layui.tableFilter,tableChild=layui.tableChild,tableMerge=layui.tableMerge,$=layui.$,table=layui.table,HIDE="layui-hide",isFirst=!0,mod={render:function(e){var t=localStorage.getItem(location.pathname+location.hash+e.id);e.filter&&e.filter.cache&&isFirst&&t?(e.cols=this.deepParse(t),isFirst=!1,table.reload(e.id,e)):(tableFilter.render(e),tableChild.render(e),tableMerge.render(e),e.fixTotal&&this.fixTotal(e),(void 0===e.drag||e.drag)&&this.drag(e),e.rowDrag&&this.rowDrag(e),this.autoColumnWidth(e),this.contextmenu(e),(void 0===e.fixResize||e.fixResize)&&this.fixResizeRightFixed(e),e.overflow&&this.overflow(e),this.fixFixedScroll(e))},export:function(e,t){tableFilter.export(e.config||e,t)},getCssRule:function(e,i,l){var t=e.elem.next().find("style")[0],a=t.sheet||t.styleSheet||{},n=a.cssRules||a.rules;layui.each(n,function(e,t){if(t.selectorText===".laytable-cell-"+i)return l(t),!0})},autoColumnWidth:function(c){var h=this,e=$(c.elem),t=e.next().children(".layui-table-box").children(".layui-table-header").children("table").children("thead").children("tr").children("th"),i=e.next().children(".layui-table-box").children(".layui-table-fixed").children(".layui-table-header").children("table").children("thead").children("tr").children("th"),u=e.next().children(".layui-table-box").children(".layui-table-body").children("table").children("tbody").children("tr");String.prototype.width=function(e){var t=e||$("body").css("font"),i=$("
"+this+"
").css({position:"absolute",float:"left","white-space":"nowrap",visibility:"hidden",font:t}).appendTo($("body")),l=i.width();return i.remove(),l},t.add(i).on("dblclick",function(e){var t=$(this),i=t.data("field"),l=t.data("key"),a=t.offset().left,n=e.clientX-a;if(!(1左固定
不固定
右固定
');var q=z.children(".soul-drag-bar");q.children("div").on("mouseenter",function(){$(this).addClass("active")}).on("mouseleave",function(){$(this).removeClass("active")})}s.find("th").each(function(){var k=$(this),w=k.data("field"),S=k.data("key");if(S){var e=S.split("-"),d=F.cols[e[1]][e[2]],C=e[1]+"-"+e[2],I=0o.width()/2,p=h&&r-b.position().left>c.width()/2;if(Math.abs(b.position().left-r),0li[data-value="+w+"]").after($("#soul-columns"+D+">li[data-value="+w+"]").prev()),l=0;lli[data-value="+w+"]").before($("#soul-columns"+D+">li[data-value="+w+"]").next()),l=0;l'),$("#column-remove").css({top:e.clientY-$("#column-remove").height()/2,left:e.clientX-$("#column-remove").width()/2,"font-size":y-e.clientY+"px"}),$("#column-remove").show()):$("#column-remove").hide()}}).on("mouseup",function(){if($(document).unbind("selectstart"),$("body").off("mousemove").off("mouseup"),P&&b){if(P=!1,O){"checkbox"!==d.type&&o.on("click",function(e){e.stopPropagation()}),O=!1,z.removeClass("no-left-border"),k.removeClass("isDrag").css({position:"relative","z-index":"inherit",left:"inherit","border-left":"inherit",width:"inherit","background-color":"inherit"}),k.next().remove();var t=k.prev().data("key");if(g){var e=z.children(".layui-table-header").children("table").find('th[data-key="'+S+'"]');t?e.parent().children('th[data-key="'+t+'"]').after(e):"right"===g?0'),e.parent().children("th:first").after(e),e.parent().children("th:first").remove())}if(_?(T.find('td[data-key="'+S+'"]').each(function(){if(t)$(this).parent().children('td[data-key="'+t+'"]').after($(this));else if("right"===g){if(0'),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove())}}else $(this).parent().prepend(' | '),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove()}),0'),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove())}else $(this).parent().prepend(' | '),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove()})):I?(c.find('td[data-key="'+S+'"]').each(function(){if(t)$(this).parent().children('td[data-key="'+t+'"]').after($(this));else if("right"===g){if(0'),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove())}}else $(this).parent().prepend(' | '),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove()}),W.find('td[data-key="'+S+'"][data-clone]').each(function(){$(this).prev().removeClass("isDrag").css({position:"relative","z-index":"inherit",left:"inherit","border-left":"inherit",width:"inherit","background-color":"inherit"}),$(this).remove()}),0'),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove())}else $(this).parent().prepend(' | '),$(this).parent().children("td:first").after($(this)),$(this).parent().children("td:first").remove()}),E.find('td[data-key="'+S+'"][data-clone]').each(function(){$(this).prev().removeClass("isDrag").css({position:"relative","z-index":"inherit",left:"inherit",width:"inherit","background-color":"inherit"}),$(this).remove()}))):(T.find('td[data-key="'+S+'"][data-clone]').each(function(){$(this).prev().removeClass("isDrag").css({position:"relative","z-index":"inherit",left:"inherit",width:"inherit","background-color":"inherit"}),$(this).remove()}),0tr>th[data-key="+S+"]").addClass(HIDE),T.find('tbody>tr>td[data-key="'+S+'"]').addClass(HIDE),X.find('tbody>tr>td[data-key="'+S+'"]').addClass(HIDE),d.hide=!0,F.filter&&F.filter.cache&&localStorage.setItem(location.pathname+location.hash+F.id,R.deepStringify(F.cols)),$("#soul-columns"+D).find('li[data-value="'+w+'"]>input').prop("checked",!1),tableFilter.resize(F)),$("#column-remove").hide()}})}})}})}}},rowDrag:function(s){var v=this,x=$(s.elem),m=x.next().children(".layui-table-box"),i=m.children(".layui-table-fixed").children(".layui-table-body").children("table"),l=m.children(".layui-table-body").children("table"),e=$.merge(m.children(".layui-table-body").children("table"),i),c=s.id,g=!1,a=s.rowDrag.trigger||"row",t="row"===a?e.children("tbody").children("tr"):e.find(a);"row"!==a&&e.find(a).css("cursor","move"),t.on("mousedown",function(e){if(0===e.button){var o="row"===a?$(this):$(this).parents("tr:eq(0)"),d=parseInt(o.data("index")),u=l.children("tbody").children("tr[data-index="+d+"]"),f=u.clone().css("visibility","hidden"),p=i.children("tbody").children("tr[data-index="+d+"]"),b=m.children(".layui-table-body").scrollTop(),t=o.position().top,y=e.clientY-t;$("body").on("mousemove",function(e){if(!g){g=!0;var t=x.next().find("style")[0],i=t.sheet||t.styleSheet||{};v.addCSSRule(i,".layui-table-view .layui-table td","cursor: move"),v.addCSSRule(i,".layui-table tr","transition: none"),m.addClass("noselect"),u.after(f),u.css({position:"absolute","z-index":1}),p.each(function(){$(this).after($(this).clone().css("visibility","hidden")),$(this).css({position:"absolute","z-index":102})})}var l=e.clientY-y+(m.children(".layui-table-body").scrollTop()-b),a=f.position().top,n=u.prev(),r=0n.height()/2,c=d&&l-a>o.height()/2;if(0l&&(n=layer.tips(''+$(this).text()+"",this,{tips:[1,d],maxWidth:a,time:0})))}i.off("mouseenter","td").on("mouseenter","td",function(){var e=this;r=setTimeout(function(){a.call(e)},l)}).on("mouseleave","td",function(){a.call(this,"hide")})}else"title"===t.type&&i.off("mouseenter","td").on("mouseenter","td",function(){var e=$(this),t=e.children(".layui-table-cell");e.data("off")||t.prop("scrollWidth")>t.outerWidth()&&t.attr("title",$(this).text())})},contextmenu:function(h){for(var e=$(h.elem),t=e.next().children(".layui-table-box"),i=$.merge(t.children(".layui-table-header").children("table"),t.children(".layui-table-fixed").children(".layui-table-header").children("table")),l=t.children(".layui-table-fixed").children(".layui-table-body").children("table"),a=$.merge(t.children(".layui-table-body").children("table"),l),n=e.next().children(".layui-table-total").children("table"),u=h.id,r={header:{box:i,tag:"th",opts:h.contextmenu?h.contextmenu.header:"",cols:{}},body:{box:a,tag:"td",opts:h.contextmenu?h.contextmenu.body:"",cols:{},isBody:!0},total:{box:n,tag:"td",opts:h.contextmenu?h.contextmenu.total:"",cols:{}}},o=!1,d=0;d