2023-02-06 13:34:15 +08:00
|
|
|
<template>
|
|
|
|
|
<Cn-page :loading='loading' noPadding>
|
|
|
|
|
<view slot='body'>
|
|
|
|
|
<view class='detail'>
|
2023-02-07 17:59:54 +08:00
|
|
|
<view class="header">
|
2023-02-10 13:38:19 +08:00
|
|
|
<image src="/static/test2.pic.jpg" mode="widthFix" style="width: 100%;" />
|
2023-02-07 17:59:54 +08:00
|
|
|
</view>
|
2023-02-06 13:34:15 +08:00
|
|
|
<view class="des">
|
|
|
|
|
<text>设备基础信息</text>
|
|
|
|
|
<text class="ml10">设备状态</text>
|
|
|
|
|
</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>
|
|
|
|
|
<view class="content" :style="{ minHeight: 'calc(100vh - ' + navHeight + 'px)' }">
|
2023-02-07 17:59:54 +08:00
|
|
|
<view v-if="navMenuActive == 0">
|
2023-02-06 13:34:15 +08:00
|
|
|
<basic></basic>
|
|
|
|
|
</view>
|
2023-02-07 17:59:54 +08:00
|
|
|
<view v-else-if="navMenuActive == 1">
|
2023-02-06 13:34:15 +08:00
|
|
|
<xieBo></xieBo>
|
|
|
|
|
</view>
|
2023-02-07 17:59:54 +08:00
|
|
|
<view v-else-if="navMenuActive == 2">
|
|
|
|
|
<power></power>
|
2023-02-06 13:34:15 +08:00
|
|
|
</view>
|
2023-02-07 17:59:54 +08:00
|
|
|
<view v-else-if="navMenuActive == 3">
|
|
|
|
|
<oscillogram></oscillogram>
|
2023-02-06 13:34:15 +08:00
|
|
|
</view>
|
2023-02-07 17:59:54 +08:00
|
|
|
<view v-else-if="navMenuActive == 4">
|
|
|
|
|
<IO></IO>
|
2023-02-06 13:34:15 +08:00
|
|
|
</view>
|
|
|
|
|
<view style="height:20rpx"></view>
|
|
|
|
|
</view>
|
2023-02-07 17:59:54 +08:00
|
|
|
<uni-fab ref="fab" direction="vertical" horizontal="right" vertical="bottom" :content="content"
|
|
|
|
|
@trigger="trigger" />
|
|
|
|
|
<uni-popup ref="share" type="share" background-color="#fff">
|
|
|
|
|
<uni-popup-share title="分享到"></uni-popup-share>
|
|
|
|
|
</uni-popup>
|
2023-02-06 13:34:15 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</Cn-page>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2023-02-10 09:16:17 +08:00
|
|
|
import basic from "./comp/basic.vue";
|
|
|
|
|
import xieBo from "./comp/xieBo.vue";
|
|
|
|
|
import power from "./comp/power.vue";
|
|
|
|
|
import oscillogram from "./comp/oscillogram.vue";
|
|
|
|
|
import IO from "./comp/IO.vue";
|
2023-02-06 13:34:15 +08:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
basic,
|
2023-02-07 17:59:54 +08:00
|
|
|
xieBo,
|
|
|
|
|
power,
|
|
|
|
|
oscillogram,
|
|
|
|
|
IO
|
2023-02-06 13:34:15 +08:00
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
loading: false,
|
|
|
|
|
navMenuActive: 0,
|
|
|
|
|
navHeight: 0,
|
|
|
|
|
navMenuList: [{
|
|
|
|
|
text: '基本'
|
|
|
|
|
}, {
|
|
|
|
|
text: '谐波'
|
|
|
|
|
}, {
|
|
|
|
|
text: '功率'
|
|
|
|
|
}, {
|
|
|
|
|
text: '波形'
|
|
|
|
|
}, {
|
|
|
|
|
text: 'I/O'
|
2023-02-07 17:59:54 +08:00
|
|
|
}],
|
2023-02-10 16:32:41 +08:00
|
|
|
content: [{
|
2023-02-09 16:37:53 +08:00
|
|
|
iconPath: '/static/report.png',
|
2023-02-07 17:59:54 +08:00
|
|
|
text: '告警',
|
2023-02-10 16:32:41 +08:00
|
|
|
}, {
|
|
|
|
|
iconPath: '/static/record.png',
|
|
|
|
|
text: '记录',
|
2023-02-07 17:59:54 +08:00
|
|
|
}, {
|
|
|
|
|
iconPath: '/static/about.png',
|
|
|
|
|
text: '关于',
|
|
|
|
|
},
|
|
|
|
|
]
|
2023-02-06 13:34:15 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2023-02-07 17:59:54 +08:00
|
|
|
trigger (e) {
|
2023-02-09 16:37:53 +08:00
|
|
|
console.log(e);
|
|
|
|
|
if (e.item.text === '分享') {
|
2023-02-07 17:59:54 +08:00
|
|
|
this.$refs.share.open()
|
2023-02-09 16:37:53 +08:00
|
|
|
} else if (e.item.text === '删除') {
|
2023-02-07 17:59:54 +08:00
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: '确定删除该设备吗?',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
console.log('用户点击确定')
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
console.log('用户点击取消')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-02-09 16:37:53 +08:00
|
|
|
} else if (e.item.text === '下载') {
|
2023-02-07 17:59:54 +08:00
|
|
|
this.$util.toast('下载成功')
|
2023-02-09 16:37:53 +08:00
|
|
|
} else if (e.item.text === '记录') {
|
2023-02-10 09:16:17 +08:00
|
|
|
uni.navigateTo({ url: '/pages/device/APF/record' })
|
2023-02-09 16:37:53 +08:00
|
|
|
} else if (e.item.text === '告警') {
|
2023-02-10 09:16:17 +08:00
|
|
|
uni.navigateTo({ url: '/pages/device/APF/report' })
|
2023-02-09 16:37:53 +08:00
|
|
|
} else if (e.item.text === '关于') {
|
2023-02-10 09:16:17 +08:00
|
|
|
uni.navigateTo({ url: '/pages/device/APF/about' })
|
2023-02-09 16:37:53 +08:00
|
|
|
} else if (e.item.text === '移交') {
|
|
|
|
|
uni.navigateTo({ url: '/pages/device/transfer' })
|
|
|
|
|
} else if (e.item.text === '反馈') {
|
|
|
|
|
uni.navigateTo({ url: '/pages/device/feedback' })
|
2023-02-10 16:32:41 +08:00
|
|
|
} else if (e.item.text === '用户') {
|
|
|
|
|
uni.navigateTo({ url: '/pages/device/user' })
|
2023-02-07 17:59:54 +08:00
|
|
|
}
|
2023-02-09 16:37:53 +08:00
|
|
|
this.$refs.fab.close()
|
2023-02-07 17:59:54 +08:00
|
|
|
},
|
2023-02-06 13:34:15 +08:00
|
|
|
navMenuClick (idx) {
|
|
|
|
|
this.navMenuActive = idx
|
|
|
|
|
},
|
|
|
|
|
init () {
|
2023-02-09 16:37:53 +08:00
|
|
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
|
|
|
|
console.log(userInfo.role);
|
|
|
|
|
switch (userInfo.role) {
|
|
|
|
|
case 3:
|
|
|
|
|
this.content.splice(0, 0, {
|
|
|
|
|
iconPath: '/static/transfer.png',
|
|
|
|
|
text: '移交',
|
|
|
|
|
})
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
2023-02-10 16:32:41 +08:00
|
|
|
this.content.splice(1, 0, {
|
2023-02-09 16:37:53 +08:00
|
|
|
iconPath: '/static/share.png',
|
|
|
|
|
text: '分享',
|
2023-02-10 16:32:41 +08:00
|
|
|
}, {
|
|
|
|
|
iconPath: '/static/subordinate.png',
|
|
|
|
|
text: '用户',
|
2023-02-09 16:37:53 +08:00
|
|
|
}, {
|
|
|
|
|
iconPath: '/static/delate.png',
|
|
|
|
|
text: '删除',
|
|
|
|
|
})
|
2023-02-10 16:32:41 +08:00
|
|
|
break;
|
2023-02-09 16:37:53 +08:00
|
|
|
case 5:
|
2023-02-10 16:32:41 +08:00
|
|
|
this.content.push({
|
2023-02-09 16:37:53 +08:00
|
|
|
iconPath: '/static/feedback.png',
|
|
|
|
|
text: '反馈',
|
|
|
|
|
})
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
2023-02-06 13:34:15 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
|
// 获取nav高度
|
|
|
|
|
uni.createSelectorQuery().select('.nav').boundingClientRect((rect) => {
|
|
|
|
|
this.navHeight = rect.height
|
|
|
|
|
}).exec()
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad (options) {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang='scss'>
|
|
|
|
|
.detail {
|
|
|
|
|
|
2023-02-07 17:59:54 +08:00
|
|
|
// background: $uni-theme-white;
|
|
|
|
|
.header {}
|
2023-02-06 13:34:15 +08:00
|
|
|
|
|
|
|
|
.des {
|
|
|
|
|
padding: 20rpx 20rpx 0;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #999;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-20 14:19:28 +08:00
|
|
|
// .nav {
|
|
|
|
|
// position: sticky;
|
|
|
|
|
// top: 0;
|
|
|
|
|
// left: 0;
|
|
|
|
|
// padding: 20rpx;
|
|
|
|
|
// display: flex;
|
|
|
|
|
// background: rgb(243, 244, 245);
|
2023-02-06 13:34:15 +08:00
|
|
|
|
2023-02-20 14:19:28 +08:00
|
|
|
// .nav-menu {
|
|
|
|
|
// padding: 10rpx 20rpx;
|
|
|
|
|
// margin-left: 20rpx;
|
|
|
|
|
// font-size: 28rpx;
|
|
|
|
|
// border-radius: 8rpx;
|
|
|
|
|
// background: $uni-theme-white;
|
2023-02-06 13:34:15 +08:00
|
|
|
|
2023-02-20 14:19:28 +08:00
|
|
|
// &:first-of-type {
|
|
|
|
|
// margin-left: 0;
|
|
|
|
|
// }
|
2023-02-06 13:34:15 +08:00
|
|
|
|
2023-02-20 14:19:28 +08:00
|
|
|
// &-active {
|
|
|
|
|
// background: $uni-theme-blue;
|
|
|
|
|
// color: #fff;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2023-02-06 13:34:15 +08:00
|
|
|
|
2023-02-20 14:19:28 +08:00
|
|
|
// }
|
2023-02-06 13:34:15 +08:00
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 0 20rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</style>
|