# Coal Feeding DataList Refactor Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Refactor `src/views/coalFeeding.vue` so its `dataList` uses the nested `team_top` and `team_bottom` structure as the only source of truth.

**Architecture:** Keep the UI layout and behavior unchanged while migrating the view's timing rows and motor grids to read and write nested section objects. Centralize section-aware reads through small helper functions so the template and state update logic stay consistent.

**Tech Stack:** Vue 3, TypeScript, OpenTiny, Vite

---

### Task 1: Migrate Coal Feeding Data Shape

**Files:**
- Modify: `D:\workSpace\product_control_client\src\views\coalFeeding.vue`

- [ ] **Step 1: Update the section types and row configuration**

Add nested section types and change the row configuration to map to `team_top` or `team_bottom` keys.

- [ ] **Step 2: Rewrite `dataList` items to the nested structure**

Replace flat timing and motor fields with:

```ts
team_top: {
  run_time_sec: 3,
  top_time_sec: 55,
  acc_time_sec: 55,
  bl_time_sec: 3,
  dianji: [],
},
team_bottom: {
  run_time_sec: 3,
  top_time_sec: 55,
  acc_time_sec: 58,
  bl_time_sec: 3,
  dianji2: [],
},
```

- [ ] **Step 3: Update template bindings**

Make upper rows use `team_top`, lower rows use `team_bottom`, the upper motor grid use `team_top.dianji`, and the lower motor grid use `team_bottom.dianji2`.

- [ ] **Step 4: Update helper logic**

Adjust motor height calculation, local-mode detection, and stop-state toggling so they operate on nested motor arrays.

- [ ] **Step 5: Verify the file still builds**

Run:

```bash
npm run build
```

Expected: production build completes successfully without TypeScript errors from `src/views/coalFeeding.vue`.
