From a4831debee63c7071a261c5f6ecfa62fd535b2ab Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Thu, 25 Jan 2024 16:21:18 +0800 Subject: [PATCH] 分页修改 --- src/views/list/devicesBasic.vue | 46 ++++++++++++++++++++++++++++++---------------- 1 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/views/list/devicesBasic.vue b/src/views/list/devicesBasic.vue index fab16c4..2da62a4 100644 --- a/src/views/list/devicesBasic.vue +++ b/src/views/list/devicesBasic.vue @@ -1205,12 +1205,15 @@ private createForm: any = null; private editRecord: any = {}; + private pagination: any = { total: 0, current: 1, - pageSize: 5, - showSizeChanger: false, - showQuickJumper: false + pageSize: 10, + showSizeChanger: true, + showQuickJumper: true, + pageSizeOptions: ["10", "30", "60", "100"], + showTotal: (total: number) => `������ ${this.pagination.total} ���������`, //��������������������������� }; private updateRecord1: any = {}; @@ -1347,7 +1350,7 @@ // agehou:'' // } ] - + private rowSelectionChange(selectedRowKeys: string[], selectedRows: DataType[]){ // console.log(selectedRows); this.selectedtable=selectedRows @@ -1380,6 +1383,14 @@ } private columns: any[] = [ + { + title: "������", + dataIndex: "key", + key: "key", + align: "center", + customRender: (text:any, record:any, index:any) => `${index + 1}`, + width: 60, + }, { title: "������", dataIndex: "name" @@ -1641,6 +1652,9 @@ private current: number = 1 private handlerTableChange(pagination: any, filter: any, sorter: any): void { this.current = pagination.current + this.pagination.current = pagination.current; + this.pagination.pageSize = pagination.pageSize; + this.pagination.total = pagination.total; this.loadRuleData(pagination.current) } @@ -1686,7 +1700,7 @@ console.log(21323); for(var i=0;i<this.datatable.length;i++){ if(this.ceAQIvalue==='+'){ - this.datatable[i].cel=((this.datatable[i].cel-0) + (this.ceAQIvaluein-0)).toFixed(2) + this.datatable[i].cel=((this.datatable[i].cel-0) + (this.ceAQIvaluein-0)).toFixed(2) }else if(this.ceAQIvalue==='-'){ this.datatable[i].cel=Number((this.datatable[i].cel - this.ceAQIvaluein).toFixed(2)) }else if(this.ceAQIvalue==='*'){ @@ -1702,16 +1716,16 @@ // this.datatable[i].cel=parseFloat(this.datatable[i].cel+this.ceAQIvaluein).toFixed(2) // this.datatable[i].agehou='aqi*'+this.datatable[i].aqi+'+'+'ce1*'+this.datatable[i].cel if(this.AQIvalue1==='+'){ - this.datatable[i].aqi=((this.datatable[i].aqi-0) + (this.AQIvalue-0)).toFixed(2) + this.datatable[i].aqi=((this.datatable[i].aqi-0) + (this.AQIvalue-0)).toFixed(2) }else if(this.AQIvalue1==='-'){ this.datatable[i].aqi=Number((this.datatable[i].aqi - this.AQIvalue)).toFixed(2) } else if(this.AQIvalue1==='*'){ this.datatable[i].aqi=Number((this.datatable[i].aqi * this.AQIvalue)).toFixed(2) }else if(this.AQIvalue1==='/'){ this.datatable[i].aqi=Number((this.datatable[i].aqi / this.AQIvalue).toFixed(3)) - } + } if(this.ceAQIvalue==='+'){ - this.datatable[i].cel=((this.datatable[i].cel-0) + (this.ceAQIvaluein-0)).toFixed(2) + this.datatable[i].cel=((this.datatable[i].cel-0) + (this.ceAQIvaluein-0)).toFixed(2) }else if(this.ceAQIvalue==='-'){ this.datatable[i].cel=Number((this.datatable[i].cel - this.ceAQIvaluein)).toFixed(2) }else if(this.ceAQIvalue==='*'){ @@ -1951,11 +1965,11 @@ // ���������������������id private selectMt: any = null - + private loading: boolean=false - + private handleCancel(){ - + } //������������ private handleCreateModalOk() { @@ -2097,7 +2111,7 @@ name: this.serch.name, mac: this.serch.name, page: pageSize, - size: 8 + size: this.pagination.pageSize, }) .then(res => { if(res.data.code === 0) { @@ -2200,13 +2214,13 @@ } // ������������������������ private receiveLomLat(lonLat: any) { - + this.addLL = lonLat this.getTownData(lonLat) } - + private getTownData(lonLat: any) { - console.log(lonLat,'dsasa'); + console.log(lonLat,'dsasa'); let self=this var geocoder = new AMap.Geocoder({ // city ������������������������������������������������������������adcode ��� citycode @@ -2248,7 +2262,7 @@ // result������������������������������������ } }) - + // jsonp('/proxy/reverse_geocoding/v3/', { // jsonp('https://api.map.baidu.com/reverse_geocoding/v3/', { // ak: 'e5ig9Z7AKFjv8wbkqDbuLkUMzBev0tgT', -- Gitblit v1.8.0