fix:
This commit is contained in:
parent
793b2d3698
commit
57ede91fa8
|
|
@ -0,0 +1,59 @@
|
||||||
|
# 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`.
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
# Coal Feeding DataList Refactor Design
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This change only refactors the `dataList` structure used in `src/views/coalFeeding.vue`.
|
||||||
|
|
||||||
|
`src/views/coalFeeding2.vue` and other views remain unchanged.
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Replace the flat timing and motor fields in `dataList` with a nested structure that models the top and bottom sections explicitly.
|
||||||
|
|
||||||
|
## New Data Shape
|
||||||
|
|
||||||
|
Each item in `dataList` will use this shape:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
{
|
||||||
|
team: string;
|
||||||
|
unit: number;
|
||||||
|
tempera1: number | string;
|
||||||
|
tempera2: number | string;
|
||||||
|
carNumber: number | string;
|
||||||
|
tmljsjs: number | string;
|
||||||
|
tmljsjx: number | string;
|
||||||
|
statusAuto: boolean;
|
||||||
|
team_top: {
|
||||||
|
run_time_sec: number | string;
|
||||||
|
top_time_sec: number | string;
|
||||||
|
acc_time_sec: number | string;
|
||||||
|
bl_time_sec: number | string;
|
||||||
|
dianji: MotorItem[];
|
||||||
|
};
|
||||||
|
team_bottom: {
|
||||||
|
run_time_sec: number | string;
|
||||||
|
top_time_sec: number | string;
|
||||||
|
acc_time_sec: number | string;
|
||||||
|
bl_time_sec: number | string;
|
||||||
|
dianji2: MotorItem[];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Template And Logic Updates
|
||||||
|
|
||||||
|
`coalFeeding.vue` will be updated so that:
|
||||||
|
|
||||||
|
- The upper parameter rows read and write `team_top`.
|
||||||
|
- The lower parameter rows read and write `team_bottom`.
|
||||||
|
- The upper motor grid reads `team_top.dianji`.
|
||||||
|
- The lower motor grid reads `team_bottom.dianji2`.
|
||||||
|
- Motor height calculations use the nested motor arrays.
|
||||||
|
- Local/remote checks and stop-state toggles use the nested motor arrays.
|
||||||
|
|
||||||
|
## Compatibility Decision
|
||||||
|
|
||||||
|
This refactor will not keep the old flat fields in parallel. `coalFeeding.vue` will use the new nested structure as the single source of truth.
|
||||||
|
|
||||||
|
## Risk Control
|
||||||
|
|
||||||
|
- Restrict all edits to `src/views/coalFeeding.vue`.
|
||||||
|
- Keep point binding, websocket updates, and page mapping behavior unchanged.
|
||||||
|
- Verify the view still type-checks and builds after migration.
|
||||||
Loading…
Reference in New Issue