路径规划打点完成 点击任务获取 路径轨迹

This commit is contained in:
mmc
2026-06-16 13:28:21 +08:00
parent a72ab15c56
commit a177498cdf
7 changed files with 80 additions and 32 deletions

View File

@@ -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 });
}