diff --git a/src/views/system/action/index.vue b/src/views/system/action/index.vue index 333630d..38d46a4 100644 --- a/src/views/system/action/index.vue +++ b/src/views/system/action/index.vue @@ -72,18 +72,34 @@ + + + + - + - @@ -117,6 +133,10 @@ export default { position: 0, // 标记位置 spanArr2: [], position2: 0, // 标记位置 + spanArr3: [], + position3: 0, // 标记位置 + spanArr4: [], + position4: 0, // 标记位置 //查询传值 queryParams: { pageNum: 1, @@ -138,6 +158,10 @@ export default { this.position = 0; this.spanArr2.push(1); this.position2 = 0; + this.spanArr3.push(1); + this.position3 = 0; + this.spanArr4.push(1); + this.position4 = 0; } else { // 判断当前元素与上一个元素是否相同 也就是判断 a 的值是否相同 if ( @@ -158,22 +182,45 @@ export default { this.actionlist[index].itemScoreAll == this.actionlist[index - 1].itemScoreAll ) { - this.spanArr2[this.position] += 1; + this.spanArr2[this.position2] += 1; this.spanArr2.push(0); // 下一个位置 给 0 } else { this.spanArr2.push(1); // 不相等下一个位置给 1 this.position2 = index; // 标记位置 设置为当前位置 } + + if ( + this.actionlist[index].rootCategoryScoreAll == + this.actionlist[index - 1].rootCategoryScoreAll && + this.actionlist[index].rootCategoryScoreAll == + this.actionlist[index - 1].rootCategoryScoreAll + ) { + this.spanArr3[this.position3] += 1; + this.spanArr3.push(0); // 下一个位置 给 0 + } else { + this.spanArr3.push(1); // 不相等下一个位置给 1 + this.position3 = index; // 标记位置 设置为当前位置 + } + + if ( + this.actionlist[index].nationalPhysiqueRank == + this.actionlist[index - 1].nationalPhysiqueRank && + this.actionlist[index].nationalPhysiqueRank == + this.actionlist[index - 1].nationalPhysiqueRank + ) { + this.spanArr4[this.position4] += 1; + this.spanArr4.push(0); // 下一个位置 给 0 + } else { + this.spanArr4.push(1); // 不相等下一个位置给 1 + this.position4 = index; // 标记位置 设置为当前位置 + } } }); - // console.log(this.spanArr); }, // 合并单元格 arraySpanMethod({ row, column, rowIndex, columnIndex }) { - // console.log(columnIndex); // 对第一列 相对字段 a 进行合并 if (columnIndex == 0) { - // console.log(this.spanArr); const _row = this.spanArr[rowIndex]; const _col = _row > 0 ? 1 : 0; return { @@ -182,7 +229,6 @@ export default { }; } if (columnIndex == 7) { - // console.log(this.spanArr2); const _row = this.spanArr2[rowIndex]; const _col = _row > 0 ? 1 : 0; return { @@ -190,14 +236,46 @@ export default { colspan: _col, }; } + if (columnIndex == 8) { + const _row = this.spanArr3[rowIndex]; + const _col = _row > 0 ? 1 : 0; + return { + rowspan: _row, + colspan: _col, + }; + } + if (columnIndex == 9) { + const _row = this.spanArr4[rowIndex]; + const _col = _row > 0 ? 1 : 0; + return { + rowspan: _row, + colspan: _col, + }; + } }, //动作发展检测 listActioninfo() { listAction(this.queryParams).then((res) => { + this.spanArr = []; + this.position = 0; + this.spanArr2 = []; + this.position2 = 0; + this.spanArr3 = []; + this.position3 = 0; + this.spanArr4 = []; + this.position4 = 0; if (!res.rows || res.rows == "") { this.itemshow2 = true; this.itemshow = false; } else { + // res.rows.forEach((e) => { + // if (e.rootCategoryScoreAll == null) { + // e.rootCategoryScoreAll = 0; + // } + // if (e.nationalPhysiqueRank == null) { + // e.nationalPhysiqueRank = 0; + // } + // }); // res.rows.itemCategoryList.forEach((e) => { // e.push(res.rows.categoryName); // }); @@ -205,12 +283,11 @@ export default { this.actionforeach(); this.itemshow = true; this.itemshow2 = false; - console.log(this.actionlist); + // console.log(this.actionlist); } }); }, itemlists(studentId, batchCode) { - console.log(studentId, batchCode); this.queryParams.studentId = studentId; this.queryParams.batchCode = batchCode; }, diff --git a/src/views/system/personalecharts/index.vue b/src/views/system/personalecharts/index.vue index 125024d..1a74243 100644 --- a/src/views/system/personalecharts/index.vue +++ b/src/views/system/personalecharts/index.vue @@ -1089,6 +1089,18 @@ + + + + { if (index == 0) { this.spanArr.push(1); this.position = 0; this.spanArr2.push(1); this.position2 = 0; + this.spanArr3.push(1); + this.position3 = 0; + this.spanArr4.push(1); + this.position4 = 0; } else { // 判断当前元素与上一个元素是否相同 也就是判断 a 的值是否相同 if ( @@ -1594,22 +1610,41 @@ export default { this.actionlist[index].itemScoreAll == this.actionlist[index - 1].itemScoreAll ) { - this.spanArr2[this.position] += 1; + this.spanArr2[this.position2] += 1; this.spanArr2.push(0); // 下一个位置 给 0 } else { this.spanArr2.push(1); // 不相等下一个位置给 1 this.position2 = index; // 标记位置 设置为当前位置 } + + if ( + this.actionlist[index].rootCategoryScoreAll == + this.actionlist[index - 1].rootCategoryScoreAll + ) { + this.spanArr3[this.position3] += 1; + this.spanArr3.push(0); // 下一个位置 给 0 + } else { + this.spanArr3.push(1); // 不相等下一个位置给 1 + this.position3 = index; // 标记位置 设置为当前位置 + } + + if ( + this.actionlist[index].nationalPhysiqueRank == + this.actionlist[index - 1].nationalPhysiqueRank + ) { + this.spanArr4[this.position4] += 1; + this.spanArr4.push(0); // 下一个位置 给 0 + } else { + this.spanArr4.push(1); // 不相等下一个位置给 1 + this.position4 = index; // 标记位置 设置为当前位置 + } } }); - // console.log(this.spanArr); }, // 合并单元格 arraySpanMethod({ row, column, rowIndex, columnIndex }) { - // console.log(columnIndex); // 对第一列 相对字段 a 进行合并 if (columnIndex == 0) { - // console.log(this.spanArr); const _row = this.spanArr[rowIndex]; const _col = _row > 0 ? 1 : 0; return { @@ -1626,11 +1661,37 @@ export default { colspan: _col, }; } + if (columnIndex == 8) { + // console.log(this.spanArr2); + const _row = this.spanArr3[rowIndex]; + const _col = _row > 0 ? 1 : 0; + return { + rowspan: _row, + colspan: _col, + }; + } + if (columnIndex == 9) { + // console.log(this.spanArr2); + const _row = this.spanArr4[rowIndex]; + const _col = _row > 0 ? 1 : 0; + return { + rowspan: _row, + colspan: _col, + }; + } }, //动作发展检测 listActioninfo() { setTimeout(() => { listAction(this.echartslist).then((res) => { + this.spanArr = []; + this.position = 0; + this.spanArr2 = []; + this.position2 = 0; + this.spanArr3 = []; + this.position3 = 0; + this.spanArr4 = []; + this.position4 = 0; if (!res.rows || res.rows == "") { } else { // res.rows.itemCategoryList.forEach((e) => { @@ -1638,7 +1699,6 @@ export default { // }); this.actionlist = res.rows; this.actionforeach(); - console.log(this.actionlist); } }); }, 300);