From 59bcd69bb1b7ba1a603bb8011108a257ce1d2962 Mon Sep 17 00:00:00 2001 From: wangbeihong Date: Sun, 8 Mar 2026 03:20:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=9B=92=E5=AD=90?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9B=92=E5=AD=90=E5=88=97=E8=A1=A8=E5=92=8C=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 11 ++++++++++- static/css/style.css | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 72f177e..8b8a5f7 100644 --- a/app.py +++ b/app.py @@ -261,6 +261,14 @@ def make_overview_rows(box: Box): return rows +def box_sort_key(box: Box): + return ( + (box.slot_prefix or "").upper(), + box.start_number if box.start_number is not None else 0, + box.name or "", + ) + + def render_box_page(box: Box, error: str = "", notice: str = ""): slots = slot_data_for_box(box) bag_rows = bag_rows_for_box(box) if box.box_type == "bag" else [] @@ -278,7 +286,8 @@ def render_box_page(box: Box, error: str = "", notice: str = ""): @app.route("/") def index(): - boxes = Box.query.order_by(Box.id.asc()).all() + boxes = Box.query.all() + boxes.sort(key=box_sort_key) groups = {key: [] for key in BOX_TYPES.keys()} for box in boxes: diff --git a/static/css/style.css b/static/css/style.css index 75c777d..161d067 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -72,8 +72,9 @@ body { .box-list { display: grid; - grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + grid-template-columns: repeat(auto-fill, 300px); gap: 14px; + justify-content: start; } .group-panel { @@ -118,6 +119,11 @@ body { box-shadow: 0 3px 12px rgba(17, 32, 49, 0.05); } +.box-card { + width: 300px; + min-height: 260px; +} + .box-card h3 { margin: 0 0 6px; } @@ -280,6 +286,15 @@ td { align-items: flex-start; } + .box-list { + grid-template-columns: 1fr; + } + + .box-card { + width: 100%; + min-height: auto; + } + .slot-grid, .slot-grid-14, .slot-grid-bag {