|
|
|
@ -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()
|
|
|
|
|
{
|
|
|
|
|