Browse Source

1.回档PK模式 √

Changpeng Duan 5 years ago
parent
commit
00c615e751
5 changed files with 145 additions and 144 deletions
  1. 18 18
      tv/src/views/2pkRank.vue
  2. 25 25
      tv/src/views/3pkRank.vue
  3. 44 43
      tv/src/views/pk.vue
  4. 57 57
      tv/src/views/threepk.vue
  5. 1 1
      tv/需求修改和debug.md

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

@@ -204,24 +204,24 @@
                     blueSum += parseFloat(item.Ck.toFixed(1));
                     // that.successCalc(item);
                 });
-                // 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.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;

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

@@ -295,33 +295,33 @@
                     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 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},

+ 44 - 43
tv/src/views/pk.vue

@@ -465,61 +465,62 @@
                 Rs.blueUnite.map(function (item, t) {
                     blueSum += parseFloat(item.Ck.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);
+                that.redSum = redSum.toFixed(1);
+                that.blueSum = blueSum.toFixed(1);
+
+
+
+                // 进度条 FormatCk
+                let redFmtSum = 0;
+                let blueFmtSum = 0;
+                Rs.redUnite.map(function (item, t) {
+                    redFmtSum += parseFloat(item.FormatCk);
+                });
+                Rs.blueUnite.map(function (item, t) {
+                    blueFmtSum +=  parseFloat(item.FormatCk);
+                });
+
+                // pkVal
+                let sumMax = parseFloat(redFmtSum) + parseFloat(blueFmtSum);
+
+                // 当为0时均分
+                if (sumMax == 0) {
+                    that.pkVal = '50%';
                 } else {
-                    that.blueSum = 0
+                    // 限制最大
+                    let pkval = parseInt((redFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((redFmtSum / sumMax) * 100);
+                    console.log(pkval);
+                    that.pkVal = pkval + '%';
                 }
+
+                // // 获取人数 计算人均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;
 
-                // 进度条 FormatCk
-                // let redFmtSum = 0;
-                // let blueFmtSum = 0;
-                // Rs.redUnite.map(function (item, t) {
-                //     redFmtSum += parseFloat(item.FormatCk);
-                // });
-                // Rs.blueUnite.map(function (item, t) {
-                //     blueFmtSum +=  parseFloat(item.FormatCk);
-                // });
-                //
-                // // pkVal
-                // let sumMax = parseFloat(redFmtSum) + parseFloat(blueFmtSum);
-                //
+                // // pkVal ***进度条对比按照人均显示
+                // let sumMax = parseFloat(that.redSum) + parseFloat(that.blueSum);
                 // // 当为0时均分
                 // if (sumMax == 0) {
                 //     that.pkVal = '50%';
                 // } else {
                 //     // 限制最大
-                //     let pkval = parseInt((redFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((redFmtSum / sumMax) * 100);
-                //     console.log(pkval);
+                //     let pkval = parseInt((that.redSum / sumMax) * 100) > 100 ? 100 : parseInt((that.redSum / sumMax) * 100);
                 //     that.pkVal = pkval + '%';
                 // }
-
-
-                // pkVal ***进度条对比按照人均显示
-                let sumMax = parseFloat(that.redSum) + parseFloat(that.blueSum);
-                // 当为0时均分
-                if (sumMax == 0) {
-                    that.pkVal = '50%';
-                } else {
-                    // 限制最大
-                    let pkval = parseInt((that.redSum / sumMax) * 100) > 100 ? 100 : parseInt((that.redSum / sumMax) * 100);
-                    that.pkVal = pkval + '%';
-                }
             },
             // 获取上课学生信息
             GetgetUserList() {

+ 57 - 57
tv/src/views/threepk.vue

@@ -469,75 +469,75 @@
                 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);
+
+                // 进度条 FormatCk
+                let redFmtSum = 0;
+                let blueFmtSum = 0;
+                let yellowFmtSum = 0;
+                Rs.redUnite.map(function (item, t) {
+                    redFmtSum += item.FormatCk
+                });
+                Rs.blueUnite.map(function (item, t) {
+                    blueFmtSum += item.FormatCk
+                });
+                Rs.yellowUnite.map(function (item, t) {
+                    yellowFmtSum += item.FormatCk
+                });
 
-                // 获取人数 计算人均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
-                }
+                // pkVal
+                let sumMax = redFmtSum + blueFmtSum + yellowFmtSum;
 
-                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);
+                // 当为0时均分
+                if (sumMax == 0) {
+                    that.pkVal = '33.33%';
+                    that.yellowVal = '33.33%';
                 } else {
-                    that.yellowSum = 0
+                    // 限制最大
+                    let pkval = parseInt((redFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((redFmtSum / sumMax) * 100);
+                    let yellowVal = parseInt((yellowFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((yellowFmtSum / sumMax) * 100);
+                    that.pkVal = pkval.toFixed(1) + '%';
+                    that.yellowVal = yellowVal.toFixed(1) + '%';
                 }
 
-                // // 进度条 FormatCk
-                // let redFmtSum = 0;
-                // let blueFmtSum = 0;
-                // let yellowFmtSum = 0;
-                // Rs.redUnite.map(function (item, t) {
-                //     redFmtSum += item.FormatCk
-                // });
-                // Rs.blueUnite.map(function (item, t) {
-                //     blueFmtSum += item.FormatCk
-                // });
-                // Rs.yellowUnite.map(function (item, t) {
-                //     yellowFmtSum += item.FormatCk
-                // });
-                //
-                // // pkVal
-                // let sumMax = redFmtSum + blueFmtSum + yellowFmtSum;
+                // 获取人数 计算人均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 sumMax = parseFloat(that.redSum) + parseFloat(that.blueSum) + parseFloat(that.yellowSum);
                 // // 当为0时均分
                 // if (sumMax == 0) {
-                //     that.pkVal = '33.33%';
+                //     that.pkVal = '50%';
                 //     that.yellowVal = '33.33%';
                 // } else {
                 //     // 限制最大
-                //     let pkval = parseInt((redFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((redFmtSum / sumMax) * 100);
-                //     let yellowVal = parseInt((yellowFmtSum / sumMax) * 100) > 100 ? 100 : parseInt((yellowFmtSum / sumMax) * 100);
-                //     that.pkVal = pkval.toFixed(1) + '%';
-                //     that.yellowVal = yellowVal.toFixed(1) + '%';
+                //     let pkval = parseInt((that.redSum / sumMax) * 100) > 100 ? 100 : parseInt((that.redSum / sumMax) * 100);
+                //     let yellowVal = parseInt((that.yellowSum / sumMax) * 100) > 100 ? 100 : parseInt((that.yellowSum / sumMax) * 100);
+                //     that.pkVal = pkval + '%';
+                //     that.yellowVal = yellowVal + '%';
                 // }
-
-                let sumMax = parseFloat(that.redSum) + parseFloat(that.blueSum) + parseFloat(that.yellowSum);
-                // 当为0时均分
-                if (sumMax == 0) {
-                    that.pkVal = '50%';
-                    that.yellowVal = '33.33%';
-                } else {
-                    // 限制最大
-                    let pkval = parseInt((that.redSum / sumMax) * 100) > 100 ? 100 : parseInt((that.redSum / sumMax) * 100);
-                    let yellowVal = parseInt((that.yellowSum / sumMax) * 100) > 100 ? 100 : parseInt((that.yellowSum / sumMax) * 100);
-                    that.pkVal = pkval + '%';
-                    that.yellowVal = yellowVal + '%';
-                }
             },
             // 获取上课学生信息
             GetgetUserList() {

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

@@ -155,6 +155,6 @@ TODO 欢迎私有心率带同学来上课
 
 ==================
 12/25
-1.回档PK模式
+1.回档PK模式