代码优化
This commit is contained in:
parent
e388221252
commit
46d723ec72
|
|
@ -31,8 +31,20 @@
|
|||
src="../../../static/images/img-phase-two/index_img_one_att.png"
|
||||
mode=""
|
||||
></image>
|
||||
<text>在场考勤率:{{ ((attPersonNum / einPersonNum) * 100).toFixed(2) }}%</text>
|
||||
<text>计划考勤率:{{ ((planAttNum / planPersonNum) * 100).toFixed(2) }}%</text>
|
||||
<text>
|
||||
在场考勤率:{{
|
||||
isNaN(((attPersonNum / einPersonNum) * 100).toFixed(2))
|
||||
? 0
|
||||
: ((attPersonNum / einPersonNum) * 100).toFixed(2)
|
||||
}}%
|
||||
</text>
|
||||
<text>
|
||||
计划考勤率:{{
|
||||
isNaN(((planAttNum / planPersonNum) * 100).toFixed(2))
|
||||
? 0
|
||||
: ((planAttNum / planPersonNum) * 100).toFixed(2)
|
||||
}}%
|
||||
</text>
|
||||
<text class="none-box">计划考勤率:20%</text>
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
|
@ -174,17 +186,27 @@
|
|||
<view class="person-content">
|
||||
<view @tap="onJumpColorLight(1)">
|
||||
<image class="person-img" src="../../../static/images/img-phase-two/index_green_light.png" mode=""></image>
|
||||
<text class="text-strong">{{ ((greenNum / colorAmount) * 100).toFixed(2) }}%</text>
|
||||
<text class="text-strong">
|
||||
{{
|
||||
isNaN(((greenNum / colorAmount) * 100).toFixed(2)) ? 0 : ((greenNum / colorAmount) * 100).toFixed(2)
|
||||
}}%
|
||||
</text>
|
||||
<text>{{ greenNum }}</text>
|
||||
</view>
|
||||
<view @tap="onJumpColorLight(2)">
|
||||
<image class="person-img" src="../../../static/images/img-phase-two/index_yellow_light.png" mode=""></image>
|
||||
<text class="text-strong">{{ ((yellowNum / colorAmount) * 100).toFixed(2) }}%</text>
|
||||
<text class="text-strong">
|
||||
{{
|
||||
isNaN(((yellowNum / colorAmount) * 100).toFixed(2)) ? 0 : ((yellowNum / colorAmount) * 100).toFixed(2)
|
||||
}}%
|
||||
</text>
|
||||
<text>{{ yellowNum }}</text>
|
||||
</view>
|
||||
<view @tap="onJumpColorLight(3)">
|
||||
<image class="person-img" src="../../../static/images/img-phase-two/index_red_light.png" mode=""></image>
|
||||
<text class="text-strong">{{ ((redNum / colorAmount) * 100).toFixed(2) }}%</text>
|
||||
<text class="text-strong">
|
||||
{{ isNaN(((redNum / colorAmount) * 100).toFixed(2)) ? 0 : ((redNum / colorAmount) * 100).toFixed(2) }}%
|
||||
</text>
|
||||
<text>{{ redNum }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -192,7 +214,9 @@
|
|||
<view class="gender-content">
|
||||
<view class="man-left">
|
||||
<view>
|
||||
<view>{{ ((maleNum / sexAmount) * 100).toFixed(2) }}%</view>
|
||||
<view>
|
||||
{{ isNaN(((maleNum / sexAmount) * 100).toFixed(2)) ? 0 : ((maleNum / sexAmount) * 100).toFixed(2) }}%
|
||||
</view>
|
||||
<view>男({{ maleNum }})</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -209,7 +233,11 @@
|
|||
style="margin-right: 30rpx; background-color: #fc8483"
|
||||
></view>
|
||||
<view>
|
||||
<view>{{ ((femaleNum / sexAmount) * 100).toFixed(2) }}%</view>
|
||||
<view>
|
||||
{{
|
||||
isNaN(((femaleNum / sexAmount) * 100).toFixed(2)) ? 0 : ((femaleNum / sexAmount) * 100).toFixed(2)
|
||||
}}%
|
||||
</view>
|
||||
<view>女({{ femaleNum }})</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -246,10 +274,19 @@
|
|||
|
||||
<view class="person-proportion">
|
||||
<text style="color: #04cdfa">
|
||||
固定占比{{ ((formalPersonNum / (formalPersonNum + temporaryPersonNum)) * 100).toFixed(2) }}%
|
||||
固定占比{{
|
||||
isNaN(((formalPersonNum / (formalPersonNum + temporaryPersonNum)) * 100).toFixed(2))
|
||||
? 0
|
||||
: ((formalPersonNum / (formalPersonNum + temporaryPersonNum)) * 100).toFixed(2)
|
||||
}}%
|
||||
</text>
|
||||
<text style="color: #fd8d01">
|
||||
流动占比 {{ ((temporaryPersonNum / (formalPersonNum + temporaryPersonNum)) * 100).toFixed(2) }}%
|
||||
流动占比
|
||||
{{
|
||||
isNaN(((temporaryPersonNum / (formalPersonNum + temporaryPersonNum)) * 100).toFixed(2))
|
||||
? 0
|
||||
: ((temporaryPersonNum / (formalPersonNum + temporaryPersonNum)) * 100).toFixed(2)
|
||||
}}%
|
||||
</text>
|
||||
</view>
|
||||
|
||||
|
|
@ -582,6 +619,8 @@ export default {
|
|||
const { data: res } = await getHomePageListApi({})
|
||||
console.log('首页数据', res)
|
||||
|
||||
if (!res) return
|
||||
|
||||
const { homePageBean, personAtt, workerMsgBean, proMsgBean } = res
|
||||
const { highRiskNum, mediumRiskNum, lowRiskNum, planPersonNum } = homePageBean
|
||||
const { buildProNum, prepareProNum, stopProNum, completeProNum } = proMsgBean
|
||||
|
|
|
|||
Loading…
Reference in New Issue