Changpeng Duan 5 năm trước cách đây
mục cha
commit
621e17f167

+ 26 - 0
pc/src/views/heartEquip.vue

@@ -35,6 +35,7 @@
         <div class="change">
             <el-button @click="addMember" type="primary">新增心率设备</el-button>
             <el-button @click="editList">编辑心率设备</el-button>
+            <el-button type="success" @click="getAllPower" :loading="BtnGetAllPower" >全部设备电量</el-button>
             <!--<el-button @click="delList" type="danger">删除心率设备</el-button>-->
         </div>
         <div class="table">
@@ -192,6 +193,7 @@
             return {
                 activeName: 'comm',
                 dialogVisible: false,//其他dialog
+                BtnGetAllPower: false,//
                 dialogMemberVisible: false,//新增心率设备dialog
                 dialogLesson: false,//课时调整
                 dialogGift: false,//赠送课时调整
@@ -498,6 +500,30 @@
                     }
                 })
             },
+            getAllPower(){
+                let that = this;
+                that.BtnGetAllPower = true;
+                let param = {
+                    token: localStorage.token,
+                    shopId: localStorage.ShopId,
+                };
+                let postdata = qs.stringify(param);
+                GetHrSensorsPowerPercent(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // table 重载
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '电量获取成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                    that.BtnGetAllPower = false;
+                })
+            },
             // 删除
             pauseRowDel(row) {
                 let that = this;

+ 4 - 4
tv/src/Mock/index.js

@@ -371,7 +371,7 @@ let getClassStat = function (ClassOn, dp) {
     };
 };
 
-let t = 0;//0 is on 1 is off
+let t = 1;//0 is on 1 is off
 if (t == 0) {
     // 列表测试
     Mock.mock('/api/testTable', 'post', testTable());
@@ -381,7 +381,7 @@ if (t == 0) {
     let curheadapi = 'http://192.168.0.63:8080/';
 
     // 0: 下课 团课/私教/PK 的排名
-    let LessonClass = 3;
+    let LessonClass = 0;
     // 1:团课/私教
     // 2:竞技课2PK
     // 3:竞技课threepk
@@ -395,7 +395,7 @@ if (t == 0) {
     } else if (LessonClass == 2) {
         // 上2队PK课
         Mock.mock(curheadapi + 'ClassStatQuery', 'post', getClassStat(1, 2));
-        Mock.mock(curheadapi + 'UserListInfo', 'post', testStudent(12, 2,));
+        Mock.mock(curheadapi + 'UserListInfo', 'post', testStudent(3, 2,));
     } else if (LessonClass == 3) {
         // 上3队PK课
         Mock.mock(curheadapi + 'ClassStatQuery', 'post', getClassStat(1, 3));
@@ -414,7 +414,7 @@ if (t == 0) {
         } else if (LessonDp == 3) {
             Mock.mock(curheadapi + 'ClassStatQuery', 'post', getClassStat(0, 3));
             // 下课排名
-            Mock.mock(curheadapi + 'ClassUserRank', 'post', testStudent(1, 3));
+            Mock.mock(curheadapi + 'ClassUserRank', 'post', testStudent(6, 3));
         }
     }
 

+ 19 - 2
tv/src/views/2pkRank.vue

@@ -204,8 +204,25 @@
                     blueSum += parseFloat(item.Ck.toFixed(1));
                     // that.successCalc(item);
                 });
-                that.redSum = redSum.toFixed(1);
-                that.blueSum = blueSum.toFixed(1);
+                // that.redSum = redSum.toFixed(1);
+                // that.blueSum = blueSum.toFixed(1);
+
+                // 获取人数 计算人均CK
+                let redHuman = 0;
+                let blueHuman = 0;
+                if (Rs.redUnite != '') {
+                    redHuman = Rs.redUnite.length;
+                    that.redSum = parseFloat(redSum / redHuman).toFixed(1);
+                } else {
+                    that.redSum = 0
+                }
+                if (Rs.blueUnite != '') {
+                    blueHuman = Rs.blueUnite.length;
+                    that.blueSum = parseFloat(blueSum / blueHuman).toFixed(1);
+                } else {
+                    that.blueSum = 0
+                }
+
                 // 上报胜率结果
                 let groupNo = redSum >= blueSum ? 1 : 2;
                 that.PostAddPkInfo(PlanId, groupNo);

+ 28 - 3
tv/src/views/3pkRank.vue

@@ -295,9 +295,34 @@
                     yellowSum += parseFloat(item.Ck);
                     that.successCalc(item);
                 });
