<template name="history">
	 <view class="container">
		 <u-navbar
		   title="历史数据"
		   @leftClick="devicemenuShow"
		   :safeAreaInsetTop="false"
		   
		 >
		   <view class="u-nav-slot" slot="left">
		     <u-icon name="list" size="20"> </u-icon>
		   </view>
		 </u-navbar>
		 
		<!-- <view v-show="menushow" class="menupage">
		   <DeviceMenu @menuClick="menuClick"></DeviceMenu>
		 </view> -->
		 <view class="menupage">
		   <u-picker mode="time" v-model="show" :params="params"></u-picker>
		 </view>
	 </view>
</template>

<script>
import DeviceMenu from "../home/devicemenu/devicemenu.vue";
import api from "@/api/api";
	export default {
		name: 'history',
		components: {
		  DeviceMenu,
		},
		watch: {
		},
		data() {
			return {
				menushow: false,
				currentRoute:'',
				TabCur: "gate",
				params: {
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				},
				show: true
			}
		},
		created() {
			// 获取当前页面的路由路径
			    const currentRoute = this.$route.path;
			    
			    // 检查路由路径是否包含 "home"
			    if (currentRoute.includes('history')) {
			      console.log('当前页面包含 "home"');
			    } else {
			      console.log('当前页面不包含 "home"');
			    }
		},
		methods: {
			devicemenuShow(e) {
			  this.menushow = true;
			},
			menuClick(id) {
			  this.TabCur = id;
			  // 选择设备分类，重新获取数据
			  this.menushow = false;
			},
		}
	}
</script>

<style scoped>
	.menupage {
	  position: absolute;
	  z-index: 2;
	  top: 40rpx;
	  height: calc(100% - 40rpx);
	  width: 100%;
	}
</style>
