|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
import { Intent } from "@blueprintjs/core";
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { Matrix4, Vector3 } from "three";
|
|
|
|
|
import { app } from "../../ApplicationServices/Application";
|
|
|
|
|
import { EBoardKeyList } from "../../Common/BoardKeyList";
|
|
|
|
@ -54,23 +53,9 @@ export class DrawTemplateByImport implements Command
|
|
|
|
|
private keyRes: PromptResult;
|
|
|
|
|
async exec()
|
|
|
|
|
{
|
|
|
|
|
const toasterKey = AppToaster.show({
|
|
|
|
|
message:
|
|
|
|
|
<>
|
|
|
|
|
可以下载
|
|
|
|
|
<a
|
|
|
|
|
style={{ textDecoration: 'underline', color: '#2d72d2', fontWeight: "bold" }}
|
|
|
|
|
href={"https://cfcad.cn/help/UpdateLog/PHOTO/ImportTemplate1.csv"}
|
|
|
|
|
download={"数据绘制模板.csv"}
|
|
|
|
|
>导入模板.csv</a>
|
|
|
|
|
</>
|
|
|
|
|
,
|
|
|
|
|
timeout: 10000,
|
|
|
|
|
});
|
|
|
|
|
FS.ChooseFile({
|
|
|
|
|
filter: ".csv", multiple: false, callback: async (files: FileList) =>
|
|
|
|
|
{
|
|
|
|
|
AppToaster.dismiss(toasterKey);
|
|
|
|
|
let f = files.item(0);
|
|
|
|
|
let reader = new FileReader();
|
|
|
|
|
this.keyRes = await app.Editor.GetKeyWords({
|
|
|
|
@ -188,12 +173,20 @@ export class DrawTemplateByImport implements Command
|
|
|
|
|
remarks.push(values[i]);
|
|
|
|
|
break;
|
|
|
|
|
case "扩展备注":
|
|
|
|
|
const pairs = values[i].split(';');
|
|
|
|
|
for (const pair of pairs)
|
|
|
|
|
let exRemarkStr = values[i];
|
|
|
|
|
if (exRemarkStr.includes(';'))
|
|
|
|
|
exRemarkStr = exRemarkStr.replaceAll(';', ';');
|
|
|
|
|
|
|
|
|
|
const pairs = exRemarkStr.split(";");
|
|
|
|
|
for (let pair of pairs)
|
|
|
|
|
{
|
|
|
|
|
const [rK, rV] = pair.split(':');
|
|
|
|
|
if (pair.includes(':'))
|
|
|
|
|
pair = pair.replaceAll(':', ':');
|
|
|
|
|
|
|
|
|
|
const [rK, rV] = pair.split(":");
|
|
|
|
|
rK && rV && extRemarks.push([rK, rV]);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "板材":
|
|
|
|
|
case "板材名":
|
|
|
|
|
bancai = values[i];
|
|
|
|
@ -211,7 +204,9 @@ export class DrawTemplateByImport implements Command
|
|
|
|
|
lines = linesMap.get(values[i]);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
const key = keys[i];
|
|
|
|
|
let key = keys[i];
|
|
|
|
|
if (key.includes('备注:'))
|
|
|
|
|
key = key.replace("备注:", "备注:");
|
|
|
|
|
if (key.includes("备注:") && values[i])
|
|
|
|
|
extRemarks.push([key.replace("备注:", ""), values[i]]);
|
|
|
|
|
break;
|
|
|
|
@ -367,6 +362,7 @@ export class DrawTemplateByImport implements Command
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
app.Editor.Prompt('可输入命令下载模板表格: DTT');
|
|
|
|
|
}
|
|
|
|
|
private handleInfo(en: Entity, info: IList)
|
|
|
|
|
{
|