diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 index adb19223..db036199 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ -/nbproject/ -/addons/ -.idea -composer.lock -*.log -*.css.map -thinkphp -vendor -runtime -public/assets/libs/ -/application/admin/command/Install/*.lock -/public/uploads +/nbproject/ +.idea +composer.lock +*.log +*.css.map +thinkphp +vendor +runtime +addons +public/assets/libs/ +/application/admin/command/Install/*.lock +/public/uploads \ No newline at end of file diff --git a/bower.json b/bower.json index dc2c4c71..d78c1235 100644 --- a/bower.json +++ b/bower.json @@ -37,5 +37,8 @@ "jquery-addtabs": "https://github.com/karsonzhang/jquery-addtabs.git", "jquery-cxselect": "https://github.com/karsonzhang/cxSelect.git", "selectpage": "https://github.com/karsonzhang/selectpage.git" + }, + "resolutions": { + "jspdf": "1.1.239 || 1.3.2" } } diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index 30f08b4b..f2e2e8d4 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -7164,72 +7164,71 @@ define("bootstrap-table-mobile", ["bootstrap-table"], (function (global) { /* tableExport.jquery.plugin - Copyright (c) 2015-2017 hhurz, https://github.com/hhurz/ - Multi Worksheets Support, Copyright (c) 2017 hejiheji001, https://github.com/hejiheji001/ - Original Work, Copyright (c) 2014 Giri Raj, https://github.com/kayalshri/ + Copyright (c) 2015-2017 hhurz, https://github.com/hhurz - Licensed under the MIT License, http://opensource.org/licenses/mit-license + Original Work Copyright (c) 2014 Giri Raj + + Licensed under the MIT License */ -(function(c){c.fn.extend({tableExport:function(n){function N(b){var a=[];c(b).find("thead").first().find("th").each(function(b,f){void 0!==c(f).attr("data-field")?a[b]=c(f).attr("data-field"):a[b]=b.toString()});return a}function x(b,m,e,f,z){if(-1==c.inArray(e,a.ignoreRow)&&-1==c.inArray(e-f,a.ignoreRow)){var F=c(b).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display")||"always"==c(this).closest("table").data("tableexport-display"))}).find(m), -l=0;F.each(function(b){if(("always"==c(this).data("tableexport-display")||"none"!=c(this).css("display")&&"hidden"!=c(this).css("visibility")&&"none"!=c(this).data("tableexport-display"))&&"function"===typeof z){var f,m=1,r=1;var d=F.length;if("undefined"!=typeof y[e]&&0d&&"undefined"!=typeof I[d]&&-1!=c.inArray(I[d],a.ignoreColumn)&&(g=!0):"number"!=typeof a.ignoreColumn[0]||-1==c.inArray(d,a.ignoreColumn)&&-1==c.inArray(d-f,a.ignoreColumn)||(g=!0));if(!1===g)for(z(this,e,b),f=1;fF&&(d=Math.min(b.width,this.width),h=this.height*d/this.width);d*=r;h*=r;hb.textPos.x&&f+h>b.textPos.x+b.width){if(0<=".,!%*;:=-".indexOf(g.charAt(0))){var k=g.charAt(0), -h=e.doc.getStringUnitWidth(k)*e.doc.internal.getFontSize();f+h<=b.textPos.x+b.width&&(e.doc.autoTableText(k,f,m,d),g=g.substring(1,g.length));h=e.doc.getStringUnitWidth(g)*e.doc.internal.getFontSize()}f=b.textPos.x;m+=e.doc.internal.getFontSize()}for(;g.length&&f+h>b.textPos.x+b.width;)g=g.substring(0,g.length-1),h=e.doc.getStringUnitWidth(g)*e.doc.internal.getFontSize();e.doc.autoTableText(g,f,m,d);f+=h}if(l||r)c(a).is("b")?l=!1:c(a).is("i")&&(r=!1),e.doc.setFontType(l||r?l?"bold":"italic":"normal"); -a=a.nextSibling}b.textPos.x=f;b.textPos.y=m}else e.doc.autoTableText(b.text,b.textPos.x,b.textPos.y,d)}}function Q(b,a,e){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function U(b){b=Q(b||"0",a.numbers.html.thousandsSeparator,"");b=Q(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function v(b,m,e){var f="";if(null!==b){var z=c(b);if(z[0].hasAttribute("data-tableexport-value"))var d=z.data("tableexport-value");else if(d= -z.html(),"function"===typeof a.onCellHtmlData)d=a.onCellHtmlData(z,m,e,d);else if(""!=d){b=c.parseHTML(d);var l=0,g=0;d="";c.each(b,function(){if(c(this).is("input"))d+=z.find("input").eq(l++).val();else if(c(this).is("select"))d+=z.find("select option:selected").eq(g++).text();else if("undefined"===typeof c(this).html())d+=c(this).text();else if(void 0===jQuery().bootstrapTable||!0!==c(this).hasClass("filterControl"))d+=c(this).html()})}if(!0===a.htmlContent)f=c.trim(d);else if(""!=d){var h=d.replace(/\n/g, -"\u2028").replace(//gi,"\u2060");b=c("
").html(h).contents();h="";c.each(b.text().split("\u2028"),function(b,a){0b?"-":"")+(a.numbers.output.thousandsSeparator?(n?k[0].substr(0,n)+a.numbers.output.thousandsSeparator:"")+k[0].substr(n).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):k[0])+(k[1].length?a.numbers.output.decimalMark+k[1]:"")}}!0===a.escape&&(f=escape(f));"function"===typeof a.onCellData&&(f=a.onCellData(z,m,e,f))}return f}function na(b,a,e){return a+"-"+e.toLowerCase()}function O(a, -m){var b=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(a),f=m;b&&(f=[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]);return f}function ga(b){var a=E(b,"text-align"),e=E(b,"font-weight"),f=E(b,"font-style"),d="";"start"==a&&(a="rtl"==E(b,"direction")?"right":"left");700<=e&&(d="bold");"italic"==f&&(d+=f);""===d&&(d="normal");a={style:{align:a,bcolor:O(E(b,"background-color"),[255,255,255]),color:O(E(b,"color"),[0,0,0]),fstyle:d},colspan:parseInt(c(b).attr("colspan"))||0,rowspan:parseInt(c(b).attr("rowspan"))|| -0};null!==b&&(b=b.getBoundingClientRect(),a.rect={width:b.width,height:b.height});return a}function E(a,c){try{return window.getComputedStyle?(c=c.replace(/([a-z])([A-Z])/,na),window.getComputedStyle(a,null).getPropertyValue(c)):a.currentStyle?a.currentStyle[c]:a.style[c]}catch(e){}return""}function P(a,c,e){c=E(a,c).match(/\d+/);if(null!==c){c=c[0];a=a.parentElement;var b=document.createElement("div");b.style.overflow="hidden";b.style.visibility="hidden";a.appendChild(b);b.style.width=100+e;e=100/ -b.offsetWidth;a.removeChild(b);return c*e}return 0}function V(){if(!(this instanceof V))return new V;this.SheetNames=[];this.Sheets={}}function oa(a){for(var b=new ArrayBuffer(a.length),e=new Uint8Array(b),f=0;f!=a.length;++f)e[f]=a.charCodeAt(f)&255;return b}function pa(a){for(var b={},e={s:{c:1E7,r:1E7},e:{c:0,r:0}},f=0;f!=a.length;++f)for(var c=0;c!=a[f].length;++c){e.s.r>f&&(e.s.r=f);e.s.c>c&&(e.s.c=c);e.e.re.s.c&&(b["!ref"]=XLSX.utils.encode_range(e));return b}function da(a){var b=0,c;if(0===a.length)return b;var f=0;for(c=a.length;fg?d+=String.fromCharCode(g):(127g?d+=String.fromCharCode(g>>6|192):(d+=String.fromCharCode(g>>12|224),d+=String.fromCharCode(g>>6&63|128)),d+=String.fromCharCode(g&63|128))}for(a=d;f>2;l=(l&3)<<4|d>>4;var r=(d&15)<<2|c>>6;var h=c&63;isNaN(d)?r=h=64:isNaN(c)&&(h=64);b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+ -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)}return b}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelFileFormat:"xlshtml",excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4", -margins:{left:20,right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onAutotableText:null,onTable:null,outputImages:!0}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".", -thousandsSeparator:","}},onCellData:null,onCellHtmlData:null,onMsoNumberFormat:null,outputMode:"file",pdfmake:{enabled:!1,docDefinition:{pageOrientation:"portrait",defaultStyle:{font:"Roboto"}},fonts:{}},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"Worksheet"},t=this,R=null,q=[],g=[],p=0,y=[],h="",I=[];c.extend(!0,a,n);I=N(t);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var C="",J=0,p=0,W=function(b,d,e){b.each(function(){h="";x(this, -d,p,e+b.length,function(b,c,e){var f=h,d="";if(null!==b)if(b=v(b,c,e),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&b.toLocaleString(),d=Q(c,"\t"," ");else if(b instanceof Date)d=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(d=Q(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=d.indexOf(a.csvSeparator)||/[\r\n ]/g.test(d))d=a.csvEnclosure+d+a.csvEnclosure;h=f+(d+("tsv"==a.type?"\t":a.csvSeparator))});h=c.trim(h).substring(0,h.length-1);0"+v(a,c,e)+""});p++});B+="";var ha=1;c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector)); -c(g).each(function(){var a=1;h="";x(this,"td,th",p,q.length+g.length,function(b,c,f){h+=""+v(b,c,f)+"";a++});0"!=h&&(B+=''+h+"",ha++);p++});B+="";!0===a.consoleLog&&console.log(B);if("string"===a.outputMode)return B;if("base64"===a.outputMode)return D(B);try{w=new Blob([B],{type:"application/xml;charset=utf-8"}),saveAs(w,a.fileName+".xml")}catch(b){A(a.fileName+".xml","data:application/xml;charset=utf-8;base64,", -B)}}else if("excel"===a.type&&"xmlss"===a.excelFileFormat){var k=c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))});var Y=[];k.each(function(){var b=c(this),d="";p=0;I=N(this);q=b.find("thead").first().find(a.theadSelector);var d=d+"",e=0;q.each(function(){h="";x(this,"th,td",p,q.length,function(a,b,c){null!==a&&(h+=''+v(a,b,c)+"",e++)});0"+h+"");p++});g=[];b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});c(g).each(function(){c(this);h="";x(this,"td,th",p,q.length+g.length,function(a,b,c){if(null!==a){var d="String",e="";a=v(a,b,c);!1!==jQuery.isNumeric(a)?d="Number":(b=a,-1"));h+="'+a+""}}); -0"+h+"");p++});d+="
";Y.push(d);!0===a.consoleLog&&console.log(d)});k=' '+ +(function(c){c.fn.extend({tableExport:function(n){function N(b){var a=[];c(b).find("thead").first().find("th").each(function(b,f){void 0!==c(f).attr("data-field")?a[b]=c(f).attr("data-field"):a[b]=b.toString()});return a}function y(b,m,e,f,K){if(-1==c.inArray(e,a.ignoreRow)&&-1==c.inArray(e-f,a.ignoreRow)){var r=c(b).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display")||"always"==c(this).closest("table").data("tableexport-display"))}).find(m), +k=0;r.each(function(b){if(("always"==c(this).data("tableexport-display")||"none"!=c(this).css("display")&&"hidden"!=c(this).css("visibility")&&"none"!=c(this).data("tableexport-display"))&&"function"===typeof K){var f,m=1,t=1;var d=r.length;if("undefined"!=typeof z[e]&&0d&&"undefined"!=typeof H[d]&&-1!=c.inArray(H[d],a.ignoreColumn))&&(g=!0);if(!1===g)for(K(this,e,b),f=1;fr&&(d=Math.min(b.width,this.width),h=this.height* +d/this.width);d*=t;h*=t;hb.textPos.x&&f+g>b.textPos.x+b.width){if(0<=".,!%*;:=-".indexOf(d.charAt(0))){var h=d.charAt(0),g=e.doc.getStringUnitWidth(h)*e.doc.internal.getFontSize();f+g<=b.textPos.x+b.width&& +(e.doc.autoTableText(h,f,m,r),d=d.substring(1,d.length));g=e.doc.getStringUnitWidth(d)*e.doc.internal.getFontSize()}f=b.textPos.x;m+=e.doc.internal.getFontSize()}for(;d.length&&f+g>b.textPos.x+b.width;)d=d.substring(0,d.length-1),g=e.doc.getStringUnitWidth(d)*e.doc.internal.getFontSize();e.doc.autoTableText(d,f,m,r);f+=g}if(k||t)c(a).is("b")?k=!1:c(a).is("i")&&(t=!1),e.doc.setFontType(k||t?k?"bold":"italic":"normal");a=a.nextSibling}b.textPos.x=f;b.textPos.y=m}else e.doc.autoTableText(b.text,b.textPos.x, +b.textPos.y,r)}}function Q(b,a,e){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function U(b){b=Q(b||"0",a.numbers.html.thousandsSeparator,"");b=Q(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function w(b,m,e){var f="";if(null!==b){var d=c(b);if(d[0].hasAttribute("data-tableexport-value"))var r=(r=d.data("tableexport-value"))?r+"":"";else if(r=d.html(),"function"===typeof a.onCellHtmlData)r=a.onCellHtmlData(d,m,e, +r);else if(""!=r){b=c.parseHTML(r);var k=0,t=0;r="";c.each(b,function(){if(c(this).is("input"))r+=d.find("input").eq(k++).val();else if(c(this).is("select"))r+=d.find("select option:selected").eq(t++).text();else if("undefined"===typeof c(this).html())r+=c(this).text();else if(void 0===jQuery().bootstrapTable||!0!==c(this).hasClass("filterControl"))r+=c(this).html()})}if(!0===a.htmlContent)f=c.trim(r);else if(r&&""!=r){var g=r.replace(/\n/g,"\u2028").replace(//gi,"\u2060");b=c("
").html(g).contents(); +g="";c.each(b.text().split("\u2028"),function(b,a){0b?1:0)).split(".");1==h.length&&(h[1]= +"");var l=3b?"-":"")+(a.numbers.output.thousandsSeparator?(l?h[0].substr(0,l)+a.numbers.output.thousandsSeparator:"")+h[0].substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):h[0])+(h[1].length?a.numbers.output.decimalMark+h[1]:"")}}!0===a.escape&&(f=escape(f));"function"===typeof a.onCellData&&(f=a.onCellData(d,m,e,f))}return f}function na(b,a,e){return a+"-"+e.toLowerCase()}function O(b,a){var e=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(b), +f=a;e&&(f=[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]);return f}function ga(b){var a=E(b,"text-align"),e=E(b,"font-weight"),f=E(b,"font-style"),d="";"start"==a&&(a="rtl"==E(b,"direction")?"right":"left");700<=e&&(d="bold");"italic"==f&&(d+=f);""===d&&(d="normal");a={style:{align:a,bcolor:O(E(b,"background-color"),[255,255,255]),color:O(E(b,"color"),[0,0,0]),fstyle:d},colspan:parseInt(c(b).attr("colspan"))||0,rowspan:parseInt(c(b).attr("rowspan"))||0};null!==b&&(b=b.getBoundingClientRect(),a.rect= +{width:b.width,height:b.height});return a}function E(a,c){try{return window.getComputedStyle?(c=c.replace(/([a-z])([A-Z])/,na),window.getComputedStyle(a,null).getPropertyValue(c)):a.currentStyle?a.currentStyle[c]:a.style[c]}catch(e){}return""}function P(a,c,e){c=E(a,c).match(/\d+/);if(null!==c){c=c[0];a=a.parentElement;var b=document.createElement("div");b.style.overflow="hidden";b.style.visibility="hidden";a.appendChild(b);b.style.width=100+e;e=100/b.offsetWidth;a.removeChild(b);return c*e}return 0} +function V(){if(!(this instanceof V))return new V;this.SheetNames=[];this.Sheets={}}function oa(a){for(var b=new ArrayBuffer(a.length),e=new Uint8Array(b),f=0;f!=a.length;++f)e[f]=a.charCodeAt(f)&255;return b}function pa(a){for(var b={},e={s:{c:1E7,r:1E7},e:{c:0,r:0}},f=0;f!=a.length;++f)for(var c=0;c!=a[f].length;++c){e.s.r>f&&(e.s.r=f);e.s.c>c&&(e.s.c=c);e.e.re.s.c&&(b["!ref"]=XLSX.utils.encode_range(e));return b}function da(a){var b=0,c;if(0===a.length)return b;var f=0;for(c=a.length;fg?d+=String.fromCharCode(g): +(127g?d+=String.fromCharCode(g>>6|192):(d+=String.fromCharCode(g>>12|224),d+=String.fromCharCode(g>>6&63|128)),d+=String.fromCharCode(g&63|128))}for(a=d;f>2;k=(k&3)<<4|d>>4;var t=(d&15)<<2|c>>6;var h=c&63;isNaN(d)?t=h=64:isNaN(c)&&(h=64);b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)+ +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)}return b}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelFileFormat:"xlshtml",excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal", +overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onAutotableText:null,onTable:null,outputImages:!0}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,onCellHtmlData:null,onMsoNumberFormat:null,outputMode:"file",pdfmake:{enabled:!1,docDefinition:{pageOrientation:"portrait", +defaultStyle:{font:"Roboto"}},fonts:{}},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"Worksheet"},u=this,R=null,q=[],g=[],p=0,z=[],h="",H=[];c.extend(!0,a,n);H=N(u);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var C="",I=0,p=0,W=function(b,d,e){b.each(function(){h="";y(this,d,p,e+b.length,function(b,c,e){var f=h,d="";if(null!==b)if(b=w(b,c,e),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&b.toLocaleString(),d=Q(c, +"\t"," ");else if(b instanceof Date)d=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(d=Q(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=d.indexOf(a.csvSeparator)||/[\r\n ]/g.test(d))d=a.csvEnclosure+d+a.csvEnclosure;h=f+(d+("tsv"==a.type?"\t":a.csvSeparator))});h=c.trim(h).substring(0,h.length-1);0"+w(a,c,d)+""});p++});B+="";var ha=1;c(u).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(u).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=1;h="";y(this,"td,th",p,q.length+g.length,function(b,c,d){h+=""+w(b,c,d)+"";a++});0"!= +h&&(B+=''+h+"",ha++);p++});B+="";!0===a.consoleLog&&console.log(B);if("string"===a.outputMode)return B;if("base64"===a.outputMode)return D(B);try{x=new Blob([B],{type:"application/xml;charset=utf-8"}),saveAs(x,a.fileName+".xml")}catch(b){A(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",B)}}else if("excel"===a.type&&"xmlss"===a.excelFileFormat){var l=c(u).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")|| +"always"==c(this).data("tableexport-display"))});var Y=[];l.each(function(){var b=c(this),d="";p=0;H=N(this);q=b.find("thead").first().find(a.theadSelector);var d=d+"",e=0;q.each(function(){h="";y(this,"th,td",p,q.length,function(a,b,c){null!==a&&(h+=''+w(a,b,c)+"",e++)});0"+h+"");p++});g=[];b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});c(g).each(function(){c(this);h="";y(this,"td,th",p, +q.length+g.length,function(a,b,c){if(null!==a){var d="String",e="";a=w(a,b,c);!1!==jQuery.isNumeric(a)?d="Number":(b=a,-1"));h+="'+a+""}});0"+h+"");p++});d+="
";Y.push(d);!0===a.consoleLog&&console.log(d)});l=' '+ (new Date).toISOString()+' 9000 13860 0 0 False False '; -for(n=0;n'+Y[n]+" ";k+="";!0===a.consoleLog&&console.log(k);if("string"===a.outputMode)return k;if("base64"===a.outputMode)return D(k);try{w=new Blob([k],{type:"application/xml;charset=utf-8"}),saveAs(w,a.fileName+".xml")}catch(b){A(a.fileName+".xml","data:application/xml;charset=utf-8;base64,", -B)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){n="excel"==a.type||"xls"==a.type?"excel":"word";var G="excel"==n?"xls":"doc",S='xmlns:x="urn:schemas-microsoft-com:office:'+n+'"';k=c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))});var H="";k.each(function(){var b=c(this);p=0;I=N(this);H+="";q=b.find("thead").first().find(a.theadSelector);q.each(function(){h=""; -x(this,"th,td",p,q.length,function(b,d,f){if(null!==b){var e="";h+=""}});0"+h+"");p++});H+= -"";b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,b.find("tfoot").find(a.tfootSelector));c(g).each(function(){var b=c(this);h="";x(this,"td,th",p,q.length+g.length,function(d,f,g){if(null!==d){var e="",l=c(d).data("tableexport-msonumberformat");"undefined"==typeof l&&"function"===typeof a.onMsoNumberFormat&&(l=a.onMsoNumberFormat(d,f,g));"undefined"!=typeof l&&""!==l&&(e="style=\"mso-number-format:'"+l+"'");for(var m in a.excelstyles)a.excelstyles.hasOwnProperty(m)&& -(l=c(d).css(a.excelstyles[m]),""===l&&(l=b.css(a.excelstyles[m])),""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=l&&(e+=""===e?'style="':";",e+=a.excelstyles[m]+":"+l));h+="")+""}});0"+h+"");p++});a.displayTableName&&(H+="");H+="
"+v(c("

"+ -a.tableName+"

"))+"
";!0===a.consoleLog&&console.log(H)});k=''+('')+"";"excel"===n&&(k+="\x3c!--[if gte mso 9]>",k+="",k+="",k+="",k+="",k+="",k+=a.worksheetName,k+="",k+="",k+="", -k+="",k+="",k+="",k+="",k+="",k+="br {mso-data-placement:same-cell;}";k+="";k+="";k+=H;k+="";k+="";!0===a.consoleLog&&console.log(k);if("string"===a.outputMode)return k;if("base64"===a.outputMode)return D(k);try{w=new Blob([k],{type:"application/vnd.ms-"+a.type}),saveAs(w,a.fileName+"."+G)}catch(b){A(a.fileName+"."+G,"data:application/vnd.ms-"+n+";base64,", -k)}}else if("xlsx"==a.type){var ia=[],Z=[],p=0,g=c(t).find("thead").first().find(a.theadSelector);c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];x(this,"th,td",p,g.length,function(b,c,d){if("undefined"!==typeof b&&null!==b){var e=parseInt(b.getAttribute("colspan")),f=parseInt(b.getAttribute("rowspan"));b=v(b,c,d);""!==b&&b==+b&&(b=+b);Z.forEach(function(b){if(p>= -b.s.r&&p<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var c=0;c<=b.e.c-b.s.c;++c)a.push(null)});if(f||e)e=e||1,Z.push({s:{r:p,c:a.length},e:{r:p+(f||1)-1,c:a.length+e-1}});a.push(""!==b?b:null);if(e)for(f=0;fla){a>L.a0[0]&&(T="a0",M="l");for(var d in L)L.hasOwnProperty(d)&& -L[d][1]>a&&(T=d,M="l",L[d][0]>a&&(M="p"));la=a}}});a.jspdf.format=""===T?"a4":T;a.jspdf.orientation=""===M?"w":M}d.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);!0===d.outputImages&&(d.images={});"undefined"!=typeof d.images&&(c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=0;q=c(this).find("thead").find(a.theadSelector);c(this).find("tbody").each(function(){g.push.apply(g, -c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){x(this,"td,th",q.length+b,q.length+g.length,function(a,b,f){"undefined"!==typeof a&&null!==a&&(b=c(a).children(),"undefined"!=typeof b&&0'+Y[n]+" ";l+="";!0===a.consoleLog&&console.log(l);if("string"===a.outputMode)return l;if("base64"===a.outputMode)return D(l);try{x=new Blob([l],{type:"application/xml;charset=utf-8"}),saveAs(x,a.fileName+".xml")}catch(b){A(a.fileName+".xml","data:application/xml;charset=utf-8;base64,", +B)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){n="excel"==a.type||"xls"==a.type?"excel":"word";var F="excel"==n?"xls":"doc",S='xmlns:x="urn:schemas-microsoft-com:office:'+n+'"';l=c(u).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))});var G="";l.each(function(){var b=c(this);p=0;H=N(this);G+="";q=b.find("thead").first().find(a.theadSelector);q.each(function(){h=""; +y(this,"th,td",p,q.length,function(b,d,f){if(null!==b){var e="";h+=""}});0"+h+"");p++});G+= +"";b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,b.find("tfoot").find(a.tfootSelector));c(g).each(function(){var b=c(this);h="";y(this,"td,th",p,q.length+g.length,function(d,f,g){if(null!==d){var e="",k=c(d).data("tableexport-msonumberformat");"undefined"==typeof k&&"function"===typeof a.onMsoNumberFormat&&(k=a.onMsoNumberFormat(d,f,g));"undefined"!=typeof k&&""!==k&&(e="style=\"mso-number-format:'"+k+"'");for(var m in a.excelstyles)a.excelstyles.hasOwnProperty(m)&& +(k=c(d).css(a.excelstyles[m]),""===k&&(k=b.css(a.excelstyles[m])),""!==k&&"0px none rgb(0, 0, 0)"!=k&&"rgba(0, 0, 0, 0)"!=k&&(e+=""===e?'style="':";",e+=a.excelstyles[m]+":"+k));h+="")+""}});0"+h+"");p++});a.displayTableName&&(G+="");G+="
"+w(c("

"+ +a.tableName+"

"))+"
";!0===a.consoleLog&&console.log(G)});l=''+('')+"";"excel"===n&&(l+="\x3c!--[if gte mso 9]>",l+="",l+="",l+="",l+="",l+="",l+=a.worksheetName,l+="",l+="",l+="", +l+="",l+="",l+="",l+="",l+="",l+="br {mso-data-placement:same-cell;}";l+="";l+="";l+=G;l+="";l+="";!0===a.consoleLog&&console.log(l);if("string"===a.outputMode)return l;if("base64"===a.outputMode)return D(l);try{x=new Blob([l],{type:"application/vnd.ms-"+a.type}),saveAs(x,a.fileName+"."+F)}catch(b){A(a.fileName+"."+F,"data:application/vnd.ms-"+n+";base64,", +l)}}else if("xlsx"==a.type){var ia=[],Z=[],p=0,g=c(u).find("thead").first().find(a.theadSelector);c(u).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(u).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];y(this,"th,td",p,g.length,function(b,c,d){if("undefined"!==typeof b&&null!==b){var e=parseInt(b.getAttribute("colspan")),f=parseInt(b.getAttribute("rowspan"));b=w(b,c,d);""!==b&&b==+b&&(b=+b);Z.forEach(function(b){if(p>= +b.s.r&&p<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var c=0;c<=b.e.c-b.s.c;++c)a.push(null)});if(f||e)e=e||1,Z.push({s:{r:p,c:a.length},e:{r:p+(f||1)-1,c:a.length+e-1}});a.push(""!==b?b:null);if(e)for(f=0;fla){a>L.a0[0]&&(T="a0",M="l");for(var d in L)L.hasOwnProperty(d)&& +L[d][1]>a&&(T=d,M="l",L[d][0]>a&&(M="p"));la=a}}});a.jspdf.format=""===T?"a4":T;a.jspdf.orientation=""===M?"w":M}d.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);!0===d.outputImages&&(d.images={});"undefined"!=typeof d.images&&(c(u).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=0;q=c(this).find("thead").find(a.theadSelector);c(this).find("tbody").each(function(){g.push.apply(g, +c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){y(this,"td,th",q.length+b,q.length+g.length,function(a,b,f){"undefined"!==typeof a&&null!==a&&(b=c(a).children(),"undefined"!=typeof b&&0a.styles.rowHeight&&(a.styles.rowHeight=g)}"undefined"!=typeof e.style&&!0!==e.style.hidden&&(a.styles.halign=e.style.align,"inherit"===f.styles.fillColor&&(a.styles.fillColor=e.style.bcolor),"inherit"===f.styles.textColor&&(a.styles.textColor=e.style.color),"inherit"===f.styles.fontStyle&&(a.styles.fontStyle=e.style.fstyle))}});"function"!==typeof f.createdCell&&(f.createdCell=function(a,b){var c=d.rowoptions[b.row.index+ ":"+b.column.dataKey];"undefined"!=typeof c&&"undefined"!=typeof c.style&&!0!==c.style.hidden&&(a.styles.halign=c.style.align,"inherit"===f.styles.fillColor&&(a.styles.fillColor=c.style.bcolor),"inherit"===f.styles.textColor&&(a.styles.textColor=c.style.color),"inherit"===f.styles.fontStyle&&(a.styles.fontStyle=c.style.fstyle))});"function"!==typeof f.drawHeaderCell&&(f.drawHeaderCell=function(a,b){var c=d.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&& 0<=c.rowIndex?ba(a,b,c):!1});"function"!==typeof f.drawCell&&(f.drawCell=function(a,b){var c=d.rowoptions[b.row.index+":"+b.column.dataKey];if(ba(a,b,c))if(d.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle),"undefined"!=typeof c&&"undefined"!=typeof c.kids&&0d.dh||"undefined"==typeof d.dh)d.dh=e;d.dw=a.width/c.rect.width;e=a.textPos.y;ea(a,c.kids,d);a.textPos.y=e;fa(a,c.kids,d)}else fa(a,{},d);return!1});d.headerrows=[];q=c(this).find("thead").find(a.theadSelector); -q.each(function(){b=0;d.headerrows[e]=[];x(this,"th,td",e,q.length,function(a,c,f){var g=ga(a);g.title=v(a,c,f);g.key=b++;g.rowIndex=e;d.headerrows[e].push(g)});e++});if(0 ' + value; }, - image: function (value, row, index, custom) { - var classname = typeof custom !== 'undefined' ? custom : 'img-sm img-center'; + image: function (value, row, index) { + var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; return ''; }, - images: function (value, row, index, custom) { - var classname = typeof custom !== 'undefined' ? custom : 'img-sm img-center'; + images: function (value, row, index) { + var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; var arr = value.split(','); var html = []; $.each(arr, function (i, value) { @@ -8031,12 +8030,12 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr }); return html.join(' '); }, - status: function (value, row, index, custom) { + status: function (value, row, index) { //颜色状态数组,可使用red/yellow/aqua/blue/navy/teal/olive/lime/fuchsia/purple/maroon var colorArr = {normal: 'success', hidden: 'grey', deleted: 'danger', locked: 'info'}; - //如果有自定义状态,可以按需传入 - if (typeof custom !== 'undefined') { - colorArr = $.extend(colorArr, custom); + //如果字段列有定义custom + if (typeof this.custom !== 'undefined') { + colorArr = $.extend(colorArr, this.custom); } value = value.toString(); var color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary'; @@ -8051,14 +8050,21 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr search: function (value, row, index) { return '' + value + ''; }, - addtabs: function (value, row, index, url) { - return '' + value + ''; + addtabs: function (value, row, index) { + var url = Table.api.replaceurl(this.url, value, row, this.table); + var title = this.title ? this.title : __("Search %s", value); + return '' + value + ''; }, - flag: function (value, row, index, custom) { + dialog: function (value, row, index) { + var url = Table.api.replaceurl(this.url, value, row, this.table); + var title = this.title ? this.title : value; + return '' + value + ''; + }, + flag: function (value, row, index) { var colorArr = {index: 'success', hot: 'warning', recommend: 'danger', 'new': 'info'}; - //如果有自定义状态,可以按需传入 - if (typeof custom !== 'undefined') { - colorArr = $.extend(colorArr, custom); + //如果字段列有定义custom + if (typeof this.custom !== 'undefined') { + colorArr = $.extend(colorArr, this.custom); } //渲染Flag var html = []; @@ -8073,8 +8079,12 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr }); return html.join(' '); }, - label: function (value, row, index, custom) { + label: function (value, row, index) { var colorArr = ['success', 'warning', 'danger', 'info']; + //如果字段列有定义custom + if (typeof this.custom !== 'undefined') { + colorArr = $.merge(colorArr, this.custom); + } //渲染Flag var html = []; var arr = value.split(','); @@ -8108,8 +8118,11 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr } var attr = table.data("operate-" + j.name); if (typeof attr === 'undefined' || attr) { - //自动加上ids - url = j.url ? j.url + (j.url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + url = j.url ? j.url : ''; + if (url.indexOf("{ids}") === -1) { + url = url ? url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + } + url = Table.api.replaceurl(url, value, row, table); url = url ? Fast.api.fixurl(url) : 'javascript:;'; classname = j.classname ? j.classname : 'btn-primary btn-' + name + 'one'; icon = j.icon ? j.icon : ''; @@ -8132,8 +8145,11 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr $.each(buttons, function (i, j) { var attr = table.data("buttons-" + j.name); if (typeof attr === 'undefined' || attr) { - //自动加上ids - url = j.url ? j.url + (j.url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + url = j.url ? j.url : ''; + if (url.indexOf("{ids}") === -1) { + url = url ? url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + } + url = Table.api.replaceurl(url, value, row, table); url = url ? Fast.api.fixurl(url) : 'javascript:;'; classname = j.classname ? j.classname : 'btn-primary btn-' + name + 'one'; icon = j.icon ? j.icon : ''; @@ -8146,6 +8162,18 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr return html.join(' '); } }, + //替换URL中的{ids}和{value} + replaceurl: function (url, value, row, table) { + url = url ? url : ''; + url = url.replace(/\{value\}/ig, value); + if (table) { + var options = table.bootstrapTable('getOptions'); + url = url.replace(/\{ids\}/ig, row[options.pk]); + } else { + url = url.replace(/\{ids\}/ig, 0); + } + return url; + }, // 获取选中的条目ID集合 selectedids: function (table) { var options = table.bootstrapTable('getOptions'); diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index 1bba38e4..00cc0b31 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -296,12 +296,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table //渲染fontawesome图标 return ' ' + value; }, - image: function (value, row, index, custom) { - var classname = typeof custom !== 'undefined' ? custom : 'img-sm img-center'; + image: function (value, row, index) { + var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; return ''; }, - images: function (value, row, index, custom) { - var classname = typeof custom !== 'undefined' ? custom : 'img-sm img-center'; + images: function (value, row, index) { + var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; var arr = value.split(','); var html = []; $.each(arr, function (i, value) { @@ -309,12 +309,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table }); return html.join(' '); }, - status: function (value, row, index, custom) { + status: function (value, row, index) { //颜色状态数组,可使用red/yellow/aqua/blue/navy/teal/olive/lime/fuchsia/purple/maroon var colorArr = {normal: 'success', hidden: 'grey', deleted: 'danger', locked: 'info'}; - //如果有自定义状态,可以按需传入 - if (typeof custom !== 'undefined') { - colorArr = $.extend(colorArr, custom); + //如果字段列有定义custom + if (typeof this.custom !== 'undefined') { + colorArr = $.extend(colorArr, this.custom); } value = value.toString(); var color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary'; @@ -329,14 +329,21 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table search: function (value, row, index) { return '' + value + ''; }, - addtabs: function (value, row, index, url) { - return '' + value + ''; + addtabs: function (value, row, index) { + var url = Table.api.replaceurl(this.url, value, row, this.table); + var title = this.title ? this.title : __("Search %s", value); + return '' + value + ''; }, - flag: function (value, row, index, custom) { + dialog: function (value, row, index) { + var url = Table.api.replaceurl(this.url, value, row, this.table); + var title = this.title ? this.title : value; + return '' + value + ''; + }, + flag: function (value, row, index) { var colorArr = {index: 'success', hot: 'warning', recommend: 'danger', 'new': 'info'}; - //如果有自定义状态,可以按需传入 - if (typeof custom !== 'undefined') { - colorArr = $.extend(colorArr, custom); + //如果字段列有定义custom + if (typeof this.custom !== 'undefined') { + colorArr = $.extend(colorArr, this.custom); } //渲染Flag var html = []; @@ -351,8 +358,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table }); return html.join(' '); }, - label: function (value, row, index, custom) { + label: function (value, row, index) { var colorArr = ['success', 'warning', 'danger', 'info']; + //如果字段列有定义custom + if (typeof this.custom !== 'undefined') { + colorArr = $.merge(colorArr, this.custom); + } //渲染Flag var html = []; var arr = value.split(','); @@ -386,8 +397,11 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table } var attr = table.data("operate-" + j.name); if (typeof attr === 'undefined' || attr) { - //自动加上ids - url = j.url ? j.url + (j.url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + url = j.url ? j.url : ''; + if (url.indexOf("{ids}") === -1) { + url = url ? url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + } + url = Table.api.replaceurl(url, value, row, table); url = url ? Fast.api.fixurl(url) : 'javascript:;'; classname = j.classname ? j.classname : 'btn-primary btn-' + name + 'one'; icon = j.icon ? j.icon : ''; @@ -410,8 +424,11 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table $.each(buttons, function (i, j) { var attr = table.data("buttons-" + j.name); if (typeof attr === 'undefined' || attr) { - //自动加上ids - url = j.url ? j.url + (j.url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + url = j.url ? j.url : ''; + if (url.indexOf("{ids}") === -1) { + url = url ? url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk] : ''; + } + url = Table.api.replaceurl(url, value, row, table); url = url ? Fast.api.fixurl(url) : 'javascript:;'; classname = j.classname ? j.classname : 'btn-primary btn-' + name + 'one'; icon = j.icon ? j.icon : ''; @@ -424,6 +441,18 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table return html.join(' '); } }, + //替换URL中的{ids}和{value} + replaceurl: function (url, value, row, table) { + url = url ? url : ''; + url = url.replace(/\{value\}/ig, value); + if (table) { + var options = table.bootstrapTable('getOptions'); + url = url.replace(/\{ids\}/ig, row[options.pk]); + } else { + url = url.replace(/\{ids\}/ig, 0); + } + return url; + }, // 获取选中的条目ID集合 selectedids: function (table) { var options = table.bootstrapTable('getOptions');