fix(web): 修复重构导致 allStations 变量未定义引发的渲染崩溃问题
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
"mtimeMs": 1783602619602.658
|
||||
},
|
||||
"ticket-order.js": {
|
||||
"size": 32045,
|
||||
"mtimeMs": 1783782910999.121
|
||||
"size": 32083,
|
||||
"mtimeMs": 1783783215957.1775
|
||||
},
|
||||
"ticket-search.js": {
|
||||
"size": 17269,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"blog.css": 2,
|
||||
"custom-dialog.js": 11,
|
||||
"public-status.js": 14,
|
||||
"ticket-order.js": 20,
|
||||
"ticket-order.js": 21,
|
||||
"ticket-search.js": 12,
|
||||
"ticket-route.js": 3,
|
||||
"index.js": 5,
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/custom-dialog.js?v=11"></script>
|
||||
<script src="/ticket-order.js?v=20"></script>
|
||||
<script src="/ticket-order.js?v=21"></script>
|
||||
<script src="/public-status.js?v=14"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
+3
-1
@@ -324,7 +324,9 @@
|
||||
`;
|
||||
}
|
||||
|
||||
const width = Math.max(560, Math.max(...allStations.map(c => stationXByCanonical[stationCanonicalByCode[c] || c] || 0)) + 120);
|
||||
const allX = Object.values(stationXByCanonical);
|
||||
const maxX = allX.length > 0 ? Math.max(...allX) : 0;
|
||||
const width = Math.max(560, maxX + 120);
|
||||
const height = Math.max(260, baseY + currentLineIdx * lineGapY + 60);
|
||||
mapContainer.innerHTML = `<svg width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">${svgContent}</svg>`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user