From 28bf8db26b5efbb27b033991fbf9a36f46edc6f1 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Mon, 22 Jul 2019 20:57:43 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=A4=AA=E5=A4=A7=E7=9A=84bug=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E6=89=93=E5=BC=80=E5=BC=B9=E6=A1=86=E5=90=8E?= =?UTF-8?q?=E9=A1=B5=E7=A0=81=E9=94=99=E4=B9=B1=E7=9A=84bug=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=98=E7=9B=AE=E9=80=89=E6=8B=A9=E5=90=8E?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E4=B9=8B=E5=89=8D=E9=80=89=E6=8B=A9=E7=9A=84?= =?UTF-8?q?=E9=A2=98=E7=9B=AE=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/admin_classify.ejs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/views/admin_classify.ejs b/views/admin_classify.ejs index d66b49e..85f0bf8 100644 --- a/views/admin_classify.ejs +++ b/views/admin_classify.ejs @@ -7,6 +7,10 @@ .current-classify{ margin-bottom: 20px; } + .classify{ + height:85%; + overflow: auto; + }
@@ -113,7 +118,8 @@ problemList: [], usedProblemId: [], multipleSelection: [], - problemCount: -1 + problemCount: -1, + currentPage:1 }, created: function() { this.getClassifyInfo(); @@ -126,7 +132,6 @@ url: '/api/pagination/allproblem', type: 'GET', success: function (data) { - console.log(data.problemInfo.count); that.problemCount = parseInt(data.problemInfo.count); }, error: function (XMLHttpRequest, textStatus, errorThrown) { @@ -180,7 +185,7 @@ }) }, handleSelectionChange(val) { - this.multipleSelection = val; + this.multipleSelection = this.multipleSelection.concat(val); }, getClassifyInfo: function() { let that = this; @@ -233,12 +238,11 @@ }, show: function(id){ let that = this; - console.log(id); this.getProblemPagination(1) if (id) { this.classifyId = id; - // this.getProblemPagination(1) this.getClassifyInfos(id); + this.currentPage = 1; } else { this.resetModal(); } @@ -257,10 +261,11 @@ name: this.classifyName, intro: this.classifyIntro, order: this.order, - problemIdArray: this.multipleSelection.map(function(item){ + problemIdArray: [...new Set(this.multipleSelection.map(function(item){ return item.id - }) + }))] } + console.log(obj.problemIdArray); if (this.classifyId === -1) { $.ajax({ url: '/api/practice/create', @@ -270,6 +275,7 @@ success: function (data) { if (data.error_code) { alert('创建失败'); + that.resetModal(); } else { alert('添加成功'); that.resetModal();