This commit is contained in:
2025-09-17 12:22:28 +08:00
parent e3cbba0607
commit 68bdabf928
7 changed files with 105 additions and 67 deletions

View File

@@ -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)
}
}
}