From 8bef5e2401cbdd1190b5f027d7795b0945c9cd1b Mon Sep 17 00:00:00 2001 From: iven Date: Fri, 17 Apr 2026 10:50:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(crm):=20=E5=90=AF=E7=94=A8=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=AE=9E=E4=BD=93=20data=5Fscope=20+=20owner=5Fid=20+?= =?UTF-8?q?=20data=5Fscope=5Flevels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - customer 实体新增 data_scope = true 启用行级数据权限 - customer 新增 owner_id 字段 (scope_role = "owner") 标记数据所有者 - customer.list 和 customer.manage 权限新增 data_scope_levels 声明 支持 self / department / department_tree / all 四种范围等级 --- crates/erp-plugin-crm/plugin.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/erp-plugin-crm/plugin.toml b/crates/erp-plugin-crm/plugin.toml index feff35a..e5813d5 100644 --- a/crates/erp-plugin-crm/plugin.toml +++ b/crates/erp-plugin-crm/plugin.toml @@ -12,11 +12,13 @@ min_platform_version = "0.1.0" code = "customer.list" name = "查看客户" description = "查看客户列表和详情" +data_scope_levels = ["self", "department", "department_tree", "all"] [[permissions]] code = "customer.manage" name = "管理客户" description = "创建、编辑、删除客户" +data_scope_levels = ["self", "department", "department_tree", "all"] [[permissions]] code = "contact.list" @@ -51,6 +53,7 @@ name = "管理客户关系" [[schema.entities]] name = "customer" display_name = "客户" +data_scope = true [[schema.entities.fields]] name = "code" @@ -163,6 +166,12 @@ display_name = "客户" display_name = "备注" ui_widget = "textarea" + [[schema.entities.fields]] + name = "owner_id" + field_type = "uuid" + display_name = "负责人" + scope_role = "owner" + [[schema.entities]] name = "contact" display_name = "联系人"