From c66946e33fcdbcd66852ed3a50967fa6f532489f Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 11 六月 2025 08:41:06 +0800 Subject: [PATCH] 添加批修量修改库口功能 --- rsf-admin/src/utils/common.js | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/rsf-admin/src/utils/common.js b/rsf-admin/src/utils/common.js index 2083ca8..309c6eb 100644 --- a/rsf-admin/src/utils/common.js +++ b/rsf-admin/src/utils/common.js @@ -50,3 +50,21 @@ }); return result; }; + +export const haveChildren = (item) => { + if (Array.isArray(item)) { + return item.map((k) => haveChildren(k)); + } + + if (item && typeof item === 'object') { + if (item.id !== undefined) { + item.id = item.id.toString(); + } + + if (item.children && Array.isArray(item.children)) { + item.children = haveChildren(item.children); + } + } + + return item; +}; -- Gitblit v1.9.1