- 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)
30 lines
716 B
Rust
30 lines
716 B
Rust
//! 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);
|