feat(web): 海选按场景分组 + 删场景点位页签 + 演出真实底图 + 破缓存

- 海选审核左侧改两列:场景列(按新字段 ir.scene 手动归类聚合,含全部/未分类) + 该场景事件列
- 删独立「场景/点位」页签(pointview.js 保留未引用)
- 演出配置 Timeline 接真实场景俯视底图(setupShot 覆盖投影范围 + drawStage 叠图,复用 /api/pointsets 的 shot)
- 事件 meta 加「所属场景」归类输入框(datalist 提示已有场景名)
- db: events 加 scene 列 + 旧库 ALTER 迁移;upsert 镜像 ir.scene;list 返回
- app.py: 首页按文件 mtime 给 js/css 注入 ?v= 破浏览器缓存(根治新html配旧缓存js崩溃→弹口令)
This commit is contained in:
2026-06-15 11:46:59 +08:00
parent 603f78b77f
commit 65424a4dfb
7 changed files with 137 additions and 71 deletions

View File

@ -32,6 +32,7 @@ def init_db(path=None):
"group" TEXT PRIMARY KEY,
title TEXT,
theme TEXT,
scene TEXT DEFAULT '',
status TEXT NOT NULL DEFAULT 'pending',
ir_json TEXT NOT NULL,
updated_at TEXT,
@ -39,6 +40,11 @@ def init_db(path=None):
notes TEXT
)"""
)
# 旧库迁移:补 scene 列(海选审核按场景分组的归类维度,镜像自 ir.scene
try:
c.execute("ALTER TABLE events ADD COLUMN scene TEXT DEFAULT ''")
except sqlite3.OperationalError:
pass # 已存在
c.execute(
"""CREATE TABLE IF NOT EXISTS sessions (
token TEXT PRIMARY KEY,
@ -80,7 +86,7 @@ def purge_sessions(now, path=None):
def list_events(status=None, path=None):
"""列表(不含 ir_json轻量"""
sql = ('SELECT "group", title, theme, status, updated_at, updated_by, notes '
sql = ('SELECT "group", title, theme, scene, status, updated_at, updated_by, notes '
"FROM events")
args = []
if status and status != "all":
@ -106,21 +112,22 @@ def upsert_event(ir, by, now, notes=None, keep_status=True, path=None):
group = ir["id"]
title = ir.get("title", "")
theme = ir.get("theme", "")
scene = ir.get("scene", "") or "" # 海选审核分组维度,镜像自 ir.scene
ir_str = json.dumps(ir, ensure_ascii=False)
with _conn(path) as c:
exists = c.execute('SELECT status FROM events WHERE "group" = ?',
(group,)).fetchone()
if exists:
c.execute(
'UPDATE events SET title=?, theme=?, ir_json=?, updated_at=?, '
'UPDATE events SET title=?, theme=?, scene=?, ir_json=?, updated_at=?, '
'updated_by=?, notes=COALESCE(?, notes) WHERE "group"=?',
(title, theme, ir_str, now, by, notes, group),
(title, theme, scene, ir_str, now, by, notes, group),
)
else:
c.execute(
'INSERT INTO events ("group", title, theme, status, ir_json, '
"updated_at, updated_by, notes) VALUES (?,?,?,?,?,?,?,?)",
(group, title, theme, "pending", ir_str, now, by, notes or ""),
'INSERT INTO events ("group", title, theme, scene, status, ir_json, '
"updated_at, updated_by, notes) VALUES (?,?,?,?,?,?,?,?,?)",
(group, title, theme, scene, "pending", ir_str, now, by, notes or ""),
)
return group