若依 3.0
This commit is contained in:
1
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.css
vendored
Normal file
1
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
8
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js
vendored
Normal file
8
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,146 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/vitalets/x-editable
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
editable: true,
|
||||
onEditableInit: function() {
|
||||
return false;
|
||||
},
|
||||
onEditableSave: function(field, row, oldValue, $el) {
|
||||
return false;
|
||||
},
|
||||
onEditableShown: function(field, row, $el, editable) {
|
||||
return false;
|
||||
},
|
||||
onEditableHidden: function(field, row, $el, reason) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'editable-init.bs.table': 'onEditableInit',
|
||||
'editable-save.bs.table': 'onEditableSave',
|
||||
'editable-shown.bs.table': 'onEditableShown',
|
||||
'editable-hidden.bs.table': 'onEditableHidden'
|
||||
});
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initTable = BootstrapTable.prototype.initTable,
|
||||
_initBody = BootstrapTable.prototype.initBody;
|
||||
|
||||
BootstrapTable.prototype.initTable = function() {
|
||||
var that = this;
|
||||
_initTable.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
var editableOptions = {},
|
||||
editableDataMarkup = [],
|
||||
editableDataPrefix = 'editable-';
|
||||
|
||||
var processDataOptions = function(key, value) {
|
||||
// Replace camel case with dashes.
|
||||
var dashKey = key.replace(/([A-Z])/g, function($1) {
|
||||
return "-" + $1.toLowerCase();
|
||||
});
|
||||
if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
|
||||
var dataKey = dashKey.replace(editableDataPrefix, 'data-');
|
||||
editableOptions[dataKey] = value;
|
||||
}
|
||||
};
|
||||
|
||||
$.each(that.options, processDataOptions);
|
||||
|
||||
column.formatter = column.formatter || function(value, row, index) {
|
||||
return value;
|
||||
};
|
||||
column._formatter = column._formatter ? column._formatter : column.formatter;
|
||||
column.formatter = function(value, row, index) {
|
||||
var result = column._formatter ? column._formatter(value, row, index) : value;
|
||||
|
||||
$.each(column, processDataOptions);
|
||||
|
||||
$.each(editableOptions, function(key, value) {
|
||||
editableDataMarkup.push(' ' + key + '="' + value + '"');
|
||||
});
|
||||
|
||||
var _dont_edit_formatter = false;
|
||||
if (column.editable.hasOwnProperty('noeditFormatter')) {
|
||||
_dont_edit_formatter = column.editable.noeditFormatter(value, row, index);
|
||||
}
|
||||
|
||||
if (_dont_edit_formatter === false) {
|
||||
return ['<a href="javascript:void(0)"',
|
||||
' data-name="' + column.field + '"',
|
||||
' data-pk="' + row[that.options.idField] + '"',
|
||||
' data-value="' + result + '"',
|
||||
editableDataMarkup.join(''),
|
||||
'>' + '</a>'
|
||||
].join('');
|
||||
} else {
|
||||
return _dont_edit_formatter;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.initBody = function() {
|
||||
var that = this;
|
||||
_initBody.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
|
||||
.off('save').on('save', function(e, params) {
|
||||
var data = that.getData(),
|
||||
index = $(this).parents('tr[data-index]').data('index'),
|
||||
row = data[index],
|
||||
oldValue = row[column.field];
|
||||
|
||||
$(this).data('value', params.submitValue);
|
||||
row[column.field] = params.submitValue;
|
||||
that.trigger('editable-save', column.field, row, oldValue, $(this));
|
||||
that.resetFooter();
|
||||
});
|
||||
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
|
||||
.off('shown').on('shown', function(e, editable) {
|
||||
var data = that.getData(),
|
||||
index = $(this).parents('tr[data-index]').data('index'),
|
||||
row = data[index];
|
||||
|
||||
that.trigger('editable-shown', column.field, row, $(this), editable);
|
||||
});
|
||||
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
|
||||
.off('hidden').on('hidden', function(e, reason) {
|
||||
var data = that.getData(),
|
||||
index = $(this).parents('tr[data-index]').data('index'),
|
||||
row = data[index];
|
||||
|
||||
that.trigger('editable-hidden', column.field, row, $(this), reason);
|
||||
});
|
||||
});
|
||||
this.trigger('editable-init');
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* bootstrap-table - v1.11.0 - 2016-07-02
|
||||
* https://github.com/wenzhixin/bootstrap-table
|
||||
* Copyright (c) 2016 zhixin wen
|
||||
* Licensed MIT License
|
||||
*/
|
||||
!function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{editable:!0,onEditableInit:function(){return!1},onEditableSave:function(){return!1},onEditableShown:function(){return!1},onEditableHidden:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"editable-init.bs.table":"onEditableInit","editable-save.bs.table":"onEditableSave","editable-shown.bs.table":"onEditableShown","editable-hidden.bs.table":"onEditableHidden"});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.initTable,d=b.prototype.initBody;b.prototype.initTable=function(){var b=this;c.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&a.each(this.columns,function(c,d){if(d.editable){var e={},f=[],g="editable-",h=function(a,b){var c=a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()});if(c.slice(0,g.length)==g){var d=c.replace(g,"data-");e[d]=b}};a.each(b.options,h),d.formatter=d.formatter||function(a){return a},d._formatter=d._formatter?d._formatter:d.formatter,d.formatter=function(c,g,i){var j=d._formatter?d._formatter(c,g,i):c;a.each(d,h),a.each(e,function(a,b){f.push(" "+a+'="'+b+'"')});var k=!1;return d.editable.hasOwnProperty("noeditFormatter")&&(k=d.editable.noeditFormatter(c,g,i)),k===!1?['<a href="javascript:void(0)"',' data-name="'+d.field+'"',' data-pk="'+g[b.options.idField]+'"',' data-value="'+j+'"',f.join(""),"></a>"].join(""):k}}})},b.prototype.initBody=function(){var b=this;d.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&(a.each(this.columns,function(c,d){d.editable&&(b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("save").on("save",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g],i=h[d.field];a(this).data("value",e.submitValue),h[d.field]=e.submitValue,b.trigger("editable-save",d.field,h,i,a(this)),b.resetFooter()}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("shown").on("shown",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-shown",d.field,h,a(this),e)}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("hidden").on("hidden",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-hidden",d.field,h,a(this),e)}))}),this.trigger("editable-init"))}}(jQuery);
|
@ -0,0 +1,119 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/kayalshri/tableExport.jquery.plugin
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
var sprintf = $.fn.bootstrapTable.utils.sprintf;
|
||||
|
||||
var TYPE_NAME = {
|
||||
csv: 'CSV',
|
||||
txt: 'TXT',
|
||||
doc: 'Word',
|
||||
excel: 'Excel'
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
showExport: false,
|
||||
exportDataType: 'all', // basic, all, selected
|
||||
exportTypes: ['csv', 'txt', 'doc', 'excel'],
|
||||
exportOptions: {
|
||||
ignoreColumn: [0] //忽略列索引
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
export: 'glyphicon glyphicon-save'
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatExport: function () {
|
||||
return 'Export data';
|
||||
}
|
||||
});
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initToolbar = BootstrapTable.prototype.initToolbar;
|
||||
|
||||
BootstrapTable.prototype.initToolbar = function () {
|
||||
this.showToolbar = this.options.showExport;
|
||||
|
||||
_initToolbar.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (this.options.showExport) {
|
||||
var that = this,
|
||||
$btnGroup = this.$toolbar.find('>.btn-group'),
|
||||
$export = $btnGroup.find('div.export');
|
||||
|
||||
if (!$export.length) {
|
||||
$export = $([
|
||||
'<div class="export btn-group">',
|
||||
'<button class="btn' +
|
||||
sprintf(' btn-%s', this.options.buttonsClass) +
|
||||
sprintf(' btn-%s', this.options.iconSize) +
|
||||
' dropdown-toggle" ' +
|
||||
'title="' + this.options.formatExport() + '" ' +
|
||||
'data-toggle="dropdown" type="button">',
|
||||
sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export),
|
||||
'<span class="caret"></span>',
|
||||
'</button>',
|
||||
'<ul class="dropdown-menu" role="menu">',
|
||||
'</ul>',
|
||||
'</div>'].join('')).appendTo($btnGroup);
|
||||
|
||||
var $menu = $export.find('.dropdown-menu'),
|
||||
exportTypes = this.options.exportTypes;
|
||||
|
||||
if (typeof this.options.exportTypes === 'string') {
|
||||
var types = this.options.exportTypes.slice(1, -1).replace(/ /g, '').split(',');
|
||||
|
||||
exportTypes = [];
|
||||
$.each(types, function (i, value) {
|
||||
exportTypes.push(value.slice(1, -1));
|
||||
});
|
||||
}
|
||||
$.each(exportTypes, function (i, type) {
|
||||
if (TYPE_NAME.hasOwnProperty(type)) {
|
||||
$menu.append(['<li data-type="' + type + '">',
|
||||
'<a href="javascript:void(0)">',
|
||||
TYPE_NAME[type],
|
||||
'</a>',
|
||||
'</li>'].join(''));
|
||||
}
|
||||
});
|
||||
|
||||
$menu.find('li').click(function () {
|
||||
var type = $(this).data('type'),
|
||||
doExport = function () {
|
||||
that.$el.tableExport($.extend({}, that.options.exportOptions, {
|
||||
type: type,
|
||||
escape: false
|
||||
}));
|
||||
};
|
||||
|
||||
if (that.options.exportDataType === 'all' && that.options.pagination) {
|
||||
that.$el.one(that.options.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table', function () {
|
||||
doExport();
|
||||
that.togglePagination();
|
||||
});
|
||||
that.togglePagination();
|
||||
} else if (that.options.exportDataType === 'selected') {
|
||||
//修改sidePagination属性为server无法导出选中数据
|
||||
var trs = that.$body.children();
|
||||
for (var i = 0; i < trs.length; i++) {
|
||||
var $this = $(trs[i]);
|
||||
if(!$this.find(sprintf('[name="%s"]',that.options.selectItemName)).prop('checked')){
|
||||
$this['hide']();
|
||||
}}
|
||||
doExport();
|
||||
that.getRowsHidden(true);
|
||||
} else {
|
||||
doExport();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,136 @@
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @webSite: http://djhvscf.github.io/Blog
|
||||
* @version: v1.1.0
|
||||
*/
|
||||
|
||||
!function ($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var showHideColumns = function (that, checked) {
|
||||
if (that.options.columnsHidden.length > 0 ) {
|
||||
$.each(that.columns, function (i, column) {
|
||||
if (that.options.columnsHidden.indexOf(column.field) !== -1) {
|
||||
if (column.visible !== checked) {
|
||||
that.toggleColumn($.fn.bootstrapTable.utils.getFieldIndex(that.columns, column.field), checked, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var resetView = function (that) {
|
||||
if (that.options.height || that.options.showFooter) {
|
||||
setTimeout(function(){
|
||||
that.resetView.call(that);
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
var changeView = function (that, width, height) {
|
||||
if (that.options.minHeight) {
|
||||
if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) {
|
||||
conditionCardView(that);
|
||||
} else if ((width > that.options.minWidth) && (height > that.options.minHeight)) {
|
||||
conditionFullView(that);
|
||||
}
|
||||
} else {
|
||||
if (width <= that.options.minWidth) {
|
||||
conditionCardView(that);
|
||||
} else if (width > that.options.minWidth) {
|
||||
conditionFullView(that);
|
||||
}
|
||||
}
|
||||
|
||||
resetView(that);
|
||||
};
|
||||
|
||||
var conditionCardView = function (that) {
|
||||
changeTableView(that, false);
|
||||
showHideColumns(that, false);
|
||||
};
|
||||
|
||||
var conditionFullView = function (that) {
|
||||
changeTableView(that, true);
|
||||
showHideColumns(that, true);
|
||||
};
|
||||
|
||||
var changeTableView = function (that, cardViewState) {
|
||||
that.options.cardView = cardViewState;
|
||||
that.toggleView();
|
||||
};
|
||||
|
||||
var debounce = function(func,wait) {
|
||||
var timeout;
|
||||
return function() {
|
||||
var context = this,
|
||||
args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
func.apply(context,args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
mobileResponsive: false,
|
||||
minWidth: 562,
|
||||
minHeight: undefined,
|
||||
heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
|
||||
checkOnInit: true,
|
||||
columnsHidden: []
|
||||
});
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_init = BootstrapTable.prototype.init;
|
||||
|
||||
BootstrapTable.prototype.init = function () {
|
||||
_init.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.mobileResponsive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.options.minWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.minWidth < 100 && this.options.resizable) {
|
||||
console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
|
||||
this.options.minWidth = 100;
|
||||
}
|
||||
|
||||
var that = this,
|
||||
old = {
|
||||
width: $(window).width(),
|
||||
height: $(window).height()
|
||||
};
|
||||
|
||||
$(window).on('resize orientationchange',debounce(function (evt) {
|
||||
// reset view if height has only changed by at least the threshold.
|
||||
var height = $(this).height(),
|
||||
width = $(this).width();
|
||||
|
||||
if (Math.abs(old.height - height) > that.options.heightThreshold || old.width != width) {
|
||||
changeView(that, width, height);
|
||||
old = {
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
},200));
|
||||
|
||||
if (this.options.checkOnInit) {
|
||||
var height = $(window).height(),
|
||||
width = $(window).width();
|
||||
changeView(this, width, height);
|
||||
old = {
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
};
|
||||
}(jQuery);
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* bootstrap-table - v1.11.0 - 2016-07-02
|
||||
* https://github.com/wenzhixin/bootstrap-table
|
||||
* Copyright (c) 2016 zhixin wen
|
||||
* Licensed MIT License
|
||||
*/
|
||||
!function(a){"use strict";var b=function(b,c){b.options.columnsHidden.length>0&&a.each(b.columns,function(d,e){-1!==b.options.columnsHidden.indexOf(e.field)&&e.visible!==c&&b.toggleColumn(a.fn.bootstrapTable.utils.getFieldIndex(b.columns,e.field),c,!0)})},c=function(a){(a.options.height||a.options.showFooter)&&setTimeout(function(){a.resetView.call(a)},1)},d=function(a,b,d){a.options.minHeight?b<=a.options.minWidth&&d<=a.options.minHeight?e(a):b>a.options.minWidth&&d>a.options.minHeight&&f(a):b<=a.options.minWidth?e(a):b>a.options.minWidth&&f(a),c(a)},e=function(a){g(a,!1),b(a,!1)},f=function(a){g(a,!0),b(a,!0)},g=function(a,b){a.options.cardView=b,a.toggleView()},h=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}};a.extend(a.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]});var i=a.fn.bootstrapTable.Constructor,j=i.prototype.init;i.prototype.init=function(){if(j.apply(this,Array.prototype.slice.apply(arguments)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&this.options.resizable&&(console.log("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var b=this,c={width:a(window).width(),height:a(window).height()};if(a(window).on("resize orientationchange",h(function(){var e=a(this).height(),f=a(this).width();(Math.abs(c.height-e)>b.options.heightThreshold||c.width!=f)&&(d(b,f,e),c={width:f,height:e})},200)),this.options.checkOnInit){var e=a(window).height(),f=a(window).width();d(this,f,e),c={width:f,height:e}}}}}(jQuery);
|
@ -0,0 +1,211 @@
|
||||
/**
|
||||
* @author: aperez <aperez@datadec.es>
|
||||
* @version: v2.0.0
|
||||
*
|
||||
* @update Dennis Hernández <http://djhvscf.github.io/Blog>
|
||||
*/
|
||||
|
||||
!function($) {
|
||||
'use strict';
|
||||
|
||||
var firstLoad = false;
|
||||
|
||||
var sprintf = $.fn.bootstrapTable.utils.sprintf;
|
||||
|
||||
var showAvdSearch = function(pColumns, searchTitle, searchText, that) {
|
||||
if (!$("#avdSearchModal" + "_" + that.options.idTable).hasClass("modal")) {
|
||||
var vModal = sprintf("<div id=\"avdSearchModal%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">", "_" + that.options.idTable);
|
||||
vModal += "<div class=\"modal-dialog modal-xs\">";
|
||||
vModal += " <div class=\"modal-content\">";
|
||||
vModal += " <div class=\"modal-header\">";
|
||||
vModal += " <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" >×</button>";
|
||||
vModal += sprintf(" <h4 class=\"modal-title\">%s</h4>", searchTitle);
|
||||
vModal += " </div>";
|
||||
vModal += " <div class=\"modal-body modal-body-custom\">";
|
||||
vModal += sprintf(" <div class=\"container-fluid\" id=\"avdSearchModalContent%s\" style=\"padding-right: 0px;padding-left: 0px;\" >", "_" + that.options.idTable);
|
||||
vModal += " </div>";
|
||||
vModal += " </div>";
|
||||
vModal += " </div>";
|
||||
vModal += " </div>";
|
||||
vModal += "</div>";
|
||||
|
||||
$("body").append($(vModal));
|
||||
|
||||
var vFormAvd = createFormAvd(pColumns, searchText, that),
|
||||
timeoutId = 0;;
|
||||
|
||||
$('#avdSearchModalContent' + "_" + that.options.idTable).append(vFormAvd.join(''));
|
||||
|
||||
$('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(function () {
|
||||
that.onColumnAdvancedSearch(event);
|
||||
}, that.options.searchTimeOut);
|
||||
});
|
||||
|
||||
$("#btnCloseAvd" + "_" + that.options.idTable).click(function() {
|
||||
$("#avdSearchModal" + "_" + that.options.idTable).modal('hide');
|
||||
});
|
||||
|
||||
$("#avdSearchModal" + "_" + that.options.idTable).modal();
|
||||
} else {
|
||||
$("#avdSearchModal" + "_" + that.options.idTable).modal();
|
||||
}
|
||||
};
|
||||
|
||||
var createFormAvd = function(pColumns, searchText, that) {
|
||||
var htmlForm = [];
|
||||
htmlForm.push(sprintf('<form class="form-horizontal" id="%s" action="%s" >', that.options.idForm, that.options.actionForm));
|
||||
for (var i in pColumns) {
|
||||
var vObjCol = pColumns[i];
|
||||
if (!vObjCol.checkbox && vObjCol.visible && vObjCol.searchable) {
|
||||
htmlForm.push('<div class="form-group">');
|
||||
htmlForm.push(sprintf('<label class="col-sm-4 control-label">%s</label>', vObjCol.title));
|
||||
htmlForm.push('<div class="col-sm-6">');
|
||||
htmlForm.push(sprintf('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">', vObjCol.field, vObjCol.title, vObjCol.field));
|
||||
htmlForm.push('</div>');
|
||||
htmlForm.push('</div>');
|
||||
}
|
||||
}
|
||||
|
||||
htmlForm.push('<div class="form-group">');
|
||||
htmlForm.push('<div class="col-sm-offset-9 col-sm-3">');
|
||||
htmlForm.push(sprintf('<button type="button" id="btnCloseAvd%s" class="btn btn-default" >%s</button>', "_" + that.options.idTable, searchText));
|
||||
htmlForm.push('</div>');
|
||||
htmlForm.push('</div>');
|
||||
htmlForm.push('</form>');
|
||||
|
||||
return htmlForm;
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
advancedSearch: false,
|
||||
idForm: 'advancedSearch',
|
||||
actionForm: '',
|
||||
idTable: undefined,
|
||||
onColumnAdvancedSearch: function (field, text) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
advancedSearchIcon: 'glyphicon-chevron-down'
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatAdvancedSearch: function() {
|
||||
return 'Advanced search';
|
||||
},
|
||||
formatAdvancedCloseButton: function() {
|
||||
return "Close";
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initToolbar = BootstrapTable.prototype.initToolbar,
|
||||
_load = BootstrapTable.prototype.load,
|
||||
_initSearch = BootstrapTable.prototype.initSearch;
|
||||
|
||||
BootstrapTable.prototype.initToolbar = function() {
|
||||
_initToolbar.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.search) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.options.advancedSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.options.idTable) {
|
||||
return;
|
||||
}
|
||||
|
||||
var that = this,
|
||||
html = [];
|
||||
|
||||
html.push(sprintf('<div class="columns columns-%s btn-group pull-%s" role="group">', this.options.buttonsAlign, this.options.buttonsAlign));
|
||||
html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="advancedSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatAdvancedSearch()));
|
||||
html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.advancedSearchIcon))
|
||||
html.push('</button></div>');
|
||||
|
||||
that.$toolbar.prepend(html.join(''));
|
||||
|
||||
that.$toolbar.find('button[name="advancedSearch"]')
|
||||
.off('click').on('click', function() {
|
||||
showAvdSearch(that.columns, that.options.formatAdvancedSearch(), that.options.formatAdvancedCloseButton(), that);
|
||||
});
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.load = function(data) {
|
||||
_load.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.advancedSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof this.options.idTable === 'undefined') {
|
||||
return;
|
||||
} else {
|
||||
if (!firstLoad) {
|
||||
var height = parseInt($(".bootstrap-table").height());
|
||||
height += 10;
|
||||
$("#" + this.options.idTable).bootstrapTable("resetView", {height: height});
|
||||
firstLoad = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.initSearch = function () {
|
||||
_initSearch.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.advancedSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
var that = this;
|
||||
var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
|
||||
|
||||
this.data = fp ? $.grep(this.data, function (item, i) {
|
||||
for (var key in fp) {
|
||||
var fval = fp[key].toLowerCase();
|
||||
var value = item[key];
|
||||
value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
|
||||
that.header.formatters[$.inArray(key, that.header.fields)],
|
||||
[value, item, i], value);
|
||||
|
||||
if (!($.inArray(key, that.header.fields) !== -1 &&
|
||||
(typeof value === 'string' || typeof value === 'number') &&
|
||||
(value + '').toLowerCase().indexOf(fval) !== -1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}) : this.data;
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.onColumnAdvancedSearch = function (event) {
|
||||
var text = $.trim($(event.currentTarget).val());
|
||||
var $field = $(event.currentTarget)[0].id;
|
||||
|
||||
if ($.isEmptyObject(this.filterColumnsPartial)) {
|
||||
this.filterColumnsPartial = {};
|
||||
}
|
||||
if (text) {
|
||||
this.filterColumnsPartial[$field] = text;
|
||||
} else {
|
||||
delete this.filterColumnsPartial[$field];
|
||||
}
|
||||
|
||||
this.options.pageNumber = 1;
|
||||
this.onSearch(event);
|
||||
this.updatePagination();
|
||||
this.trigger('column-advanced-search', $field, text);
|
||||
};
|
||||
}(jQuery);
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* bootstrap-table - v1.11.0 - 2016-07-02
|
||||
* https://github.com/wenzhixin/bootstrap-table
|
||||
* Copyright (c) 2016 zhixin wen
|
||||
* Licensed MIT License
|
||||
*/
|
||||
!function(a){"use strict";var b=!1,c=a.fn.bootstrapTable.utils.sprintf,d=function(b,d,f,g){if(a("#avdSearchModal_"+g.options.idTable).hasClass("modal"))a("#avdSearchModal_"+g.options.idTable).modal();else{var h=c('<div id="avdSearchModal%s" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">',"_"+g.options.idTable);h+='<div class="modal-dialog modal-xs">',h+=' <div class="modal-content">',h+=' <div class="modal-header">',h+=' <button type="button" class="close" data-dismiss="modal" aria-hidden="true" >×</button>',h+=c(' <h4 class="modal-title">%s</h4>',d),h+=" </div>",h+=' <div class="modal-body modal-body-custom">',h+=c(' <div class="container-fluid" id="avdSearchModalContent%s" style="padding-right: 0px;padding-left: 0px;" >',"_"+g.options.idTable),h+=" </div>",h+=" </div>",h+=" </div>",h+=" </div>",h+="</div>",a("body").append(a(h));var i=e(b,f,g),j=0;a("#avdSearchModalContent_"+g.options.idTable).append(i.join("")),a("#"+g.options.idForm).off("keyup blur","input").on("keyup blur","input",function(a){clearTimeout(j),j=setTimeout(function(){g.onColumnAdvancedSearch(a)},g.options.searchTimeOut)}),a("#btnCloseAvd_"+g.options.idTable).click(function(){a("#avdSearchModal_"+g.options.idTable).modal("hide")}),a("#avdSearchModal_"+g.options.idTable).modal()}},e=function(a,b,d){var e=[];e.push(c('<form class="form-horizontal" id="%s" action="%s" >',d.options.idForm,d.options.actionForm));for(var f in a){var g=a[f];!g.checkbox&&g.visible&&g.searchable&&(e.push('<div class="form-group">'),e.push(c('<label class="col-sm-4 control-label">%s</label>',g.title)),e.push('<div class="col-sm-6">'),e.push(c('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">',g.field,g.title,g.field)),e.push("</div>"),e.push("</div>"))}return e.push('<div class="form-group">'),e.push('<div class="col-sm-offset-9 col-sm-3">'),e.push(c('<button type="button" id="btnCloseAvd%s" class="btn btn-default" >%s</button>',"_"+d.options.idTable,b)),e.push("</div>"),e.push("</div>"),e.push("</form>"),e};a.extend(a.fn.bootstrapTable.defaults,{advancedSearch:!1,idForm:"advancedSearch",actionForm:"",idTable:void 0,onColumnAdvancedSearch:function(){return!1}}),a.extend(a.fn.bootstrapTable.defaults.icons,{advancedSearchIcon:"glyphicon-chevron-down"}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"column-advanced-search.bs.table":"onColumnAdvancedSearch"}),a.extend(a.fn.bootstrapTable.locales,{formatAdvancedSearch:function(){return"Advanced search"},formatAdvancedCloseButton:function(){return"Close"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales);var f=a.fn.bootstrapTable.Constructor,g=f.prototype.initToolbar,h=f.prototype.load,i=f.prototype.initSearch;f.prototype.initToolbar=function(){if(g.apply(this,Array.prototype.slice.apply(arguments)),this.options.search&&this.options.advancedSearch&&this.options.idTable){var a=this,b=[];b.push(c('<div class="columns columns-%s btn-group pull-%s" role="group">',this.options.buttonsAlign,this.options.buttonsAlign)),b.push(c('<button class="btn btn-default%s" type="button" name="advancedSearch" title="%s">',void 0===a.options.iconSize?"":" btn-"+a.options.iconSize,a.options.formatAdvancedSearch())),b.push(c('<i class="%s %s"></i>',a.options.iconsPrefix,a.options.icons.advancedSearchIcon)),b.push("</button></div>"),a.$toolbar.prepend(b.join("")),a.$toolbar.find('button[name="advancedSearch"]').off("click").on("click",function(){d(a.columns,a.options.formatAdvancedSearch(),a.options.formatAdvancedCloseButton(),a)})}},f.prototype.load=function(){if(h.apply(this,Array.prototype.slice.apply(arguments)),this.options.advancedSearch&&"undefined"!=typeof this.options.idTable&&!b){var c=parseInt(a(".bootstrap-table").height());c+=10,a("#"+this.options.idTable).bootstrapTable("resetView",{height:c}),b=!0}},f.prototype.initSearch=function(){if(i.apply(this,Array.prototype.slice.apply(arguments)),this.options.advancedSearch){var b=this,c=a.isEmptyObject(this.filterColumnsPartial)?null:this.filterColumnsPartial;this.data=c?a.grep(this.data,function(d,e){for(var f in c){var g=c[f].toLowerCase(),h=d[f];if(h=a.fn.bootstrapTable.utils.calculateObjectValue(b.header,b.header.formatters[a.inArray(f,b.header.fields)],[h,d,e],h),-1===a.inArray(f,b.header.fields)||"string"!=typeof h&&"number"!=typeof h||-1===(h+"").toLowerCase().indexOf(g))return!1}return!0}):this.data}},f.prototype.onColumnAdvancedSearch=function(b){var c=a.trim(a(b.currentTarget).val()),d=a(b.currentTarget)[0].id;a.isEmptyObject(this.filterColumnsPartial)&&(this.filterColumnsPartial={}),c?this.filterColumnsPartial[d]=c:delete this.filterColumnsPartial[d],this.options.pageNumber=1,this.onSearch(b),this.updatePagination(),this.trigger("column-advanced-search",d,c)}}(jQuery);
|
42
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.js
vendored
Normal file
42
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.js
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$.fn.bootstrapTable.locales['zh-CN'] = {
|
||||
formatLoadingMessage: function () {
|
||||
return '正在努力地加载数据中,请稍候……';
|
||||
},
|
||||
formatRecordsPerPage: function (pageNumber) {
|
||||
return pageNumber + ' 条记录每页';
|
||||
},
|
||||
formatShowingRows: function (pageFrom, pageTo, totalRows) {
|
||||
return '第 ' + pageFrom + ' 到 ' + pageTo + ' 条,共 ' + totalRows + ' 条记录。';
|
||||
},
|
||||
formatSearch: function () {
|
||||
return '搜索';
|
||||
},
|
||||
formatNoMatches: function () {
|
||||
return '没有找到匹配的记录';
|
||||
},
|
||||
formatPaginationSwitch: function () {
|
||||
return '隐藏/显示分页';
|
||||
},
|
||||
formatRefresh: function () {
|
||||
return '刷新';
|
||||
},
|
||||
formatToggle: function () {
|
||||
return '切换';
|
||||
},
|
||||
formatColumns: function () {
|
||||
return '列';
|
||||
},
|
||||
formatExport: function () {
|
||||
return '导出数据';
|
||||
},
|
||||
formatClearFilters: function () {
|
||||
return '清空过滤';
|
||||
}
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1 @@
|
||||
(function($){$.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(pageNumber){return pageNumber+" 条记录每页"},formatShowingRows:function(pageFrom,pageTo,totalRows){return"第 "+pageFrom+" 到 "+pageTo+" 条,共 "+totalRows+" 条记录。"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}};$.extend($.fn.bootstrapTable.defaults,$.fn.bootstrapTable.locales["zh-CN"])})(jQuery);
|
Reference in New Issue
Block a user