1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>分页查询</title> <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport"> <link rel="stylesheet" href="../plugins/elementui/index.css"> <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="../css/style.css"> </head> <body class="hold-transition"> <div id="app"> <div class="filter-container"> <el-input placeholder="项目编码/项目名称" v-model="pagination.queryString" style="width: 200px;" class="filter-item"></el-input> <el-button @click="handleCurrentChange(1)" class="dalfBut">查询</el-button> </div> <div class="box"> <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row> <el-table-column type="index" align="center" label="序号"></el-table-column> <el-table-column prop="code" label="项目编码" align="center"></el-table-column> <el-table-column prop="name" label="项目名称" align="center"></el-table-column> <el-table-column label="适用性别" align="center"> <template slot-scope="scope"> <span>{{ scope.row.sex == '0' ? '不限' : scope.row.sex == '1' ? '男' : '女'}}</span> </template> </el-table-column> <el-table-column prop="age" label="适用年龄" align="center"></el-table-column> <el-table-column prop="remark" label="项目说明" align="center"></el-table-column> <el-table-column label="操作" align="center"> <template slot-scope="scope"> <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> <el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button> </template> </el-table-column> </el-table> <div class="pagination-container"> <el-pagination class="pagiantion" <!--这里注释会出现问题,使用请删除--> @current-change="handleCurrentChange" :current-page="pagination.currentPage" :page-size="pagination.pageSize" layout="total, prev, pager, next, jumper" :total="pagination.total"> </el-pagination> </div> </div> </div>
</body>
<script src="../js/vue.js"></script> <script src="../plugins/elementui/index.js"></script> <script src="../js/axios-0.18.0.js"></script> <script> var vue = new Vue({ el: '#app', data: { pagination: { currentPage: 1, pageSize: 10, total: 0, queryString: null }, dataList: [], }, created() { this.findPage(); }, methods: { findPage() { axios.post('/checkitem/findPage.do', this.pagination).then(res => { if (res.data.flag) { this.dataList = res.data.data.rows; this.pagination.total = res.data.data.total; } else { this.$message.error(res.data.message); } }) }, handleCurrentChange(currentPage) { this.pagination.currentPage = currentPage; this.findPage(); }, } }) </script> </html>
|