|
@@ -7515,10 +7515,12 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
|
|
Upload.events.onUploadError(this, ret, file);
|
|
|
},
|
|
|
uploadprogress: function (file, progress, bytesSent) {
|
|
|
-
|
|
|
+ if (file.upload.chunked) {
|
|
|
+ $(this.element).prop("disabled", true).html("<i class='fa fa-upload'></i> " + __('Upload') + Math.floor((file.upload.bytesSent / file.size) * 100) + "%");
|
|
|
+ }
|
|
|
},
|
|
|
totaluploadprogress: function (progress, bytesSent) {
|
|
|
- if (this.getActiveFiles().length > 0) {
|
|
|
+ if (this.getActiveFiles().length > 0 && !this.options.chunking) {
|
|
|
$(this.element).prop("disabled", true).html("<i class='fa fa-upload'></i> " + __('Upload') + Math.floor(progress) + "%");
|
|
|
}
|
|
|
},
|
|
@@ -7533,13 +7535,13 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
|
|
var that = this;
|
|
|
Fast.api.ajax({
|
|
|
url: this.options.url,
|
|
|
- data: {
|
|
|
+ data: $.extend({}, multipart, {
|
|
|
action: 'merge',
|
|
|
filesize: file.size,
|
|
|
filename: file.name,
|
|
|
chunkid: file.upload.uuid,
|
|
|
chunkcount: file.upload.totalChunkCount,
|
|
|
- }
|
|
|
+ })
|
|
|
}, function (data, ret) {
|
|
|
done(JSON.stringify(ret));
|
|
|
return false;
|
|
@@ -10234,7 +10236,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
faselect: function (form) {
|
|
|
//绑定fachoose选择附件事件
|
|
|
if ($(".faselect,.fachoose", form).size() > 0) {
|
|
|
- $(".faselect,.fachoose", form).on('click', function () {
|
|
|
+ $(".faselect,.fachoose", form).off('click').on('click', function () {
|
|
|
var that = this;
|
|
|
var multiple = $(this).data("multiple") ? $(this).data("multiple") : false;
|
|
|
var mimetype = $(this).data("mimetype") ? $(this).data("mimetype") : '';
|
|
@@ -10405,6 +10407,35 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
return false;
|
|
|
});
|
|
|
},
|
|
|
+ tagsinput: function (form) {
|
|
|
+ //标签输入
|
|
|
+ $("input[data-toggle='tagsinput']").each(function () {
|
|
|
+ var setting = {
|
|
|
+ width: 'auto',
|
|
|
+ defaultText: '输入后空格确认',
|
|
|
+ minInputWidth: 110,
|
|
|
+ height: '36px',
|
|
|
+ placeholderColor: '#999',
|
|
|
+ onChange: function (row) {
|
|
|
+ $("input", $(this).next()).parent().focus();
|
|
|
+ $("input", $(this).next()).trigger("blur.autocomplete").focus();
|
|
|
+ },
|
|
|
+ };
|
|
|
+ var autocomplete = $(this).data("tagsinput-autocomplete");
|
|
|
+ if (autocomplete) {
|
|
|
+ if (typeof autocomplete == 'string') {
|
|
|
+ autocomplete = {url: autocomplete};
|
|
|
+ }
|
|
|
+ setting['autocomplete'] = $.extend({
|
|
|
+ url: '',
|
|
|
+ minChars: 1,
|
|
|
+ menuClass: 'autocomplete-tags'
|
|
|
+ }, autocomplete);
|
|
|
+ }
|
|
|
+ setting = $.extend(true, setting, $(this).data("tagsinput") || {});
|
|
|
+ $(this).tagsInput(setting);
|
|
|
+ });
|
|
|
+ },
|
|
|
bindevent: function (form) {
|
|
|
|
|
|
},
|
|
@@ -10523,6 +10554,8 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
events.slider(form);
|
|
|
|
|
|
events.switcher(form);
|
|
|
+
|
|
|
+ events.tagsinput(form);
|
|
|
},
|
|
|
custom: {}
|
|
|
},
|
|
@@ -10572,6 +10605,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
// 重置搜索
|
|
|
form.on("click", "button[type=reset]", function (event) {
|
|
|
form[0].reset();
|
|
|
+
|
|
|
setTimeout(function () {
|
|
|
that.onCommonSearch();
|
|
|
}, 0);
|
|
@@ -10861,13 +10895,19 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
});
|
|
|
|
|
|
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) {
|
|
|
- var value = $(this).data("value");
|
|
|
if (obj.is("select")) {
|
|
|
$("option[value='" + value + "']", obj).prop("selected", true);
|
|
|
} 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 {
|
|
|
obj.val(value + "");
|
|
|
}
|
|
@@ -11247,8 +11287,8 @@ define("bootstrap-table-jumpto", ["bootstrap-table"], (function (global) {
|
|
|
this.$tableBody.css("height", "100%");
|
|
|
this.$fixedColumns && this.$fixedColumns.show();
|
|
|
this.$fixedColumnsRight && this.$fixedColumnsRight.show();
|
|
|
- this.$fixedHeaderRight.scrollLeft(this.$tableBody.find('table').width());
|
|
|
- this.$fixedBodyRight.scrollLeft(this.$tableBody.find('table').width());
|
|
|
+ this.$fixedHeaderRight && this.$fixedHeaderRight.scrollLeft(this.$tableBody.find('table').width());
|
|
|
+ this.$fixedBodyRight && this.$fixedBodyRight.scrollLeft(this.$tableBody.find('table').width());
|
|
|
}
|
|
|
}
|
|
|
if (!that.fixedColumnsSupported()) {
|
|
@@ -11258,11 +11298,11 @@ define("bootstrap-table-jumpto", ["bootstrap-table"], (function (global) {
|
|
|
this.initFixedColumnsHeader();
|
|
|
} else if (arguments[0] === 'scroll-body') {
|
|
|
if (this.needFixedColumns && this.options.fixedNumber) {
|
|
|
- this.$fixedBody.scrollTop(this.$tableBody.scrollTop());
|
|
|
+ this.$fixedBody && this.$fixedBody.scrollTop(this.$tableBody.scrollTop());
|
|
|
}
|
|
|
|
|
|
if (this.needFixedColumns && this.options.fixedRightNumber) {
|
|
|
- this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop());
|
|
|
+ this.$fixedBodyRight && this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop());
|
|
|
}
|
|
|
} else if (arguments[0] === 'load-success') {
|
|
|
this.hideLoading();
|
|
@@ -11460,6 +11500,17 @@ define("bootstrap-table-jumpto", ["bootstrap-table"], (function (global) {
|
|
|
//给鼠标滑轮绑定事件
|
|
|
updateScroll(e, that.$fixedBody[0]);
|
|
|
});
|
|
|
+ //给固定表格的checkbox绑定事件
|
|
|
+ this.$fixedBody.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) {
|
|
|
+ e.stopImmediatePropagation();
|
|
|
+ var index = $(e.target).data("index");
|
|
|
+ $(that.$selectItem[index]).trigger("click");
|
|
|
+ });
|
|
|
+ //绑定TD点击事件
|
|
|
+ this.$fixedBody.find('> table > tbody > tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
|
|
|
+ var index = $(this).closest("tr[data-index]").data("index");
|
|
|
+ $(that.$selectItem[index]).closest("tr[data-index]").find(">td:eq(" + $(this).index() + ")").trigger("click");
|
|
|
+ });
|
|
|
}
|
|
|
//给原本表格绑定scroll事件
|
|
|
$('div.fixed-table-body').off('scroll'); //给所有的body解绑 scroll
|
|
@@ -11491,11 +11542,16 @@ define("bootstrap-table-jumpto", ["bootstrap-table"], (function (global) {
|
|
|
updateScroll(e, that.$fixedBodyRight[0]);
|
|
|
});
|
|
|
//给固定表格的checkbox绑定事件
|
|
|
- this.$fixedBody && this.$fixedBody.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) {
|
|
|
+ this.$fixedBodyRight.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) {
|
|
|
e.stopImmediatePropagation();
|
|
|
var index = $(e.target).data("index");
|
|
|
$(that.$selectItem[index]).trigger("click");
|
|
|
});
|
|
|
+ //绑定TD点击事件
|
|
|
+ this.$fixedBodyRight.find('> table > tbody > tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
|
|
|
+ var index = $(this).closest("tr[data-index]").data("index");
|
|
|
+ $(that.$selectItem[index]).closest("tr[data-index]").find(">td:eq(" + $(this).index() + ")").trigger("click");
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
if (this.options.filterControl) {
|
|
@@ -11813,7 +11869,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', !options.selectedIds.length);
|
|
|
});
|
|
|
// 绑定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 value = $(this).data("value");
|
|
|
var object = $("[name='" + field + "']", table.closest(".bootstrap-table").find(".commonsearch-table"));
|
|
@@ -11826,6 +11882,14 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
table.bootstrapTable('refresh', {pageNumber: 1});
|
|
|
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 () {
|
|
|
table.bootstrapTable('refresh');
|
|
@@ -11924,7 +11988,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
var ids = Table.api.selectedids(table);
|
|
|
Layer.confirm(
|
|
|
__('Are you sure you want to delete the %s selected item?', ids.length),
|
|
|
- {icon: 3, title: __('Warning'), offset: 0, shadeClose: true},
|
|
|
+ {icon: 3, title: __('Warning'), offset: 0, shadeClose: true, btn: [__('OK'), __('Cancel')]},
|
|
|
function (index) {
|
|
|
Table.api.multi("del", ids, table, that);
|
|
|
Layer.close(index);
|
|
@@ -12013,7 +12077,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
var that = this;
|
|
|
Layer.confirm(
|
|
|
__('Are you sure you want to delete this item?'),
|
|
|
- {icon: 3, title: __('Warning'), shadeClose: true},
|
|
|
+ {icon: 3, title: __('Warning'), shadeClose: true, btn: [__('OK'), __('Cancel')]},
|
|
|
function (index) {
|
|
|
Table.api.multi("del", id, table, that);
|
|
|
Layer.close(index);
|
|
@@ -12116,7 +12180,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
}
|
|
|
Layer.confirm(
|
|
|
__('Are you sure you want to delete this item?'),
|
|
|
- {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true},
|
|
|
+ {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true, btn: [__('OK'), __('Cancel')]},
|
|
|
function (index) {
|
|
|
var table = $(that).closest('table');
|
|
|
var options = table.bootstrapTable('getOptions');
|
|
@@ -12262,6 +12326,16 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
value = row[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
|
|
|
var html = [];
|
|
@@ -12325,6 +12399,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
},
|
|
|
buttonlink: function (column, buttons, value, row, index, type) {
|
|
|
var table = column.table;
|
|
|
+ column.clickToSelect = false;
|
|
|
type = typeof type === 'undefined' ? 'buttons' : type;
|
|
|
var options = table ? table.bootstrapTable('getOptions') : {};
|
|
|
var html = [];
|