Browse Source

告警分页加载

ming 3 years ago
parent
commit
5bbe76a771
3 changed files with 33 additions and 64 deletions
  1. 6 6
      pages/deviceType/deviceType.vue
  2. 23 54
      pages/processList/processList.vue
  3. 4 4
      pages/safeGuard/safeGuard.vue

+ 6 - 6
pages/deviceType/deviceType.vue

@@ -57,13 +57,13 @@
 				this.deviceType[2].num=this.getData.electrical_fire_device_count
 				this.deviceType[3].num=this.getData.rtu_device_count
 				
-				this.deviceType[4].num=this.getData.smoke_sensation_device_count
-				this.deviceType[5].num=this.getData.video_device_count
-				this.deviceType[6].num=this.getData.manhole_cover_device_count
-				this.deviceType[7].num=this.getData.fire_hydrant_device_count
+				this.deviceType[4].num=this.getData.smoke_sensation_device_count  //烟感
+				this.deviceType[5].num=this.getData.video_device_count  //视频
+				this.deviceType[6].num=this.getData.elevator_device_count   //电梯
+				this.deviceType[7].num=this.getData.manhole_cover_device_count  //井盖
 				
-				this.deviceType[8].num=this.getData.fire_hydrant_device_count
-				this.deviceType[9].num=this.getData.level_device_count
+				this.deviceType[8].num=this.getData.fire_hydrant_device_count  //消防栓
+				this.deviceType[9].num=this.getData.level_device_count  //液位
 				// this.deviceType[10].num=this.getData.geomagnetism_device_count
 				// this.deviceType[11].num=this.getData.access_control_device_count
 				// this.deviceType[12].num=this.getData.gsa_device_count

+ 23 - 54
pages/processList/processList.vue

@@ -8,13 +8,9 @@
 					<!-- <view v-if="TabCur==index" class="cu-tag badge">
 						<block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
 					</view> -->
-
-
 					<view v-if="TabCur==index&&!TabCur" class="cu-tag badge">
 						<block class="cu-tag badge">{{alarm_count}} </block>
 					</view>
-
-
 					{{item}}
 				</view>
 			</scroll-view>
@@ -23,7 +19,6 @@
 		<block v-if="TabCur==0">
 			<view class="processList">
 				<view class="cu-list menu-avatar">
-
 					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
 						<view class="cu-avatar lg">
 							<image class="image-bg" src="/static/process-icon.png" />
@@ -87,7 +82,6 @@
 			return {
 				unporcessList: [],
 				porcessedList: [],
-
 				type: '0',
 				modalName: null,
 				listTouchStart: 0,
@@ -102,43 +96,34 @@
 				pageSize: 10,
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 				isLoadMore: false, //是否加载中
-
-
 			};
 		},
 
-		onPullDownRefresh() {
-			console.log('refresh--上拉刷新');
-			this.getProcessData(0);
-			this.page=1
-
-			setTimeout(function() {
-				uni.stopPullDownRefresh();
-			}, 100);
-		},
-
 		onReachBottom() { //上拉触底函数
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.isLoadMore = true
 				this.page += 1
-				this.getProcessData(0);
+				this.getProcessData({
+					"company_code": uni.getStorageSync('selectedCode'),
+					"type": this.type, 
+					"processing_status": this.TabCur,
+					"page": this.page,
+					"pageSize": this.pageSize,
+				}, this.TabCur);
 			}
 		},
 
-
 		onLoad: function(option) {
-
-			setTimeout(function() {
-				console.log('start pulldown');
-			}, 1000);
-			uni.startPullDownRefresh();
-
-			this.getProcessData(0);
-
+			this.getProcessData({
+				"company_code": uni.getStorageSync('selectedCode'),
+				"type": option.type, 
+				"processing_status": 0,
+				"page": this.page,
+				"pageSize": this.pageSize,
+			}, 0);
 
 			this.companyCode = option.companyCode;
 			this.processingStatus = 1
-
 			this.type = option.type;
 
 			let url = "";
@@ -182,8 +167,6 @@
 			uni.setNavigationBarTitle({
 				title: url
 			});
-
-
 		},
 
 		onNavigationBarButtonTap(e) {
@@ -197,33 +180,22 @@
 		},
 		methods: {
 
-			async getProcessData(whichTab) {
+			async getProcessData(params, whichTab) {
 				const res = await this.$myRequest({
 					url: 'ComprehensiveAlarm/getIntegratedAlarmList',
-					data: {
-						"company_code": uni.getStorageSync('selectedCode'),
-						"type": 1, //aa写活
-						"processing_status": 0,
-						"page": this.page,
-						"pageSize": this.pageSize,
-					},
+					data: params,
 					showLoading: true
 				})
-
 				if (res.data.alarm_count) {
-
-					this.unporcessList = res.data.data;
-
 					if (whichTab == 0) {
-						this.unporcessList = res.data.data;
+						this.unporcessList = this.unporcessList.concat(res.data.data)
 						this.alarm_count = parseInt(res.data.alarm_count)
 
 					} else {
-						this.porcessedList = res.data.data;
+						this.porcessedList = this.porcessedList.concat(res.data.data);
 						this.alarm_count1 = parseInt(res.data.alarm_count)
 					}
 
-
 					if (res.data.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
 						this.isLoadMore = true
 						this.loadStatus = 'nomore'
@@ -234,24 +206,23 @@
 					this.isLoadMore = true
 					this.loadStatus = 'nomore'
 				}
-
-
-
-
 			},
 
 			tabSelect(e) {
 				this.unporcessList = [],
 					this.porcessedList = [],
+					this.page = 1
 
-					console.log(e.currentTarget);
+				console.log(e.currentTarget);
 				this.TabCur = e.currentTarget.dataset.id;
 				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
 
 				this.getProcessData({
 					"company_code": uni.getStorageSync('selectedCode'),
 					"type": this.type,
-					"processing_status": e.currentTarget.dataset.id
+					"processing_status": e.currentTarget.dataset.id,
+					"page": this.page,
+					"pageSize": this.pageSize
 				}, this.TabCur);
 			},
 
@@ -271,8 +242,6 @@
 					complete: () => {}
 				});
 			},
-
-
 		}
 	}
 </script>

+ 4 - 4
pages/safeGuard/safeGuard.vue

@@ -28,17 +28,17 @@
 					<text>联系电话:</text>
 					<text>{{this.getData.salesman_phone}}</text>
 				</view>
-				<view class="info-one-info ">
-					<text>客户联系人:</text>
+				<view class="info-one-info " >
+					<text style="width:120px!important">客户联系人:</text>
 					<text>{{this.getData.customer}}</text>
 				</view>
 				<view class="info-one-info ">
-					<text>客户电话:</text>
+					<text >客户电话:</text>
 					<text>{{this.getData.customer_phone}}</text>
 				</view>
 				<view class="info-one-info ">
 					<text>合同状态:</text>
-					<text class="online">启用{{this.getData.status}}</text>
+					<text class="online">{{this.getData.status}}</text>
 				</view>
 				<view class="info-one-info ">
 					<text>详细内容:</text>