处理问题
This commit is contained in:
parent
36003db150
commit
9ec02fbbbe
@ -240,6 +240,23 @@ layui.define(function (exports) {
|
|||||||
return exportColumns;
|
return exportColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getImgBase64(url, callback) {
|
||||||
|
var Img = new Image(),
|
||||||
|
dataURL = '';
|
||||||
|
Img.src = url + '?v=' + Math.random();
|
||||||
|
Img.setAttribute('crossOrigin', 'Anonymous');
|
||||||
|
Img.onload = function() {
|
||||||
|
var canvas = document.createElement('canvas'),
|
||||||
|
width = Img.width,
|
||||||
|
height = Img.height;
|
||||||
|
canvas.width = width;
|
||||||
|
canvas.height = height;
|
||||||
|
canvas.getContext('2d').drawImage(Img, 0, 0, width, height);
|
||||||
|
dataURL = canvas.toDataURL('image/jpeg');
|
||||||
|
return callback ? callback(dataURL) : null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
//对外暴露的接口
|
//对外暴露的接口
|
||||||
exports('common', {
|
exports('common', {
|
||||||
refreshTree: refreshTree,
|
refreshTree: refreshTree,
|
||||||
@ -248,6 +265,7 @@ layui.define(function (exports) {
|
|||||||
formatDate: formatDate,
|
formatDate: formatDate,
|
||||||
getBrowserType: getBrowserType,
|
getBrowserType: getBrowserType,
|
||||||
getIEBrowserVersion: getIEBrowserVersion,
|
getIEBrowserVersion: getIEBrowserVersion,
|
||||||
listTableExportColumns: listTableExportColumns
|
listTableExportColumns: listTableExportColumns,
|
||||||
|
getImgBase64: getImgBase64
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -168,10 +168,9 @@ layui.define(function(exports) {
|
|||||||
var kvs = item.split('=');
|
var kvs = item.split('=');
|
||||||
if (kvs.length == 1) {
|
if (kvs.length == 1) {
|
||||||
paramsObj[kvs[0]] = null;
|
paramsObj[kvs[0]] = null;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (kvs.length == 2) {
|
paramsObj[kvs[0]] = decodeURI(item.replace(kvs[0] +'=', ''));
|
||||||
paramsObj[kvs[0]] = decodeURI(kvs[1]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return paramsObj;
|
return paramsObj;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user