123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <template>
- <view>
- <view v-if="menushow" class="menupage">
- <DeviceMenu @menuClick="menuClick"></DeviceMenu>
- </view>
- <view v-if="!menushow" class="cu-form-group menubtn" @click="devicemenuShow">
- ≡
- </view>
- <cu-custom><block slot="content">设备监控</block></cu-custom>
- <view v-show="!menushow" scroll-x class="top-nav">
- <view class="flex text-center">
- <view class="cu-item flex-sub" :current= 'currentTab' v-for="(item,index) in 4" :key="index" @tap="tabSelect" :data-id="index">
- Tab{{index}}
- </view>
- </view>
- <view class="flex text-center top-nav2" v-show="currentTab === 0">
- <view class="cu-item flex-sub" v-for="(item,index) in tab0data" :key="item.id" @tap="tabSelect" :data-id="item.id">
- {{item.name}}
- </view>
- </view>
- </view>
- <view v-show="!menushow" class="main">
- <view class="card" v-for="(item,index) in 4" :key="index">
- <H1>Tab{{index}}</H1>
- </view>
- </view>
- </view>
- </template>
- <script>
- import DeviceMenu from './devicemenu/devicemenu.vue'
- export default {
- data() {
- return {
- menushow:false,
- TabCur: 0,
- scrollLeft: 0,
- currentTab:0,
- tab0data:[
- {name:"测风装置",id:0},
- {name:"对射测风",id:1},
- {name:"单点测风",id:2},
- {name:"九点测风",id:3},
- ]
- };
- },
- components: {
- DeviceMenu,
- },
- methods: {
- tabSelect(e) {
- this.currentTab = e.currentTarget.dataset.id;
- this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
- },
- devicemenuShow(e){
- this.menushow = true;
- },
- menuClick(id){
- this.menushow = false;
- }
- }
- }
- </script>
- <style>
- .top-nav{
- height: 100rpx;
- line-height: 100rpx;
- background-color: #2aa9f3;
- color: #daaaa;
- }
- .top-nav2{
- background-color:#ffffff
- }
- .main{
- margin-top: 100rpx;
- display: flex;
- flex-direction: column;
- }
- .card{
- background-color: #ffffff;
- margin: auto;
- margin-top: 20rpx;
- width: 90%;
- height: 280rpx;
- border:1rpx solid #000000;
- border-radius: 20rpx;
- }
- .menupage{
- position: absolute;
- z-index: 2;
- top:40rpx;
- overflow-y: scroll;
- height: calc(100% - 40rpx);
- width: 100%;
- }
- .menubtn{
- position: absolute;
- z-index: 2;
- top:5rpx;
- left:5rpx;
- padding-left: 10rpx;
- background-color: #007BFF;
- border-radius: 10rpx;
- height: 40rpx;
- width: 40rpx;
- }
- </style>
|