From 32f2be2793fd5d27faacd07d44af4bf6faac89c7 Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 1 Mar 2023 17:24:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B5=84=E4=BA=A7=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=A0=91=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=97=B6,=20=E6=B2=A1=E6=9C=89platfrom=E8=AE=BE=E7=BD=AEisPare?= =?UTF-8?q?nt=E4=B8=BAFalse,=20=E8=A7=A3=E5=86=B3=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/const/types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/assets/const/types.py b/apps/assets/const/types.py index a18caa7b2..00a496eee 100644 --- a/apps/assets/const/types.py +++ b/apps/assets/const/types.py @@ -214,10 +214,13 @@ class AllTypes(ChoicesMixin): tp_node = cls.choice_to_node(tp, category_node['id'], opened=False, meta=meta) tp_count = category_type_mapper.get(category + '_' + tp, 0) tp_node['name'] += f'({tp_count})' + platforms = tp_platforms.get(category + '_' + tp, []) + if not platforms: + tp_node['isParent'] = False nodes.append(tp_node) # Platform 格式化 - for p in tp_platforms.get(category + '_' + tp, []): + for p in platforms: platform_node = cls.platform_to_node(p, tp_node['id'], include_asset) platform_node['name'] += f'({platform_count.get(p.id, 0)})' nodes.append(platform_node)