路径规划打点完成 点击任务获取 路径轨迹
This commit is contained in:
@@ -215,3 +215,22 @@ export const exportTable = (columns, dataSource, fileName = "导出数据") => {
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* base64 dataUrl 转 File 对象
|
||||
* @param {string} dataUrl base64图片
|
||||
* @param {string} fileName 文件名
|
||||
* @returns {File}
|
||||
*/
|
||||
export function dataUrlToFile(dataUrl, fileName) {
|
||||
const arr = dataUrl.split(',');
|
||||
const mime = arr[0].match(/:(.*?);/)[1];
|
||||
const bstr = atob(arr[1]);
|
||||
let n = bstr.length;
|
||||
const u8arr = new Uint8Array(n);
|
||||
while (n--) {
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
return new File([u8arr], fileName, { type: mime });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user