继续学习之旅
@@ -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 {