第十次课后作业

📅 2026/7/7 10:33:06
第十次课后作业
分页显示在前端代码添加分页控制实现显示templatedivclasspaginationel-paginationsize-changehandleSizeChangecurrent-changehandleCurrentChange:current-pagecurrentPage:page-sizes[10, 20, 30, 40]:page-size10layouttotal, sizes, prev, pager, next, jumper:totalfilteredUsers.length/el-pagination/div/template同时要增加计算属性以及方法后端三层架构PageBean用以封装分页查询结果PageService用以逻辑处理PageController用以接受请求返回结果packagecom.example.myweb.controller;// import javax.naming.spi.DirStateFactory.Result;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.web.bind.annotation.RestController;importcom.example.myweb.service.PageService;importcom.example.myweb.service.ResultVO;importcom.example.myweb.pojo.PageBean;importorg.springframework.web.bind.annotation.GetMapping;importorg.springframework.web.bind.annotation.RequestParam;importlombok.extern.slf4j.Slf4j;Slf4jRestControllerpublicclassPageController{AutowiredprivatePageServicepageService;// 请求的样式例/?page1pageSize10GetMapping(/users)//axios方法publicResultVOPageBeanpage(RequestParam(defaultValue1)Integerpage,RequestParam(defaultValue10)IntegerpageSize){log.info(分页查询参数{},{},page,pageSize);// 调用service层的分页查询方法PageBeanpageBeanpageService.page(page,pageSize);returnResultVO.success(pageBean);}}其他变动将页面的新建用户按钮跳转注册页面链接取消更改为点击则在页面内弹窗实现新建效果如下