🚀 chore(ui): Refactor UpstreamRatioSync with conflict-modal component, performance hooks & cleanup (#1286)
WHAT’S NEW • Extracted reusable ConflictConfirmModal for clearer JSX hierarchy • Added detailed conflict detection & confirmation flow before syncing options • Refactored state-heavy callbacks (`selectValue`, `performSync`) with `useCallback` to avoid unnecessary renders • Introduced build-time constants (later removed unused export) and unified helper utilities • Ensured final ratios are rebuilt accurately before API `PUT`, fixing “value not updated” bug • Enhanced UI hints: warning icon on conflict, multiline billing info, mobile-friendly modal size • General code cleanup: removed dead variables, adopted early returns, improved comments WHY Improves maintainability, user clarity when billing-type collisions occur, and guarantees data consistency after synchronisation.
This commit is contained in:
@@ -1728,5 +1728,9 @@
|
||||
"自适应列表": "Adaptive list",
|
||||
"紧凑列表": "Compact list",
|
||||
"仅显示矛盾倍率": "Only show conflicting ratios",
|
||||
"矛盾": "Conflict"
|
||||
"矛盾": "Conflict",
|
||||
"确认冲突项修改": "Confirm conflict item modification",
|
||||
"该模型存在固定价格与倍率计费方式冲突,请确认选择": "The model has a fixed price and ratio billing method conflict, please confirm the selection",
|
||||
"当前计费": "Current billing",
|
||||
"修改为": "Modify to"
|
||||
}
|
||||
Reference in New Issue
Block a user