Files
DashBoard/openspec/changes/archive/2026-02-10-hold-lot-overview/proposal.md
egg 8225863a85 feat(hold-overview): add Hold Lot Overview page with TreeMap, Matrix, and cascade filtering
Provide managers with a dedicated page to analyze hold lots across all stations.
Extends existing service functions (get_hold_detail_summary, get_hold_detail_lots,
get_wip_matrix) with optional parameters for backward compatibility, adds one new
function (get_hold_overview_treemap), and registers the page in the portal navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 13:02:24 +08:00

2.9 KiB
Raw Blame History

Why

主管需要一個獨立頁面,專注於線上 Hold Lot 的全局觀。目前 WIP Overview 的 Pareto 圖混合在所有 WIP 資料中,而 Hold Detail 只能看單一 Hold Reason 的明細。缺少一個可以「一覽各站 Hold Lot 情況」的專用分析頁面,讓主管能快速掌握哪些站別、哪些原因造成最多 Hold以及滯留嚴重程度。

What Changes

  • 新增 /hold-overview 頁面Vue 3 SFC + ECharts TreeMap獨立於現有 WIP Overview 和 Hold Detail
  • 新增 Flask Blueprint 與 4 支 API endpointssummary / matrix / treemap / lots
  • 頁面預設只顯示品質異常 Hold可切換至非品質異常或全部
  • 提供 Workcenter x Package Matrix如 WIP Overview數字可點擊篩選下方所有資料
  • 提供 TreeMap 視覺化WC → Reason 層級,面積=QTY顏色=平均滯留天數)
  • 提供 paginated Hold Lot 明細表
  • 篩選 cascade 機制Filter Bar → 全部重載Matrix 點擊 → TreeMap + TableTreeMap 點擊 → Table
  • 新增 Vite multi-entry 設定

Capabilities

New Capabilities

  • hold-overview-page: Hold Lot Overview 頁面的完整功能規格包含篩選器、Summary Cards、Matrix、TreeMap、明細表及 filter cascade 互動邏輯
  • hold-overview-api: Hold Overview 後端 API 端點summary / matrix / treemap / lots從 DWH.DW_MES_LOT_V 查詢 Hold Lot 資料

Modified Capabilities

  • vue-vite-page-architecture: 新增 hold-overview 作為 Vite multi-entry HTML entry point

Impact

  • Backend擴充現有: 擴充 wip_service.pyget_hold_detail_summary()get_hold_detail_lots() — 將 reason 改為 optional 並新增 hold_type 參數,向後相容;擴充 get_wip_matrix() 新增 optional reason 參數
  • Backend唯一新增函數: get_hold_overview_treemap() — WC × Reason 聚合 + avgAge 計算
  • Backend新增路由: src/mes_dashboard/routes/hold_overview_routes.pyFlask Blueprint4 支 API
  • Frontend直接複用: hold-detail/SummaryCards.vuewip-shared/Pagination.vueuseAutoRefreshcore/api.jswip-shared/constants.js
  • Frontend基於現有擴充: 基於 MatrixTable.vueHoldMatrix.vue(加 cell/column click基於 hold-detail/LotTable.vueLotTable.vue(加 Hold Reason 欄位)
  • Frontend全新元件: HoldTreeMap.vueFilterBar.vueFilterIndicator.vue
  • Vite Config: vite.config.js 新增 hold-overview entry
  • Dependencies: echarts/chartsTreemapChart(進入現有 vendor-echarts chunk
  • Cache: 完全複用現有 Redis cache + snapshot indexes已有 wip_status['HOLD']hold_type['quality'|'non-quality'] 索引),零改動
  • SQL: 不需新增 SQL 模板 — 複用現有 summary.sql / matrix.sql / detail.sql + QueryBuilder WHERE clause