From a791022ff1311e1fb76930c398d6ff91036d0456 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期三, 11 十二月 2024 17:57:52 +0800 Subject: [PATCH] 新增加标签功能 --- app/models/organization_model.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/app/models/organization_model.py b/app/models/organization_model.py index f0c2f55..950ba32 100644 --- a/app/models/organization_model.py +++ b/app/models/organization_model.py @@ -92,6 +92,13 @@ 'children': [org.to_tree_select_json() for org in self.children] } + def to_parent_select_json(self): + return { + 'id': self.id, + 'label': self.name, + 'parent': [org.to_parent_select_json() for org in self.parent] + } + def get_pid(self): if self.parent: return self.parent.id -- Gitblit v1.8.0