From 86d9b0511e4730ca19633b6c3be605e5d61533aa Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期五, 25 七月 2025 14:55:23 +0800
Subject: [PATCH] ID1625-血压计页面修改
---
src/utils/utils.ts | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index 4081f1e..deeee91 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -28,4 +28,24 @@
}
return value;
-}
\ No newline at end of file
+}
+/**
+ * 深拷贝
+ * @param obj
+ * @returns
+ */
+export function deepClone<T>(obj: T): T {
+ if (obj === null || typeof obj !== "object") return obj;
+
+ if (Array.isArray(obj)) {
+ return obj.map(item => deepClone(item)) as unknown as T;
+ }
+
+ const result: any = {};
+ for (const key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ result[key] = deepClone(obj[key]);
+ }
+ }
+ return result;
+}
--
Gitblit v1.8.0