111
This commit is contained in:
@@ -56,7 +56,7 @@ Vue Desktop 使用分层的事件管理系统:
|
||||
```mermaid
|
||||
graph TD
|
||||
A[SystemServiceIntegration] --> B[EventCommunicationService]
|
||||
A --> C[WindowService]
|
||||
A --> C[WindowFormService]
|
||||
A --> D[ResourceService]
|
||||
|
||||
B --> E[IEventBuilder]
|
||||
@@ -114,7 +114,7 @@ constructor(config: SystemServiceConfig = {}) {
|
||||
|
||||
// 注入到依赖的服务中
|
||||
// EventCommunicationService 需要 IEventBuilder 接口
|
||||
// WindowService 也需要 IEventBuilder 接口
|
||||
// WindowFormService 也需要 IEventBuilder 接口
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ graph TD
|
||||
A --> D[事件系统]
|
||||
A --> E[应用注册中心]
|
||||
|
||||
B --> B1[WindowService]
|
||||
B --> B1[WindowFormService]
|
||||
B --> B2[ResourceService]
|
||||
B --> B3[EventCommunicationService]
|
||||
B --> B4[ApplicationSandboxEngine]
|
||||
@@ -39,7 +39,7 @@ graph TD
|
||||
|
||||
| 模块 | 职责 |
|
||||
| --------------------------- | ---------------------------------- |
|
||||
| WindowService | 管理应用窗体的创建、销毁、状态控制 |
|
||||
| WindowFormService | 管理应用窗体的创建、销毁、状态控制 |
|
||||
| ResourceService | 管理应用资源访问权限和存储 |
|
||||
| EventCommunicationService | 处理应用间通信 |
|
||||
| ApplicationSandboxEngine | 为外部应用创建安全沙箱环境 |
|
||||
|
||||
@@ -26,7 +26,7 @@ graph TB
|
||||
end
|
||||
|
||||
subgraph "系统服务层"
|
||||
WindowService[窗体服务]
|
||||
WindowFormService[窗体服务]
|
||||
ResourceService[资源服务]
|
||||
EventService[事件服务]
|
||||
SecurityService[安全服务]
|
||||
@@ -47,7 +47,7 @@ graph TB
|
||||
end
|
||||
|
||||
Desktop --> WindowManager
|
||||
WindowManager --> WindowService
|
||||
WindowManager --> WindowFormService
|
||||
AppContainer --> SandboxEngine
|
||||
SDKBridge --> SystemService[系统服务层]
|
||||
App1 --> AppContainer
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<cite>
|
||||
**本文档引用文件**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts)
|
||||
- [WindowFormService.ts](file://src/services/WindowFormService.ts)
|
||||
</cite>
|
||||
|
||||
## 目录
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
`windowFormCreated` 事件在新窗口实例成功挂载并完成首次渲染后触发,标志着窗口已完全初始化并可交互。该事件不携带任何参数,作为全局窗口创建完成的信号。
|
||||
|
||||
根据 `WindowFormEventManager.ts` 中的定义,此事件是 `IWindowFormEvent` 接口的一部分,由 `wfem` 事件管理器负责分发。虽然当前实现中未直接显示触发逻辑,但结合 `WindowService.ts` 的窗口创建流程可知,该事件应在 `createWindow` 方法执行完毕、DOM 元素已添加至页面且应用内容加载完成后被通知。
|
||||
根据 `WindowFormEventManager.ts` 中的定义,此事件是 `IWindowFormEvent` 接口的一部分,由 `wfem` 事件管理器负责分发。虽然当前实现中未直接显示触发逻辑,但结合 `WindowFormService.ts` 的窗口创建流程可知,该事件应在 `createWindow` 方法执行完毕、DOM 元素已添加至页面且应用内容加载完成后被通知。
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L41-L41)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
|
||||
## 应用场景分析
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L41-L41)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
|
||||
## 事件监听代码范例
|
||||
|
||||
@@ -58,7 +58,7 @@ wfem.addEventListener('windowFormCreated', () => {
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L60-L60)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
|
||||
## 生命周期时序关系
|
||||
|
||||
@@ -73,4 +73,4 @@ wfem.addEventListener('windowFormCreated', () => {
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L41-L41)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
@@ -3,7 +3,7 @@
|
||||
<cite>
|
||||
**本文档引用文件**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts)
|
||||
- [WindowFormService.ts](file://src/services/WindowFormService.ts)
|
||||
- [WindowFormTypes.ts](file://src/ui/types/WindowFormTypes.ts)
|
||||
</cite>
|
||||
|
||||
@@ -73,14 +73,14 @@ I --> J[接收端更新UI]
|
||||
```
|
||||
|
||||
**Diagram sources**
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
|
||||
**Section sources**
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
|
||||
## 接收端批量更新UI的TypeScript示例
|
||||
接收 `windowFormDataUpdate` 事件后,应使用接收到的完整数据对象一次性批量更新UI,避免逐个属性设置带来的性能开销和视觉闪烁。以下为推荐的处理方式:
|
||||
@@ -146,4 +146,4 @@ wfem.addEventListener('windowFormDataUpdate', debouncedHandler);
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L37-L37)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L67-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L67-L118)
|
||||
Reference in New Issue
Block a user