This commit is contained in:
2025-10-23 12:14:03 +08:00
parent 900a72e4c9
commit f9fdb1a6c2
49 changed files with 851 additions and 8129 deletions

View File

@@ -8,7 +8,7 @@ import type {
import type { ResourceType } from './ResourceService'
// 导入所有服务
import { WindowFormService } from './WindowFormService.ts'
import { WindowFormService } from './windowForm/WindowFormService.ts'
import { ResourceService } from './ResourceService'
import { ApplicationSandboxEngine } from './ApplicationSandboxEngine'
import { ApplicationLifecycleManager } from './ApplicationLifecycleManager'
@@ -310,7 +310,7 @@ export class SystemServiceIntegration {
*/
private setupServiceCommunication(): void {
// 监听窗体状态变化(来自 windowFormService 的 onStateChange 事件)
this.eventBus.addEventListener(
this.eventBus.subscribe(
'onWindowStateChanged',
(windowId: string, newState: string, oldState: string) => {
console.log(
@@ -320,7 +320,7 @@ export class SystemServiceIntegration {
)
// 监听窗体关闭事件,自动停止对应的应用
this.eventBus.addEventListener('onWindowClose', async (windowId: string) => {
this.eventBus.subscribe('onWindowClose', async (windowId: string) => {
console.log(`[SystemIntegration] 接收到窗体关闭事件: ${windowId}`)
// 查找对应的应用
const runningApps = this.lifecycleManager.getRunningApps()
@@ -338,17 +338,17 @@ export class SystemServiceIntegration {
})
// 监听窗体数据更新事件
this.eventBus.addEventListener('onWindowFormDataUpdate', (data: IWindowFormDataUpdateParams) => {
this.eventBus.subscribe('onWindowFormDataUpdate', (data: IWindowFormDataUpdateParams) => {
console.log(`[SystemIntegration] 接收到窗体数据更新事件:`, data)
})
// 监听窗体调整尺寸开始事件
this.eventBus.addEventListener('onWindowFormResizeStart', (windowId: string) => {
this.eventBus.subscribe('onWindowFormResizeStart', (windowId: string) => {
console.log(`[SystemIntegration] 接收到窗体调整尺寸开始事件: ${windowId}`)
})
// 监听窗体调整尺寸过程中事件
this.eventBus.addEventListener(
this.eventBus.subscribe(
'onWindowFormResizing',
(windowId: string, width: number, height: number) => {
console.log(`[SystemIntegration] 接收到窗体调整尺寸过程中事件: ${windowId}`, {
@@ -359,7 +359,7 @@ export class SystemServiceIntegration {
)
// 监听窗体调整尺寸结束事件
this.eventBus.addEventListener('onWindowFormResizeEnd', (windowId: string) => {
this.eventBus.subscribe('onWindowFormResizeEnd', (windowId: string) => {
console.log(`[SystemIntegration] 接收到窗体调整尺寸结束事件: ${windowId}`)
})
}
@@ -422,7 +422,7 @@ export class SystemServiceIntegration {
try {
switch (type) {
case 'sdk:storage:get':
case 'sdk:storage:getWindowForm':
result = await this.resourceService.getStorage(appId, key)
success = true
break
@@ -432,7 +432,7 @@ export class SystemServiceIntegration {
success = result === true
break
case 'sdk:storage:remove':
case 'sdk:storage:removeWindowForm':
result = await this.resourceService.removeStorage(appId, key)
success = result === true
break
@@ -566,7 +566,7 @@ export class SystemServiceIntegration {
case 'get':
return this.resourceService.getStorage(appId, data.key)
case 'remove':
case 'removeWindowForm':
return this.resourceService.removeStorage(appId, data.key)
case 'clear':