From 37e19536ed75591fbe067d83e26513a2dba89d16 Mon Sep 17 00:00:00 2001 From: xiejun <xj@2023> Date: 星期四, 28 九月 2023 22:17:32 +0800 Subject: [PATCH] 历史导入线程流时获取不到用户对象,导致错误修改(暂时更改成单线程流) --- Source/UBCS-WEB/src/views/integration/systemInfo.vue | 38 ++++++++++++++++++++++++++++++++++---- 1 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Source/UBCS-WEB/src/views/integration/systemInfo.vue b/Source/UBCS-WEB/src/views/integration/systemInfo.vue index 0826c26..ac49796 100644 --- a/Source/UBCS-WEB/src/views/integration/systemInfo.vue +++ b/Source/UBCS-WEB/src/views/integration/systemInfo.vue @@ -59,6 +59,7 @@ return { checkAll: {}, ParentList: [], + ParentRemoveList: [], //閬垮厤缂撳瓨 reload: Math.random(), TreeLoading: false, @@ -146,7 +147,7 @@ //鍒嗙被鎺堟潈澶氶�夊洖璋� checkChange(row, checked) { if (checked) { - if (!row.parentId && row.children) { + if (!row.parentId) { const parentRecord = { oid: row.oid, classifyId: row.attributes.classifyId, @@ -178,12 +179,41 @@ } } } - console.log(this.ParentList); } } else { - this.ParentList = this.ParentList.filter(res => res.classifyId !== row.classifyId); - console.log(this.ParentList); + // 鍙栨秷鍕鹃�夌殑鑺傜偣鏄埗鑺傜偣 + if (!row.parentId) { + // 鎵惧埌鐖惰妭鐐瑰湪ParentList涓殑绱㈠紩 + const parentIndex = this.ParentList.findIndex(item => item.oid === row.oid); + if (parentIndex !== -1) { + const parentOid = this.ParentList[parentIndex].classifyOid; + + // 鏌ユ壘鎵�鏈夐渶瑕佸垹闄ょ殑瀛愯妭鐐圭殑绱㈠紩 + const childIndexes = this.ParentList.reduce((indexes, item, index) => { + if (item.classParentOid === parentOid && item.classifyOid !== parentOid) { + indexes.push(index); + } + return indexes; + }, []); + + // 浠庡悗寰�鍓嶅垹闄ゅ瓙鑺傜偣鐨勬暟鎹紝淇濊瘉绱㈠紩鐨勬纭�� + for (let i = childIndexes.length - 1; i >= 0; i--) { + this.ParentList.splice(childIndexes[i], 1); + } + + // 鍒犻櫎鐖惰妭鐐圭殑鏁版嵁 + this.ParentList.splice(parentIndex, 1); + } + } else { + // 鍙栨秷鍕鹃�夌殑鑺傜偣鏄瓙鑺傜偣 + const childIndex = this.ParentList.findIndex(item => item.oid === row.oid); + if (childIndex !== -1) { + // 鍒犻櫎瀛愯妭鐐圭殑鏁版嵁 + this.ParentList.splice(childIndex, 1); + } + } } + console.log(this.ParentList); }, //鍒嗙被鎺堟潈 classifyHandler(row) { -- Gitblit v1.9.3