|
|
|
@ -27,6 +27,7 @@ import { TemplateRecord } from '../../../DatabaseServices/Template/TemplateRecor
|
|
|
|
|
import { SelectTempate } from '../../../DatabaseServices/Template/TemplateTest';
|
|
|
|
|
import { TemplateSplitType } from '../../../DatabaseServices/Template/TemplateType';
|
|
|
|
|
import { commandMachine, CommandWrap } from '../../../Editor/CommandMachine';
|
|
|
|
|
import { CommandState } from '../../../Editor/CommandState';
|
|
|
|
|
import { JigUtils } from '../../../Editor/JigUtils';
|
|
|
|
|
import { PromptStatus } from '../../../Editor/PromptResult';
|
|
|
|
|
import { Filter } from '../../../Editor/SelectFilter';
|
|
|
|
@ -1024,14 +1025,45 @@ export class TemplateManage extends React.Component<ITemplateManage, {}> {
|
|
|
|
|
}
|
|
|
|
|
</CommonPanel>;
|
|
|
|
|
};
|
|
|
|
|
handleHotKey = (e: KeyboardEvent) =>
|
|
|
|
|
{
|
|
|
|
|
/** keypress 不能作用与组合键 */
|
|
|
|
|
|
|
|
|
|
/** 没选中模板时不触发 */
|
|
|
|
|
if (!this.currentTemplateInfo.id) return;
|
|
|
|
|
/** 正在执行命令时不触发 */
|
|
|
|
|
if (CommandState.CommandIng) return;
|
|
|
|
|
|
|
|
|
|
if (e.altKey)
|
|
|
|
|
{
|
|
|
|
|
if (e.code === 'KeyI')
|
|
|
|
|
{
|
|
|
|
|
this.handleInsert(true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (e.code === 'KeyS')
|
|
|
|
|
{
|
|
|
|
|
this.handleInsert(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (e.code === 'KeyT')
|
|
|
|
|
{
|
|
|
|
|
this.handleReplace();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
componentDidMount()
|
|
|
|
|
{
|
|
|
|
|
ReadAutoCutConfig(TemplateManage.name, this.autoCutOption, this.option);
|
|
|
|
|
document.addEventListener('keyup', this.handleHotKey);
|
|
|
|
|
}
|
|
|
|
|
componentWillUnmount()
|
|
|
|
|
{
|
|
|
|
|
templateTagCommand.UploadTagList();
|
|
|
|
|
UploadAutoCutConfig(TemplateManage.name, this.autoCutOption, this.option);
|
|
|
|
|
document.removeEventListener('keyup', this.handleHotKey);
|
|
|
|
|
}
|
|
|
|
|
public render()
|
|
|
|
|
{
|
|
|
|
@ -1066,7 +1098,7 @@ export class TemplateManage extends React.Component<ITemplateManage, {}> {
|
|
|
|
|
{
|
|
|
|
|
!this.props.R2bReplace && <Button
|
|
|
|
|
className={Classes.INTENT_SUCCESS}
|
|
|
|
|
text="动态插入"
|
|
|
|
|
text={<span>动态插入<i>(I)</i></span>}
|
|
|
|
|
disabled={!this.currentTemplateInfo.id}
|
|
|
|
|
onClick={() => this.handleInsert(true)}
|
|
|
|
|
/>
|
|
|
|
@ -1074,7 +1106,7 @@ export class TemplateManage extends React.Component<ITemplateManage, {}> {
|
|
|
|
|
{
|
|
|
|
|
!this.props.R2bReplace && <Button
|
|
|
|
|
className={Classes.INTENT_DANGER}
|
|
|
|
|
text="空间拾取"
|
|
|
|
|
text={<span>空间拾取<i>(S)</i></span>}
|
|
|
|
|
onClick={() => this.handleInsert(false)}
|
|
|
|
|
disabled={!this.currentTemplateInfo.id}
|
|
|
|
|
/>
|
|
|
|
@ -1091,7 +1123,7 @@ export class TemplateManage extends React.Component<ITemplateManage, {}> {
|
|
|
|
|
{
|
|
|
|
|
!this.props.R2bReplace && <Button
|
|
|
|
|
className={Classes.INTENT_PRIMARY}
|
|
|
|
|
text="模块替换"
|
|
|
|
|
text={<span>模块替换<i>(T)</i></span>}
|
|
|
|
|
onClick={this.handleReplace}
|
|
|
|
|
disabled={!this.currentTemplateInfo.id || this.currentTemplateInfo.isKuGan}
|
|
|
|
|
/>
|
|
|
|
|