修改
This commit is contained in:
@@ -47,7 +47,7 @@ export default class ProcessImpl implements IProcess {
|
||||
}
|
||||
|
||||
private initEvent() {
|
||||
this.event.addEventListener('onProcessWindowFormExit', (id: string) => {
|
||||
this.event.addEventListener('processWindowFormExit', (id: string) => {
|
||||
this.windowForms.delete(id)
|
||||
if(this.windowForms.size === 0) {
|
||||
processManager.removeProcess(this)
|
||||
@@ -58,7 +58,20 @@ export default class ProcessImpl implements IProcess {
|
||||
public openWindowForm(startName: string) {
|
||||
const info = this._processInfo.windowFormConfigs.find(item => item.name === startName);
|
||||
if (!info) throw new Error(`未找到窗体:${startName}`);
|
||||
const window = new WindowFormImpl(this, info);
|
||||
this._windowForms.set(window.id, window);
|
||||
const wf = new WindowFormImpl(this, info);
|
||||
this._windowForms.set(wf.id, wf);
|
||||
}
|
||||
|
||||
public closeWindowForm(id: string) {
|
||||
try {
|
||||
const wf = this._windowForms.get(id);
|
||||
if (!wf) throw new Error(`未找到窗体:${id}`);
|
||||
this.windowForms.delete(id)
|
||||
if(this.windowForms.size === 0) {
|
||||
processManager.removeProcess(this)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('关闭窗体失败', e)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user