From 2830381aa236e5085e6499ec6a11bd9092e7a193 Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Thu, 28 Nov 2024 14:39:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8A=82=E7=82=B9=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E4=BD=BF=E7=94=A8=E5=8F=AF=E8=A7=86=E5=8C=96=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/node/list/node-layout/welcome.vue | 812 +++++++++++--------- src/utils/obj.js | 19 + 2 files changed, 466 insertions(+), 365 deletions(-) diff --git a/src/pages/node/list/node-layout/welcome.vue b/src/pages/node/list/node-layout/welcome.vue index ab8617b..8bb5f2e 100644 --- a/src/pages/node/list/node-layout/welcome.vue +++ b/src/pages/node/list/node-layout/welcome.vue @@ -1,365 +1,447 @@ - - - - - + + + + + diff --git a/src/utils/obj.js b/src/utils/obj.js index 765d9b4..89cfe2f 100644 --- a/src/utils/obj.js +++ b/src/utils/obj.js @@ -45,4 +45,23 @@ export function deepCloneV2(obj, seen = new WeakMap()) { // 数组去重 export function unique(arr) { return [...new Set(arr)]; + } + +/** + * 深度比较两个对象是否相等 + * @param {Object} a - 第一个对象 + * @param {Object} b - 第二个对象 + * @returns {boolean} 两个对象是否相等 + */ +export function deepEqual(a, b) { + if (a === b) return true; + if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) return false; + + let keysA = Object.keys(a), keysB = Object.keys(b); + if (keysA.length !== keysB.length) return false; + + for (let key of keysA) { + if (!keysB.includes(key) || !deepEqual(a[key], b[key])) return false; + } + return true; } \ No newline at end of file -- Gitee