|
|
@@ -23,7 +23,7 @@
|
|
|
<div style="margin-bottom: 20px">
|
|
|
<span>上报时间范围:</span>
|
|
|
<el-date-picker
|
|
|
- v-model="search.updateTime"
|
|
|
+ v-model="queryParams.updateTime"
|
|
|
:default-time="defaultTime"
|
|
|
type="datetimerange"
|
|
|
range-separator="至"
|
|
|
@@ -41,7 +41,7 @@
|
|
|
{{ getLabel(statusDict, r.row.status) }}
|
|
|
</template></el-table-column
|
|
|
>
|
|
|
- <el-table-column prop="updateTime" label="上报时间">
|
|
|
+ <el-table-column prop="updateTime" label="上报时间">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="statusUpdatorName"
|
|
|
@@ -49,16 +49,13 @@
|
|
|
></el-table-column>
|
|
|
</el-table>
|
|
|
<div style="margin-top: 20px; text-align: right">
|
|
|
- <el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-sizes="[10, 20, 30, 40, 50, 100]"
|
|
|
- :page-size="search.size"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -83,9 +80,8 @@ export default {
|
|
|
protection: {},
|
|
|
tableData: [],
|
|
|
defaultTime: ["00:00:00", "23:59:59"],
|
|
|
- search: this.resetSearch(),
|
|
|
+ queryParams: this.resetSearch(),
|
|
|
total: 1,
|
|
|
- currentPage: 1,
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -98,44 +94,41 @@ export default {
|
|
|
methods: {
|
|
|
getLabel,
|
|
|
async refresh() {
|
|
|
- this.currentPage = 1;
|
|
|
- this.getlist();
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
- async getlist() {
|
|
|
- this.search.page = this.currentPage - 1;
|
|
|
- await api.history(this.search).then((v) => {
|
|
|
+ async getList() {
|
|
|
+ await api.history(this.queryParams).then((v) => {
|
|
|
this.tableData = v.rows;
|
|
|
this.total = v.total;
|
|
|
});
|
|
|
},
|
|
|
close() {
|
|
|
- this.search = this.resetSearch();
|
|
|
- this.tableData=[];
|
|
|
- this.total=0;
|
|
|
+ this.queryParams = this.resetSearch();
|
|
|
+ this.tableData = [];
|
|
|
+ this.total = 0;
|
|
|
},
|
|
|
async show(protection) {
|
|
|
- this.protection=protection;
|
|
|
- this.search = this.resetSearch();
|
|
|
- this.search.protectionId = protection.id;
|
|
|
+ this.protection = protection;
|
|
|
+ this.queryParams = this.resetSearch();
|
|
|
+ this.queryParams.protectionId = protection.id;
|
|
|
await this.refresh();
|
|
|
this.isShow = true;
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
- this.currentPage = 1;
|
|
|
- this.search.size = val;
|
|
|
- this.getlist();
|
|
|
- console.log(`每页 ${val} 条`);
|
|
|
+ this.queryParams.pageSize = val;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
- this.currentPage = val;
|
|
|
- this.getlist();
|
|
|
+ this.queryParams.pageNum = val;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
resetSearch() {
|
|
|
return {
|
|
|
- size: 10,
|
|
|
- page: 0,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
protectionId: null,
|
|
|
- updateTime: [new Date( new Date() - 3600 * 1000 * 24 * 90), new Date()],
|
|
|
+ updateTime: [new Date(new Date() - 3600 * 1000 * 24 * 90), new Date()],
|
|
|
};
|
|
|
},
|
|
|
// 事件
|