| @@ -32,7 +32,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -56,7 +56,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -89,7 +89,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -122,7 +122,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -370,14 +370,17 @@ | |||
| // 当为全部时 | |||
| this['newlisttabinfo'+index]=[] | |||
| // 当选择全部时 | |||
| let arr=[] | |||
| // 当两个都选择的时候 | |||
| result.map(item=>{ | |||
| let obj={} | |||
| obj.name=item.houseName | |||
| obj.zxl=item.data | |||
| this['newlisttabinfo'+index].push(obj) | |||
| arr.push(obj) | |||
| }) | |||
| arr=this.dealData(arr) | |||
| this['newlisttabinfo'+index]=arr | |||
| }) | |||
| }, | |||
| // 获取销奖能力 | |||
| @@ -431,7 +434,28 @@ | |||
| uni.navigateTo({ | |||
| url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}` | |||
| }); | |||
| } | |||
| }, | |||
| // 定义一个公共方法对数据进行处理 | |||
| dealData(arr){ | |||
| // 获取最大值 | |||
| let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3 | |||
| // console.log(num) | |||
| if(num>100){ | |||
| // 获取最大值的下标 | |||
| // let idx=arr.findIndex(item=>item.zxl==num) | |||
| // console.log(idx,123) | |||
| arr.map(item=>{ | |||
| item.zxl1=Math.floor(item.zxl/num*100) | |||
| }) | |||
| // console.log(arr) | |||
| return arr | |||
| }else{ | |||
| arr.map(item=>{ | |||
| item.zxl1=item.zxl | |||
| }) | |||
| return arr | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||
| @@ -74,7 +74,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -120,7 +120,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -166,7 +166,7 @@ | |||
| <view class="jindu-boxche"> | |||
| <view class="jindu-name">{{item.name.substring(0, 4)}}</view> | |||
| <view style="width: 440rpx;margin-left: 10rpx;"> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress> | |||
| <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress> | |||
| </view> | |||
| <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view> | |||
| </view> | |||
| @@ -795,6 +795,7 @@ | |||
| // 先处理牌名数据,需要进行判断全部还是单个 | |||
| // 当为全部时 | |||
| this['newlisttabinfo'+index]=[] | |||
| let arr=[] | |||
| // 当选择全部时 | |||
| if(!this.staff1.value&&!this.staff2.value){ | |||
| // console.log(1) | |||
| @@ -802,8 +803,11 @@ | |||
| let obj={} | |||
| obj.name=item.deptName | |||
| obj.zxl=item.data | |||
| this['newlisttabinfo'+index].push(obj) | |||
| arr.push(obj) | |||
| }) | |||
| arr=this.dealData(arr) | |||
| this['newlisttabinfo'+index]=arr | |||
| } | |||
| // 当选择只有一个时 | |||
| else if(this.staff1.value&&!this.staff2.value){ | |||
| @@ -812,7 +816,7 @@ | |||
| let obj={} | |||
| obj.name=item.deptName | |||
| obj.zxl=item.data | |||
| this['newlisttabinfo'+index].push(obj) | |||
| arr.push(obj) | |||
| }) | |||
| // 判断是否显示平均 | |||
| // 如果显示对比 | |||
| @@ -821,9 +825,11 @@ | |||
| let obj={} | |||
| obj.name='平均' | |||
| obj.zxl=item.data | |||
| this['newlisttabinfo'+index].push(obj) | |||
| arr.push(obj) | |||
| }) | |||
| } | |||
| arr=this.dealData(arr) | |||
| this['newlisttabinfo'+index]=arr | |||
| }else{ | |||
| // console.log(3) | |||
| // 当两个都选择的时候 | |||
| @@ -831,14 +837,16 @@ | |||
| let obj={} | |||
| obj.name=item.deptName | |||
| obj.zxl=item.data | |||
| this['newlisttabinfo'+index].push(obj) | |||
| arr.push(obj) | |||
| }) | |||
| result[1].map(item=>{ | |||
| let obj={} | |||
| obj.name=item.deptName | |||
| obj.zxl=item.data | |||
| this['newlisttabinfo'+index].push(obj) | |||
| arr.push(obj) | |||
| }) | |||
| arr=this.dealData(arr) | |||
| this['newlisttabinfo'+index]=arr | |||
| } | |||
| }else{ | |||
| // 当选择趋势时 | |||
| @@ -1002,7 +1010,27 @@ | |||
| this.$forceUpdate() | |||
| }) | |||
| }, | |||
| // 定义一个公共方法对数据进行处理 | |||
| dealData(arr){ | |||
| // 获取最大值 | |||
| let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3 | |||
| // console.log(num) | |||
| if(num>100){ | |||
| // 获取最大值的下标 | |||
| // let idx=arr.findIndex(item=>item.zxl==num) | |||
| // console.log(idx,123) | |||
| arr.map(item=>{ | |||
| item.zxl1=Math.floor(item.zxl/num*100) | |||
| }) | |||
| // console.log(arr) | |||
| return arr | |||
| }else{ | |||
| arr.map(item=>{ | |||
| item.zxl1=item.zxl | |||
| }) | |||
| return arr | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||