Browse Source

bug修复

ming 3 years ago
parent
commit
8908f5116f
4 changed files with 90 additions and 37 deletions
  1. 2 1
      pages.json
  2. 32 32
      pages/deviceManage/deviceManage.vue
  3. 1 0
      pages/export/export.vue
  4. 55 4
      pages/processList/export/export.vue

+ 2 - 1
pages.json

@@ -664,7 +664,8 @@
             "style" :                                                                                    
             {
                 "navigationBarTitleText": "导出",
-                "enablePullDownRefresh": false
+                "enablePullDownRefresh": false,
+				"onReachBottomDistance":200
             }
             
         }

+ 32 - 32
pages/deviceManage/deviceManage.vue

@@ -43,14 +43,14 @@
 
 		<!-- 设备注册列表start -->
 		<block class="">
-			<view class="processList deviceRegistList" style="padding-bottom:150rpx;" >
+			<view class="processList deviceRegistList" style="padding-bottom:150rpx;">
 				<checkbox-group @change="changeCheckbox">
 					<view class="cu-list menu-avatar ">
 						<view class=" site-item text-center margin-top"
 							v-if="!this.deviceManage.length&&this.deviceManageRes==1">暂无数据</view>
-							
-						
-						
+
+
+
 						<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
 							v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
 							<view class="cu-form-group margin-top">
@@ -88,9 +88,9 @@
 								</view>
 							</view> -->
 						</view>
-							<view v-show="isLoadMore&&page>1" >
-								<uni-load-more :status="loadStatus"></uni-load-more>
-							</view>
+						<view v-show="isLoadMore&&page>1">
+							<uni-load-more :status="loadStatus"></uni-load-more>
+						</view>
 					</view>
 				</checkbox-group>
 			</view>
@@ -225,14 +225,14 @@
 					"单元地址": "unitinfo",
 					"创建时间": "install_time",
 				},
-				
-				
+
+
 				page: 1,
 				pageSize: 10,
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 				isLoadMore: false, //是否加载中
-				
-				
+
+
 
 			};
 		},
@@ -264,7 +264,7 @@
 				"dwtype": this.dwtype,
 			})
 		},
-		
+
 		onReachBottom() { //上拉触底函数
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.isLoadMore = true
@@ -276,13 +276,13 @@
 					"transmission_mode": this.transmission_mode,
 					"dwtype": this.dwtype,
 				})
-				
+
 			}
 			// alert(this.page)
 		},
-		
-		
-	
+
+
+
 		methods: {
 
 			exportButton() {
@@ -331,16 +331,16 @@
 
 			//筛选请求
 			searchList() {
-				this.deviceManage=[],
-				this.page=1,
-				this.getDataList({
-					"transmission_mode": this.transmission_mode,
-					"dwtype": this.dwtype,
-					'company_code': uni.getStorageSync('selectedCode'),
-					"page": this.page,
-					"pageSize": this.pageSize,
-				})
-				
+				this.deviceManage = [],
+					this.page = 1,
+					this.getDataList({
+						"transmission_mode": this.transmission_mode,
+						"dwtype": this.dwtype,
+						'company_code': uni.getStorageSync('selectedCode'),
+						"page": this.page,
+						"pageSize": this.pageSize,
+					})
+
 				this.transmission_mode1 = this.transmission_mode;
 				this.dwtype1 = this.dwtype;
 			},
@@ -353,11 +353,11 @@
 					showLoading: true
 				})
 				this.deviceManageRes = 1;
-				
+
 				if (res.data.data.length) {
-					
+
 					this.deviceManage = this.deviceManage.concat(res.data.data)
-					
+
 					if (res.data.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
 						this.isLoadMore = true
 						this.loadStatus = 'nomore'
@@ -368,9 +368,9 @@
 					this.isLoadMore = true
 					this.loadStatus = 'nomore'
 				}
-				
-				
-				
+
+
+
 			},
 
 			// 页面跳转

+ 1 - 0
pages/export/export.vue

@@ -108,6 +108,7 @@
 				let exportUrl = this.$BASE_URL +url2+
 					`/start_time/${this.datetimerange[0]}/end_time/${this.datetimerange[1]}/company_code/${uni.getStorageSync('selectedCode')}/`
 				var ua = window.navigator.userAgent.toLowerCase();
+				// alert(exportUrl)
 				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
 					uni.showModal({
 						showCancel: false,

+ 55 - 4
pages/processList/export/export.vue

@@ -38,6 +38,9 @@
 						</view>
 					</view>
 					<view class=" text-center margin-top" v-if="!this.getExportData.length&&this.dataRes">暂无数据...</view>
+					<view v-show="isLoadMore&&page>1">
+						<uni-load-more :status="loadStatus"></uni-load-more>
+					</view>
 				</view>
 			</view>
 		</block>
@@ -59,7 +62,14 @@
 				dataRes: 0,
 				datetimerange: ['', ''],
 				keyWords:'',
-				type:0
+				type:0,
+				start_time:'',
+				end_time:'',
+				
+				page: 1,
+				pageSize: 10,
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
 			};
 		},
 		onLoad: function(option) {
@@ -67,22 +77,48 @@
 			this.getData({
 				"company_code": uni.getStorageSync('selectedCode'),
 				"type":this.type,
-				"start_time": '',
-				"end_time": '',
+				"start_time": this.start_time,
+				"end_time": this.end_time,
+				"page": this.page,
+				"pageSize": this.pageSize,
 			})
 
 		},
 		watch: {
 			datetimerange(newval) {
+				this.start_time=newval[0];
+				this.end_time=newval[1]
+				
+				this.getExportData = [],
+					this.page = 1,
 				this.getData({
 					"company_code": uni.getStorageSync('selectedCode'),
 					"type":this.type,
 					"start_time":newval[0],
 					"end_time": newval[1],
+					"page": this.page,
+					"pageSize": this.pageSize,
 				})
 			}
 		},
 		
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.page += 1
+				this.getData({
+					"company_code": uni.getStorageSync('selectedCode'),
+					"type":this.type,
+					"start_time": this.start_time,
+					"end_time": this.end_time,
+					"page": this.page,
+					"pageSize": this.pageSize,
+				})
+		
+			}
+			// alert(this.page)
+		},
+		
 		methods: {
 			async getData(params = {}) {
 				const res = await this.$myRequest({
@@ -90,14 +126,29 @@
 					data: params,
 					showLoading: true
 				})
-				this.getExportData = res.data.data;
 				this.dataRes = 1;
+				if (res.data.data.length) {
+				
+					this.getExportData = this.getExportData.concat(res.data.data)
+				
+					if (res.data.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
+						this.isLoadMore = true
+						this.loadStatus = 'nomore'
+					} else {
+						this.isLoadMore = false
+					}
+				} else {
+					this.isLoadMore = true
+					this.loadStatus = 'nomore'
+				}
+				
 			},
 			exportButton() {
 				//#ifdef H5
 				let exportUrl = this.$BASE_URL+
 					`ExportModule/getIntegratedAlarmListExpor/start_time/${this.datetimerange[0]}/end_time/${this.datetimerange[1]}/type/${this.type}/company_code/${uni.getStorageSync('selectedCode')}/`
 				var ua = window.navigator.userAgent.toLowerCase();
+				// alert(exportUrl)
 				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
 					uni.showModal({
 						showCancel: false,