From 6f88298632262d08cc9ab990baa24b16832f2d8c Mon Sep 17 00:00:00 2001 From: vapao Date: Mon, 16 Mar 2020 12:18:04 +0800 Subject: [PATCH] =?UTF-8?q?A=20=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AE=A1=E7=90=86=E8=B4=A6=E6=88=B7=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/account/models.py | 1 + spug_web/src/pages/system/role/Table.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spug_api/apps/account/models.py b/spug_api/apps/account/models.py index 3c78009..03ee641 100644 --- a/spug_api/apps/account/models.py +++ b/spug_api/apps/account/models.py @@ -73,6 +73,7 @@ class Role(models.Model, ModelMixin): tmp = super().to_dict(*args, **kwargs) tmp['page_perms'] = json.loads(self.page_perms) if self.page_perms else None tmp['deploy_perms'] = json.loads(self.deploy_perms) if self.deploy_perms else None + tmp['used'] = self.user_set.count() return tmp def __repr__(self): diff --git a/spug_web/src/pages/system/role/Table.js b/spug_web/src/pages/system/role/Table.js index e968a4a..05d2ec7 100644 --- a/spug_web/src/pages/system/role/Table.js +++ b/spug_web/src/pages/system/role/Table.js @@ -20,8 +20,8 @@ class ComTable extends React.Component { title: '角色名称', dataIndex: 'name', }, { - title: '权限个数', - dataIndex: 'type', + title: '关联账户', + dataIndex: 'used', }, { title: '描述信息', dataIndex: 'desc',