|
|
|
@ -7,6 +7,10 @@
|
|
|
|
|
.current-classify{ |
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
} |
|
|
|
|
.classify{ |
|
|
|
|
height:85%; |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
<div id="classify" v-cloak> |
|
|
|
|
<div class="ui modal classify"> |
|
|
|
@ -54,6 +58,7 @@
|
|
|
|
|
<el-pagination |
|
|
|
|
@current-change="handlePageChange" |
|
|
|
|
layout="prev, pager, next" |
|
|
|
|
:current-page.sync="currentPage" |
|
|
|
|
:total="problemCount"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
@ -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(); |
|
|
|
|