<template>
	<view>
		<view class="section">
			<view class="box">
				<view class="title">
					风机参数
				</view>
				<view class="content">
					<view class="inner">
						<view class="inner_title">
							<view class="title_item" :class="active == 1?'title_item_active':''" @click="click_title(1)">
								1#风机
							</view>
							<view class="title_item" :class="active == 2?'title_item_active':''" @click="click_title(2)">
								2#风机
							</view>
						</view>
						<view v-if="active == 1">
							<view class="inner_box">
								<view class="box_title">
									<view class="text name">参数名称</view>
									<view class="text num">数值</view>
									<view class="text company">单位</view>
								</view>
								<view class="box_list">
									<view class="item" v-for="(item,index) in param1" :key="index">
										<view class="text name">{{item.name}}</view>
										<view class="text num">
											<view class="num_box">{{item.value}}</view>
										</view>
										<view class="text company">{{item.unit}}</view>
									</view>
									
								</view>
								
							</view>
						</view>
						<view v-if="active == 2">
							<view class="inner_box">
								<view class="box_title">
									<view class="text name">参数名称</view>
									<view class="text num">数值</view>
									<view class="text company">单位</view>
								</view>
								<view class="box_list">
									<view class="item" v-for="(item,index) in param2" :key="index">
										<view class="text name">{{item.name}}</view>
										<view class="text num">
											<view class="num_box">{{item.value}}</view>
										</view>
										<view class="text company">{{item.unit}}</view>
									</view>
								</view>
								
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:[
			"param1",
			"param2"
		],
		data() {
			return {
				active:1,
			};
		},
		methods:{
			click_title(active){
				this.active = active
			}
		}
	}
</script>

<style lang="scss">
	.section{
		margin-top: 10rpx;
		box-sizing: border-box;
		padding: 0 15rpx;
		
		.box{
			background: #FFFFFF;
			box-shadow: 0px 3rpx 30rpx 0px rgba(59, 74, 116, 0.14);
			border-radius: 21rpx;
	
			.title{
				width: 750rpx;
				
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #232627;
				line-height: 100rpx;
				text-align: center;
				
				border-bottom: 2rpx solid #f3f3f3;
			}
			.content{
				.inner{
					box-sizing: border-box;
					padding: 0 15rpx;
					.inner_title{
						height: 74rpx;
						display: flex;
						.title_item{
							width: 188rpx;
							text-align: center;
							font-size: 31rpx;
							font-family: PingFangSC-Medium, PingFang SC;
							font-weight: 500;
							color: #6C6F74;
							line-height: 74rpx;
							
						}
						.title_item_active{
							color: #3498DB;
							border-bottom: 3rpx solid #3498d8;
						}
					}
					.inner_box{
						margin-top: 17rpx;
						margin-bottom: 20rpx;
						padding-bottom: 20rpx;
						width: 690rpx;
						.box_title{
							display: flex;
							background: #F3F6FA;

							.text{
								font-size: 27rpx;
								font-family: PingFangSC-Regular, PingFang SC;
								font-weight: 400;
								color: #232627;
								line-height: 83rpx;
								text-align: center;
							}
							.name{
								width: 324rpx;
							}
							.num{
								margin-left: 26rpx;
								width: 162rpx;
							}
							.company{
								margin-left: 16rpx;
								width: 162rpx;
							}
						}
						.box_list{
							.item{
								display: flex;
								
								border-bottom: 1rpx solid #f3f3f3;
								.text{
									font-size: 27rpx;
									font-family: PingFangSC-Regular, PingFang SC;
									font-weight: 400;
									color: #232627;
									line-height: 83rpx;
									text-align: center;
								}
								.name{
									width: 324rpx;
								}
								.num{
									margin-left: 26rpx;
									width: 162rpx;
									.num_box{
										margin-top: 22rpx;
										background: #8ADAFF;
										line-height: 40rpx;
									}
								}
								.company{
									margin-left: 16rpx;
									width: 162rpx;
								}
							}
						}
					}
				}
			}
		}
	}
</style>
