mirror of https://gitee.com/karson/fastadmin.git
parent
4e657d1f25
commit
8130a49fab
|
|
@ -40,6 +40,7 @@
|
||||||
// 重置搜索
|
// 重置搜索
|
||||||
form.on("click", "button[type=reset]", function (event) {
|
form.on("click", "button[type=reset]", function (event) {
|
||||||
form[0].reset();
|
form[0].reset();
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
that.onCommonSearch();
|
that.onCommonSearch();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
@ -329,13 +330,19 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
that.$container.on("click", "." + that.options.searchClass, function () {
|
that.$container.on("click", "." + that.options.searchClass, function () {
|
||||||
var obj = $("form [name='" + $(this).data("field") + "']", that.$commonsearch);
|
var value = $(this).data("value");
|
||||||
|
var field = $(this).data("field");
|
||||||
|
var ul = that.$container.closest(".panel-intro").find("ul[data-field='" + field + "']");
|
||||||
|
if (ul.length > 0) {
|
||||||
|
$('li a[data-value="' + value + '"][data-toggle="tab"]', ul).trigger('click');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var obj = $("form [name='" + field + "']", that.$commonsearch);
|
||||||
if (obj.size() > 0) {
|
if (obj.size() > 0) {
|
||||||
var value = $(this).data("value");
|
|
||||||
if (obj.is("select")) {
|
if (obj.is("select")) {
|
||||||
$("option[value='" + value + "']", obj).prop("selected", true);
|
$("option[value='" + value + "']", obj).prop("selected", true);
|
||||||
} else if (obj.size() > 1) {
|
} else if (obj.size() > 1) {
|
||||||
$("form [name='" + $(this).data("field") + "'][value='" + value + "']", that.$commonsearch).prop("checked", true);
|
$("form [name='" + field + "'][value='" + value + "']", that.$commonsearch).prop("checked", true);
|
||||||
} else {
|
} else {
|
||||||
obj.val(value + "");
|
obj.val(value + "");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', !options.selectedIds.length);
|
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', !options.selectedIds.length);
|
||||||
});
|
});
|
||||||
// 绑定TAB事件
|
// 绑定TAB事件
|
||||||
$('.panel-heading [data-field] a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
$('.panel-heading [data-field] a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) {
|
||||||
var field = $(this).closest("[data-field]").data("field");
|
var field = $(this).closest("[data-field]").data("field");
|
||||||
var value = $(this).data("value");
|
var value = $(this).data("value");
|
||||||
var object = $("[name='" + field + "']", table.closest(".bootstrap-table").find(".commonsearch-table"));
|
var object = $("[name='" + field + "']", table.closest(".bootstrap-table").find(".commonsearch-table"));
|
||||||
|
|
@ -298,6 +298,14 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
table.bootstrapTable('refresh', {pageNumber: 1});
|
table.bootstrapTable('refresh', {pageNumber: 1});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
// 修复重置事件
|
||||||
|
$("form", table.closest(".bootstrap-table").find(".commonsearch-table")).on('reset', function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
// $('.panel-heading [data-field] li.active a[data-toggle="tab"]').trigger('shown.bs.tab');
|
||||||
|
}, 0);
|
||||||
|
$('.panel-heading [data-field] li', table.closest(".panel-intro")).removeClass('active');
|
||||||
|
$('.panel-heading [data-field] li:first', table.closest(".panel-intro")).addClass('active');
|
||||||
|
});
|
||||||
// 刷新按钮事件
|
// 刷新按钮事件
|
||||||
toolbar.on('click', Table.config.refreshbtn, function () {
|
toolbar.on('click', Table.config.refreshbtn, function () {
|
||||||
table.bootstrapTable('refresh');
|
table.bootstrapTable('refresh');
|
||||||
|
|
@ -734,6 +742,16 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
value = row[this.customField];
|
value = row[this.customField];
|
||||||
field = this.customField;
|
field = this.customField;
|
||||||
}
|
}
|
||||||
|
if (typeof that.searchList === 'object' && typeof that.custom === 'undefined') {
|
||||||
|
var i = 0;
|
||||||
|
var searchValues = Object.values(colorArr);
|
||||||
|
$.each(that.searchList, function (key, val) {
|
||||||
|
if (typeof colorArr[key] == 'undefined') {
|
||||||
|
colorArr[key] = searchValues[i];
|
||||||
|
i = typeof searchValues[i + 1] === 'undefined' ? 0 : i + 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//渲染Flag
|
//渲染Flag
|
||||||
var html = [];
|
var html = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue