|
@@ -776,8 +776,10 @@ define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, u
|
|
|
//获取修复后可访问的cdn链接
|
|
|
cdnurl: function (url, domain) {
|
|
|
var rule = new RegExp("^((?:[a-z]+:)?\\/\\/|data:image\\/)", "i");
|
|
|
- var cdnurl = Config.upload.cdnurl;
|
|
|
- url = rule.test(url) || (cdnurl && url.indexOf(cdnurl) === 0) ? url : cdnurl + url;
|
|
|
+ if(typeof domain === 'undefined'){
|
|
|
+ var cdnurl = Config.upload.cdnurl;
|
|
|
+ url = rule.test(url) || (cdnurl && url.indexOf(cdnurl) === 0) ? url : cdnurl + url;
|
|
|
+ }
|
|
|
if (domain && !rule.test(url)) {
|
|
|
domain = typeof domain === 'string' ? domain : location.origin;
|
|
|
url = domain + url;
|
|
@@ -7686,9 +7688,10 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
|
|
$(document.body).on("keyup change", "#" + input_id, function (e) {
|
|
|
var inputStr = $("#" + input_id).val();
|
|
|
var inputArr = inputStr.split(/\,/);
|
|
|
- $("#" + preview_id).empty();
|
|
|
- var tpl = $("#" + preview_id).data("template") ? $("#" + preview_id).data("template") : "";
|
|
|
- var extend = $("#" + preview_id).next().is("textarea") ? $("#" + preview_id).next("textarea").val() : "{}";
|
|
|
+ var previewObj = $("#" + preview_id);
|
|
|
+ previewObj.empty();
|
|
|
+ var tpl = previewObj.data("template") ? previewObj.data("template") : "";
|
|
|
+ var extend = previewObj.next().is("textarea") ? previewObj.next("textarea").val() : "{}";
|
|
|
var json = {};
|
|
|
try {
|
|
|
json = JSON.parse(extend);
|
|
@@ -7700,13 +7703,15 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
|
|
}
|
|
|
var suffix = /[\.]?([a-zA-Z0-9]+)$/.exec(j);
|
|
|
suffix = suffix ? suffix[1] : 'file';
|
|
|
- j = Config.upload.fullmode ? Fast.api.cdnurl(j) : j;
|
|
|
+ var btnData = $(that).data();
|
|
|
+ var fullurl = typeof btnData.cdnurl!=='undefined' ? Fast.api.cdnurl(j, btnData.cdnurl) : Fast.api.cdnurl(j);
|
|
|
+ j = Config.upload.fullmode ? fullurl : j;
|
|
|
var value = (json && typeof json[i] !== 'undefined' ? json[i] : null);
|
|
|
- var data = {url: j, fullurl: Fast.api.cdnurl(j), data: $(that).data(), key: i, index: i, value: value, row: value, suffix: suffix};
|
|
|
+ var data = {url: j, fullurl: fullurl, data: btnData, key: i, index: i, value: value, row: value, suffix: suffix};
|
|
|
var html = tpl ? Template(tpl, data) : Template.render(Upload.config.previewtpl, data);
|
|
|
- $("#" + preview_id).append(html);
|
|
|
+ previewObj.append(html);
|
|
|
});
|
|
|
- refresh($("#" + preview_id).data("name"));
|
|
|
+ refresh(previewObj.data("name"));
|
|
|
});
|
|
|
$("#" + input_id).trigger("change");
|
|
|
}
|
|
@@ -10186,6 +10191,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
//绑定select元素事件
|
|
|
if ($(".selectpicker", form).length > 0) {
|
|
|
require(['bootstrap-select', 'bootstrap-select-lang'], function () {
|
|
|
+ $.fn.selectpicker.Constructor.BootstrapVersion = '3';
|
|
|
$('.selectpicker', form).selectpicker();
|
|
|
$(form).on("reset", function () {
|
|
|
setTimeout(function () {
|
|
@@ -10298,7 +10304,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
};
|
|
|
var origincallback = function (start, end) {
|
|
|
$(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format));
|
|
|
- $(this.element).trigger('blur');
|
|
|
+ $(this.element).trigger('change');
|
|
|
};
|
|
|
$(".datetimerange", form).each(function () {
|
|
|
var callback = typeof $(this).data('callback') == 'function' ? $(this).data('callback') : origincallback;
|
|
@@ -10306,7 +10312,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
callback.call(picker, picker.startDate, picker.endDate);
|
|
|
});
|
|
|
$(this).on('cancel.daterangepicker', function (ev, picker) {
|
|
|
- $(this).val('').trigger('blur');
|
|
|
+ $(this).val('').trigger('change');
|
|
|
});
|
|
|
$(this).daterangepicker($.extend(true, options, $(this).data() || {}, $(this).data("daterangepicker-options") || {}));
|
|
|
});
|
|
@@ -10405,15 +10411,15 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
$.each(data, function (i, j) {
|
|
|
if (j) {
|
|
|
if (!template) {
|
|
|
- if (j.key != '') {
|
|
|
- result[j.key] = j.value;
|
|
|
+ if (j.key !== '') {
|
|
|
+ result['__PLACEHOLDKEY__' + j.key] = j.value;
|
|
|
}
|
|
|
} else {
|
|
|
result.push(j);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- textarea.val(JSON.stringify(result));
|
|
|
+ textarea.val(JSON.stringify(result).replace(/__PLACEHOLDKEY__/g, ''));
|
|
|
};
|
|
|
//追加一行数据
|
|
|
var append = function (container, row, initial) {
|
|
@@ -10481,11 +10487,12 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
$("[fieldlist-item]", container).remove();
|
|
|
var json = {};
|
|
|
try {
|
|
|
- json = JSON.parse(textarea.val());
|
|
|
+ var val = textarea.val().replace(/"(\d+)"\:/g, "\"__PLACEHOLDERKEY__$1\":");
|
|
|
+ json = JSON.parse(val);
|
|
|
} catch (e) {
|
|
|
}
|
|
|
$.each(json, function (i, j) {
|
|
|
- append(container, {key: i, value: j}, true);
|
|
|
+ append(container, {key: i.toString().replace("__PLACEHOLDERKEY__", ""), value: j}, true);
|
|
|
});
|
|
|
});
|
|
|
//拖拽排序
|
|
@@ -10593,7 +10600,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
'==': function(a, b) { return a == b; },
|
|
|
'!=': function(a, b) { return a != b; },
|
|
|
'in': function(a, b) { return b.split(/\,/).indexOf(a) > -1; },
|
|
|
- 'regex': function(a, b) {
|
|
|
+ 'regex': function (a, b) {
|
|
|
var regParts = b.match(/^\/(.*?)\/([gim]*)$/);
|
|
|
var regexp = regParts ? new RegExp(regParts[1], regParts[2]) : new RegExp(b);
|
|
|
return regexp.test(a);
|
|
@@ -10824,7 +10831,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
|
|
|
setTimeout(function () {
|
|
|
that.onCommonSearch();
|
|
|
- }, 0);
|
|
|
+ }, 10);
|
|
|
});
|
|
|
|
|
|
};
|
|
@@ -10989,13 +10996,23 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
} else {
|
|
|
value = process ? process(obj.val()) : obj.val();
|
|
|
}
|
|
|
- if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) {
|
|
|
+ if (removeempty && (value === '' || value == null || ($.isArray(value) && value.length === 0)) && !sym.match(/null/i)) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
op[name] = sym;
|
|
|
filter[name] = value;
|
|
|
});
|
|
|
+ if (that.options.searchCountTips) {
|
|
|
+ var count = 0;
|
|
|
+ $.each(filter, function (key, value) {
|
|
|
+ if ((value === '' || value == null || ($.isArray(value) && value.length === 0))) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ count++;
|
|
|
+ });
|
|
|
+ that.$toolbar.find(".btn-commonsearch > span").text(count).toggleClass("hidden", count === 0);
|
|
|
+ }
|
|
|
return {op: op, filter: filter};
|
|
|
};
|
|
|
|
|
@@ -11025,6 +11042,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
actionForm: "",
|
|
|
searchFormTemplate: "",
|
|
|
searchFormVisible: true,
|
|
|
+ searchCountTips: true,
|
|
|
searchClass: 'searchit',
|
|
|
showSearch: true,
|
|
|
renderDefault: true,
|
|
@@ -11049,7 +11067,7 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
return "Common search";
|
|
|
},
|
|
|
formatCommonSubmitButton: function () {
|
|
|
- return "Submit";
|
|
|
+ return "Search";
|
|
|
},
|
|
|
formatCommonResetButton: function () {
|
|
|
return "Reset";
|
|
@@ -11092,8 +11110,11 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'],
|
|
|
html = [];
|
|
|
if (that.options.showSearch) {
|
|
|
html.push(sprintf('<div class="columns-%s pull-%s" style="margin-top:10px;margin-bottom:10px;">', this.options.buttonsAlign, this.options.buttonsAlign));
|
|
|
- html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="commonSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatCommonSearch()));
|
|
|
- html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.commonSearchIcon))
|
|
|
+ html.push(sprintf('<button class="btn btn-default btn-commonsearch %s' + '" type="button" name="commonSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatCommonSearch()));
|
|
|
+ if (that.options.searchCountTips) {
|
|
|
+ html.push(sprintf('<span class="label label-danger hidden">0</span>'));
|
|
|
+ }
|
|
|
+ html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.commonSearchIcon));
|
|
|
html.push('</button></div>');
|
|
|
}
|
|
|
if (that.$toolbar.find(".pull-right").length > 0) {
|
|
@@ -11934,7 +11955,7 @@ define('table',['jquery', 'bootstrap'], function ($, undefined) {
|
|
|
return __('Common search');
|
|
|
},
|
|
|
formatCommonSubmitButton: function () {
|
|
|
- return __('Submit');
|
|
|
+ return __('Search');
|
|
|
},
|
|
|
formatCommonResetButton: function () {
|
|
|
return __('Reset');
|
|
@@ -13344,7 +13365,7 @@ define("drop", function(){});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- localStorage.setItem("addtabs", $(this).prop('outerHTML'));
|
|
|
+ // localStorage.setItem("addtabs", $(this).prop('outerHTML'));
|
|
|
//激活TAB
|
|
|
tabitem.addClass('active');
|
|
|
conitem.addClass("active");
|
|
@@ -14009,9 +14030,11 @@ define("addtabs", function(){});
|
|
|
hidden_id = input_id;
|
|
|
|
|
|
//switch the id and name attributes of input/hidden element
|
|
|
- elem.hidden = $('<input type="hidden" class="sp_hidden" />').attr({
|
|
|
+ elem.hidden = elem.combo_input.clone().attr({
|
|
|
name: hidden_name,
|
|
|
- id: hidden_id
|
|
|
+ id: hidden_id,
|
|
|
+ type: 'hidden',
|
|
|
+ class: 'sp_hidden'
|
|
|
}).val('');
|
|
|
elem.combo_input.attr({
|
|
|
name: typeof input.data('name') !== 'undefined' ? input.data('name') : input_name + namePrefix,
|
|
@@ -14436,7 +14459,7 @@ define("addtabs", function(){});
|
|
|
self.elem.results.empty().append(msgLi).show();
|
|
|
self.calcResultsSize(self);
|
|
|
self.setOpenStatus(self, true);
|
|
|
- if(self.elem.control) self.elem.control.hide();
|
|
|
+ if (self.elem.control) self.elem.control.hide();
|
|
|
if (self.option.pagination) self.elem.navi.hide();
|
|
|
};
|
|
|
|
|
@@ -15625,7 +15648,7 @@ define("addtabs", function(){});
|
|
|
* Get selected item raw data
|
|
|
* @returns {any[]}
|
|
|
*/
|
|
|
- function GetSelectedData () {
|
|
|
+ function GetSelectedData() {
|
|
|
var results = [];
|
|
|
this.each(function () {
|
|
|
var $this = getPlugin(this), data = $this.data(SelectPage.dataKey);
|