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

93 lines
3.2 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">
2023-07-06 14:24:03 +08:00
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
2023-02-09 08:50:01 +08:00
<div class="header-item-label">正常设备</div>
</div>
2023-08-02 09:10:45 +08:00
<div class="header-item" @click="jump('alarmLineDevs')">
2023-07-06 14:24:03 +08:00
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
2023-02-09 08:50:01 +08:00
<div class="header-item-label">报警设备</div>
</div>
2023-08-02 09:10:45 +08:00
<div class="header-item" @click="jump('offLineDevs')">
2023-07-06 14:24:03 +08:00
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
2023-02-09 08:50:01 +08:00
<div class="header-item-label">离线设备</div>
</div>
</div>
2023-05-24 08:58:48 +08:00
<view style="padding: 20rpx 20rpx 0">
2023-02-28 16:39:58 +08:00
<Cn-grid title="常用功能">
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
2023-08-02 09:10:45 +08:00
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
2023-03-09 13:50:45 +08:00
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
2023-02-17 09:03:47 +08:00
</Cn-grid>
</view>
2023-02-23 08:44:46 +08:00
</view>
2023-02-09 08:50:01 +08:00
</template>
<script>
export default {
2023-04-04 08:47:19 +08:00
data() {
2023-02-09 08:50:01 +08:00
return {
2023-02-17 09:03:47 +08:00
loading: false,
2023-07-03 20:29:24 +08:00
}
2023-02-09 08:50:01 +08:00
},
2023-07-06 14:24:03 +08:00
props: {
devCount: {
type: Object,
default: {},
},
},
2023-02-09 08:50:01 +08:00
methods: {
2023-05-24 08:58:48 +08:00
submitFeedBack() {
2023-07-03 20:29:24 +08:00
uni.navigateTo({ url: '/pages/home/feedback' })
2023-02-28 14:03:38 +08:00
},
2023-04-04 08:47:19 +08:00
registerDevice() {
2023-02-20 14:19:28 +08:00
uni.showModal({
title: '提示',
content: '请选择设备类型',
confirmText: '直连装置',
cancelText: '网关接入',
cancelColor: '#007aff',
success: ({ confirm, cancel }) => {
if (confirm) {
uni.navigateTo({
2023-05-24 08:58:48 +08:00
url: '/pages/device/new',
2023-07-03 20:29:24 +08:00
})
2023-02-20 14:19:28 +08:00
} else if (cancel) {
uni.navigateTo({
2023-05-24 08:58:48 +08:00
url: '/pages/gateway/list',
2023-07-03 20:29:24 +08:00
})
2023-02-20 14:19:28 +08:00
}
2023-05-24 08:58:48 +08:00
},
2023-07-03 20:29:24 +08:00
})
2023-02-20 14:19:28 +08:00
},
2023-04-04 08:47:19 +08:00
registerGateway() {
2023-02-20 14:19:28 +08:00
uni.navigateTo({
2023-05-24 08:58:48 +08:00
url: '/pages/gateway/new',
2023-07-03 20:29:24 +08:00
})
2023-02-17 09:03:47 +08:00
},
2023-08-02 09:10:45 +08:00
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
break
}
2023-02-09 16:37:53 +08:00
},
2023-02-20 14:19:28 +08:00
},
2023-07-03 20:29:24 +08:00
}
2023-02-09 08:50:01 +08:00
</script>
2023-05-24 08:58:48 +08:00
<style lang="scss"></style>