Files
RuoYi/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js

8 lines
124 KiB
JavaScript
Raw Normal View History

/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* version: 1.18.0
* https://github.com/wenzhixin/bootstrap-table/
*/
function getRememberRowIds(t,e){return $.isArray(t)?props=$.map(t,function(t){return t[e]}):props=[t[e]],props}function addRememberRow(t,e){var i=null==table.options.uniqueId?table.options.columns[1].field:table.options.uniqueId,n=getRememberRowIds(t,i);-1==$.inArray(e[i],n)&&(t[t.length]=e)}function removeRememberRow(t,e){var i=null==table.options.uniqueId?table.options.columns[1].field:table.options.uniqueId,n=getRememberRowIds(t,i),o=$.inArray(e[i],n);-1!=o&&t.splice(o,1)}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t=t||self,t.BootstrapTable=e(t.jQuery))}(this,function(t){function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}function i(t,e){return RegExp(t,e)}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value" in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),t}function s(t,e){return h(t)||d(t,e)||f()}function l(t){return c(t)||u(t)||p()}function c(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++){i[e]=t[e]}return i}}function h(t){return Array.isArray(t)?t:void 0}function u(t){return Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)?Array.from(t):void 0}function d(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var i=[],n=!0,o=!1,r=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0){}}catch(l){o=!0,r=l}finally{try{n||null==s["return"]||s["return"]()}finally{if(o){throw r}}}return i}}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t;var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v=function(t){return t&&t.Math==Math&&t},b=v("object"==typeof globalThis&&globalThis)||v("object"==typeof window&&window)||v("object"==typeof self&&self)||v("object"==typeof g&&g)||Function("return this")(),m=function(t){try{return !!t()}catch(e){return !0}},y=!m(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),w={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,x=S&&!w.call({1:2},1),k=x?function(t){var e=S(this,t);return !!e&&e.enumerable}:w,O={f:k},C=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},P={}.toString,T=function(t){return P.call(t).slice(8,-1)},I="".split,A=m(function(){return !Object("z").propertyIsEnumerable(0)})?function(t){return"String"==T(t)?I.call(t,""):Object(t)}:Object,$=function(t){if(void 0==t){throw TypeError("Can't call method on "+t)}return t},R=function(t){return A($(t))},E=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=function(t,e){if(!E(t)){return t}var i,n;if(e&&"function"==typeof(i=t.toString)&&!E(n=i.call(t))){return n}if("function"==typeof(i=t.valueOf)&&!E(n=i.call(t))){return n}if(!e&&"function"==typeof(i=t.toString)&&!E(n=i.call(t))){return n}throw TypeError("Can't convert object to primitive value")},_={}.hasOwnProperty,N=function(t,e){return _.call(t,e)},F=b.document,V=E(F)&&E(F.createElement),D=function(t){return V?F.createElement(t):{}},B=!y&&!m(function(){return 7!=Object.defineProperty(D("div"),"a",{get:function(){return 7}}).a}),L=Object.getOwnPropertyDescriptor,H=y?L:function(t,e){if(t=R(t),e=j(e,!0),B){try{return L(t,e)}catch(i){}}return N(t,e)?C(!O.f.call(t,e),t[e]):void 0},M={f:H},U=func
});e.visible&&v++},m=g.colspanIndex;m<g.colspanIndex+g.colspanGroup;m++){b(m)}g.colspan=v,g.visible=v>0}}}catch(y){u=!0,d=y}finally{try{h||null==f["return"]||f["return"]()}finally{if(u){throw d}}}}}catch(y){o=!0,r=y}finally{try{n||null==s["return"]||s["return"]()}finally{if(o){throw r}}}},getScrollBarWidth:function(){if(void 0===this.cachedWidth){var e=t("<div/>").addClass("fixed-table-scroll-inner"),i=t("<div/>").addClass("fixed-table-scroll-outer");i.append(e),t("body").append(i);var n=e[0].offsetWidth;i.css("overflow","scroll");var o=e[0].offsetWidth;n===o&&(o=i[0].clientWidth),i.remove(),this.cachedWidth=n-o}return this.cachedWidth},calculateObjectValue:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,r=e;if("string"==typeof e){var a=e.split(".");if(a.length>1){r=window;var s=!0,c=!1,h=void 0;try{for(var u,d=a[Symbol.iterator]();!(s=(u=d.next()).done);s=!0){var p=u.value;r=r[p]}}catch(f){c=!0,h=f}finally{try{s||null==d["return"]||d["return"]()}finally{if(c){throw h}}}}else{r=window[e]}}return null!==r&&"object"===n(r)?r:"function"==typeof r?r.apply(t,i||[]):!r&&"string"==typeof e&&this.sprintf.apply(this,[e].concat(l(i)))?this.sprintf.apply(this,[e].concat(l(i))):o},compareObjects:function(t,e,i){var n=Object.keys(t),o=Object.keys(e);if(i&&n.length!==o.length){return !1}for(var r=0,a=n;r<a.length;r++){var s=a[r];if(o.includes(s)&&t[s]!==e[s]){return !1}}return !0},escapeHTML:function(t){return"string"==typeof t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#x60;"):t},unescapeHTML:function(t){return"string"==typeof t?t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#x60;/g,"`"):t},getRealDataAttr:function(t){for(var e=0,i=Object.entries(t);e<i.length;e++){var n=s(i[e],2),o=n[0],r=n[1],a=o.split(/(?=[A-Z])/).join("-").toLowerCase();a!==o&&(t[a]=r,delete t[o])}return t},getItemField:function(t,e,i){var n=t;if("string"!=typeof e||t.hasOwnProperty(e)){return i?this.escapeHTML(t[e]):t[e]}var o=e.split("."),r=!0,a=!1,s=void 0;try{for(var l,c=o[Symbol.iterator]();!(r=(l=c.next()).done);r=!0){var h=l.value;n=n&&n[h]}}catch(u){a=!0,s=u}finally{try{r||null==c["return"]||c["return"]()}finally{if(a){throw s}}}return i?this.escapeHTML(n):n},isIEBrowser:function(){return navigator.userAgent.includes("MSIE ")||/Trident.*rv:11\./.test(navigator.userAgent)},findIndex:function(t,e){var i=!0,n=!1,o=void 0;try{for(var r,a=t[Symbol.iterator]();!(i=(r=a.next()).done);i=!0){var s=r.value;if(JSON.stringify(s)===JSON.stringify(e)){return t.indexOf(s)}}}catch(l){n=!0,o=l}finally{try{i||null==a["return"]||a["return"]()}finally{if(n){throw o}}}return -1},trToData:function(e,i){var n=this,o=[],r=[];return i.each(function(i,a){var s=t(a),l={};l._id=s.attr("id"),l._class=s.attr("class"),l._data=n.getRealDataAttr(s.data()),l._style=s.attr("style"),s.find(">td,>th").each(function(o,a){for(var s=t(a),c=+s.attr("colspan")||1,h=+s.attr("rowspan")||1,u=o;r[i]&&r[i][u];u++){}for(var d=u;u+c>d;d++){for(var p=i;i+h>p;p++){r[p]||(r[p]=[]),r[p][d]=!0}}var f=e[u].field;l[f]=s.html().trim(),l["_".concat(f,"_id")]=s.attr("id"),l["_".concat(f,"_class")]=s.attr("class"),l["_".concat(f,"_rowspan")]=s.attr("rowspan"),l["_".concat(f,"_colspan")]=s.attr("colspan"),l["_".concat(f,"_title")]=s.attr("title"),l["_".concat(f,"_data")]=n.getRealDataAttr(s.data()),l["_".concat(f,"_style")]=s.attr("style")}),o.push(l)}),o},sort:function(t,e,i,n,o,r){return(void 0===t||null===t)&&(t=""),(void 0===e||null===e)&&(e=""),n&&t===e&&(t=o,e=r),this.isNumeric(t)&&this.isNumeric(e)?(t=parseFloat(t),e=parseFloat(e),e>t?-1*i:t>e?i:0):t===e?0:("string"!=typeof t&&(t=""+t),-1===t.localeCompare(e)?-1*i:i)},getEventName:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=e||"".concat(+new Date).concat(~~(1000000*Math.random())),"".concat(t,"-").concat(e)},hasDetailViewIcon:function(t){return t.detailView&&t.detailViewIcon&&!t.cardView},ge
this.$selectItem.each(function(i,n){e.data[t(n).data("index")][e.header.stateField]=t(n).prop("checked")})}},{key:"resetRows",value:function(){var t=!0,e=!1,i=void 0;try{for(var n,o=this.data[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){var r=n.value;this.$selectAll.prop("checked",!1),this.$selectItem.prop("checked",!1),this.header.stateField&&(r[this.header.stateField]=!1)}}catch(a){e=!0,i=a}finally{try{t||null==o["return"]||o["return"]()}finally{if(e){throw i}}}this.initHiddenRows()}},{key:"trigger",value:function(i){for(var n,o,r="".concat(i,".bs.table"),a=arguments.length,s=Array(a>1?a-1:0),l=1;a>l;l++){s[l-1]=arguments[l]}(n=this.options)[e.EVENTS[r]].apply(n,[].concat(s,[this])),this.$el.trigger(t.Event(r,{sender:this}),s),(o=this.options).onAll.apply(o,[r].concat([].concat(s,[this]))),this.$el.trigger(t.Event("all.bs.table",{sender:this}),[r,s])}},{key:"resetHeader",value:function(){var t=this;clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(function(){return t.fitHeader()},this.$el.is(":hidden")?100:0)}},{key:"fitHeader",value:function(){var e=this;if(this.$el.is(":hidden")){return void (this.timeoutId_=setTimeout(function(){return e.fitHeader()},100))}var i=this.$tableBody.get(0),n=i.scrollWidth>i.clientWidth&&i.scrollHeight>i.clientHeight+this.$header.outerHeight()?Ka.getScrollBarWidth():0;this.$el.css("margin-top",-this.$header.outerHeight());var o=t(":focus");if(o.length>0){var r=o.parents("th");if(r.length>0){var a=r.attr("data-field");if(void 0!==a){var s=this.$header.find("[data-field='".concat(a,"']"));s.length>0&&s.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css("margin-right",n).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),this.$tableLoading.css("width",this.$el.outerWidth());var l=t(".focus-temp:visible:eq(0)");l.length>0&&(l.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each(function(i,n){e.$header_.find(Ka.sprintf('th[data-field="%s"]',t(n).data("field"))).data(t(n).data())});for(var c=this.getVisibleFields(),h=this.$header_.find("th"),u=this.$body.find(">tr:not(.no-records-found,.virtual-scroll-top)").eq(0);u.length&&u.find('>td[colspan]:not([colspan="1"])').length;){u=u.next()}var d=u.find("> *").length;u.find("> *").each(function(i,n){var o=t(n);if(Ka.hasDetailViewIcon(e.options)&&(0===i&&"right"!==e.options.detailViewAlign||i===d-1&&"right"===e.options.detailViewAlign)){var r=h.filter(".detail"),a=r.innerWidth()-r.find(".fht-cell").width();return void r.find(".fht-cell").width(o.innerWidth()-a)}var s=i-Ka.getDetailViewIndexOffset(e.options),l=e.$header_.find(Ka.sprintf('th[data-field="%s"]',c[s]));l.length>1&&(l=t(h[o[0].cellIndex]));var u=l.innerWidth()-l.find(".fht-cell").width();l.find(".fht-cell").width(o.innerWidth()-u)}),this.horizontalScroll(),this.trigger("post-header")}},{key:"initFooter",value:function(){if(this.options.showFooter&&!this.options.cardView){var t=this.getData(),e=[],i="";Ka.hasDetailViewIcon(this.options)&&(i='<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>'),i&&"right"!==this.options.detailViewAlign&&e.push(i);var n=!0,o=!1,r=void 0;try{for(var a,l=this.columns[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){var c=a.value,h="",u="",d=[],p={},f=Ka.sprintf(' class="%s"',c["class"]);if(c.visible&&(!(this.footerData&&this.footerData.length>0)||c.field in this.footerData[0])){if(this.options.cardView&&!c.cardVisible){return}if(h=Ka.sprintf("text-align: %s; ",c.falign?c.falign:c.align),u=Ka.sprintf("vertical-align: %s; ",c.valign),p=Ka.calculateObjectValue(null,this.options.footerStyle,[c]),p&&p.css){for(var g=0,v=Object.entries(p.css);g<v.length;g++){var b=s(v[g],2),m=b[0],y=b[1];d.push("".concat(m,": ").concat(y))}}p&&p.classes&&(f=Ka.sprintf(' class="%s"',c["class"]?[c["class"],p.classes].join(" "):p.classes)),e.push("<th",f,Ka.sprintf(' style="%s"',h+u+d.concat().join("; ")));var w=0;this.