APPbug反馈修改
This commit is contained in:
@@ -16,10 +16,30 @@
|
||||
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
<view style="flex: 1"></view>
|
||||
<template v-if="deviceListFilter.length">
|
||||
<template v-if="transfer || share">
|
||||
<view class="nav-menu nav-menu-btn" @click="submit">完成 </view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
@click="transfer = true"
|
||||
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||
>移交
|
||||
</view>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
@click="share = true"
|
||||
v-if="userInfo.authorities === 'app_vip_user'"
|
||||
>分享
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
|
||||
>{{ select.projectType || '类型' }}
|
||||
</view>
|
||||
</view>
|
||||
</picker> -->
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
@@ -31,15 +51,25 @@
|
||||
v-for="(item, index) in deviceListFilter"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
thumbnail="/static/device.png"
|
||||
:thumbnail="deviceIcon(item.runStatus)"
|
||||
>
|
||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
||||
<template v-slot:title v-if="transfer || share">
|
||||
<view class="switch-title">
|
||||
<view class="switch-title-left">{{ item.equipmentName }}</view>
|
||||
<switch
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8)"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="deviceListFilter && deviceListFilter.length > 0"
|
||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -56,6 +86,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
transfer: false,
|
||||
share: false,
|
||||
checkList: [],
|
||||
select: {
|
||||
projectName: '',
|
||||
projectNameIndex: 0,
|
||||
@@ -67,6 +100,7 @@ export default {
|
||||
projectList: [],
|
||||
projectType: [],
|
||||
navHeight: 0,
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -84,39 +118,66 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.uni-navbar')
|
||||
.boundingClientRect((rect1) => {
|
||||
this.navHeight = rect1.height
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
// #ifdef H5
|
||||
this.minHeight =
|
||||
'calc(100vh - env(safe-area-inset-bottom) - ' +
|
||||
(50 + (rect2.height + rect1.height)) +
|
||||
'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + (rect2.height + rect1.height) + 'px)'
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
.exec()
|
||||
}, 1000)
|
||||
created() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
},
|
||||
methods: {
|
||||
deviceIcon(e) {
|
||||
let str = ''
|
||||
switch (e) {
|
||||
case 1:
|
||||
str = '/static/device_bad.png'
|
||||
break
|
||||
case 2:
|
||||
str = '/static/device.png'
|
||||
break
|
||||
default:
|
||||
str = '/static/device.png'
|
||||
break
|
||||
}
|
||||
return str
|
||||
},
|
||||
switchChange(e) {
|
||||
console.log(e)
|
||||
let index = this.checkList.indexOf(e.equipmentId)
|
||||
if (index > -1) {
|
||||
this.checkList.splice(index, 1)
|
||||
} else {
|
||||
this.checkList.push(e.equipmentId)
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
console.log(this.checkList)
|
||||
if (this.transfer) {
|
||||
this.transfer = false
|
||||
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
|
||||
} else if (this.share) {
|
||||
this.share = false
|
||||
this.$emit('share', this.shareList)
|
||||
}
|
||||
this.checkList = []
|
||||
},
|
||||
async init() {
|
||||
this.getProjectList()
|
||||
this.getDeviceList()
|
||||
},
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 999
|
||||
this.store.firstCallBack = () => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
if (!rect2) return
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
getProjectList() {
|
||||
@@ -214,4 +275,14 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss">
|
||||
/deep/ .switch-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
&-left {
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,21 +1,40 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mt20">常用功能</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="常用功能">
|
||||
<Cn-grid title="">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||
@@ -67,22 +86,14 @@ export default {
|
||||
},
|
||||
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:
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/device/list?type=' +
|
||||
type +
|
||||
'&projectList=' +
|
||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,19 +1,37 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -27,22 +45,14 @@ export default {
|
||||
methods:{
|
||||
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:
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/device/list?type=' +
|
||||
type +
|
||||
'&projectList=' +
|
||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,23 +1,70 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="index-zhuanzhi">
|
||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="projectNum">
|
||||
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
|
||||
<view class="header-item-label">项目个数</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="projectNum">
|
||||
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
|
||||
<view class="header-item-label">项目个数</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
devCount: {
|
||||
type: Object,
|
||||
@@ -25,28 +72,34 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
projectWarning() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/zhuanzhi/warning',
|
||||
})
|
||||
},
|
||||
projectNum() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/list',
|
||||
})
|
||||
},
|
||||
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:
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/device/list?type=' +
|
||||
type +
|
||||
'&projectList=' +
|
||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss">
|
||||
.index-zhuanzhi {
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,21 +1,40 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mt20">常用功能</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="常用功能">
|
||||
<Cn-grid title="">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||
@@ -67,22 +86,14 @@ export default {
|
||||
},
|
||||
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:
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/device/list?type=' +
|
||||
type +
|
||||
'&projectList=' +
|
||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,67 +1,61 @@
|
||||
<template>
|
||||
<view class="index-zhuanzhi">
|
||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
|
||||
<div class="header-item-label">设备总数</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
|
||||
<div class="header-item-label">告警数量</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
|
||||
<div class="header-item-label">事件数量</div>
|
||||
</div>
|
||||
<div class="header-item" @click="projectNum">
|
||||
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
|
||||
<div class="header-item-label">项目个数</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('onLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('offLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="projectNum">
|
||||
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
|
||||
<view class="header-item-label">项目个数</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
|
||||
<div class="header-item-label">设备总数</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
|
||||
<div class="header-item-label">告警数量</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
|
||||
<div class="header-item-label">事件数量</div>
|
||||
</div>
|
||||
<div class="header-item" @click="projectNum">
|
||||
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
|
||||
<div class="header-item-label">项目个数</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">在线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="projectNum">
|
||||
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
|
||||
<view class="header-item-label">项目个数</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -90,22 +84,14 @@ export default {
|
||||
},
|
||||
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:
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/device/list?type=' +
|
||||
type +
|
||||
'&projectList=' +
|
||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body" class="canneng-index">
|
||||
<uni-nav-bar
|
||||
<!-- <uni-nav-bar
|
||||
rightWidth="300rpx"
|
||||
leftWidth="300rpx"
|
||||
dark
|
||||
@@ -18,7 +18,7 @@
|
||||
<text class="hide-txt mr5" style="font-size: 28rpx">{{ select.engineeringName }}</text>
|
||||
<uni-icons type="bottom" size="16" color="#fff"></uni-icons>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</uni-nav-bar> -->
|
||||
<view class="index">
|
||||
<!-- 运维 -->
|
||||
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
|
||||
@@ -33,8 +33,6 @@
|
||||
<Device ref="device" :store="store" />
|
||||
</view>
|
||||
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
||||
<uni-nav-bar :fixed="true" status-bar title="选择工程" color="#111"> </uni-nav-bar>
|
||||
<view style="height: 200px"></view>
|
||||
<view>
|
||||
<uni-indexed-list
|
||||
:options="engineeringListFilter"
|
||||
@@ -78,6 +76,7 @@ export default {
|
||||
engineeringId: '',
|
||||
},
|
||||
engineeringList: [],
|
||||
drawer: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -101,6 +100,16 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onNavigationBarButtonTap(e) {
|
||||
console.log(e)
|
||||
// e的返回格式为json对象:{"text":"测试","index":0}
|
||||
this.drawer = !this.drawer
|
||||
if (this.drawer) {
|
||||
this.openDrawer()
|
||||
} else {
|
||||
this.closeDrawer()
|
||||
}
|
||||
},
|
||||
async init() {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
let res = await queryEngineering()
|
||||
@@ -123,12 +132,23 @@ export default {
|
||||
}
|
||||
}
|
||||
this.store.params.engineerId = this.select.engineeringId
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: this.select.engineeringName,
|
||||
})
|
||||
// #endif
|
||||
getDevCount(this.select.engineeringId).then((res) => {
|
||||
this.devCount = res.data
|
||||
})
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
},
|
||||
closeDrawer(e) {
|
||||
if (!e) {
|
||||
this.$refs.showRight.close()
|
||||
return
|
||||
}
|
||||
console.log(e)
|
||||
this.engineeringList.forEach((item) => {
|
||||
if (item.name === e.item.name) {
|
||||
@@ -136,10 +156,20 @@ export default {
|
||||
this.select.engineeringName = item.name
|
||||
this.select.engineeringId = item.id
|
||||
this.store.params.engineerId = item.id
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: this.select.engineeringName,
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
this.$refs.device.select.projectName = ''
|
||||
this.$refs.device.select.projectNameIndex = 0
|
||||
getDevCount(this.select.engineeringId).then((res) => {
|
||||
this.devCount = res.data
|
||||
})
|
||||
this.$refs.device.init()
|
||||
this.$refs.showRight.close()
|
||||
},
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<view class="message">
|
||||
<view class="message-nav" @click="jump('system')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/message3.png" />
|
||||
<view class="message-nav-label">系统</view>
|
||||
<view class="message-nav-label">设备消息</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="message-nav" @click="jump('feedback')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/feedback.png" />
|
||||
<view class="message-nav-label">反馈</view>
|
||||
<view class="message-nav-label">反馈回复</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="message-nav" @click="jump('report')">
|
||||
|
||||
@@ -20,30 +20,39 @@
|
||||
<view class="mine-nav-label">角色升级</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<!-- <view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
||||
<view class="mine-nav-label">角色审核</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
|
||||
<view class="mine-nav-label">子用户列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<view class="mine-nav" @click="jump('scan')">
|
||||
<view
|
||||
class="mine-nav"
|
||||
@click="jump('scan')"
|
||||
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png" />
|
||||
<view class="mine-nav-label">扫一扫</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('engineering')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">工程管理</view>
|
||||
<view class="mine-nav-label">工程列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('engineering/setting')" v-if="userInfo.authorities === 'engineering_user'">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
|
||||
<view class="mine-nav-label">关注工程配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('project')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">项目管理</view>
|
||||
<view class="mine-nav-label">项目列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view
|
||||
@@ -145,9 +154,8 @@ export default {
|
||||
let content = JSON.parse(res.result)
|
||||
switch (content.type) {
|
||||
case 'transferDevice':
|
||||
this.transferDevice(content.id)
|
||||
this.transferDevice(content.id.split(','))
|
||||
break
|
||||
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -182,6 +190,11 @@ export default {
|
||||
url: `/pages/engineering/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering/setting':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/setting`,
|
||||
})
|
||||
break
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/${type}`,
|
||||
|
||||
Reference in New Issue
Block a user