mirror of https://gitee.com/cf-fz/WebCAD.git
!1302 开发:999命令同时将文件发送给内部人员
parent
db8a283239
commit
51433e1522
@ -1,19 +1,46 @@
|
|||||||
import { app } from "../ApplicationServices/Application";
|
import { Intent } from "@blueprintjs/core";
|
||||||
import { ReportError } from "../Common/ErrorMonitoring";
|
import { ReportError } from "../Common/ErrorMonitoring";
|
||||||
import { Log } from "../Common/Log";
|
import { ErrorReportUrl } from "../Common/HostUrl";
|
||||||
|
import { PostJson, RequestStatus } from "../Common/Request";
|
||||||
import { FileServer } from "../DatabaseServices/FileServer";
|
import { FileServer } from "../DatabaseServices/FileServer";
|
||||||
import { Command } from "../Editor/CommandMachine";
|
import { Command } from "../Editor/CommandMachine";
|
||||||
|
import { AppToaster } from "../UI/Components/Toaster";
|
||||||
|
|
||||||
export class Command_999 implements Command
|
export class Command_999 implements Command
|
||||||
{
|
{
|
||||||
async exec()
|
async exec()
|
||||||
{
|
{
|
||||||
let fileServer = FileServer.GetInstance() as FileServer;
|
let fileServer = FileServer.GetInstance() as FileServer;
|
||||||
ReportError("报告错误!" + fileServer.m_CurFileId);
|
if (!fileServer.m_CurFileId)
|
||||||
|
{
|
||||||
|
AppToaster.show({
|
||||||
|
message: "图纸尚未保存,无法报告!",
|
||||||
|
timeout: 5000,
|
||||||
|
intent: Intent.DANGER,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Log("成功发送图纸给开发人员!");
|
let msg = prompt("请输出错误原因:");
|
||||||
|
if (msg === null)
|
||||||
|
{
|
||||||
|
AppToaster.show({
|
||||||
|
message: "取消发送!",
|
||||||
|
timeout: 5000,
|
||||||
|
intent: Intent.WARNING,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!app.Saved)
|
ReportError("报告错误!\n错误id:" + fileServer.m_CurFileId + "\n错误原因:" + msg);
|
||||||
Log("图纸尚未保存!");
|
|
||||||
|
let res = await PostJson(ErrorReportUrl, { file_id: fileServer.m_CurFileId });
|
||||||
|
|
||||||
|
if (res.err_code === RequestStatus.Ok)
|
||||||
|
AppToaster.show({
|
||||||
|
message: "成功发送图纸!",
|
||||||
|
timeout: 5000,
|
||||||
|
intent: Intent.SUCCESS,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue