From eeff149c1733db2501bad09fa235ab196a3bf7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E6=98=8A?= <15984991+wwh2328692301@user.noreply.gitee.com> Date: Sat, 23 May 2026 16:50:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(todo=20page):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E6=AE=B5=E6=98=A0=E5=B0=84=E4=B8=8E?= =?UTF-8?q?key=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 将列表循环的key从item.actionId改为item.coilId,确保唯一标识正确 2. 新增mapDataFields方法统一处理后端字段到前端字段的映射 3. 替换fetchList中原有的直接赋值逻辑,使用映射后的新数据 4. 简化handleViewRecord和handleViewDetail中的coilId获取逻辑 --- apps/hand-factory/pages/todo/index.vue | 40 ++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/apps/hand-factory/pages/todo/index.vue b/apps/hand-factory/pages/todo/index.vue index e7a0657..59d93b1 100644 --- a/apps/hand-factory/pages/todo/index.vue +++ b/apps/hand-factory/pages/todo/index.vue @@ -42,7 +42,7 @@ this.mapDataFields(row)) + console.log('映射后的数据:', { mappedRows, total: this.total }) if (isLoadMore) { - this.list = [...this.list, ...rows] + this.list = [...this.list, ...mappedRows] } else { - this.list = rows + this.list = mappedRows } // 更新待贴标签数量 @@ -249,7 +277,7 @@ export default { // 查看记录 handleViewRecord(coilInfo) { - const coilId = coilInfo.coilId || coilInfo.materialCoilId + const coilId = coilInfo.coilId if (!coilId) { uni.showToast({ title: '无法获取钢卷ID', @@ -262,7 +290,7 @@ export default { // 查看详情 handleViewDetail(coilInfo) { - const coilId = coilInfo.coilId || coilInfo.materialCoilId + const coilId = coilInfo.coilId if (!coilId) { uni.showToast({ title: '无法获取钢卷ID',