Pārlūkot izejas kodu

考勤记录页面修改

yanym 6 gadi atpakaļ
vecāks
revīzija
ecc1159b8a

+ 9 - 0
dorm-manager-wx/pages/teacher/statistics/statistics.js

@@ -144,6 +144,15 @@ Page({
 
   getChart: function(e) {
     const that = this;
+    let unAccessCountP = (that.data.totalInfo.unAccessCount / that.data.totalInfo.total).toFixed(2)*100;
+    let outP = (that.data.totalInfo.out / that.data.totalInfo.total).toFixed(2)*100;
+    let inP = (that.data.totalInfo.in / that.data.totalInfo.total).toFixed(2)*100;
+    let laterInP = (that.data.totalInfo.laterIn / that.data.totalInfo.total).toFixed(2)*100;
+    let unInP = (that.data.totalInfo.unIn / that.data.totalInfo.total).toFixed(2)*100;
+    let unOutP = (that.data.totalInfo.unOut / that.data.totalInfo.total).toFixed(2)*100;
+    that.setData({
+      'totalInfo.unAccessCountP': unAccessCountP
+    })
     if (that.data.totalInfo.total == 0) {
       ringChart = new wxCharts({
         animation: true,

+ 24 - 0
dorm-manager-wx/pages/teacher/statistics/statistics.wxml

@@ -52,6 +52,30 @@
         <view class="charts-icon1 charts-icon"></view>
         <view class="charts-data">全员人数{{totalInfo.total}}人</view>
       </view>
+      <view class="charts-line" wx:if='{{totalInfo.unAccessCount!=0}}'>
+        <view class="charts-icon2 charts-icon"></view>
+        <view class="charts-data">无进出记录人员{{totalInfo.unAccessCountP}}%</view>
+      </view>
+      <view class="charts-line" wx:if='{{totalInfo.out!=0}}'>
+        <view class="charts-icon3 charts-icon"></view>
+        <view class="charts-data">已出宿舍人员{{totalInfo.outP}}%</view>
+      </view>
+      <view class="charts-line" wx:if='{{totalInfo.in!=0}}'>
+        <view class="charts-icon4 charts-icon"></view>
+        <view class="charts-data">已归宿舍人员{{totalInfo.inP}}%</view>
+      </view>
+      <view class="charts-line" wx:if='{{totalInfo.laterIn!=0}}'>
+        <view class="charts-icon5 charts-icon"></view>
+        <view class="charts-data">晚归宿舍人员{{totalInfo.laterInP}}%</view>
+      </view>
+      <view class="charts-line" wx:if='{{totalInfo.unIn!=0}}'>
+        <view class="charts-icon6 charts-icon"></view>
+        <view class="charts-data">未归宿舍人员{{totalInfo.unInP}}%</view>
+      </view>
+      <view class="charts-line" wx:if='{{totalInfo.unOut!=0}}'>
+        <view class="charts-icon7 charts-icon"></view>
+        <view class="charts-data">未出宿舍人员{{totalInfo.unOutP}}%</view>
+      </view>
     </view>
     <view class="bottom">
       <view class="my-column my-align-c">

+ 21 - 3
dorm-manager-wx/pages/teacher/statistics/statistics.wxss

@@ -57,12 +57,11 @@ page {
 .charts-right {
   display: flex;
   flex-direction: column;
-  align-items: center;
   justify-content: space-around;
   padding: 60rpx 0rpx;
   position: absolute;
-  top: 20rpx;
-  right: 80rpx;
+  top: -20rpx;
+  right: 40rpx;
 }
 
 .charts-line {
@@ -71,6 +70,7 @@ page {
   height: 30rpx;
   font-size: 30rpx;
   color: #333;
+  margin-bottom: 6rpx;
 }
 
 .charts-icon {
@@ -82,6 +82,24 @@ page {
 .charts-icon1 {
   background: #6282f4;
 }
+.charts-icon2 {
+  background: #ed5c68;
+}
+.charts-icon3 {
+  background: #f5a786;
+}
+.charts-icon4 {
+  background: #7792f5;
+}
+.charts-icon5 {
+  background: #79bef4;
+}
+.charts-icon6 {
+  background: #5be0c1;
+}
+.charts-icon7 {
+  background: #ac91f7;
+}
 
 .charts-data {
   margin-left: 8rpx;