", that.options.idTable);
+ vModal += vFormCommon.join('');
+ vModal += "
";
+ $("#myTabContent").before($(vModal));
+
+ if (that.options.sidePagination != 'server' || !that.options.url) {
+ $('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
+ clearTimeout(timeoutId);
+ timeoutId = setTimeout(function () {
+ that.onColumnCommonSearch(event);
+ }, that.options.searchTimeOut);
+ });
+ }
+
+ //绑定日期时间元素事件
+ var form = $("#" + that.options.idForm);
+ if ($(".datetimepicker", form).size() > 0) {
+ require(['bootstrap-datetimepicker'], function () {
+ $('.datetimepicker', form).parent().css('position', 'relative');
+ $('.datetimepicker', form).datetimepicker({
+ //format: 'YYYY-MM-DD',
+ icons: {
+ time: 'fa fa-clock-o',
+ date: 'fa fa-calendar',
+ up: 'fa fa-chevron-up',
+ down: 'fa fa-chevron-down',
+ previous: 'fa fa-chevron-left',
+ next: 'fa fa-chevron-right',
+ today: 'fa fa-history',
+ clear: 'fa fa-trash',
+ close: 'fa fa-remove'
+ },
+ showTodayButton: true,
+ showClose: true
+ });
+ });
+ }
+
+ // 提交搜索
+ $("#btnSubmitCommon" + "_" + that.options.idTable).click(function (event) {
+ that.onColumnCommonSearch();
+ });
+
+ // 重置搜索
+ $("#btnResetCommon" + "_" + that.options.idTable).click(function () {
+ $("#commonSearchModalContent" + "_" + that.options.idTable + " form")[0].reset();
+ that.onColumnCommonSearch();
+ });
+
+ };
+
+ var createFormCommon = function (pColumns, that) {
+ var htmlForm = [];
+ var opList = ['=', '>', '>=', '<', '<=', '!=', 'LIKE', 'LIKE %...%', 'NOT LIKE', 'IN(...)', 'NOT IN(...)', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL'];
+ //var selectList = [];
+ //for (var i = 0; i < opList.length; i++) {
+ // selectList.push("'
- + (titype ? config.title[0] : config.title)
+ var titleHTML = (config.title ? '
'
+ + (titype ? config.title[0] : config.title)
+ '
' : '');
-
+
config.zIndex = zIndex;
callback([
//遮罩
config.shade ? ('
') : '',
-
+
//主体
'
'
+ (conType && config.type != 2 ? '' : titleHTML)
@@ -446,22 +451,22 @@ Class.pt.creat = function(){
,content = config.content
,conType = typeof content === 'object'
,body = $('body');
-
+
if($('#'+config.id)[0]) return;
if(typeof config.area === 'string'){
config.area = config.area === 'auto' ? ['', ''] : [config.area, ''];
}
-
+
//anim兼容旧版shift
if(config.shift){
config.anim = config.shift;
}
-
+
if(layer.ie == 6){
config.fixed = false;
}
-
+
switch(config.type){
case 0:
config.btn = ('btn' in config) ? config.btn : ready.btn[0];
@@ -486,7 +491,7 @@ Class.pt.creat = function(){
config.tipsMore || layer.closeAll('tips');
break;
}
-
+
//建立容器
that.vessel(conType, function(html, titleHTML, moveElem){
body.append(html[0]);
@@ -516,12 +521,12 @@ Class.pt.creat = function(){
config.type == 4 && that.tips();
});
}
-
+
config.time <= 0 || setTimeout(function(){
layer.close(that.index)
}, config.time);
that.move().callback();
-
+
//为兼容jQuery3.0的css动画影响元素尺寸计算
if(doms.anim[config.anim]){
that.layero.addClass(doms.anim[config.anim]).data('anim', true);
@@ -546,7 +551,7 @@ Class.pt.auto = function(index){
elem.height(area[1] - titHeight - btnHeight - 2*(parseFloat(elem.css('padding'))|0));
}
switch(config.type){
- case 2:
+ case 2:
setHeight('iframe');
break;
default:
@@ -570,12 +575,12 @@ Class.pt.offset = function(){
var type = typeof config.offset === 'object';
that.offsetTop = (win.height() - area[1])/2;
that.offsetLeft = (win.width() - area[0])/2;
-
+
if(type){
that.offsetTop = config.offset[0];
that.offsetLeft = config.offset[1]||that.offsetLeft;
} else if(config.offset !== 'auto'){
-
+
if(config.offset === 't'){ //上
that.offsetTop = 0;
} else if(config.offset === 'r'){ //右
@@ -599,20 +604,20 @@ Class.pt.offset = function(){
} else {
that.offsetTop = config.offset;
}
-
+
}
-
+
if(!config.fixed){
- that.offsetTop = /%$/.test(that.offsetTop) ?
+ that.offsetTop = /%$/.test(that.offsetTop) ?
win.height()*parseFloat(that.offsetTop)/100
: parseFloat(that.offsetTop);
- that.offsetLeft = /%$/.test(that.offsetLeft) ?
+ that.offsetLeft = /%$/.test(that.offsetLeft) ?
win.width()*parseFloat(that.offsetLeft)/100
: parseFloat(that.offsetLeft);
that.offsetTop += win.scrollTop();
that.offsetLeft += win.scrollLeft();
}
-
+
if(layero.attr('minLeft')){
that.offsetTop = win.height() - (layero.find(doms[1]).outerHeight() || 0);
that.offsetLeft = layero.css('left');
@@ -632,10 +637,10 @@ Class.pt.tips = function(){
top: follow.offset().top,
left: follow.offset().left
}, tipsG = layero.find('.layui-layer-TipsG');
-
+
var guide = config.tips[0];
config.tips[1] || tipsG.remove();
-
+
goal.autoLeft = function(){
if(goal.left + layArea[0] - win.width() > 0){
goal.tipLeft = goal.left + goal.width - layArea[0];
@@ -644,16 +649,16 @@ Class.pt.tips = function(){
goal.tipLeft = goal.left;
};
};
-
+
//辨别tips的方位
- goal.where = [function(){ //上
+ goal.where = [function(){ //上
goal.autoLeft();
goal.tipTop = goal.top - layArea[1] - 10;
tipsG.removeClass('layui-layer-TipsB').addClass('layui-layer-TipsT').css('border-right-color', config.tips[1]);
}, function(){ //右
goal.tipLeft = goal.left + goal.width + 10;
goal.tipTop = goal.top;
- tipsG.removeClass('layui-layer-TipsL').addClass('layui-layer-TipsR').css('border-bottom-color', config.tips[1]);
+ tipsG.removeClass('layui-layer-TipsL').addClass('layui-layer-TipsR').css('border-bottom-color', config.tips[1]);
}, function(){ //下
goal.autoLeft();
goal.tipTop = goal.top + goal.height + 10;
@@ -664,7 +669,7 @@ Class.pt.tips = function(){
tipsG.removeClass('layui-layer-TipsR').addClass('layui-layer-TipsL').css('border-bottom-color', config.tips[1]);
}];
goal.where[guide-1]();
-
+
/* 8*2为小三角形占据的空间 */
if(guide === 1){
goal.top - (win.scrollTop() + layArea[1] + 8*2) < 0 && goal.where[2]();
@@ -677,11 +682,11 @@ Class.pt.tips = function(){
}
layero.find('.'+doms[5]).css({
- 'background-color': config.tips[1],
+ 'background-color': config.tips[1],
'padding-right': (config.closeBtn ? '30px' : '')
});
layero.css({
- left: goal.tipLeft - (config.fixed ? win.scrollLeft() : 0),
+ left: goal.tipLeft - (config.fixed ? win.scrollLeft() : 0),
top: goal.tipTop - (config.fixed ? win.scrollTop() : 0)
});
}
@@ -695,7 +700,7 @@ Class.pt.move = function(){
,moveElem = layero.find(config.move)
,resizeElem = layero.find('.layui-layer-resize')
,dict = {};
-
+
if(config.move){
moveElem.css('cursor', 'move');
}
@@ -711,7 +716,7 @@ Class.pt.move = function(){
ready.moveElem.css('cursor', 'move').show();
}
});
-
+
resizeElem.on('mousedown', function(e){
e.preventDefault();
dict.resizeStart = true;
@@ -722,7 +727,7 @@ Class.pt.move = function(){
];
ready.moveElem.css('cursor', 'se-resize').show();
});
-
+
_DOC.on('mousemove', function(e){
//拖拽移动
@@ -730,35 +735,35 @@ Class.pt.move = function(){
var X = e.clientX - dict.offset[0]
,Y = e.clientY - dict.offset[1]
,fixed = layero.css('position') === 'fixed';
-
+
e.preventDefault();
-
+
dict.stX = fixed ? 0 : win.scrollLeft();
dict.stY = fixed ? 0 : win.scrollTop();
//控制元素不被拖出窗口外
if(!config.moveOut){
var setRig = win.width() - layero.outerWidth() + dict.stX
- ,setBot = win.height() - layero.outerHeight() + dict.stY;
+ ,setBot = win.height() - layero.outerHeight() + dict.stY;
X < dict.stX && (X = dict.stX);
- X > setRig && (X = setRig);
+ X > setRig && (X = setRig);
Y < dict.stY && (Y = dict.stY);
Y > setBot && (Y = setBot);
}
-
+
layero.css({
left: X
,top: Y
});
}
-
+
//Resize
if(config.resize && dict.resizeStart){
var X = e.clientX - dict.offset[0]
,Y = e.clientY - dict.offset[1];
-
+
e.preventDefault();
-
+
layer.style(that.index, {
width: dict.area[0] + X
,height: dict.area[1] + Y
@@ -776,7 +781,7 @@ Class.pt.move = function(){
ready.moveElem.hide();
}
});
-
+
return that;
};
@@ -793,7 +798,7 @@ Class.pt.callback = function(){
}
}
layer.ie == 6 && that.IE6(layero);
-
+
//按钮
layero.find('.'+ doms[6]).children('a').on('click', function(){
var index = $(this).index();
@@ -810,29 +815,29 @@ Class.pt.callback = function(){
close === false || layer.close(that.index);
}
});
-
+
//取消
function cancel(){
var close = config.cancel && config.cancel(that.index, layero);
close === false || layer.close(that.index);
}
-
+
//右上角关闭回调
layero.find('.'+ doms[7]).on('click', cancel);
-
+
//点遮罩关闭
if(config.shadeClose){
$('#layui-layer-shade'+ that.index).on('click', function(){
layer.close(that.index);
});
- }
-
+ }
+
//最小化
layero.find('.layui-layer-min').on('click', function(){
var min = config.min && config.min(layero);
- min === false || layer.min(that.index, config);
+ min === false || layer.min(that.index, config);
});
-
+
//全屏/还原
layero.find('.layui-layer-max').on('click', function(){
if($(this).hasClass('layui-layer-maxmin')){
@@ -854,11 +859,11 @@ ready.reselect = function(){
$.each($('select'), function(index , value){
var sthis = $(this);
if(!sthis.parents('.'+doms[0])[0]){
- (sthis.attr('layer') == 1 && $('.'+doms[0]).length < 1) && sthis.removeAttr('layer').show();
+ (sthis.attr('layer') == 1 && $('.'+doms[0]).length < 1) && sthis.removeAttr('layer').show();
}
sthis = null;
});
-};
+};
Class.pt.IE6 = function(layero){
//隐藏select
@@ -874,7 +879,7 @@ Class.pt.IE6 = function(layero){
//需依赖原型的对外方法
Class.pt.openLayer = function(){
var that = this;
-
+
//置顶当前窗口
layer.zIndex = that.config.zIndex;
layer.setTop = function(layero){
@@ -892,7 +897,7 @@ ready.record = function(layero){
var area = [
layero.width(),
layero.height(),
- layero.position().top,
+ layero.position().top,
layero.position().left + parseFloat(layero.css('margin-left'))
];
layero.find('.layui-layer-max').addClass('layui-layer-maxmin');
@@ -917,7 +922,7 @@ window.layer = layer;
//获取子iframe的DOM
layer.getChildFrame = function(selector, index){
index = index || $('.'+doms[4]).attr('times');
- return $('#'+ doms[0] + index).find('iframe').contents().find(selector);
+ return $('#'+ doms[0] + index).find('iframe').contents().find(selector);
};
//得到当前iframe层的索引,子iframe时使用
@@ -949,24 +954,24 @@ layer.style = function(index, options, limit){
,titHeight = layero.find(doms[1]).outerHeight() || 0
,btnHeight = layero.find('.'+doms[6]).outerHeight() || 0
,minLeft = layero.attr('minLeft');
-
+
if(type === ready.type[3] || type === ready.type[4]){
return;
}
-
+
if(!limit){
if(parseFloat(options.width) <= 260){
options.width = 260;
};
-
+
if(parseFloat(options.height) - titHeight - btnHeight <= 64){
options.height = 64 + titHeight + btnHeight;
};
}
-
+
layero.css(options);
btnHeight = layero.find('.'+doms[6]).outerHeight();
-
+
if(type === ready.type[2]){
layero.find('iframe').css({
height: parseFloat(options.height) - titHeight - btnHeight
@@ -986,16 +991,16 @@ layer.min = function(index, options){
,titHeight = layero.find(doms[1]).outerHeight() || 0
,left = layero.attr('minLeft') || (181*ready.minIndex)+'px'
,position = layero.css('position');
-
+
ready.record(layero);
-
+
if(ready.minLeft[0]){
left = ready.minLeft[0];
ready.minLeft.shift();
}
-
+
layero.attr('position', position);
-
+
layer.style(index, {
width: 180
,height: titHeight
@@ -1008,7 +1013,7 @@ layer.min = function(index, options){
layero.find('.layui-layer-min').hide();
layero.attr('type') === 'page' && layero.find(doms[4]).hide();
ready.rescollbar(index);
-
+
if(!layero.attr('minLeft')){
ready.minIndex++;
}
@@ -1020,9 +1025,9 @@ layer.restore = function(index){
var layero = $('#'+ doms[0] + index), area = layero.attr('area').split(',');
var type = layero.attr('type');
layer.style(index, {
- width: parseFloat(area[0]),
- height: parseFloat(area[1]),
- top: parseFloat(area[2]),
+ width: parseFloat(area[0]),
+ height: parseFloat(area[1]),
+ top: parseFloat(area[2]),
left: parseFloat(area[3]),
position: layero.attr('position'),
overflow: 'visible'
@@ -1085,16 +1090,16 @@ layer.close = function(index){
layero.remove();
}
};
-
+
if(layero.data('anim')){
layero.addClass(closeAnim);
}
-
+
$('#layui-layer-moves, #layui-layer-shade' + index).remove();
layer.ie == 6 && ready.reselect();
ready.rescollbar(index);
typeof ready.end[index] === 'function' && ready.end[index]();
- delete ready.end[index];
+ delete ready.end[index];
if(layero.attr('minLeft')){
ready.minIndex--;
ready.minLeft.push(layero.attr('minLeft'));
@@ -1114,7 +1119,7 @@ layer.closeAll = function(type){
});
};
-/**
+/**
拓展模块,layui开始合并在一起
@@ -1122,15 +1127,15 @@ layer.closeAll = function(type){
var cache = layer.cache||{}, skin = function(type){
return (cache.skin ? (' ' + cache.skin + ' ' + cache.skin + '-'+type) : '');
-};
-
+};
+
//仿系统prompt
layer.prompt = function(options, yes){
var style = '';
options = options || {};
-
+
if(typeof options === 'function') yes = options;
-
+
if(options.area){
var area = options.area;
style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"';
@@ -1139,7 +1144,7 @@ layer.prompt = function(options, yes){
var prompt, content = options.formType == 2 ? '' : function(){
return '';
}();
-
+
return layer.open($.extend({
type: 1
,btn: ['确定','取消']
@@ -1215,7 +1220,7 @@ layer.photos = function(options, loop, key){
var photos = type ? options.photos : {}, data = photos.data || [];
var start = photos.start || 0;
dict.imgIndex = (start|0) + 1;
-
+
options.img = options.img || 'img';
if(!type){ //页面直接获取
@@ -1232,13 +1237,13 @@ layer.photos = function(options, loop, key){
});
})
};
-
+
pushData();
-
+
if (data.length === 0) return;
-
+
loop || parent.on('click', options.img, function(){
- var othis = $(this), index = othis.attr('layer-index');
+ var othis = $(this), index = othis.attr('layer-index');
layer.photos($.extend(options, {
photos: {
start: index,
@@ -1249,14 +1254,14 @@ layer.photos = function(options, loop, key){
}), true);
pushData();
})
-
+
//不直接弹出
if(!loop) return;
-
+
} else if (data.length === 0){
return layer.msg('没有图片');
}
-
+
//上一张
dict.imgprev = function(key){
dict.imgIndex--;
@@ -1265,7 +1270,7 @@ layer.photos = function(options, loop, key){
}
dict.tabimg(key);
};
-
+
//下一张
dict.imgnext = function(key,errorMsg){
dict.imgIndex++;
@@ -1275,7 +1280,7 @@ layer.photos = function(options, loop, key){
}
dict.tabimg(key)
};
-
+
//方向键
dict.keyup = function(event){
if(!dict.end){
@@ -1290,7 +1295,7 @@ layer.photos = function(options, loop, key){
}
}
}
-
+
//切换
dict.tabimg = function(key){
if(data.length <= 1) return;
@@ -1298,7 +1303,7 @@ layer.photos = function(options, loop, key){
layer.close(dict.index);
layer.photos(options, true, key);
}
-
+
//一些动作
dict.event = function(){
dict.bigimg.hover(function(){
@@ -1306,24 +1311,24 @@ layer.photos = function(options, loop, key){
}, function(){
dict.imgsee.hide();
});
-
+
dict.bigimg.find('.layui-layer-imgprev').on('click', function(event){
event.preventDefault();
dict.imgprev();
- });
-
- dict.bigimg.find('.layui-layer-imgnext').on('click', function(event){
+ });
+
+ dict.bigimg.find('.layui-layer-imgnext').on('click', function(event){
event.preventDefault();
dict.imgnext();
});
-
+
$(document).on('keyup', dict.keyup);
};
-
+
//图片预加载
- function loadImage(url, callback, error) {
+ function loadImage(url, callback, error) {
var img = new Image();
- img.src = url;
+ img.src = url;
if(img.complete){
return callback(img);
}
@@ -1334,9 +1339,9 @@ layer.photos = function(options, loop, key){
img.onerror = function(e){
img.onerror = null;
error(e);
- };
+ };
};
-
+
dict.loadi = layer.load(1, {
shade: 'shade' in options ? false : 0.9,
scrollbar: false
@@ -1348,7 +1353,7 @@ layer.photos = function(options, loop, key){
area: function(){
var imgarea = [img.width, img.height];
var winarea = [$(window).width() - 100, $(window).height() - 100];
-
+
//如果 实际图片的宽或者高比 屏幕大(那么进行缩放)
if(!options.full && (imgarea[0]>winarea[0]||imgarea[1]>winarea[1])){
var wh = [imgarea[0]/winarea[0],imgarea[1]/winarea[1]];//取宽度缩放比例、高度缩放比例
@@ -1360,8 +1365,8 @@ layer.photos = function(options, loop, key){
imgarea[1] = imgarea[1]/wh[1];
}
}
-
- return [imgarea[0]+'px', imgarea[1]+'px'];
+
+ return [imgarea[0]+'px', imgarea[1]+'px'];
}(),
title: false,
shade: 0.9,
@@ -1393,8 +1398,8 @@ layer.photos = function(options, loop, key){
}, function(){
layer.close(dict.loadi);
layer.msg('当前图片地址异常
是否继续查看下一张?', {
- time: 30000,
- btn: ['下一张', '不看了'],
+ time: 30000,
+ btn: ['下一张', '不看了'],
yes: function(){
data.length > 1 && dict.imgnext(true,true);
}
diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js
index 4d212af8a5e486bd051cff804e2d1870bfd4da77..beabb5f3e5d4a5b34432a28aa19c03ddcab8a961 100644
--- a/public/assets/js/require-table.js
+++ b/public/assets/js/require-table.js
@@ -1,4 +1,4 @@
-define(['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-mobile', 'bootstrap-table-export', 'bootstrap-table-advancedsearch'], function ($, undefined, Backend, Config, Toastr, Moment) {
+define(['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-mobile', 'bootstrap-table-export', 'bootstrap-table-advancedsearch', 'bootstrap-table-commonsearch'], function ($, undefined, Backend, Config, Toastr, Moment) {
var Table = {
list: {},
@@ -10,7 +10,9 @@ define(['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstr
toolbar: "#toolbar",
search: true,
cache: false,
- advancedSearch: true,
+ advancedSearch: false,
+ commonSearch: false,
+ titleForm: '', //为空则不显示标题,不定义默认显示:普通搜索
idTable: 'advancedTable',
showExport: true,
exportDataType: "all",