|
|
|
@ -5,7 +5,7 @@ import pako from "pako";
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { app } from "../../../ApplicationServices/Application";
|
|
|
|
|
import { TemplateUrls } from "../../../Common/HostUrl";
|
|
|
|
|
import { PostJson } from "../../../Common/Request";
|
|
|
|
|
import { PostJson, RequestStatus } from "../../../Common/Request";
|
|
|
|
|
import { StoreageKeys } from "../../../Common/StoreageKeys";
|
|
|
|
|
import { CADFiler } from "../../../DatabaseServices/CADFiler";
|
|
|
|
|
import { FileServer } from "../../../DatabaseServices/FileServer";
|
|
|
|
@ -107,14 +107,31 @@ export class ImportFile extends React.Component<{ commonPanel: CommonPanel, type
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
await PostJson(TemplateUrls.create, {
|
|
|
|
|
name: f.name.replace(".json", ""),
|
|
|
|
|
let name = f.name.replace(".json", "");
|
|
|
|
|
let zip_type = "gzip";
|
|
|
|
|
|
|
|
|
|
let res = await PostJson(TemplateUrls.create, {
|
|
|
|
|
name,
|
|
|
|
|
dir_id,
|
|
|
|
|
logo,
|
|
|
|
|
props,
|
|
|
|
|
file,
|
|
|
|
|
zip_type: "gzip",
|
|
|
|
|
zip_type
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//返回状态码802 没有封面Logo 使用默认Logo
|
|
|
|
|
if (res.err_code === RequestStatus.CreateTempNoLogo)
|
|
|
|
|
{
|
|
|
|
|
logo = "CAD/images/default.svg";
|
|
|
|
|
await PostJson(TemplateUrls.create, {
|
|
|
|
|
name,
|
|
|
|
|
dir_id,
|
|
|
|
|
logo,
|
|
|
|
|
props,
|
|
|
|
|
file,
|
|
|
|
|
zip_type
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|