| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 | 
							- <template>
 
- 	<view style="width: 100%;">
 
- 		<view class="card_humiture border_humiture" v-if="humitureData.length > 0">
 
- 			<view class="headline_item w_wsd">温度(°C)</view>
 
- 			<view class="headline_item w_wsd">湿度(Rh)</view>
 
- 			<view class="headline_item w_time">时间</view>
 
- 		</view>
 
- 		<view class="card_record" v-if="humitureData.length > 0">
 
- 			<scroll-view class="scroll-view" scroll-y="true" @scrolltolower="loadMore">
 
- 				<view class="card_humiture" v-for="(item,index) in humitureData" :key="index">
 
- 					<view class="title_item w_wsd">{{item.T_t || ''}}</view>
 
- 					<view class="title_item w_wsd">{{item.T_rh || ''}}</view>
 
- 					<view class="title_item w_time">{{item.T_time || ''}}</view>
 
- 				</view>
 
- 			</scroll-view>
 
- 		</view>
 
- 		<view v-else style="padding: 30rpx 0rpx;">
 
- 			<u-empty mode="data" text="暂无温湿度记录"></u-empty>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	export default {
 
- 		name: 'Xhumiture',
 
- 		props: {
 
- 			probeList: {
 
- 				type: Array,
 
- 				default: () => [],
 
- 			},
 
- 			waybillNo: {
 
- 				type: String,
 
- 				default: () => '',
 
- 			},
 
- 			taskId: {
 
- 				type: Number,
 
- 				default: () => null,
 
- 			},
 
- 		},
 
- 		data() {
 
- 			return {
 
- 				current: 0,
 
- 				loadingMore: true,
 
- 				pageSize: 10,
 
- 				currentPage: 1,
 
- 				tIds: [],
 
- 				humitureData: [],
 
- 				loading: ''
 
- 			}
 
- 		},
 
- 		mounted() {
 
- 			// this.getProbe()
 
- 		},
 
- 		methods: {
 
- 			getlist(num) {
 
- 				this.humitureData = []
 
- 				this.currentPage = 1
 
- 				this.getList(num)
 
- 			},
 
- 			getList(tIds) {
 
- 				this.loadingMore = true;
 
- 				this.tIds = []
 
- 				this.tIds.push(tIds)
 
- 				function methods1(arr) {
 
- 					return Array.from(new Set(arr));
 
- 				}
 
- 				this.tIds = methods1(this.tIds)
 
- 				let params = {
 
- 					t_ids: this.tIds,
 
- 					taskId: this.taskId,
 
- 					waybillNo: this.waybillNo,
 
- 					page: this.currentPage,
 
- 					pageSize: this.pageSize,
 
- 				}
 
- 				this.$api.post('/api/waybill-task/data', params).then(res => {
 
- 					if (res.code == 200) {
 
- 						const data = res.data.list
 
- 						if (this.loadingMore == true && data) {
 
- 							this.humitureData = this.humitureData.concat(data);
 
- 						}
 
- 						if (data.length < this.pageSize) {
 
- 							this.loadingMore = false
 
- 							this.loading = '没有更多了'
 
- 						} else {
 
- 							this.loadingMore = true
 
- 							this.currentPage++
 
- 						}
 
- 					}
 
- 				})
 
- 			},
 
- 			sectionChange1(value) {
 
- 				this.current = value
 
- 				this.currentPage = 1
 
- 				this.humitureData = []
 
- 				const num = this.probeList[value].T_id
 
- 				this.getList(num)
 
- 			},
 
- 			// 滚动加载更多
 
- 			loadMore() {
 
- 				if (this.loadingMore) {
 
- 					this.getList(this.tIds[0]);
 
- 				}
 
- 			}
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss" scoped>
 
- 	.sub_card {
 
- 		margin: 0rpx 20rpx 20rpx 20rpx;
 
- 	}
 
- 	.card_humiture {
 
- 		width: 100%;
 
- 		display: flex;
 
- 		align-items: center;
 
- 		padding: 20rpx 0rpx;
 
- 		margin-bottom: 10rpx;
 
- 	}
 
- 	.border_humiture {
 
- 		border-bottom: 1rpx solid #EBEEF5;
 
- 	}
 
- 	.headline_item {
 
- 		font-size: 30rpx;
 
- 		font-weight: 600;
 
- 	}
 
- 	.title_item {
 
- 		font-size: 28rpx
 
- 	}
 
- 	.w_wsd {
 
- 		text-align: center;
 
- 		width: 27%;
 
- 	}
 
- 	.w_time {
 
- 		text-align: center;
 
- 		width: 46%;
 
- 	}
 
- 	.card_record {
 
- 		margin-bottom: 20rpx;
 
- 	}
 
- 	.scroll-view {
 
- 		max-height: 600rpx;
 
- 		overflow: hidden;
 
- 	}
 
- </style>
 
 
  |