From e044be08ece38af7a400fb7f3eacdda2e4fc4113 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期二, 10 十月 2023 16:09:59 +0800 Subject: [PATCH] 整合代码 --- Source/UBCS-WEB/src/views/integration/systemInfo.vue | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/UBCS-WEB/src/views/integration/systemInfo.vue b/Source/UBCS-WEB/src/views/integration/systemInfo.vue index f7e2560..ab7958a 100644 --- a/Source/UBCS-WEB/src/views/integration/systemInfo.vue +++ b/Source/UBCS-WEB/src/views/integration/systemInfo.vue @@ -159,35 +159,35 @@ if (checked) { this.addAllChildren(row.children); this.addToParentList(row); - // 鍕鹃�夎鏃讹紝灏嗗綋鍓嶈浠ュ強鍏舵墍鏈夊瓙鑺傜偣娣诲姞鍒癙arentList涓� + // 鍕鹃�夎鏃跺皢鎵�鏈夎妭鐐规坊鍔犲埌ParentList涓� } else { this.removeAllChildren(row.children); this.removeFromParentList(row); - // 鍙栨秷鍕鹃�夎鏃讹紝灏嗗綋鍓嶈浠ュ強鍏舵墍鏈夊瓙鑺傜偣浠嶱arentList涓Щ闄� + // 鍙栨秷鍕鹃�夊皢鎵�鏈夎妭鐐规坊鍔犱粠ParentList涓Щ闄� } - // console.table(this.ParentList); }, + //瀛愯妭鐐规坊鍔� addAllChildren(children) { for (let child of children) { this.addToParentList(child); // 灏嗗瓙鑺傜偣娣诲姞鍒� ParentList 涓� if (child.children && child.children.length > 0) { this.addAllChildren(child.children); - // 閫掑綊璋冪敤缁х画娣诲姞瀛愯妭鐐圭殑瀛愯妭鐐� } } }, + //瀛愯妭鐐圭Щ闄� removeAllChildren(children) { for (let child of children) { this.removeFromParentList(child); // 灏嗗瓙鑺傜偣浠� ParentList 涓Щ闄� if (child.children && child.children.length > 0) { this.removeAllChildren(child.children); - // 閫掑綊璋冪敤缁х画绉婚櫎瀛愯妭鐐圭殑瀛愯妭鐐� } } }, + //褰撳墠鐖惰妭鐐规坊鍔� addToParentList(item) { const classifyOid = item.attributes.classifyOid; if (!this.isClassifyOidExists(classifyOid)) { @@ -197,9 +197,9 @@ classifyOid: classifyOid, }; this.ParentList.push(record); - // 灏嗚妭鐐规坊鍔犲埌ParentList涓� } }, + //褰撳墠鐖惰妭鐐圭Щ闄� removeFromParentList(item) { const classifyOid = item.attributes.classifyOid; if (this.isClassifyOidExists(classifyOid)) { @@ -207,12 +207,13 @@ if (index !== -1) { this.ParentList.splice(index, 1); } - // 灏嗚妭鐐逛粠ParentList涓Щ闄� } }, + //鍒ら噸-ParentList isClassifyOidExists(classifyOid) { return this.ParentList.some(item => item.classifyOid === classifyOid); }, + //鏌ユ壘index浣嶇疆 findIndexByClassifyOid(classifyOid) { return this.ParentList.findIndex(item => item.classifyOid === classifyOid); }, -- Gitblit v1.9.3