|
@@ -799,6 +799,7 @@ async def update_bz_visible(
|
|
|
|
|
|
@router.put('/ws/group_visible')
|
|
|
async def update_group_visible(
|
|
|
+ websocket:WebSocket,
|
|
|
body = Depends(remove_xss_json),
|
|
|
user_id=Depends(valid_access_token),
|
|
|
db: Session = Depends(get_db)
|
|
@@ -808,6 +809,9 @@ async def update_group_visible(
|
|
|
visible = body['visible']
|
|
|
group0 = group_id_get_tp_pattern_ws_group_info(group_id,db)
|
|
|
# print(visible,group0.visible)
|
|
|
+ group0.visible=visible
|
|
|
+ pattern_id = group_id_get_tp_pattern_ws_group_info(group_id, db).pattern_id
|
|
|
+ group_list = pattern_id_get_tp_pattern_ws_group_list(pattern_id, db)
|
|
|
if visible=='0':#1显示 0隐藏
|
|
|
query = db.query(TpPatternWSList)
|
|
|
query = query.filter(TpPatternWSList.del_flag!='2')
|
|
@@ -816,8 +820,7 @@ async def update_group_visible(
|
|
|
for info in bz_list:
|
|
|
info.visible='0'
|
|
|
elif visible=='1':
|
|
|
- pattern_id = group_id_get_tp_pattern_ws_group_info(group_id,db).pattern_id
|
|
|
- group_list = pattern_id_get_tp_pattern_ws_group_list(pattern_id,db)
|
|
|
+
|
|
|
for group in group_list:
|
|
|
# print(group.group_id)
|
|
|
visible = '0'
|
|
@@ -834,7 +837,7 @@ async def update_group_visible(
|
|
|
for info in bz_list:
|
|
|
# print(info.visible)
|
|
|
info.visible = visible
|
|
|
- # group0.visible=visible
|
|
|
+ await manager.broadcast(pattern_id, db, websocket)
|
|
|
db.commit()
|
|
|
return {"code": 200, "msg": "查询成功", "data": None
|
|
|
}
|