提交 9fab0aa7 authored 作者: lihuihui's avatar lihuihui

Merge branch 'vite' of https://gitlab.ezijing.com/ezijing/x-learn into vite

......@@ -22,7 +22,7 @@
<el-option v-for="item in dataInfo.class_map" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<el-button type="text" style="margin-left: 10px" @click="$refs.html2Pdf.generatePdf()">导出pdf</el-button>
<el-button type="text" style="margin-left: 10px" @click="$refs.html2Pdf.generatePdf()">导出PDF</el-button>
</div>
</div>
......
......@@ -14,6 +14,19 @@
<template v-slot:table-operate="{ row }">
<el-button type="text" size="mini" @click="toExamData(row)">查看</el-button>
</template>
<template #footer>
<el-pagination
class="table-list-pagination"
layout="total, prev, pager, next, sizes, jumper"
:page-sizes="[10, 20, 30, 50, 100]"
:page-size="queryInfo.pagesize"
:total="total"
:current-page="queryInfo.pagenum"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
>
</el-pagination>
</template>
</app-list>
</app-container>
</template>
......@@ -23,9 +36,14 @@ import { getClassDetail } from '../api'
export default {
data() {
return {
end: '',
tableData: [],
total: 1,
callList: [],
queryInfo: {
query: ''
query: '',
pagenum: 1,
pagesize: 10
}
}
},
......@@ -33,6 +51,7 @@ export default {
// 列表配置
tableOptions() {
return {
hasPagination: false,
remote: {
httpRequest: getClassDetail,
callback: this.callback,
......@@ -74,9 +93,28 @@ export default {
}
},
methods: {
handleSizeChange(val) {
this.queryInfo.pagesize = val
console.log(val, 'handleSizeChange')
this.$refs.list.dataList = this.callList.slice(
(this.queryInfo.pagenum - 1) * this.queryInfo.pagesize,
this.queryInfo.pagenum * this.queryInfo.pagesize
)
},
handleCurrentChange(val) {
console.log(val, 'handleCurrentChange')
this.queryInfo.pagenum = val
this.$refs.list.dataList = this.callList.slice(
(this.queryInfo.pagenum - 1) * this.queryInfo.pagesize,
this.queryInfo.pagenum * this.queryInfo.pagesize
)
},
callback(val) {
this.total = val.total
this.callList = val.list
console.log(val.list, 'val')
console.log(val, '999')
// console.log(val.list, 'val')
return this.callList
},
// 搜索
......@@ -119,3 +157,9 @@ export default {
}
}
</script>
<style lang="scss" scoped>
::v-deep .table-list-ft {
display: flex;
justify-content: flex-end;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论