|
@@ -295,14 +295,50 @@
|
|
|
{name: "blue", val: that.blueSum},
|
|
{name: "blue", val: that.blueSum},
|
|
|
{name: "yellow", val: that.yellowSum},
|
|
{name: "yellow", val: that.yellowSum},
|
|
|
];
|
|
];
|
|
|
- that.getUnitRank(res, PlanId);
|
|
|
|
|
|
|
+ that.getUnitRank(res, PlanId,Rs);
|
|
|
|
|
+ },
|
|
|
|
|
+ getWhoWin(redUnite, blueUnite, yellowUnite, groupNo) {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ if (groupNo == 1) {
|
|
|
|
|
+ redUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 1);
|
|
|
|
|
+ });
|
|
|
|
|
+ blueUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 0);
|
|
|
|
|
+ });
|
|
|
|
|
+ yellowUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 0);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (groupNo == 2) {
|
|
|
|
|
+ redUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 0);
|
|
|
|
|
+ });
|
|
|
|
|
+ blueUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 1);
|
|
|
|
|
+ });
|
|
|
|
|
+ yellowUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 0);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (groupNo == 3) {
|
|
|
|
|
+ redUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 0);
|
|
|
|
|
+ });
|
|
|
|
|
+ blueUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 0);
|
|
|
|
|
+ });
|
|
|
|
|
+ yellowUnite.map(function (item, t) {
|
|
|
|
|
+ that.successCalc(item, 1);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 插入胜率结果
|
|
// 插入胜率结果
|
|
|
- successCalc(item) {
|
|
|
|
|
- if (item.PkTotalnum == 0 || item.PkSucessnum == 0) {
|
|
|
|
|
|
|
+ successCalc(item,Victorl ) {
|
|
|
|
|
+ // item.success = '胜' + (parseInt(item.PkSucessnum) + parseInt(Victorl)) + ' 总:' + (parseInt(item.PkTotalnum) + 1) + '结' + (parseFloat(parseInt(item.PkSucessnum) + parseInt(Victorl)) / (parseInt(item.PkTotalnum) + 1)) * 100
|
|
|
|
|
+
|
|
|
|
|
+ if (parseInt(item.PkTotalnum + Victorl) == 0) {
|
|
|
item.success = 0;
|
|
item.success = 0;
|
|
|
} else {
|
|
} else {
|
|
|
- let res = (parseFloat(parseFloat(item.PkSucessnum) / parseFloat(item.PkTotalnum)) * 100);
|
|
|
|
|
|
|
+ let res = (parseFloat(parseInt(item.PkSucessnum) + parseInt(Victorl)) / (parseInt(item.PkTotalnum) + 1)) * 100;
|
|
|
if (res >= 100) {
|
|
if (res >= 100) {
|
|
|
item.success = 100;
|
|
item.success = 100;
|
|
|
} else {
|
|
} else {
|
|
@@ -311,7 +347,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 结果排序
|
|
// 结果排序
|
|
|
- getUnitRank(res, PlanId) {
|
|
|
|
|
|
|
+ getUnitRank(res, PlanId,Rs) {
|
|
|
let that = this;//这个that不要删
|
|
let that = this;//这个that不要删
|
|
|
let sum = res.sort(function (a, b) {
|
|
let sum = res.sort(function (a, b) {
|
|
|
return b.val - a.val;
|
|
return b.val - a.val;
|
|
@@ -335,7 +371,10 @@
|
|
|
groupNo = 3;
|
|
groupNo = 3;
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
|
|
+ // 上报本场胜率
|
|
|
that.PostAddPkInfo(PlanId, groupNo);
|
|
that.PostAddPkInfo(PlanId, groupNo);
|
|
|
|
|
+ // 计算本场胜率
|
|
|
|
|
+ that.getWhoWin(Rs.redUnite, Rs.blueUnite,Rs.yellowUnite, groupNo);
|
|
|
},
|
|
},
|
|
|
getClassUserRank() {
|
|
getClassUserRank() {
|
|
|
let that = this;
|
|
let that = this;
|
|
@@ -367,6 +406,7 @@
|
|
|
// this.students.CkSort = json.Rs.CkSort;
|
|
// this.students.CkSort = json.Rs.CkSort;
|
|
|
// this.students.CalSort = json.Rs.CalSort;
|
|
// this.students.CalSort = json.Rs.CalSort;
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ this.jumpWait(10);
|
|
|
if (json.Code == '999') {
|
|
if (json.Code == '999') {
|
|
|
// that.$router.push({path: '/'});
|
|
// that.$router.push({path: '/'});
|
|
|
} else {
|
|
} else {
|
|
@@ -390,7 +430,8 @@
|
|
|
if (json.Code == 0) {
|
|
if (json.Code == 0) {
|
|
|
console.log('竞技课程结果上传成功dpid:' + dpId + ' groupNo:' + groupNo);
|
|
console.log('竞技课程结果上传成功dpid:' + dpId + ' groupNo:' + groupNo);
|
|
|
} else {
|
|
} else {
|
|
|
- that.$message.error(json.Memo);
|
|
|
|
|
|
|
+ console.log(json.Memo);
|
|
|
|
|
+ // that.$message.error(json.Memo);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -694,11 +735,13 @@
|
|
|
|
|
|
|
|
li .CLEscore em {
|
|
li .CLEscore em {
|
|
|
font-size: 0.3rem;
|
|
font-size: 0.3rem;
|
|
|
|
|
+ /*font-size: 0;*/
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
li .CLEscore span {
|
|
li .CLEscore span {
|
|
|
padding-left: 0.1rem;
|
|
padding-left: 0.1rem;
|
|
|
font-size: 0.3rem;
|
|
font-size: 0.3rem;
|
|
|
|
|
+ /*font-size: 12px;*/
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
li .CKscore {
|
|
li .CKscore {
|