diff --git a/fam-ui/src/app.py b/fam-ui/src/app.py index a52c79a..4327a9a 100644 --- a/fam-ui/src/app.py +++ b/fam-ui/src/app.py @@ -802,13 +802,33 @@ elif page == "👤 人物管理": f'border:1px solid #713f12;padding:1px 8px;border-radius:10px;' f'margin-left:8px;">未命名') label_str = ' · '.join(g['labels']) + # 人物代表画面:取该身份任一 label 出现事件的截图(头像) + rep_img = '' + if _oracle_url: + for lb in g['labels']: + try: + cursor.execute( + "SELECT e.id FROM sync_events e WHERE e.person_list_json LIKE %s " + "ORDER BY e.id LIMIT 1", (f'%{lb}%',)) + r2 = cursor.fetchone() + if r2 and r2['id']: + rep_img = ( + f'') + break + except Exception: + continue st.markdown( f'
' f'{esc(key)}{tag}
' f'
' f'标识: {esc(label_str)}
' f'
' - f'出现 {g["appearances"]} 次 · 首次 {esc(first_str)}
', + f'出现 {g["appearances"]} 次 · 首次 {esc(first_str)}' + f'{rep_img}', unsafe_allow_html=True) if not is_named: # 未命名身份:每个 label 都给一个命名框