修复:删除加工组没有历史记录,且无法撤销

pull/1504/MERGE
ChenX 3 years ago
parent 103c262aa7
commit 44ee913c03

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`EdgeGeometry生成 1`] = `164`;
exports[`EdgeGeometry生成 1`] = `168`;
exports[`EdgeGeometry生成 2`] = `410`;

@ -6,6 +6,7 @@ import { userConfigStore } from "../UI/Store/UserConfigStore";
export class Command_ShowProcessingGroupModal2 implements Command
{
NoHistory = true;//呼出时,我们没有任何的操作记录
async exec()
{
let store = ProcessingGroupModalStore.GetInstance() as ProcessingGroupModalStore;

@ -12,3 +12,7 @@ export function Log(message?: any, ...optionalParams: any[]): void
export const LogEnable = {
Display: false
};
export const ReportErrorWrap = {
ReportError: undefined
};

@ -1,4 +1,4 @@
import { LogEnable } from '../Common/Log';
import { LogEnable, ReportErrorWrap } from '../Common/Log';
import { Intent, Toaster } from '../Common/Toaster';
import { CommandState } from '../Editor/CommandState';
import { Factory } from './CADFactory';
@ -75,6 +75,17 @@ export class HistoricManage extends CADObject
console.warn("未标记命令!");
}
if (!CommandState.CommandIng && ReportErrorWrap.ReportError)
{
ReportErrorWrap.ReportError(new Error().stack, "命令未执行中,但是却产生了错误了记录!");
Toaster({
message: "程序内部错误!命令未执行中,但是却产生了错误了记录! (请与我们联系,将错误报告给我们)",
timeout: 5000,
intent: Intent.DANGER,
key: "no_command_his"
});
}
if (this._SignalCommandHistory && CommandState.CommandIng)
return this._SignalCommandHistory.UndoData;
else

@ -62,9 +62,5 @@ export class ProcessingGroupRecord extends SymbolTableRecord
for (let id of this.Objects)
file.WriteObjectId(id);
}
//局部撤销
ApplyPartialUndo(undoData: CADObject)
{
}
//#endregion
}

@ -587,6 +587,8 @@ export class ProcessingGroupModal extends React.Component<{ store: ProcessingGro
};
//确认删除
private DelAlertConfirm = () =>
{
CommandWrap(() =>
{
//为了保持节点展开 删除完毕后将父节点选中
let needSelectedCategory: string[] = [];
@ -650,6 +652,8 @@ export class ProcessingGroupModal extends React.Component<{ store: ProcessingGro
for (let c of needSelectedCategory)
this.props.store.selectedRightNodeSet.add(c);
this.setState({ nodes: this.parseNodes(), canAlertOpen1: false });
}, "删除加工组");
};
//使选中的实体亮显
private ShowGroups = () =>

@ -1,8 +1,8 @@
import { Intent } from '@blueprintjs/core';
import hotkeys from 'hotkeys-js';
import { Cache, Layers, Object3D } from 'three';
import { ErrorMonitoring } from './Common/ErrorMonitoring';
import { LogEnable } from './Common/Log';
import { ErrorMonitoring, ReportError } from './Common/ErrorMonitoring';
import { LogEnable, ReportErrorWrap } from './Common/Log';
import { copyTextToClipboard } from './Common/Utils';
import { ExtrudeConfig } from './DatabaseServices/Entity/ExtrudeConfig';
import { AppToaster } from './UI/Components/Toaster';
@ -187,6 +187,8 @@ window.onload = function ()
LogEnable.Display = true;
ReportErrorWrap.ReportError = ReportError;
let searchParams = new URLSearchParams(location.search);
if (searchParams.has("disablerefcut"))

Loading…
Cancel
Save