feat(web): 演出配置 Timeline 加「场景底图」选择器(venue 特写)

- 后端 /api/sceneshots:列 SceneShots 全部俯视底图(venue 特写) name->{url,bounds}
- timeline.js:底图优先级 ir.stage.backdrop(venue) > 点位集默认 shot;
  顶栏加底图下拉 renderMapInfo + applyBackdrop(换底+改投影范围+重画+回调)
- app.js:拉 /api/sceneshots;performSelect 传入;saveBackdrop 写 ir.stage.backdrop 并 PUT
- venue 特写与点位集同 map-local → 换底图后锚点自动落对位(无头实拍擂台验证)
- ir.stage.backdrop 是编辑器元数据:validate 不读、compile 不碰
@
This commit is contained in:
2026-06-15 12:01:14 +08:00
parent 65424a4dfb
commit 676df30c67
4 changed files with 96 additions and 7 deletions

View File

@ -3,6 +3,7 @@
const App = {
dict: { conditions: {}, grants: {} },
pointsets: {}, // name -> {mapId, points:[]}
sceneshots: {}, // name -> {url,bounds,w,h}(演出配置「场景底图」可选项)
events: [],
current: null, // 当前 group
ir: null, // 工作副本
@ -42,6 +43,7 @@
try {
App.dict = await (await api("/api/dictionary")).json();
App.pointsets = await (await api("/api/pointsets")).json();
try { App.sceneshots = await (await api("/api/sceneshots")).json(); } catch (_) { App.sceneshots = {}; }
} catch (e) { return; }
await loadList();
}
@ -252,12 +254,27 @@
host.appendChild(d);
});
}
let performIr = null; // 演出配置当前事件 IR底图选择写这里并持久化
async function performSelect(group) {
let d;
try { d = await (await api("/api/events/" + encodeURIComponent(group))).json(); } catch (e) { return; }
performCurrent = group;
performIr = d.ir;
performLoadList();
Timeline.show($("perform-main"), d.ir, App.dict, App.pointsets);
Timeline.show($("perform-main"), d.ir, App.dict, App.pointsets, {
sceneshots: App.sceneshots,
onPickBackdrop: name => saveBackdrop(group, name),
});
}
// 演出配置选底图 → 写 ir.stage.backdrop编辑器元数据validate/compile 都不读)并 PUT 持久化。
async function saveBackdrop(group, name) {
if (!performIr || group !== performCurrent) return;
performIr.stage = performIr.stage || {};
if (name) performIr.stage.backdrop = name; else delete performIr.stage.backdrop;
try {
await api("/api/events/" + encodeURIComponent(group), { method: "PUT", body: JSON.stringify({ ir: performIr, by: App.by }) });
toast(name ? ("底图已设为 " + name) : "已恢复默认底图");
} catch (e) { toast("底图保存失败"); }
}
// ---------- 导入 ----------