feat(crm): 创建 CRM 插件 crate + 前端 tabs/tree 页面类型 + 动态菜单

- CRM WASM 插件:Cargo.toml + src/lib.rs + plugin.toml(5 实体 + 9 权限 + 6 页面)
- 注册 erp-plugin-crm 到 workspace members
- PluginTabsPage: 通用标签页容器,递归渲染子页面
- PluginTreePage: 通用树形页面,前端构建树结构
- App.tsx: 新增 /tabs/:pageLabel 和 /tree/:entityName 路由
- plugin store: 从 manifest pages 生成菜单(支持 tabs 聚合)
- MainLayout: 动态图标映射(team/user/message/tags/apartment)
This commit is contained in:
iven
2026-04-16 12:41:17 +08:00
parent e68fe8c1b1
commit 92789e6713
9 changed files with 760 additions and 26 deletions

View File

@@ -0,0 +1,29 @@
//! CRM 客户管理插件 — WASM Guest 实现
wit_bindgen::generate!({
path: "../erp-plugin-prototype/wit/plugin.wit",
world: "plugin-world",
});
use crate::exports::erp::plugin::plugin_api::Guest;
struct CrmPlugin;
impl Guest for CrmPlugin {
fn init() -> Result<(), String> {
// CRM 插件初始化:当前无需创建默认数据
Ok(())
}
fn on_tenant_created(_tenant_id: String) -> Result<(), String> {
// 为新租户创建 CRM 默认数据:当前无需创建默认客户
Ok(())
}
fn handle_event(_event_type: String, _payload: Vec<u8>) -> Result<(), String> {
// CRM V1: 无事件处理
Ok(())
}
}
export!(CrmPlugin);