From e8749e3efa5b81e0e91a49361f73b479f8860e23 Mon Sep 17 00:00:00 2001 From: Azure <983547216@qq.com> Date: Tue, 19 Aug 2025 16:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/XSystem.ts | 1 - src/core/desktop/DesktopProcess.ts | 9 ++-- src/core/desktop/ui/DesktopComponent.vue | 48 ++++++++++-------- src/core/desktop/ui/useDesktopInit.ts | 32 +++++++----- src/core/events/EventTypes.ts | 49 ++++++++++++++----- src/core/process/AppProcessInfo.ts | 4 +- src/core/process/ProcessManages.ts | 4 +- ...InfoParams.ts => IAppProcessInfoParams.ts} | 2 +- 8 files changed, 94 insertions(+), 55 deletions(-) rename src/core/process/types/{AppProcessInfoParams.ts => IAppProcessInfoParams.ts} (94%) diff --git a/src/core/XSystem.ts b/src/core/XSystem.ts index 10a92c1..a36ae27 100644 --- a/src/core/XSystem.ts +++ b/src/core/XSystem.ts @@ -31,7 +31,6 @@ export default class XSystem { public initialization(dom: HTMLDivElement) { this.run('basic-system', BasicSystemProcess).then(() => { this.run('desktop', DesktopProcess).then((proc) => { - console.log(proc) proc.mount(dom) }) }) diff --git a/src/core/desktop/DesktopProcess.ts b/src/core/desktop/DesktopProcess.ts index edae0ae..09d9d83 100644 --- a/src/core/desktop/DesktopProcess.ts +++ b/src/core/desktop/DesktopProcess.ts @@ -72,7 +72,8 @@ export class DesktopProcess extends AppProcess { } public mount(dom: HTMLDivElement) { - if (this._isMounted) return; + console.log('DesktopProcess: start mount') + if (this._isMounted) return this._width = window.innerWidth this._height = window.innerHeight window.addEventListener( @@ -80,18 +81,18 @@ export class DesktopProcess extends AppProcess { debounce(() => { this.width = window.innerWidth this.height = window.innerHeight - }, 300), + }, 300) ) dom.style.zIndex = '0'; dom.style.width = `${this._width}px` dom.style.height = `${this._height}px` - this._desktopRootDom = dom; + this._desktopRootDom = dom const app = createApp(DesktopComponent, { process: this }) app.use(naiveUi) app.mount(dom) - this._isMounted = true; + this._isMounted = true } } \ No newline at end of file diff --git a/src/core/desktop/ui/DesktopComponent.vue b/src/core/desktop/ui/DesktopComponent.vue index b00e84a..c427a23 100644 --- a/src/core/desktop/ui/DesktopComponent.vue +++ b/src/core/desktop/ui/DesktopComponent.vue @@ -1,8 +1,12 @@