SPA_TemperProductionOverview/src/components/PressLane.vue
Erik aa115a0b8d feat: scaffold Temper-Linie live-overview page-module (temper_overview)
Vue 3 + Vite 8 + TS + PrimeVue 4 (Nora/Industrial) + Pinia + vue-i18n SPA, served
by the SPRO gateway as a static page-module under /module/temper_overview and
embedded into Grafana via iframe.

- Ports the LOCKED design #4 "Shop-floor Schematic": one connected line
  Pressen -> (cyan) -> Ofen -> (green) -> Fertig; carts under their origin press;
  oven trays as dwell-progress bars; finished band; range picker scoping only the
  Fertig figures. Flow/order colours match PressV (fleet recognisability).
- Python page-module wrapper: register(app) mounts committed dist/ + a no-auth
  read API (GET /api/overview). Kernel DB seam in _db.py.
- Backend returns SAMPLE data; frontend falls back to bundled sample so `npm run
  dev` renders with zero backend (TODO markers point at the real temper aggregates).
- Rich README bakes in the design, contract, wiring + Grafana embedding for
  standalone development.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 20:41:04 +02:00

123 lines
2.8 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import OrderLine from '@/components/OrderLine.vue'
import type { CartOnWay } from '@/types/overview'
const props = defineProps<{ carts: CartOnWay[] }>()
const { t } = useI18n()
const active = computed(() => props.carts.length > 0)
const partsOf = (c: CartOnWay) => c.orders.reduce((s, o) => s + o.qty, 0)
</script>
<template>
<div class="lane" :class="{ active }">
<span class="conn"></span>
<span class="lc" :class="active ? 'on' : 'off'">
{{ active ? t('lane.wagen', { n: carts.length }) : t('lane.none') }}
</span>
<div v-for="cart in carts" :key="cart.cartId" class="cart">
<div class="chd">
<span class="cid">{{ cart.cartId }}</span>
<span class="cp">{{ t('lane.parts', { n: partsOf(cart) }) }}</span>
</div>
<div class="cbody">
<OrderLine v-for="(o, i) in cart.orders" :key="i" :order-no="o.orderNo" :qty="o.qty" :color-index="o.colorIndex" />
</div>
<div class="cfoot">{{ t('lane.ovenIn', { n: cart.etaMin }) }}</div>
</div>
</div>
</template>
<style scoped>
.lane {
position: relative;
min-height: 132px;
max-height: 236px;
overflow-y: auto;
padding-top: 22px;
display: flex;
flex-direction: column;
gap: 8px;
scrollbar-width: thin;
}
.conn {
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 2px;
transform: translateX(-50%);
z-index: 0;
background: repeating-linear-gradient(180deg, var(--way) 0 3px, transparent 3px 11px);
background-size: 2px 11px;
opacity: 0.3;
}
.lane.active .conn {
opacity: 0.95;
animation: flowdown 1.05s linear infinite;
}
.lc {
position: absolute;
left: 50%;
top: 3px;
transform: translateX(-50%);
font-family: var(--mono);
font-size: 0.53rem;
letter-spacing: 0.06em;
text-transform: uppercase;
white-space: nowrap;
background: var(--ground);
padding: 0 5px;
z-index: 3;
}
.lc.on {
color: var(--way);
}
.lc.off {
color: var(--ink-faint);
}
.cart {
position: relative;
z-index: 2;
border: 1px solid var(--line-2);
border-top: 2px solid var(--way);
border-radius: var(--r);
background: var(--panel);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.chd {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 8px;
background: var(--panel-3);
border-bottom: 1px solid var(--line);
}
.cid {
font-family: var(--mono);
font-size: 0.75rem;
font-weight: 800;
}
.cp {
margin-left: auto;
font-family: var(--mono);
font-size: 0.68rem;
color: var(--ink-dim);
}
.cbody {
padding: 6px 8px;
display: flex;
flex-direction: column;
gap: 4px;
}
.cfoot {
padding: 4px 8px;
border-top: 1px solid var(--line);
font-family: var(--mono);
font-size: 0.62rem;
color: var(--way);
}
</style>