|
@@ -272,11 +272,11 @@ async def get_dict_data_by_type(
|
|
for parent_info in dict_data:
|
|
for parent_info in dict_data:
|
|
data = {"id":parent_info.dict_value,"label":parent_info.dict_label,"css_class":parent_info.css_class}
|
|
data = {"id":parent_info.dict_value,"label":parent_info.dict_label,"css_class":parent_info.css_class}
|
|
type_list = get_type_parent_id_by_type_list(db,parent_info.dict_value)
|
|
type_list = get_type_parent_id_by_type_list(db,parent_info.dict_value)
|
|
- if type_info:
|
|
|
|
|
|
+ if type_list:
|
|
children = []
|
|
children = []
|
|
for type_info in type_list:
|
|
for type_info in type_list:
|
|
children.append({"id":type_info.id,"label":type_info.type_name,"parent_id":type_info.type_parent_id})
|
|
children.append({"id":type_info.id,"label":type_info.type_name,"parent_id":type_info.type_parent_id})
|
|
- data['children']:children
|
|
|
|
|
|
+ data['children']=children
|
|
dict_data_list.append(data)
|
|
dict_data_list.append(data)
|
|
result = {
|
|
result = {
|
|
"rows": dict_data_list,
|
|
"rows": dict_data_list,
|
|
@@ -287,4 +287,5 @@ async def get_dict_data_by_type(
|
|
|
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
# 处理异常
|
|
# 处理异常
|
|
|
|
+ traceback.print_exc()
|
|
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
|
|
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))
|