|
@@ -222,7 +222,7 @@ async def change_classification_visible(
|
|
|
|
|
|
@router.get("/templateTree")
|
|
|
async def get_pattern_list(
|
|
|
- # name: str = Query(None, description='名称'),
|
|
|
+ visible: str = Query(None, description='是否显示'),
|
|
|
# page: int = Query(1, gt=0, description='页码'),
|
|
|
# pageSize: int = Query(None, gt=0, description='每页条目数量'),
|
|
|
db: Session = Depends(get_db)
|
|
@@ -230,6 +230,8 @@ async def get_pattern_list(
|
|
|
try:
|
|
|
query = db.query(TpPatternTemplate)
|
|
|
query = query.filter_by(del_flag='0')
|
|
|
+ if visible is not None:
|
|
|
+ query = query.filter_by(visible=visible)
|
|
|
# if name:
|
|
|
# query = query.filter(TpPatternTemplate.name.like(f'%{name}%'))
|
|
|
# total_items = query.count()
|
|
@@ -241,7 +243,14 @@ async def get_pattern_list(
|
|
|
lists = query.all() # .offset((page - 1) * pageSize).limit(pageSize)
|
|
|
data = []
|
|
|
for info in lists:
|
|
|
- classification_list=template_id_get_classification_list(db,info.template_id)
|
|
|
+ # print(1111)
|
|
|
+ query1 = db.query(TpPatternClassification)
|
|
|
+ query1 = query1.filter_by(template_id=info.template_id, del_flag='0')
|
|
|
+ if visible is not None:
|
|
|
+ query1 = query1.filter_by(visible=visible)
|
|
|
+ query1 = query1.order_by(TpPatternClassification.order_num.asc())
|
|
|
+ classification_list = query1.all()
|
|
|
+ # =template_id_get_classification_list(db,info.template_id)
|
|
|
template_info = {"template_id": info.template_id,
|
|
|
"name": info.name,
|
|
|
"value": info.value,
|