Carry the level everywhere a position is drawn, and gate it per occurrence
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<!-- With coordinates, the name carries the same floor-plan preview
|
||||
the asset's own page uses. Without them, a plain link. -->
|
||||
<LocationMapTooltip v-if="row.link && row.maphover"
|
||||
:left="row.maphover.x" :top="row.maphover.y"
|
||||
:left="row.maphover.x" :top="row.maphover.y" :levelid="row.maphover.levelid"
|
||||
:machineName="row.maphover.label">
|
||||
<router-link :to="row.link" class="dc-row-title"
|
||||
:title="row.titletip || undefined">
|
||||
|
||||
@@ -127,7 +127,15 @@ export function mapHover(card, item) {
|
||||
const x = item[spec.x]
|
||||
const y = item[spec.y]
|
||||
if (x === null || x === undefined || y === null || y === undefined) return null
|
||||
return { x, y, label: spec.label ? (item[spec.label] || '') : '' }
|
||||
// The level travels with the coordinates (ADR-017) - they are pixels of ONE
|
||||
// drawing. Read `levelid` unless the card names another field, so a card that
|
||||
// predates levels still previews on the right floor instead of none.
|
||||
const levelid = item[spec.level || 'levelid']
|
||||
return {
|
||||
x, y,
|
||||
levelid: levelid === undefined ? null : levelid,
|
||||
label: spec.label ? (item[spec.label] || '') : '',
|
||||
}
|
||||
}
|
||||
|
||||
export function cardRows(card) {
|
||||
|
||||
@@ -289,7 +289,12 @@ async function exportPdf() {
|
||||
try {
|
||||
await loadMapConfig()
|
||||
await exportMapPdf({
|
||||
assets: filteredAssets.value,
|
||||
// Only this level's markers. The sheet is one drawing, so a marker
|
||||
// positioned against another level would be printed on the wrong floor
|
||||
// plan - the same failure the on-screen map had, in a form nobody can
|
||||
// correct after it is printed and carried onto the floor.
|
||||
assets: filteredAssets.value.filter(
|
||||
asset => (asset.levelid ?? null) === shownLevelId.value),
|
||||
// blueprintUrlFor applies withBase - the raw setting value is a
|
||||
// root-relative /api path, which 404s under a subpath mount like /ops.
|
||||
// The PDF always uses the light blueprint: it prints on white paper.
|
||||
|
||||
Reference in New Issue
Block a user