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