!1754 修复:灯光面板界面响应外部命令修改的数

erp_check_sealing
黄诗津 3 years ago committed by ChenX
parent 17800d0c56
commit d45b952f5d

@ -1,16 +1,16 @@
import { Button, Classes, HTMLSelect } from '@blueprintjs/core';
import { observer } from 'mobx-react';
import * as React from 'react';
import { begin } from 'xaop';
import { app } from '../../../ApplicationServices/Application';
import { EBoardKeyList } from '../../../Common/BoardKeyList';
import { KeyBoard } from '../../../Common/KeyEnum';
import { Board } from '../../../DatabaseServices/Entity/Board';
import { CommonModal } from '../Modal/ModalContainer';
import { Notes } from './BoardCommon';
import { BoardConfigModal } from './BoardConfigModal';
import { BoardProcessModal } from './BoardProcessModal';
import { AddCommonBoardProps, ICommonOptionProps } from './CommonBoardOption';
import { EBoardKeyList } from '../../../Common/BoardKeyList';
import { begin } from 'xaop';
import { KeyBoard } from '../../../Common/KeyEnum';
@observer
class BoardOptionCom extends React.Component<ICommonOptionProps, {}>
@ -25,7 +25,9 @@ class BoardOptionCom extends React.Component<ICommonOptionProps, {}>
{
app.Editor.ModalManage.Destory();
};
private event: Function;
//移除注入
private removeFuncs: Function[] = [];
UNSAFE_componentWillMount()
{
for (let e of app.Database.ModelSpace.Entitys)
@ -37,31 +39,43 @@ class BoardOptionCom extends React.Component<ICommonOptionProps, {}>
}
componentDidMount()
{
this.event = begin(app.Editor.ModalManage, app.Editor.ModalManage.OnKeyDown, (e: KeyboardEvent) =>
{
if ("双击板件" !== app.Editor.ModalManage.CurrentModalKey) return;
let el = e.target as HTMLInputElement;
if (e.keyCode === KeyBoard.Enter ||
(e.keyCode === KeyBoard.Space &&
(el.nodeName !== "INPUT" || el.type !== "text" || !el.getAttribute('data-isNum'))))
this.removeFuncs.push(
begin(app.Editor.ModalManage, app.Editor.ModalManage.OnKeyDown, (e: KeyboardEvent) =>
{
this.props.handleComfirmOption();
e.preventDefault();
}
else if (e.keyCode === KeyBoard.Escape)
if ("双击板件" !== app.Editor.ModalManage.CurrentModalKey) return;
let el = e.target as HTMLInputElement;
if (e.keyCode === KeyBoard.Enter ||
(e.keyCode === KeyBoard.Space &&
(el.nodeName !== "INPUT" || el.type !== "text" || !el.getAttribute('data-isNum'))))
{
this.props.handleComfirmOption();
e.preventDefault();
}
else if (e.keyCode === KeyBoard.Escape)
{
this.handClose();
app.Editor.ModalManage.stopKeyDownEvent = true;
}
e.stopPropagation();
return true;
}),
app.CommandReactor.OnCommandEnd((cmdName, changeObjects, createObjects) =>
{
this.handClose();
app.Editor.ModalManage.stopKeyDownEvent = true;
}
e.stopPropagation();
return true;
});
for (let o of changeObjects)
{
if (o.Id.Index === this.props._CurrentBoard.get()?.Id?.Index)
{
this.props.setBrConfig();
break;
}
}
}));
}
componentWillUnmount()
{
if (this.event)
this.event();
this.event = null;
for (let f of this.removeFuncs)
f();
this.removeFuncs.length = 0;
}
render()
{

@ -7,6 +7,7 @@ import { ZINDEX } from "../../../Common/ZIndex";
import { CommandWrap } from "../../../Editor/CommandMachine";
import { equaln } from '../../../Geometry/GeUtils';
import { AnyObject } from '../../Store/BoardInterface';
import { LightStore } from "../../Store/RightPanelStore/LightStore";
import { GetCompoentObjectIdString } from '../ComponentObjectId';
import { CommandState } from './../../../Editor/CommandState';
import { ModalPosition } from "./ModalInterface";
@ -35,6 +36,7 @@ export class CADModal
private _canForceMax = false;
/**锁定后不能关闭和最大化 */
IsLock = false;
IsLightModal = false;
constructor(_rootContainer: HTMLElement, private _rootModal?: CADModal)
{
this.container = document.createElement("div");
@ -74,6 +76,12 @@ export class CADModal
this.rndDiv.style.minHeight = "220px";
}
}
//灯光面板最小化响应外部修改的数
if (this.IsLightModal)
{
let lightStore = LightStore.GetInstance();
lightStore.InitLightData(lightStore.currentSelectEnt);
}
}
}
};

@ -192,8 +192,8 @@ export class LightStore implements IConfigStore
this.title = "矩形光";
this.pars.push(["Intensity", "强度"], ["IndirectLightingIntensity", "反弹"], ["SpecularScale", "高光"], ["Width", "宽度"], ["Height", "长度"], ["BarnDoorAngle", "挡板角度"], ["BarnDoorLength", "挡板长度"], ["AttenuationRadius", "衰减半径"]);
Object.assign(newState, {
Height: light.Height.toString(),
Width: light.Width.toString(),
Height: FixedNotZero(light.Height, 2),
Width: FixedNotZero(light.Width, 2),
BarnDoorAngle: light.BarnDoorAngle.toString(),
BarnDoorLength: light.BarnDoorLength.toString(),
AttenuationRadius: light.AttenuationRadius.toString(),

@ -48,9 +48,11 @@ export class SpotLightModel extends React.Component<{ store: LightStore; configS
e.stopPropagation();
})
);
setTimeout(() => { app.Editor.ModalManage.CurrentModal.IsLightModal = true; }, 0);
}
componentWillUnmount()
{
app.Editor.ModalManage.CurrentModal.IsLightModal = false;
for (let f of this.removeFuncs)
f();
this.removeFuncs.length = 0;

Loading…
Cancel
Save