From 3d018a4221fdd384d54d3cd8a423789e6ef0fd6d Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 26 Jun 2024 11:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/study/Growth.vue | 8 ++++--- src/views/study/GrowthPath.vue | 43 ++++++++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/views/study/Growth.vue b/src/views/study/Growth.vue index adf8fc31..e336ff64 100644 --- a/src/views/study/Growth.vue +++ b/src/views/study/Growth.vue @@ -128,7 +128,7 @@
本功能针对学员所在组织、岗位、职级自动匹配成长路径,完成本路径方可晋升
-
+
我已阅读
@@ -175,7 +175,9 @@ export default { } }, watch:{ - + checked(){ + this.checkedVisible() + } }, methods: { startLearn(){ @@ -189,7 +191,7 @@ export default { this.checked = localStorage.getItem("checkedGrowth") === "false" }, checkedVisible(){ - this.centerDialogVisible = false + // this.centerDialogVisible = false localStorage.setItem("checkedGrowth",!this.checked) }, }, diff --git a/src/views/study/GrowthPath.vue b/src/views/study/GrowthPath.vue index ba1b69b0..0e53f4fe 100644 --- a/src/views/study/GrowthPath.vue +++ b/src/views/study/GrowthPath.vue @@ -237,7 +237,7 @@
{{ item.isOtherPosition == 1 ? item.positionName + '(' + item.organizationName + ')' : item.positionName }}
-
+
@@ -476,13 +476,48 @@ export default { const codeTrimmed = code.trim(); const index = bandCodeIndexMap.get(codeTrimmed); if (index !== undefined) { - integratedDataMap.get(key).bandCodes[index] = { growId: item.growId, permission: item.permission ,isMajorPosition:item.isMajorPosition ,growName:item.growName }; + integratedDataMap.get(key).bandCodes[index] = { growId: item.growId, permission: item.permission ,isMajorPosition:item.isMajorPosition ,growName:item.growName ,colspan: item.colspan }; } }); }); const integratedDataArray = Array.from(integratedDataMap.values()); - - console.log(integratedDataArray,'integratedDataArray') + const mergeById = (array) => { + const result = []; + let currentGroup = null; + + array.forEach(item => { + if (item === null) { + if (currentGroup && currentGroup.growId !== null) { + result.push(currentGroup); + currentGroup = null; + } + if (!currentGroup) { + currentGroup = { growId: null, number: 1, ...item }; + } else { + currentGroup.number++; + } + } else { + if (!currentGroup || currentGroup.growId !== item.growId) { + if (currentGroup) { + result.push(currentGroup); + } + currentGroup = { growId: item.growId, number: 1, ...item }; + } else { + currentGroup.number++; + } + } + }); + if (currentGroup) { + result.push(currentGroup); + } + + return result; + }; + integratedDataArray.forEach(item => { + item.bandCodes = mergeById(item.bandCodes); + }); + + console.log(integratedDataArray, 'integratedDataArray'); return integratedDataArray; }, toggleFlag() {