diff --git a/src/views/study/GrowthPath.vue b/src/views/study/GrowthPath.vue index 7ceac562..6f89cb3c 100644 --- a/src/views/study/GrowthPath.vue +++ b/src/views/study/GrowthPath.vue @@ -193,17 +193,17 @@ 当前路径
- + 其他路径
- + 其他路径(无权限)
- - - + + +
+
+
+
{{ title.title }}
+
+
+
+
+
{{ item.isOtherPosition == 1 ? item.positionName + '(' + item.organizationName + ')' : item.positionName }}
+
+
+
+ + + + +
+
+
+
@@ -264,7 +258,7 @@
- +
继续学习之旅
@@ -409,6 +403,9 @@ export default { FAEStatusL: 0, salesManagement: 1 }], + pathData: [], + titleList: [], + preparedData: [], drawer: false, activeName: 'first', }; @@ -440,10 +437,49 @@ export default { } }) getFullJobPath().then(res=>{ - console.log(res,'res') + if(res.code == 200){ + this.pathData = res.data + this.titleList = this.pathData.allBandCodeList + this.preparedData = this.integrateTableData(this.pathData); + this.titleList = this.titleList.map(item=>({ + title: item, + })) + this.titleList.unshift({ + title: '' + }) + // console.log(this.pathData.growFullPositionPathBoItemList,'pathData') + console.log(this.titleList,'titleList') + } }) }, methods: { + integrateTableData(data) { + const { growFullPositionPathBoItemList, allBandCodeList } = data; + const bandCodeIndexMap = new Map(allBandCodeList.map((code, index) => [code, index])); + const integratedDataMap = new Map(); + growFullPositionPathBoItemList.flat().forEach(item => { + const key = `${item.positionName}-${item.organizationName}-${item.isOtherPosition}`; + + if (!integratedDataMap.has(key)) { + integratedDataMap.set(key, { + positionName: item.positionName, + organizationName: item.organizationName, + isOtherPosition: item.isOtherPosition, + bandCodes: new Array(allBandCodeList.length).fill(null), + }); + } + item.bandCodes.split(',').forEach(code => { + 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 }; + } + }); + }); + const integratedDataArray = Array.from(integratedDataMap.values()); + console.log(integratedDataArray,'integratedDataArray') + return integratedDataArray; + }, toggleFlag() { this.flagToggle = this.flagToggle === 2 ? 3 : 2; this.flagToggleTwo = this.flagToggleTwo === 2 ? 3 : 2; @@ -682,6 +718,54 @@ export default {