-                that.redSum = redSum.toFixed(1);
-                that.blueSum = blueSum.toFixed(1);
-                that.yellowSum = yellowSum.toFixed(1);
+                // that.redSum = redSum.toFixed(1);
+                // that.blueSum = blueSum.toFixed(1);
+                // that.yellowSum = yellowSum.toFixed(1);
+
+                // 获取人数 计算人均CK
+                let redHuman = 0;
+                let blueHuman = 0;
+                let yellowHuman = 0;
+                if (Rs.redUnite != '') {
+                    redHuman = Rs.redUnite.length;
+                    that.redSum = parseFloat(redSum / redHuman).toFixed(1);
+                } else {
+                    that.redSum = 0
+                }
+
+                if (Rs.blueUnite != '') {
+                    blueHuman = Rs.blueUnite.length;
+                    that.blueSum = parseFloat(blueSum / blueHuman).toFixed(1);
+                } else {
+                    that.blueSum = 0
+                }
+                if (Rs.yellowUnite != '') {
+                    yellowHuman = Rs.yellowUnite.length;
+                    that.yellowSum = parseFloat(yellowSum / yellowHuman).toFixed(1);
+                } else {
+                    that.yellowSum = 0
+                }
+
                 let res = [
                     {name: "red", val: that.redSum},
                     {name: "blue", val: that.blueSum},

+ 20 - 26
tv/src/views/pk.vue

@@ -457,6 +457,7 @@
                 let that = this;
                 let redSum = 0;
                 let blueSum = 0;
+
                 // that.redSum
                 Rs.redUnite.map(function (item, t) {
                     redSum += parseFloat(item.Ck.toFixed(1));
@@ -464,9 +465,24 @@
                 Rs.blueUnite.map(function (item, t) {
                     blueSum += parseFloat(item.Ck.toFixed(1));
                 });
-                that.redSum = redSum.toFixed(1);
-                that.blueSum = blueSum.toFixed(1);
-
+                // that.redSum = redSum.toFixed(1);
+                // that.blueSum = blueSum.toFixed(1);
+
+                // 获取人数 计算人均CK
+                let redHuman = 0;
+                let blueHuman = 0;
+                if (Rs.redUnite != '') {
+                    redHuman = Rs.redUnite.length;
+                    that.redSum = parseFloat(redSum / redHuman).toFixed(1);
+                } else {
+                    that.redSum = 0
+                }
+                if (Rs.blueUnite != '') {
+                    blueHuman = Rs.blueUnite.length;
+                    that.blueSum = parseFloat(blueSum / blueHuman).toFixed(1);
+                } else {
+                    that.blueSum = 0
+                }
                 // that.redSum = redSum;
                 // that.blueSum = blueSum;
 
@@ -564,28 +580,6 @@
                 let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
                 this.classInfo.endTime = h + m + s;
             },
-            // // 计算双方对抗强度加总
-            // CalcTeamCk() {
-            //     let that = this;
-            //     let Redsum = 0;
-            //     let Bluesum = 0;
-            //     let sumMax = 0;
-            //     if (that.Redstudents) {
-            //         that.Redstudents.map(function (i) {
-            //             Redsum = parseFloat(Redsum) + parseFloat(i.Ck)
-            //         });
-            //     }
-            //     if (that.Bluestudents) {
-            //         that.Bluestudents.map(function (i) {
-            //             Bluesum = parseFloat(Bluesum) + parseFloat(i.Ck)
-            //         });
-            //     }
-            //     that.classInfo.redSum = parseFloat(Redsum).toFixed(1);
-            //     that.classInfo.blueSum = parseFloat(Bluesum).toFixed(1);
-            //
-            //     sumMax = parseFloat(Redsum) + parseFloat(Bluesum);
-            //     that.classInfo.pkVal = (that.classInfo.redSum / sumMax) * 100 + '%';
-            // },
             // 当前课程状态
             curgetClassStat() {
                 let that = this;
@@ -1670,7 +1664,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        margin-top: 0.1rem;
+        margin-top: 0.2rem;
         width: 1rem !important;
         height: 1rem !important;
         border: none !important;

+ 26 - 3
tv/src/views/threepk.vue

@@ -469,10 +469,33 @@
                 Rs.yellowUnite.map(function (item, t) {
                     yellowSum += parseFloat(item.Ck.toFixed(1))
                 });
-                that.redSum = redSum.toFixed(1);
-                that.blueSum = blueSum.toFixed(1);
-                that.yellowSum = yellowSum.toFixed(1);
+                // that.redSum = redSum.toFixed(1);
+                // that.blueSum = blueSum.toFixed(1);
+                // that.yellowSum = yellowSum.toFixed(1);
+
+                // 获取人数 计算人均CK
+                let redHuman = 0;
+                let blueHuman = 0;
+                let yellowHuman = 0;
+                if (Rs.redUnite != '') {
+                    redHuman = Rs.redUnite.length;
+                    that.redSum = parseFloat(redSum / redHuman).toFixed(1);
+                } else {
+                    that.redSum = 0
+                }
 
+                if (Rs.blueUnite != '') {
+                    blueHuman = Rs.blueUnite.length;
+                    that.blueSum = parseFloat(blueSum / blueHuman).toFixed(1);
+                } else {
+                    that.blueSum = 0
+                }
+                if (Rs.yellowUnite != '') {
+                    yellowHuman = Rs.yellowUnite.length;
+                    that.yellowSum = parseFloat(yellowSum / yellowHuman).toFixed(1);
+                } else {
+                    that.yellowSum = 0
+                }
 
                 // 进度条 FormatCk
                 let redFmtSum = 0;

+ 2 - 2
tv/需求修改和debug.md

@@ -159,14 +159,14 @@ TODO 欢迎私有心率带同学来上课
 8.学员名字四个字兼容√ 
 9.2队PK 一个人的时候数字偏上了√ 
 2.  TV私有心率带标识在上课时显示(PK课试试能不能放得下√ 
-
+11. PK使用人均PK比较√ 
 
 
 
 5.  TV 数字火的样式
 6.  欢迎新同学,改样式
 10. todo PC统计报表
-11. PK使用人均PK比较
+