mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-14 05:16:46 +08:00
全路径
This commit is contained in:
@@ -6,3 +6,5 @@ export const taskList = (id) => ajax.get(`/manageApi/stu/grow/taskList?growId=${
|
||||
export const getAllPosition = () => ajax.get(`/manageApi/admin/thirdApi/getAllPosition`)
|
||||
// 获取职级
|
||||
export const getAllBandInfo = () => ajax.get(`/manageApi/admin/thirdApi/getAllBandInfo`)
|
||||
//全岗位路径
|
||||
export const getFullJobPath = () => ajax.get(`/manageApi/stu/grow/getFullJobPath`);
|
||||
@@ -14,116 +14,44 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<image class="img" src="../../static/images/learnpath/otherpath.png" mode=""></image>
|
||||
<text class="text">当前路径</text>
|
||||
<text class="text">其他路径</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<image class="img" src="../../static/images/learnpath/notpath.png" mode=""></image>
|
||||
<text class="text">当前路径</text>
|
||||
<text class="text">其他路径(无权限)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="table-container">
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr style="background: #F0F6FC;">
|
||||
<th class="first" align="center"><view class="text">
|
||||
name
|
||||
</view></th>
|
||||
<th align="center">Band1</th>
|
||||
<th align="center">Band2</th>
|
||||
<th align="center">Band3</th>
|
||||
<th align="center">Band4</th>
|
||||
<th align="center">Band5</th>
|
||||
<th v-for="item in titleList" align="center">{{ item.title }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in gridData" :key="row.id">
|
||||
<td class="first" align="center"><view class="text">{{ row.name }}</view></td>
|
||||
<td align="center">
|
||||
<tr 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 align="center" v-for="t,i in item.bandCodes">
|
||||
<image
|
||||
v-if="row.marketStatus === 0"
|
||||
v-if="(t && t.isMajorPosition) "
|
||||
src="@/static/images/learnpath/thispath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else-if="row.marketStatus === 1"
|
||||
v-else-if="(t && t.permission)"
|
||||
src="@/static/images/learnpath/otherpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
v-else-if="!(t && t.permission)"
|
||||
src="@/static/images/learnpath/notpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text v-else></text>
|
||||
</td>
|
||||
<td align="center">
|
||||
<image
|
||||
v-if="row.saleStatus === 0"
|
||||
src="@/static/images/learnpath/thispath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else-if="row.saleStatus === 1"
|
||||
src="@/static/images/learnpath/otherpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
src="@/static/images/learnpath/notpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</td>
|
||||
<td align="center">
|
||||
<image
|
||||
v-if="row.productStatus === 0"
|
||||
src="@/static/images/learnpath/thispath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else-if="row.productStatus === 1"
|
||||
src="@/static/images/learnpath/otherpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
src="@/static/images/learnpath/notpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</td>
|
||||
<td align="center">
|
||||
<image
|
||||
v-if="row.FAEStatusL === 0"
|
||||
src="@/static/images/learnpath/thispath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else-if="row.FAEStatusL === 1"
|
||||
src="@/static/images/learnpath/otherpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
src="@/static/images/learnpath/notpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</td>
|
||||
<td align="center">
|
||||
<image
|
||||
v-if="row.salesManagement === 0"
|
||||
src="@/static/images/learnpath/thispath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else-if="row.salesManagement === 1"
|
||||
src="@/static/images/learnpath/otherpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
src="@/static/images/learnpath/notpath.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -133,6 +61,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getFullJobPath } from "@/api/modules/growth.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -172,12 +101,55 @@
|
||||
FAEStatusL: 0,
|
||||
salesManagement: 1
|
||||
}],
|
||||
pathData: [],
|
||||
titleList: [],
|
||||
preparedData: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
getFullJobPath().then(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.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;
|
||||
},
|
||||
goSearch(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/learnPath/pathSearch'
|
||||
|
||||
Reference in New Issue
Block a user