Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

beetlsql3-dev
姚丹ab 2 years ago
commit fada35c143

@ -46,6 +46,55 @@ $.ajaxSetup({
},
});
if(typeof Object.assign != 'function') {
(function() {
Object.assign = function(target) {
'use strict';
if(target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for(var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if(source !== undefined && source !== null) {
for(var nextKey in source) {
if(source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}
// 增加IE对Object.assign 的支持
if(typeof Object.assign != 'function') {
(function() {
Object.assign = function(target) {
'use strict';
if(target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for(var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if(source !== undefined && source !== null) {
for(var nextKey in source) {
if(source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}
//日期格式化
Date.prototype.format = function (format) {
var d = this, o = {
@ -107,15 +156,21 @@ var Common = {
}
},
error: function (rsp) {
if(rsp.responseJSON?.msg)
Common.error(rsp.responseJSON?.msg);
if(rsp.responseJSON && rsp.responseJSON.msg)
Common.error(rsp.responseJSON.msg);
else
Common.error('服务器错误,请联系管理员');
}
})
},
downLoad: function (url, data = {}, method = 'POST') {
downLoad: function (url, data, method) {
if(!method) {
method = 'POST';
}
if(!data) {
data = {};
}
var form = $('<form method="'+ method +'" action="' + Common.ctxPath + url + '">');
$.each(data, function (k, v) {
form.append($('<input type="hidden" name="' + k +

@ -227,7 +227,13 @@ var Lib = {
*/
$(form).find(".input-year,.input-month,.input-time,.input-datetime").each(function () {
laydate = layui.laydate;
var classAttr = [...$(this)[0].classList].filter(item => /^input-/g.test(item))[0];
var classAttr;
$(this)[0].classList.forEach(function (value, key) {
if(/^input-/g.test(value) && classAttr == null) {
classAttr = value;
}
});
var options = $(this).data('options');
try {
options = JSON.parse(options || '{}')

Loading…
Cancel
Save