project page limit

This commit is contained in:
Captain.B 2020-02-18 14:06:47 +08:00
parent d5470c33c9
commit be1daa5e87
1 changed files with 29 additions and 2 deletions

View File

@ -24,6 +24,23 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div>
<el-row>
<el-col :span="22" :offset="1">
<div class="table-page">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[5, 10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</el-col>
</el-row>
</div>
</el-card> </el-card>
<el-dialog title="创建项目" :visible.sync="createVisible"> <el-dialog title="创建项目" :visible.sync="createVisible">
@ -58,6 +75,9 @@
condition: "", condition: "",
items: [], items: [],
form: {}, form: {},
currentPage: 1,
pageSize: 5,
total: 0,
rules: { rules: {
name: [ name: [
{required: true, message: '请输入项目名称', trigger: 'blur'}, {required: true, message: '请输入项目名称', trigger: 'blur'},
@ -115,10 +135,17 @@
}); });
}, },
list() { list() {
this.$post("/project/list/1/10", {}, (response) => { let url = "/project/list/" + this.currentPage + '/' + this.pageSize;
this.$post(url, {}, (response) => {
this.items = response.data; this.items = response.data;
}) })
} },
handleSizeChange(size) {
this.pageSize = size;
},
handleCurrentChange(current) {
this.currentPage = current;
},
} }
} }
</script> </script>