This commit is contained in:
zhangsir
2024-06-26 11:09:29 +08:00
parent b973ebccc5
commit 1e28aa139f
2 changed files with 82 additions and 12 deletions

View File

@@ -25,16 +25,16 @@
<view class="table-container"> <view class="table-container">
<table width="100%"> <table width="100%">
<thead> <thead>
<tr style="background: #F0F6FC;"> <tr style="background: #F0F6FC;display: flex;align-items: center;">
<th class="first" align="center"><view class="text"> <th class="first" align="center"><view class="text">
</view></th> </view></th>
<th v-for="item in titleList" align="center">{{ item.title }}</th> <th class="item1" v-for="item in titleList" align="center">{{ item.title }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="item,index in preparedData" :key="index"> <tr style="display: flex;align-items: center;" v-for="item,index in preparedData" :key="index">
<td class="first" align="center"><view class="text">{{ item.isOtherPosition == 1 ? item.positionName + '(' + item.organizationName + ')' : item.positionName }}</view></td> <td class="first" align="center"><view class="text">{{ item.isOtherPosition == 1 ? item.positionName + '(' + item.organizationName + ')' : item.positionName }}</view></td>
<td align="center" v-for="t,i in item.bandCodes"> <td :style="{width: 222 * t.number + 'rpx'}" class="item" align="center" v-for="t,i in item.bandCodes">
<image <image
v-if="(t && t.isMajorPosition) " v-if="(t && t.isMajorPosition) "
src="@/static/images/learnpath/thispath.png" src="@/static/images/learnpath/thispath.png"
@@ -150,6 +150,41 @@
}); });
}); });
const integratedDataArray = Array.from(integratedDataMap.values()); const integratedDataArray = Array.from(integratedDataMap.values());
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') console.log(integratedDataArray,'integratedDataArray')
return integratedDataArray; return integratedDataArray;
}, },
@@ -176,22 +211,23 @@
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border: 2rpx solid #F0F6FC;
} }
th { /* th {
padding: 12px 20px; padding: 12px 20px;
text-align: center; text-align: center;
border: 2rpx solid #F0F6FC; border: 2rpx solid #F0F6FC;
background: #F0F6FC; background: #F0F6FC;
} } */
td{ /* td{
padding: 12px 16px; padding: 12px 16px;
text-align: center; text-align: center;
border: 2rpx solid #F0F6FC; border: 2rpx solid #F0F6FC;
color: #333333; color: #333333;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
} } */
th { th {
font-weight: bold; font-weight: bold;
@@ -205,7 +241,36 @@
border-collapse: collapse; border-collapse: collapse;
} }
} }
.item1{
/* padding: 12px 20px; */
width: 220rpx;
min-height: 100rpx;
text-align: center;
border: 2rpx solid #F0F6FC;
background: #F0F6FC;
font-weight: bold;
color: #387DF7;
font-weight: bold;
border-collapse: collapse;
display: flex;
justify-content: center;
align-items: center;
}
.item{
width: 220rpx;
min-height: 120rpx;
text-align: center;
border: 2rpx solid #F0F6FC;
border-bottom: none;
background-color: #ffffff;
color: #333333;
font-weight: 400;
font-size: 28rpx;
border-collapse: collapse;
display: flex;
justify-content: center;
align-items: center;
}
tbody tr:nth-child(odd) { tbody tr:nth-child(odd) {
background-color: #ffffff; background-color: #ffffff;
} }

View File

@@ -284,7 +284,7 @@
<view class="item_text"> <view class="item_text">
本功能针对学员所在组织岗位职级自动匹配成长路径完成本路径方可晋升 本功能针对学员所在组织岗位职级自动匹配成长路径完成本路径方可晋升
</view> </view>
<view class="item_btn" @click="outLearnModal"> <view class="item_btn" @click="learnModal = false">
我已阅读 我已阅读
</view> </view>
<view class="item_check"> <view class="item_check">
@@ -444,6 +444,11 @@
$this.loadStatus = 'noMore'; $this.loadStatus = 'noMore';
}, 500); }, 500);
}, },
watch: {
checked(){
this.outLearnModal()
}
},
methods: { methods: {
goLearn() { goLearn() {
uni.navigateTo({ uni.navigateTo({
@@ -465,7 +470,7 @@
this.checked = value this.checked = value
}, },
outLearnModal() { outLearnModal() {
this.learnModal = false // this.learnModal = false
localStorage.setItem("checkedTrue",!this.checked) localStorage.setItem("checkedTrue",!this.checked)
}, },
reSetList() { reSetList() {