|
|
@ -13,6 +13,7 @@ import { UserConfig } from '../Board/UserConfig';
|
|
|
|
import TempalteActionList from './TemplateActionList';
|
|
|
|
import TempalteActionList from './TemplateActionList';
|
|
|
|
import TemplateParamList from './TemplateParamList';
|
|
|
|
import TemplateParamList from './TemplateParamList';
|
|
|
|
import { TemplateSaveDir } from './TemplateSaveDir';
|
|
|
|
import { TemplateSaveDir } from './TemplateSaveDir';
|
|
|
|
|
|
|
|
import { AppToaster } from '../Toaster';
|
|
|
|
|
|
|
|
|
|
|
|
export interface ITemplateEditorProps
|
|
|
|
export interface ITemplateEditorProps
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -22,6 +23,7 @@ export interface ITemplateEditorProps
|
|
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
@observer
|
|
|
|
export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
|
|
|
|
export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
|
|
|
|
|
|
|
|
private normalExit = false; //是否正常退出
|
|
|
|
private _container: HTMLDivElement;
|
|
|
|
private _container: HTMLDivElement;
|
|
|
|
componentDidMount()
|
|
|
|
componentDidMount()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -36,6 +38,18 @@ export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.props.store.currentParamIndex = undefined;
|
|
|
|
this.props.store.currentParamIndex = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async componentWillUnmount()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//TODO:临时解决无法退出编辑状态
|
|
|
|
|
|
|
|
if (!this.normalExit && this.props.tid)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
|
|
|
message: "暂无法支持编辑共同显示多个模态框,退出编辑状态",
|
|
|
|
|
|
|
|
timeout: 1500
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
await TempEditor.End();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
public render()
|
|
|
|
public render()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const template = this.props.store.Template;
|
|
|
|
const template = this.props.store.Template;
|
|
|
@ -114,6 +128,7 @@ export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private handleClose = () =>
|
|
|
|
private handleClose = () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
this.normalExit = true;
|
|
|
|
if (this.props.tid)
|
|
|
|
if (this.props.tid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TempEditor.End();
|
|
|
|
TempEditor.End();
|
|
|
|