Files
app-govern/pages/index/comp/indexZhuYongHu.vue

94 lines
3.1 KiB
Vue
Raw Normal View History

2023-02-09 08:50:01 +08:00
<template>
<view class="index-zhuyonghu">
<div class="header">
<div class="header-item">
<div class="header-item-value">3</div>
<div class="header-item-label">正常设备</div>
</div>
<div class="header-item">
<div class="header-item-value">1</div>
<div class="header-item-label">报警设备</div>
</div>
<div class="header-item">
<div class="header-item-value">0</div>
<div class="header-item-label">离线设备</div>
</div>
</div>
2023-02-17 09:03:47 +08:00
<view style="padding:30rpx 30rpx 0">
<Cn-grid title="注册">
<Cn-grid-item src="/static/device2.png" text="设备"></Cn-grid-item>
<Cn-grid-item src="/static/gateway2.png" text="网关"></Cn-grid-item>
<Cn-grid-item background="#fff"></Cn-grid-item>
<Cn-grid-item background="#fff"></Cn-grid-item>
</Cn-grid>
</view>
<view class="nav">
<view class="nav-menu" :class="{ 'nav-menu-active': navMenuActive == index }"
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text }}
</view>
</view>
<uni-card :title="item.name" :sub-title="item.project" :extra="item.type" v-for="item in deviceListFilter"
:key="item" style="margin-top:4rpx" @click="jump(item)" thumbnail="/static/device.png">
<text>{{ item.project }} {{ item.type }}</text>
2023-02-09 08:50:01 +08:00
</uni-card>
2023-02-17 09:03:47 +08:00
2023-02-09 08:50:01 +08:00
<uni-load-more status="nomore"></uni-load-more>
2023-02-17 09:03:47 +08:00
</view>
2023-02-09 08:50:01 +08:00
</template>
<script>
export default {
data () {
return {
2023-02-17 09:03:47 +08:00
loading: false,
navMenuList: [{
text: '全部'
}, {
text: '监测'
}, {
text: '治理'
}],
navMenuActive: 0,
deviceList: [
{
name: '设备1',
des: '设备描述1',
type: 'APF',
project: '监测',
},
{
name: '设备2',
des: '设备描述2',
type: 'DVR',
project: '治理'
}
]
}
},
computed: {
deviceListFilter () {
if (this.navMenuActive == 0) {
return this.deviceList
} else {
return this.deviceList.filter(item => item.project == this.navMenuList[this.navMenuActive].text)
}
2023-02-09 08:50:01 +08:00
}
},
methods: {
2023-02-17 09:03:47 +08:00
navMenuClick (index) {
this.navMenuActive = index
},
2023-02-09 16:37:53 +08:00
jump (item) {
if (item % 2) {
2023-02-17 09:03:47 +08:00
uni.navigateTo({
2023-02-10 09:16:17 +08:00
url: '/pages/device/APF/detail'
2023-02-09 16:37:53 +08:00
})
} else {
uni.navigateTo({
2023-02-10 09:16:17 +08:00
url: '/pages/device/DVR/detail'
2023-02-09 16:37:53 +08:00
})
}
},
2023-02-09 08:50:01 +08:00
}
}
</script>
2023-02-17 09:03:47 +08:00
<style lang='scss'></style>