From 7c532a4b681457aee930299dfed34d49ce263d9e Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Tue, 4 Jan 2022 18:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E6=A0=B8=E6=88=90=E7=BB=A9=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=A0=E9=99=A4=E4=B8=8E=E6=89=B9=E9=87=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/achievement/ass/index.vue | 31 +++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/pages/achievement/ass/index.vue b/src/pages/achievement/ass/index.vue index 63a19de..88aecf6 100644 --- a/src/pages/achievement/ass/index.vue +++ b/src/pages/achievement/ass/index.vue @@ -154,14 +154,14 @@ export default { this.avg = res.avgScore this.total = res.peopleNum let list = res.page.records; - if (res.page.records.length){ - this.assessmentId = res.page.records[0].assessmentId; - } - let score = 0; - list.map(n => { - n.class = this.className; - score += n.score; - }); + if (list.length > 0){ + this.assessmentId = res.page.records[0].assessmentId; + let score = 0; + list.map(n => { + n.class = this.className; + score += n.score; + }); + } this.listData = list; this.getChart(); } @@ -221,7 +221,6 @@ export default { }) .then(() => { let ids = [row.reportId] - console.log(ids) this.$post(`${this.api.deleteExperimentalReport}`,ids).then(res => { util.successMsg("删除成功"); this.getData(); @@ -233,18 +232,16 @@ export default { }, delAllData() { if (this.multipleSelection.length != "") { - let newArr = this.multipleSelection; - let delList = newArr.map(item => { - return `reportId=${item.reportId}`; - }); - let delList1 = newArr.map(item => { - return `recordId=${item.reportId}`; - }); this.$confirm("确定要删除吗?", "提示", { type: "warning" }) .then(() => { - this.$post(`${this.api.deleteReport}?${delList.join("&")}&${delList1.join("&")}`).then(res => { + let newArr = this.multipleSelection; + let ids = [] + for (var i=0;i { util.successMsg("删除成功"); this.getData(); }).catch(res => {