<template>
	<view id="equipmentInformation">
		<view class="top-table-button-box">
			<view :class="checkType == 1?'checkButton':''" @click="checkButton(1)">设备信息</view>
			<view :class="checkType == 2?'checkButton':''" @click="checkButton(2)">使用记录</view>
		</view>
		<view class="bottom-flex">
			<infoPage :equipmentId="equipmentId" v-if="checkType == 1"></infoPage>
			<listPage :equipmentId="equipmentId" v-if="checkType == 2"></listPage>
		</view>
	</view>
</template>

<script>
	import {
		demo1,
	} from '@/pages_equipmentUtilization/api/index.js'
	import infoPage from './infoPage'
	import listPage from './listPage'
	export default {
		components: {
			infoPage,
			listPage
		},
		data() {
			return {
				checkType:1,
				equipmentId:'',
			}
		},
		onLoad(option) {
			this.$set(this,'equipmentId',option.id);
		},
		onShow() {
			
		},
		mounted() {
			
		},
		methods: {
			checkButton(type){
				if(this.checkType != type){
					this.$set(this,'checkType',type);
				}
			},
		},
	}
</script>

<style lang="stylus" scoped>
	#equipmentInformation {
		height: 100%;
		flex:1;
		display:flex;
		overflow: hidden;
		flex-direction:column;
		.top-table-button-box{
			display: flex;
			border-bottom: 1rpx solid #0183FA;
			background-color: #fff;
			view{
				font-weigth:700;
				flex: 1;
				text-align: center;
				line-height:80rpx;
			}
			.checkButton{
				color:#0183FA;
			}
		}
		.bottom-flex{
			flex: 1;
			overflow: hidden;
		}
	}
</style>