<template>
	<view>
		<view class="inner_box">
			<view class="inner_title">
				<view class="name name_1">姓名</view>
				<view class="name name_2">部门</view>
				<view class="name name_2">当前位置</view>
				<view class="name name_3">下井时间</view>
			</view>
			<view class="list_item">
				<view class="item" v-for="(item,index) in peoples" :key="index"  @click="go_downhole_statistics(item.people_num,item.depart_name,item.name)">
					<view class="text text_1">{{item.name}}</view>
					<view class="text text_2">{{item.depart_name}}</view>
					<view class="text text_2">{{item.station_name}}</view>
					<view class="text text_3">{{item.time}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				peoples:[],
				
				
				mine:""
			};
		},
		onLoad(option) {
			// console.log(option)
			uni.setNavigationBarTitle({
				title:option.title
			})
			this.mine = option.mine
			
			this.getPeoples(option.title,option.mine,option.departType)
		},
		methods:{
			getPeoples(name,mine,departType){
				uni.showLoading()
				this.$p_api.personnel_depart_people({
					depart_id:name,
					mine:mine,
					departType:departType
				}).then((res)=>{
					uni.hideLoading()
					// console.log(res)
					this.peoples = res.data.data
					// console.log(this.peoples)
				})
				
			},
			
			go_downhole_statistics(people_num,depart_name,name){
				// console.log(people_num,depart_name,name)
				uni.navigateTo({
					url:"../downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
				})
			}
		}
		

	}
</script>

<style lang="scss">
	.inner_box{
		.inner_title{
			position: fixed;
			left: 0;
			top: 1;
			z-index: 999;
			overflow: hidden;
			
			padding: 0 25rpx;
			
			height: 94rpx;
			background: #F3F6FA;
			
			display: flex;
			align-items: center;
			.name{
				font-size: 28rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 700;
				color: #232627;
				text-align: center;
			}
			.name_1{
				width: 130rpx;
			}
			.name_2{
				width: 220rpx;
			}
			.name_3{
				width: 130rpx;
			}
		}
		.list_item{
			padding-top: 94rpx;
			.item{
				padding: 0 24rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				
				border-bottom: 1px solid #f3f3f3;
				.text{
					height: 94rpx;
					font-size: 25rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					text-align: center;
					display: flex;
					flex-flow: column;
					justify-content: center;
					line-height: 40rpx;
				}
				.text_1{
					width: 130rpx;
				}
				.text_2{
					width: 220rpx;
				}
				.text_3{
					width: 130rpx;
				}
			}
		}
	}

</style>
