|
|
|
@ -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 +
|
|
|
|
|