修复:五金应用修改失败时,弹窗提示

erp_cdOption
ChenX 4 years ago
parent 14c5ead4f8
commit 5ff0a32349

@ -1,4 +1,4 @@
import { Button, Classes, Icon } from '@blueprintjs/core';
import { Button, Classes, Icon, Intent } from '@blueprintjs/core';
import * as React from 'react';
import { MathUtils } from 'three';
import { app } from '../../../ApplicationServices/Application';
@ -10,6 +10,7 @@ import { PromptStatus } from '../../../Editor/PromptResult';
import { BaseHardwareStore } from '../../Store/RightPanelStore/HardwareStore';
import { BoardModalType } from '../Board/BoardModal';
import { UserConfig } from '../Board/UserConfig';
import { AppToaster } from '../Toaster';
interface IMetalsModal
{
@ -76,14 +77,18 @@ export function GetHardwareModal(Com, props: IMetalsModal)
</div>
);
}
private ok = () =>
private ok = async () =>
{
let en = props.store.Entity;
let ro = props.store.rotation;
CommandWrap(() =>
await CommandWrap(() =>
{
if (!en) return;//避免空实体导致的报错
if (!en)
{
AppToaster.show({ message: "未知错误导致修改五金数据失败,请重新修改!(五金实体丢失)", intent: Intent.DANGER, timeout: 30000 });
return;
}
Object.assign(en.HardwareOption, props.store.option);
en.DataList = props.store.KvList;
@ -91,7 +96,6 @@ export function GetHardwareModal(Com, props: IMetalsModal)
{
en.ContourRotation = MathUtils.degToRad(parseFloat(ro)) ?? en.ContourRotation;
}
app.Viewer.UpdateRender();
}, "修改五金");
this.cancel();
};

Loading…
Cancel
Save