提交app
This commit is contained in:
246
pages/index/comp/apply.vue
Normal file
246
pages/index/comp/apply.vue
Normal file
@@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="filterCriteria">
|
||||
<!-- 筛选条件 -->
|
||||
<Cn-filterCriteria @select="select" :showDatetime="false"> </Cn-filterCriteria>
|
||||
<view class="choose1">
|
||||
<view>
|
||||
<checkbox-group @change="changeBox"
|
||||
><checkbox value="true" :checked="checkedAll" />全选
|
||||
</checkbox-group></view
|
||||
>
|
||||
<view class="nav-menu nav-menu-btn" @click="selectDevice('transfer')">申请报表 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="smallLabel mt20">
|
||||
<view> 共 {{ store.total }} 条事件 | 已选择 {{ checkedTotal }} 条事件 </view>
|
||||
<view style="width: 180rpx">
|
||||
<picker @change="bindPickerChange" :value="sort" :range="array">
|
||||
<view class="uni-input"
|
||||
>{{ array[sort] }}排序
|
||||
<uni-icons custom-prefix="iconfont" type="icon-paixu1" size="10" color="#2563EB"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 卡片 -->
|
||||
<view class="event-list" :style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }">
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card
|
||||
class="event-item"
|
||||
:class="judgment(item.showName)"
|
||||
v-for="(item, index) in store.data"
|
||||
:key="index"
|
||||
@click="clackCard(item)"
|
||||
>
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-icon">
|
||||
<!-- 动态图标:根据类型切换 -->
|
||||
<uni-icons
|
||||
:custom-prefix="judgment(item.showName) == 'interrupt' ? 'custom-icon' : 'iconfont'"
|
||||
:type="
|
||||
judgment(item.showName) == 'sag'
|
||||
? 'icon-xiajiang'
|
||||
: judgment(item.showName) == 'swell'
|
||||
? 'icon-shangsheng'
|
||||
: 'minus'
|
||||
"
|
||||
:color="
|
||||
judgment(item.showName) == 'sag'
|
||||
? '#2563eb '
|
||||
: judgment(item.showName) == 'swell'
|
||||
? '#e6a23c'
|
||||
: '#909399'
|
||||
"
|
||||
:size="judgment(item.showName) == 'interrupt' ? '50' : '25'"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.equipmentName }}</text>
|
||||
<text class="event-tag" :class="`${judgment(item.showName)}-tag`">{{ item.showName }}</text>
|
||||
</view>
|
||||
<view class="event-desc">
|
||||
<text>工程名称:{{ item.engineeringName }}</text>
|
||||
<text>项目名称:{{ item.projectName }}</text>
|
||||
<text>监测点名称:{{ item.lineName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="event-action">
|
||||
<!-- 选择 -->
|
||||
<checkbox-group @change="changeChild($event, item)"
|
||||
><checkbox value="true" :checked="item.checked" />
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text>
|
||||
发生时间:{{ item.startTime }},幅值:{{ item.evtParamVVaDepth }},持续时间:{{
|
||||
item.evtParamTm
|
||||
}},相别:{{ item.evtParamPhase }}
|
||||
</text>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else style="top: 20%"></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
navHeight: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
selectValue: {},
|
||||
height: 0,
|
||||
checkedAll: false,
|
||||
checkedTotal: 0,
|
||||
sort: 0,
|
||||
array: ['发生时间', '暂降深度', '持续时间'],
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
setHeight() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.filterCriteria')
|
||||
.boundingClientRect((rect) => {
|
||||
console.log('🚀 ~ rect:', rect)
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 100 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 100 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
async select(val) {
|
||||
this.selectValue = val
|
||||
await this.init()
|
||||
this.setHeight()
|
||||
},
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = 0
|
||||
this.store.params.pageSize = 10000
|
||||
this.store.params.sortField = this.sort
|
||||
this.store.params.engineeringid = this.selectValue.engineeringId
|
||||
this.store.params.projectId = this.selectValue.projectId
|
||||
this.store.params.deviceId = this.selectValue.deviceId
|
||||
this.store.params.lineId = this.selectValue.lineId
|
||||
this.store.params.startTime = this.selectValue.range[0]
|
||||
this.store.params.endTime = this.selectValue.range[1]
|
||||
this.store.loadedCallback = () => {
|
||||
this.checkedTotal = 0
|
||||
this.store.data = this.store.data.map((item) => {
|
||||
item.checked = false
|
||||
return item
|
||||
})
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
// 全选
|
||||
changeBox(e) {
|
||||
this.checkedAll = !this.checkedAll
|
||||
if (e.target.value.length > 0) {
|
||||
this.store.data = this.store.data.map((item) => {
|
||||
item.checked = true
|
||||
return item
|
||||
})
|
||||
this.checkedTotal = this.store.total
|
||||
} else {
|
||||
this.store.data = this.store.data.map((item) => {
|
||||
item.checked = false
|
||||
return item
|
||||
})
|
||||
this.checkedTotal = 0
|
||||
}
|
||||
},
|
||||
changeChild(e, item) {
|
||||
item.checked = !item.checked
|
||||
this.checkedAll = this.store.data.every((item) => item.checked === true)
|
||||
this.checkedTotal = this.store.data.filter((item) => item.checked === true).length
|
||||
},
|
||||
// 点击卡片
|
||||
clackCard() {},
|
||||
// 切换排序
|
||||
bindPickerChange(e) {
|
||||
this.sort = e.detail.value
|
||||
this.init()
|
||||
},
|
||||
judgment(val) {
|
||||
switch (val) {
|
||||
case '电压暂降':
|
||||
return 'sag'
|
||||
case '电压暂升':
|
||||
return 'swell'
|
||||
case '电压中断':
|
||||
return 'interrupt'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
watch: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/pages/message1/index.scss';
|
||||
.filterCriteria {
|
||||
.nav {
|
||||
background-color: #fff;
|
||||
}
|
||||
.choose1 {
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
/deep/ .uni-checkbox-input {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
.nav-menu {
|
||||
padding: 6rpx 20rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #ebeaec;
|
||||
color: #666;
|
||||
&-active {
|
||||
background: #dfe5f7;
|
||||
color: $uni-theme-color;
|
||||
}
|
||||
&-btn {
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
/deep/.uni-card__content {
|
||||
padding: 20rpx !important;
|
||||
}
|
||||
.smallLabel {
|
||||
justify-content: space-between;
|
||||
font-size: 24rpx !important;
|
||||
}
|
||||
</style>
|
||||
@@ -61,33 +61,22 @@
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
<Cn-device-card v-for="(item, index) in deviceListFilter" :device="item" :key="index">
|
||||
<template v-slot:title v-if="transfer || share">
|
||||
<template v-slot:title>
|
||||
<!-- 卡片标题 -->
|
||||
<view class="uni-card__header">
|
||||
<view class="uni-card__header-box">
|
||||
<view class="uni-card__header-avatar">
|
||||
<image
|
||||
class="uni-card__header-avatar-image"
|
||||
:src="deviceIcon(item.runStatus)"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<view class="uni-card__header-content">
|
||||
<text class="uni-card__header-content-title uni-ellipsis">
|
||||
{{ item.equipmentName }}
|
||||
</text>
|
||||
<text class="uni-card__header-content-subtitle uni-ellipsis">
|
||||
{{ item.mac }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="uni-card__header-extra" style="position: relative">
|
||||
<switch
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8); position: relative; left: 20rpx"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<switch
|
||||
v-if="transfer || share"
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8); position: relative; left: 20rpx"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
<view class="star-icon" v-else @click="toggleStar(item)">
|
||||
<uni-icons
|
||||
custom-prefix="custom-icon"
|
||||
:type="item.isTop == 1 ? 'star-filled' : 'star'"
|
||||
:color="item.isTop == 1 ? '#ffcc00' : ''"
|
||||
size="25"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</Cn-device-card>
|
||||
@@ -102,7 +91,7 @@
|
||||
<script>
|
||||
import { getProjectList } from '@/common/api/project'
|
||||
import { queryDictData } from '@/common/api/dictionary'
|
||||
|
||||
import { engineeringPinToTop } from '@/common/api/device'
|
||||
export default {
|
||||
props: {
|
||||
store: {
|
||||
@@ -133,7 +122,6 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
deviceListFilter() {
|
||||
|
||||
let arr = this.store.data.filter((item) => {
|
||||
if (this.select.projectName && this.select.projectType) {
|
||||
return item.project === this.select.projectName && item.type === this.select.projectType
|
||||
@@ -145,9 +133,8 @@ export default {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
if (this.transfer || this.share) {
|
||||
|
||||
return arr.filter((item) => {
|
||||
return item.isPrimaryUser === '1' //&& item.process == 4
|
||||
})
|
||||
@@ -161,6 +148,20 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toggleStar(item) {
|
||||
engineeringPinToTop({
|
||||
targetId: item.equipmentId,
|
||||
targetType: 1,
|
||||
userId: uni.getStorageSync(this.$cacheKey.userInfo).userIndex,
|
||||
}).then((res) => {
|
||||
if (res.code == 'A0000') {
|
||||
this.$util.toast('操作成功!')
|
||||
this.store.search()
|
||||
} else {
|
||||
this.$util.toast(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDevice(type) {
|
||||
if (this.deviceListFilter.findIndex((item) => item.isPrimaryUser === '1') === -1) {
|
||||
this.$util.toast('没有可操作的设备')
|
||||
@@ -184,7 +185,6 @@ export default {
|
||||
return str
|
||||
},
|
||||
switchChange(e) {
|
||||
console.log(e)
|
||||
let index = this.checkList.indexOf(e.equipmentId)
|
||||
if (index > -1) {
|
||||
this.checkList.splice(index, 1)
|
||||
@@ -333,18 +333,22 @@ export default {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
jump(item) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser+ '&ndid=' + item.ndid,
|
||||
url:
|
||||
'/pages/device/APF/detail?id=' +
|
||||
item.equipmentId +
|
||||
'&isPrimaryUser=' +
|
||||
item.isPrimaryUser +
|
||||
'&ndid=' +
|
||||
item.ndid,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index-device{
|
||||
.index-device {
|
||||
.nav-menu {
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
224
pages/index/comp/engineering.vue
Normal file
224
pages/index/comp/engineering.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<view class="index-device">
|
||||
<view class="nav" :style="{ top: navTabHeight + 'px' }"> </view>
|
||||
<view class="content device project-list" :style="{ minHeight: minHeight }">
|
||||
<uni-card v-for="(item, index) in store.data" :key="index">
|
||||
<view class="card-header">
|
||||
<view class="project-icon">
|
||||
<uni-icons custom-prefix="iconfont" type="icon-gongcheng" color="#2563eb" size="45"></uni-icons>
|
||||
</view>
|
||||
<view class="project-info">
|
||||
<view class="project-name">{{ item.engineeringName }}</view>
|
||||
<view class="project-stats">
|
||||
<view class="stat-item" @click="jump('nowEngineering', item)">
|
||||
<text class="stat-value blue">{{ item.devTotal }}</text>
|
||||
<text class="stat-label">设备总数</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('currentOnLineDevs', item)">
|
||||
<text class="stat-value green">{{ item.onlineDevTotal }}</text>
|
||||
<text class="stat-label">在线设备</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('currentOffLineDevs', item)">
|
||||
<text class="stat-value red">{{ item.offlineDevTotal }}</text>
|
||||
<text class="stat-label">离线设备</text>
|
||||
</view>
|
||||
<view class="stat-item" @click="jump('event', item)">
|
||||
<text class="stat-value red">{{ item.alarmTotal }}</text>
|
||||
<text class="stat-label">告警数量</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="star-icon" @click="toggleStar(item)">
|
||||
<uni-icons
|
||||
custom-prefix="custom-icon"
|
||||
:type="item.isTop == 1 ? 'star-filled' : 'star'"
|
||||
:color="item.isTop == 1 ? '#ffcc00' : ''"
|
||||
size="25"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { engineeringPinToTop } from '@/common/api/device'
|
||||
export default {
|
||||
props: {
|
||||
store: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
minHeight: 0,
|
||||
navTabHeight: 0,
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
deviceListFilter() {
|
||||
let arr = this.store.data
|
||||
|
||||
return arr
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
},
|
||||
mounted() {
|
||||
console.log(12333, this.store)
|
||||
},
|
||||
methods: {
|
||||
toggleStar(item) {
|
||||
engineeringPinToTop({
|
||||
targetId: item.engineeringId,
|
||||
targetType: 2,
|
||||
userId: uni.getStorageSync(this.$cacheKey.userInfo).userIndex,
|
||||
}).then((res) => {
|
||||
if (res.code == 'A0000') {
|
||||
this.$util.toast('操作成功!')
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$util.toast(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 50
|
||||
this.store.firstCallBack = (res) => {
|
||||
uni.createSelectorQuery()
|
||||
.select('.uni-navbar')
|
||||
.boundingClientRect((rect1) => {
|
||||
if (!rect1) return
|
||||
this.navTabHeight = rect1.height
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
if (!rect2) return
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - ' + (this.navTabHeight + rect2.height + 50) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + (this.navTabHeight + rect2.height) + 'px)'
|
||||
console.log(this.minHeight)
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
.exec()
|
||||
}
|
||||
this.store.reload()
|
||||
},
|
||||
async init() {
|
||||
console.warn('init')
|
||||
this.getDeviceList()
|
||||
},
|
||||
|
||||
jump(type, item) {
|
||||
if (type == 'event') {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message1',
|
||||
})
|
||||
} else {
|
||||
uni.setStorageSync('engineering', { name: item.engineeringName, id: item.engineeringId })
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.index-device {
|
||||
/* 列表容器 */
|
||||
|
||||
// .project-card {
|
||||
// background-color: #ffffff;
|
||||
// border-radius: 16rpx;
|
||||
// margin-bottom: 16rpx;
|
||||
// padding: 24rpx;
|
||||
// box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
|
||||
// }
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.project-icon {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 20rpx;
|
||||
background-color: #2563eb20;
|
||||
}
|
||||
|
||||
.project-info {
|
||||
flex: 1;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.project-name {
|
||||
font-size: 15px;
|
||||
color: #3a3a3a;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.project-stats {
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
border-right: 2rpx solid #ccc;
|
||||
&:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 24rpx;
|
||||
color: #6a6a6a;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: #007aff;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #34c759;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #ff3b30;
|
||||
}
|
||||
|
||||
.icon-star {
|
||||
color: #cccccc;
|
||||
}
|
||||
}
|
||||
/deep/ .uni-card {
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,24 +1,38 @@
|
||||
<template>
|
||||
<view class="index-zhuyonghu">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
<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="mt20"></view>
|
||||
</template>
|
||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="index-zhuyonghu">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
<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" @click="jumpMessage">
|
||||
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage">
|
||||
<view class="header-item-value">{{
|
||||
devCount.eventCount + devCount.runCount + devCount.harmonicCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="eningerNum">
|
||||
<view class="header-item-value">{{ devCount.eningerCount || 0 }}</view>
|
||||
<view class="header-item-label">工程个数</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="mt20"></view> -->
|
||||
</template>
|
||||
<!-- <view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('nowEngineering')">
|
||||
<view class="header-item-value"
|
||||
@@ -34,135 +48,147 @@
|
||||
<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="" :auto-fill="false">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice(4)"></Cn-grid-item>
|
||||
<Cn-grid-item
|
||||
src="/static/device2.png"
|
||||
text="功能调试"
|
||||
@click="registerDevice(2)"
|
||||
v-if="config.feature"
|
||||
></Cn-grid-item>
|
||||
<Cn-grid-item
|
||||
src="/static/device2.png"
|
||||
text="出厂调试"
|
||||
@click="registerDevice(3)"
|
||||
v-if="config.factory"
|
||||
></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.feature"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.factory"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></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>-->
|
||||
</Cn-grid>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="dialog" @maskClick="maskClick">
|
||||
<uni-popup-dialog
|
||||
mode="base"
|
||||
type="info"
|
||||
content="请选择设备类型"
|
||||
:duration="0"
|
||||
confirmText="直连设备"
|
||||
cancelText="网关接入"
|
||||
cancelColor="#007aff"
|
||||
@close="close"
|
||||
@confirm="confirm"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="canneng-index-title mt20">常用功能</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="" :auto-fill="false">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice(4)"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item
|
||||
src="/static/device2.png"
|
||||
text="功能调试"
|
||||
@click="registerDevice(2)"
|
||||
v-if="config.feature"
|
||||
></Cn-grid-item>
|
||||
<Cn-grid-item
|
||||
src="/static/device2.png"
|
||||
text="出厂调试"
|
||||
@click="registerDevice(3)"
|
||||
v-if="config.factory"
|
||||
></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item background="#fff" v-if="!config.feature"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.factory"></Cn-grid-item> -->
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></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>-->
|
||||
</Cn-grid>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="dialog" @maskClick="maskClick">
|
||||
<uni-popup-dialog
|
||||
mode="base"
|
||||
type="info"
|
||||
content="请选择设备类型"
|
||||
:duration="0"
|
||||
confirmText="直连设备"
|
||||
cancelText="网关接入"
|
||||
cancelColor="#007aff"
|
||||
@close="close"
|
||||
@confirm="confirm"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
config: {
|
||||
feature: true,
|
||||
factory: true,
|
||||
},
|
||||
type: 0,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
devCount: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
console.log('工程init')
|
||||
let serverConfig = uni.getStorageSync(this.$cacheKey.serverConfig)
|
||||
serverConfig && (this.config = serverConfig)
|
||||
},
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
},
|
||||
registerDevice(type) {
|
||||
this.type = type
|
||||
this.$refs.popup.open()
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请选择设备类型',
|
||||
// confirmText: '直连设备',
|
||||
// cancelText: '网关接入',
|
||||
// cancelColor: '#007aff',
|
||||
// success: ({ confirm, cancel }) => {
|
||||
// if (confirm) {
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/device/new?type=' + type,
|
||||
// })
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index&type=' + type,
|
||||
// })
|
||||
// }
|
||||
// } else if (cancel) {
|
||||
// // uni.navigateTo({
|
||||
// // url: '/pages/gateway/list',
|
||||
// // })
|
||||
// this.$util.toast('功能正在开发,敬请期待')
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
},
|
||||
maskClick() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
close() {
|
||||
this.$util.toast('功能正在开发,敬请期待')
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm(value) {
|
||||
if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=' + this.type,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?from=index&type=' + this.type,
|
||||
})
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
config: {
|
||||
feature: true,
|
||||
factory: true,
|
||||
},
|
||||
type: 0,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
devCount: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
console.log('工程init')
|
||||
let serverConfig = uni.getStorageSync(this.$cacheKey.serverConfig)
|
||||
serverConfig && (this.config = serverConfig)
|
||||
},
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
},
|
||||
registerDevice(type) {
|
||||
this.type = type
|
||||
this.$refs.popup.open()
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请选择设备类型',
|
||||
// confirmText: '直连设备',
|
||||
// cancelText: '网关接入',
|
||||
// cancelColor: '#007aff',
|
||||
// success: ({ confirm, cancel }) => {
|
||||
// if (confirm) {
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/device/new?type=' + type,
|
||||
// })
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index&type=' + type,
|
||||
// })
|
||||
// }
|
||||
// } else if (cancel) {
|
||||
// // uni.navigateTo({
|
||||
// // url: '/pages/gateway/list',
|
||||
// // })
|
||||
// this.$util.toast('功能正在开发,敬请期待')
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
},
|
||||
maskClick() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
close() {
|
||||
this.$util.toast('功能正在开发,敬请期待')
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm(value) {
|
||||
if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=' + this.type,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?from=index&type=' + this.type,
|
||||
})
|
||||
}
|
||||
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
registerGateway() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/new',
|
||||
})
|
||||
},
|
||||
jump(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
},
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
registerGateway() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/new',
|
||||
})
|
||||
},
|
||||
jump(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
jumpMessage() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message1',
|
||||
})
|
||||
},
|
||||
eningerNum() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/list',
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
|
||||
@@ -1,122 +1,122 @@
|
||||
<template>
|
||||
<view class="index-zhuanzhi">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
<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" @click="jumpMessage">
|
||||
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage">
|
||||
<view class="header-item-value">{{
|
||||
devCount.eventCount + devCount.runCount + devCount.harmonicCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="eningerNum">
|
||||
<view class="header-item-value">{{ devCount.eningerCount || 0 }}</view>
|
||||
<view class="header-item-label">工程个数</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt20"></view>
|
||||
</template>
|
||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('nowEngineering')">
|
||||
<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" @click="jumpMessage">
|
||||
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentEventCount + devCount.currentRunCount + devCount.currentHarmonicCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="projectNum(true)">
|
||||
<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,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
jumpMessage(){
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message',
|
||||
})
|
||||
},
|
||||
eningerNum(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/list',
|
||||
})
|
||||
},
|
||||
projectWarning() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/zhuanzhi/warning',
|
||||
})
|
||||
},
|
||||
projectNum() {
|
||||
console.log(now)
|
||||
if (now) {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/list?engineeringName=' + engineering.name + '&engineeringId=' + engineering.id,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/list',
|
||||
})
|
||||
}
|
||||
},
|
||||
jump(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index-zhuanzhi {
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="index-zhuanzhi">
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('allEngineering')">
|
||||
<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" @click="jumpMessage">
|
||||
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage">
|
||||
<view class="header-item-value">{{
|
||||
devCount.eventCount + devCount.runCount + devCount.harmonicCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="eningerNum">
|
||||
<view class="header-item-value">{{ devCount.eningerCount || 0 }}</view>
|
||||
<view class="header-item-label">工程个数</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt20"></view>
|
||||
</template>
|
||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item" @click="jump('nowEngineering')">
|
||||
<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" @click="jumpMessage">
|
||||
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
|
||||
<view class="header-item-label">告警数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentEventCount + devCount.currentRunCount + devCount.currentHarmonicCount || 0
|
||||
}}</view>
|
||||
<view class="header-item-label">事件数量</view>
|
||||
</view>
|
||||
<view class="header-item" @click="projectNum(true)">
|
||||
<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,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
jumpMessage(){
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message',
|
||||
})
|
||||
},
|
||||
eningerNum(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/list',
|
||||
})
|
||||
},
|
||||
projectWarning() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/zhuanzhi/warning',
|
||||
})
|
||||
},
|
||||
projectNum(now) {
|
||||
console.log(now)
|
||||
if (now) {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/list?engineeringName=' + engineering.name + '&engineeringId=' + engineering.id,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/list',
|
||||
})
|
||||
}
|
||||
},
|
||||
jump(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index-zhuanzhi {
|
||||
}
|
||||
</style>
|
||||
|
||||
124
pages/index/comp/steadyState.vue
Normal file
124
pages/index/comp/steadyState.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<view class="dateReport">
|
||||
<view class="pd20">
|
||||
<uni-segmented-control
|
||||
:current="curSub"
|
||||
class="subsection"
|
||||
active-color="#376cf3"
|
||||
:values="subsectionList"
|
||||
@clickItem="sectionChange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 卡片 -->
|
||||
<view
|
||||
class="event-list"
|
||||
v-if="eventList.length != 0"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + 56) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in eventList" :key="index">
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id" >{{ item.id }}</text>
|
||||
<text class="event-tags">{{ item.tag }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text>频率偏差越限111次</text>
|
||||
<text>不平衡度越限3次</text>
|
||||
<text>电压畸变率越限5次</text>
|
||||
<text>偶次电压越限5次</text>
|
||||
</view>
|
||||
<view class="downloadReport">
|
||||
<uni-icons type="download" size="16" color="#376cf3"></uni-icons>下载报告
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more :status="status"></uni-load-more>
|
||||
</view>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
indexList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
navHeight: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 'noMore',
|
||||
curSub: 0,
|
||||
subsectionList: ['周报', '月报'],
|
||||
eventList: [
|
||||
{
|
||||
id: '测试监测点',
|
||||
tag: '2026-01-23至2026-01-23',
|
||||
|
||||
status: '1',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
|
||||
methods: {
|
||||
sectionChange(index) {
|
||||
this.curSub = index.currentIndex
|
||||
},
|
||||
scrolltolower() {
|
||||
if (this.total != this.indexList.length) {
|
||||
this.$emit('scrolltolower')
|
||||
} else {
|
||||
// this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
watch: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/pages/message1/index.scss';
|
||||
.event-title {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.event-tags {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.event-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.downloadReport {
|
||||
width: 100%;
|
||||
background: #376cf320;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: #376cf3;
|
||||
font-weight: 600;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
179
pages/index/comp/transient.vue
Normal file
179
pages/index/comp/transient.vue
Normal file
@@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<view class="dateReport">
|
||||
<view class="pd20">
|
||||
<uni-segmented-control
|
||||
:current="curSub"
|
||||
class="subsection"
|
||||
active-color="#376cf3"
|
||||
:values="subsectionList"
|
||||
@clickItem="sectionChange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 申请报表 -->
|
||||
<view v-if="curSub == 0">
|
||||
<!-- apply -->
|
||||
<Apply :navHeight="navHeight"/>
|
||||
</view>
|
||||
|
||||
<!-- 申请记录 -->
|
||||
<view v-if="curSub == 1">
|
||||
<view
|
||||
class="record event-list"
|
||||
v-if="eventList.length != 0"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + 56) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in eventList" :key="index">
|
||||
<view class="title" :class="item.status == 1 ? 'completed' : 'incomplete'">
|
||||
<view> {{ item.status == 1 ? '已完成' : '未完成' }} </view>
|
||||
</view>
|
||||
<!-- 头部:图标 + 信息 + 操作 -->
|
||||
<view class="event-header">
|
||||
<view class="event-info">
|
||||
<view class="event-title">
|
||||
<text class="event-id">{{ item.id }}</text>
|
||||
<text class="event-tags">{{ item.tag }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情区域 -->
|
||||
<view class="event-detail">
|
||||
<text>申请人:xxx</text>
|
||||
<text>电话号码:18888888888</text>
|
||||
</view>
|
||||
<view class="downloadReport">
|
||||
<!-- <u-icon :name="item.status == 1 ? 'download' : 'upload'" color="#376cf3" size="40"></u-icon> -->
|
||||
<uni-icons
|
||||
:type="item.status == 1 ? 'download' : 'upload'"
|
||||
size="16"
|
||||
color="#376cf3"
|
||||
></uni-icons>
|
||||
|
||||
{{ item.status == 1 ? '下载报告' : '生成报告' }}
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more :status="status"></uni-load-more>
|
||||
</view>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import Apply from './apply.vue'
|
||||
export default {
|
||||
components: { Apply },
|
||||
props: {
|
||||
indexList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
// status: {
|
||||
// type: String,
|
||||
// default: 'more',
|
||||
// },
|
||||
navHeight: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: ['0'],
|
||||
content: 123,
|
||||
curSub: 0,
|
||||
subsectionList: ['申请报表', '申请记录'],
|
||||
form: {
|
||||
type: 0,
|
||||
lindId: '',
|
||||
},
|
||||
status: 'noMore',
|
||||
eventList: [
|
||||
{
|
||||
id: '测试监测点',
|
||||
tag: '2026-01-23至2026-01-23',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
id: '测试监测点',
|
||||
tag: '2026-01-23至2026-01-23',
|
||||
status: '0',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
this.$emit('scrolltolower')
|
||||
},
|
||||
getHeight() {},
|
||||
|
||||
sectionChange(index) {
|
||||
this.curSub = index.currentIndex
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/pages/message1/index.scss';
|
||||
.event-title {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.event-tags {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.event-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.downloadReport {
|
||||
width: 100%;
|
||||
background: #376cf320;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: #376cf3;
|
||||
font-weight: 600;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
width: calc(100% - 36rpx);
|
||||
// margin: 0 10px;
|
||||
top: 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
padding: 2px 10px;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-weight: 700;
|
||||
}
|
||||
.completed {
|
||||
background: #e1f3d8;
|
||||
color: #67c23a;
|
||||
}
|
||||
.incomplete {
|
||||
background: #fde2e2;
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
/deep/ .record {
|
||||
.uni-card__content {
|
||||
padding: 55rpx 20rpx 20rpx !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -16,9 +16,18 @@
|
||||
</template>
|
||||
<template slot="right">
|
||||
<text class="hide-txt mr5" style="font-size: 28rpx"
|
||||
>{{ select.engineeringName || emptyEngineeringName }}
|
||||
>{{
|
||||
userInfo.authorities === 'engineering_user'
|
||||
? '创建工程'
|
||||
: select.engineeringName || emptyEngineeringName
|
||||
}}
|
||||
</text>
|
||||
<uni-icons type="bottom" size="16" color="#111" v-if="select.engineeringName"></uni-icons>
|
||||
<uni-icons
|
||||
type="bottom"
|
||||
size="16"
|
||||
color="#111"
|
||||
v-if="select.engineeringName && userInfo.authorities != 'engineering_user'"
|
||||
></uni-icons>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="index">
|
||||
@@ -32,7 +41,13 @@
|
||||
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
|
||||
<!-- 游客 -->
|
||||
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"></YouKe>
|
||||
<template v-show="engineeringList.length">
|
||||
<!-- 工程列表 -->
|
||||
<template v-show="engineeringList.length" v-if="userInfo.authorities === 'engineering_user'">
|
||||
<view class="canneng-index-title mt20">工程列表</view>
|
||||
<Engineering ref="engineering" :store="store" @refresh="store.search()"/>
|
||||
</template>
|
||||
<!-- 设备列表 -->
|
||||
<template v-else v-show="engineeringList.length">
|
||||
<view class="canneng-index-title mt20">设备列表</view>
|
||||
<Device ref="device" :store="store" />
|
||||
</template>
|
||||
@@ -47,6 +62,7 @@ import ZhuYongHu from './comp/indexZhuYongHu.vue'
|
||||
import ZhuanZhi from './comp/indexZhuanZhi.vue'
|
||||
import YouKe from './comp/indexYouKe.vue'
|
||||
import Device from './comp/device.vue'
|
||||
import Engineering from './comp/engineering.vue'
|
||||
import list from '../../common/js/list'
|
||||
import { getDevCount } from '../../common/api/device.js'
|
||||
import { queryEngineering } from '@/common/api/engineering.js'
|
||||
@@ -60,6 +76,7 @@ export default {
|
||||
ZhuanZhi,
|
||||
YouKe,
|
||||
Device,
|
||||
Engineering,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -88,7 +105,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
selectEngineering() {
|
||||
if (this.select.engineeringName) {
|
||||
if (this.userInfo.authorities === 'engineering_user') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new',
|
||||
})
|
||||
} else if (this.select.engineeringName) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/selectEngineering',
|
||||
})
|
||||
@@ -140,6 +161,7 @@ export default {
|
||||
console.log(this.$refs.device, 'this.$refs.device')
|
||||
this.$nextTick(() => {
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
this.$refs.engineering && this.$refs.engineering.init()
|
||||
})
|
||||
}
|
||||
this.$refs.gongCheng?.init()
|
||||
@@ -175,7 +197,7 @@ export default {
|
||||
if (messagePage) {
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text:messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
|
||||
text: messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
|
||||
})
|
||||
} else {
|
||||
uni.removeTabBarBadge({
|
||||
@@ -197,8 +219,10 @@ export default {
|
||||
// #endif
|
||||
})
|
||||
},
|
||||
// 动态配置导航栏按钮
|
||||
},
|
||||
onLoad() {
|
||||
// 页面加载时,动态配置导航栏按钮
|
||||
if (!uni.getStorageSync(this.$cacheKey.access_token)) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/user/login',
|
||||
@@ -216,7 +240,11 @@ export default {
|
||||
}, 1000)
|
||||
}
|
||||
this.timer = setInterval(this.getDevCount, 1000 * 60) // 定时请求
|
||||
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||
|
||||
this.store =
|
||||
uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'engineering_user'
|
||||
? this.DataSource('/cs-harmonic-boot/homePage/getEngineeringHomePage')
|
||||
: this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
|
||||
287
pages/index/message1.vue
Normal file
287
pages/index/message1.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" class="messageBox" style="padding-top: 10px">
|
||||
<view slot="body" class="message">
|
||||
<view class="tabsBox">
|
||||
<uni-segmented-control
|
||||
:current="current"
|
||||
:values="items"
|
||||
style-type="text"
|
||||
active-color="#376cf3"
|
||||
@clickItem="onClickItem"
|
||||
/>
|
||||
<!-- 角标 -->
|
||||
<view class="badge-container">
|
||||
<span
|
||||
v-for="(item, index) in items"
|
||||
:key="index"
|
||||
class="badge"
|
||||
:style="{ left: getBadgeRightPosition(index) }"
|
||||
v-if="badgeCounts[index] > 0"
|
||||
>
|
||||
{{ badgeCounts[index] > 99 ? '99+' : badgeCounts[index] }}
|
||||
</span>
|
||||
</view>
|
||||
<!-- 筛选条件 -->
|
||||
<Cn-filterCriteria
|
||||
ref="cnFilterCriteria"
|
||||
:level="current === 0 ? 3 : current === 1 ? 3 : 2"
|
||||
@select="select"
|
||||
>
|
||||
</Cn-filterCriteria>
|
||||
</view>
|
||||
<view class="content">
|
||||
<Transient
|
||||
ref="TransientRef"
|
||||
v-if="current === 0"
|
||||
:navHeight="navHeight"
|
||||
:selectValue="selectValue"
|
||||
@getDevCount="getDevCount"
|
||||
/>
|
||||
<SteadyState
|
||||
ref="SteadyStateRef"
|
||||
v-if="current === 1"
|
||||
:navHeight="navHeight"
|
||||
:selectValue="selectValue"
|
||||
@getDevCount="getDevCount"
|
||||
/>
|
||||
<Alarm
|
||||
ref="AlarmRef"
|
||||
v-if="current === 2"
|
||||
:navHeight="navHeight"
|
||||
:selectValue="selectValue"
|
||||
@getDevCount="getDevCount"
|
||||
/>
|
||||
<Run
|
||||
ref="RunRef"
|
||||
v-if="current === 3"
|
||||
:navHeight="navHeight"
|
||||
:selectValue="selectValue"
|
||||
@getDevCount="getDevCount"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import Transient from '@/pages/message1/transient.vue'
|
||||
import SteadyState from '@/pages/message1/steadyState.vue'
|
||||
import Alarm from '@/pages/message1/alarm.vue'
|
||||
import Run from '@/pages/message1/run.vue'
|
||||
import { getDevCount } from '../../common/api/device.js'
|
||||
import { updateStatus } from '@/common/api/message'
|
||||
export default {
|
||||
components: { Transient, SteadyState, Alarm, Run },
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
items: ['暂态事件', '稳态事件', '运行告警', '运行事件'],
|
||||
badgeCounts: [0, 0, 0, 0],
|
||||
current: 0,
|
||||
colorIndex: 0,
|
||||
item: '',
|
||||
loading: false,
|
||||
width: 0,
|
||||
navHeight: 0,
|
||||
selectValue: {},
|
||||
devCount: [],
|
||||
// 筛选数据
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.refresh()
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要全部标记为已读吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
updateStatus({
|
||||
// '暂态事件', 0
|
||||
// '稳态事件', 1
|
||||
// '运行告警', 3
|
||||
// '运行事件' 2
|
||||
type: this.current == 2 ? 3 : this.current == 3 ? 2 : this.current,
|
||||
eventIds: [],
|
||||
}).then(() => {
|
||||
this.refresh()
|
||||
this.getDevCount()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getDevCount()
|
||||
this.$nextTick(() => {
|
||||
this.refresh()
|
||||
this.$refs.cnFilterCriteria.getProjectList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
setHeight() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.tabsBox')
|
||||
.boundingClientRect((rect) => {
|
||||
this.width = rect.width
|
||||
//
|
||||
// #ifdef H5
|
||||
this.navHeight = rect.height + 70
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.navHeight = rect.height + 20
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
|
||||
refresh() {
|
||||
switch (this.current) {
|
||||
case 0:
|
||||
// this.$refs.TransientRef.getConfig()
|
||||
// this.$refs.TransientRef.filterValue = ''
|
||||
this.$refs.TransientRef.store.reload()
|
||||
|
||||
break
|
||||
case 1:
|
||||
this.$refs.SteadyStateRef.store.reload()
|
||||
break
|
||||
case 2:
|
||||
this.$refs.AlarmRef.store.reload()
|
||||
break
|
||||
case 3:
|
||||
this.$refs.RunRef.store.reload()
|
||||
break
|
||||
}
|
||||
},
|
||||
onClickItem(e) {
|
||||
if (this.current !== e.currentIndex) {
|
||||
this.current = e.currentIndex
|
||||
}
|
||||
},
|
||||
select(value) {
|
||||
this.selectValue = value
|
||||
setTimeout(() => {
|
||||
this.setHeight()
|
||||
}, 100)
|
||||
},
|
||||
|
||||
getDevCount() {
|
||||
if (uni.getStorageSync('projectList')[1] != undefined) {
|
||||
getDevCount(uni.getStorageSync('projectList')[1].engineeringId).then((res) => {
|
||||
this.devCount = res.data
|
||||
this.badgeCounts = [
|
||||
this.devCount.eventCount,
|
||||
this.devCount.harmonicCount,
|
||||
this.devCount.alarmCount,
|
||||
this.devCount.runCount,
|
||||
]
|
||||
uni.setStorage({
|
||||
key: this.$cacheKey.messageCount,
|
||||
data: this.devCount,
|
||||
})
|
||||
let messagePage =
|
||||
this.devCount.runCount +
|
||||
this.devCount.eventCount +
|
||||
this.devCount.alarmCount +
|
||||
this.devCount.harmonicCount
|
||||
let minePage = this.devCount.feedBackCount
|
||||
|
||||
if (messagePage) {
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text: messagePage ? (messagePage > 99 ? '99+' : messagePage + '') : '',
|
||||
})
|
||||
} else {
|
||||
uni.removeTabBarBadge({
|
||||
index: 1,
|
||||
})
|
||||
}
|
||||
if (minePage) {
|
||||
uni.setTabBarBadge({
|
||||
index: 2,
|
||||
text: minePage + '',
|
||||
})
|
||||
} else {
|
||||
uni.removeTabBarBadge({
|
||||
index: 2,
|
||||
})
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.setBadgeNumber(messagePage + minePage)
|
||||
// #endif
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 根据索引动态计算右侧偏移位置,使徽章对准每个标签的右上角
|
||||
getBadgeRightPosition(index) {
|
||||
return (index + 1) * (this.width / 4) + 'px'
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.messageBox {
|
||||
overflow: hidden;
|
||||
/deep/.tabsBox {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
.segmented-control {
|
||||
height: 49px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #cccccc70;
|
||||
}
|
||||
|
||||
.segmented-control__text {
|
||||
font-size: 27rpx !important;
|
||||
color: rgb(96, 98, 102);
|
||||
}
|
||||
.segmented-control__item--text {
|
||||
font-weight: bold;
|
||||
}
|
||||
.choose {
|
||||
// padding: 20rpx;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.subsection {
|
||||
width: 90%;
|
||||
margin: 20rpx auto;
|
||||
}
|
||||
.badge-container {
|
||||
position: absolute;
|
||||
top: 10rpx; /* 徽章向上偏移,与控件重叠 */
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
pointer-events: none; /* 确保徽章不干扰点击事件 */
|
||||
}
|
||||
|
||||
.badge {
|
||||
position: absolute;
|
||||
// min-width: 18px;
|
||||
height: 16px;
|
||||
padding: 0 4px;
|
||||
background-color: #ff3b30; /* 红色徽章 */
|
||||
color: white;
|
||||
font-size: 22rpx;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
border-radius: 9px;
|
||||
transform: translateX(-150%); /* 使徽章中心对齐右上角 */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,382 +1,383 @@
|
||||
<template>
|
||||
<view :loading="loading">
|
||||
<view class="mine">
|
||||
<view class="mine-header" @click="jump('basic')">
|
||||
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar" />
|
||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else />
|
||||
<view class="mine-header-name hide-txt">
|
||||
<view>{{ userInfo.nickname }}</view>
|
||||
<view></view>
|
||||
<view class="tag">{{ roleName }}</view>
|
||||
</view>
|
||||
<image
|
||||
src="/static/erweima.png"
|
||||
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<uni-icons type="forward" color="#aaa" size="16"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" v-if="userInfo.authorities === 'tourist'" @click="jump('upgrade')">
|
||||
<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 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 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')"
|
||||
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/gongcheng.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>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('feedback')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/feedback.png" />
|
||||
<view class="mine-nav-label">反馈列表</view>
|
||||
<uni-badge :text="messageCount.feedBackCount"></uni-badge>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view
|
||||
class="mine-nav"
|
||||
@click="jump('gateway')"
|
||||
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/gateway.png" />
|
||||
<view class="mine-nav-label">网关列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<view class="mine-nav" @click="jump('setupMessage')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.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/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('serverSetting')" v-if="userInfo.authorities === 'engineering_user'">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server2.png" />
|
||||
<view class="mine-nav-label">调试内容配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
|
||||
<view class="mine-nav-label">设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
mode="input"
|
||||
title="角色升级"
|
||||
placeholder="请输入六位邀请码"
|
||||
@confirm="upgrade"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
style="width: 90%; margin: 5%"
|
||||
type="info"
|
||||
cancelText="禁止"
|
||||
confirmText="允许"
|
||||
title="权限说明"
|
||||
content='是否允许"灿能物联"使用相机?'
|
||||
@confirm="handleScon('camera')"
|
||||
@close="dialogClose"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<uni-popup ref="message" type="message">
|
||||
<uni-popup-message type="info" :duration="0" style="width: 90%; margin: 5%">
|
||||
<view style="color: #909399; font-style: 16px">相机权限使用说明:</view>
|
||||
<view style="color: #6c6c6c; margin-top: 3rpx; "> 用于相机扫描二维码!</view>
|
||||
</uni-popup-message>
|
||||
</uni-popup>
|
||||
<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CAMERA"></yk-authpup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { roleUpdate, autoLogin } from '@/common/api/user'
|
||||
import { transferDevice, shareDevice } from '@/common/api/device'
|
||||
import ykAuthpup from "@/components/yk-authpup/yk-authpup";
|
||||
export default {
|
||||
components: {
|
||||
ykAuthpup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
messageCount: {},
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roleName() {
|
||||
let roleName = ''
|
||||
switch (this.userInfo.authorities) {
|
||||
case 'tourist':
|
||||
roleName = '游客'
|
||||
break
|
||||
case 'engineering_user':
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
break
|
||||
case 'operation_manager':
|
||||
roleName = '运维管理员'
|
||||
break
|
||||
}
|
||||
return roleName
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
roleUpdate({
|
||||
referralCode: code,
|
||||
userId: this.userInfo.userIndex,
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.removeStorageSync('access_token')
|
||||
// 直接登录
|
||||
autoLogin(this.userInfo.user_name).then((res) => {
|
||||
this.$util.loginSuccess(res.data).then((userInfo) => {
|
||||
this.userInfo = userInfo
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
changeAuth(){
|
||||
//这里是权限通过后执行自己的代码逻辑
|
||||
console.log('权限已授权,可执行自己的代码逻辑了');
|
||||
// this.handleScon()
|
||||
this.handleScon()
|
||||
},
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
case 'scan':
|
||||
if (
|
||||
plus.os.name == 'Android'
|
||||
// && plus.navigator.checkPermission('android.permission.CAMERA') === 'undetermined'
|
||||
) {
|
||||
//未授权
|
||||
// this.$refs.alertDialog.open('bottom')
|
||||
this.$refs['authpup'].open()
|
||||
// this.$refs.message.open()
|
||||
|
||||
} else {
|
||||
console.log(2)
|
||||
this.handleScon()
|
||||
}
|
||||
|
||||
|
||||
break
|
||||
case 'login':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/login`,
|
||||
})
|
||||
break
|
||||
case 'gateway':
|
||||
uni.navigateTo({
|
||||
url: `/pages/gateway/list`,
|
||||
})
|
||||
break
|
||||
case 'upgrade':
|
||||
this.$refs.inputDialog.open()
|
||||
break
|
||||
case 'basic':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/basic`,
|
||||
})
|
||||
break
|
||||
case 'project':
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering/setting':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/setting`,
|
||||
})
|
||||
break
|
||||
case 'feedback':
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/feedback`,
|
||||
})
|
||||
break
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/${type}`,
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
handleScon(){
|
||||
this.$refs.message.close()
|
||||
uni.scanCode({
|
||||
onlyFromCamera:true,
|
||||
success: (res) => {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
let content = JSON.parse(res.result)
|
||||
switch (content.type) {
|
||||
case 'transferDevice':
|
||||
this.transferDevice(content.id.split(','))
|
||||
break
|
||||
case 'shareDevice':
|
||||
this.shareDevice(content.id.split(','))
|
||||
break
|
||||
default:
|
||||
this.$util.toast('无效二维码')
|
||||
break
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
dialogClose(){this.$refs.message.close()},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
shareDevice(id) {
|
||||
shareDevice(id).then((res) => {
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=shareDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.loading = false
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
this.timer = setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 1000) // 定时请求
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mine {
|
||||
.mine-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
|
||||
.mine-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mine-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
|
||||
.engineering-button {
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 12rpx;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
border-radius: 16rpx;
|
||||
background: $uni-theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mine-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/ .uni-popup-message__box {
|
||||
border-radius: 10rpx !important;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
<template>
|
||||
<view :loading="loading">
|
||||
<view class="mine">
|
||||
<view class="mine-header" @click="jump('basic')">
|
||||
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar" />
|
||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else />
|
||||
<view class="mine-header-name hide-txt">
|
||||
<view>{{ userInfo.nickname }}</view>
|
||||
<view></view>
|
||||
<view class="tag">{{ roleName }}</view>
|
||||
</view>
|
||||
<image
|
||||
src="/static/erweima.png"
|
||||
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<uni-icons type="forward" color="#aaa" size="16"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" v-if="userInfo.authorities === 'tourist'" @click="jump('upgrade')">
|
||||
<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 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 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')"
|
||||
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/gongcheng.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>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('feedback')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/feedback.png" />
|
||||
<view class="mine-nav-label">反馈列表</view>
|
||||
<uni-badge :text="messageCount.feedBackCount"></uni-badge>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view
|
||||
class="mine-nav"
|
||||
@click="jump('gateway')"
|
||||
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/gateway.png" />
|
||||
<view class="mine-nav-label">网关列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<view class="mine-nav" @click="jump('setupMessage')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.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/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('transientSetting')" >
|
||||
<!-- 调试内容配置 serverSetting-->
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server2.png" />
|
||||
<view class="mine-nav-label">暂态事件</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
|
||||
<view class="mine-nav-label">设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
mode="input"
|
||||
title="角色升级"
|
||||
placeholder="请输入六位邀请码"
|
||||
@confirm="upgrade"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
style="width: 90%; margin: 5%"
|
||||
type="info"
|
||||
cancelText="禁止"
|
||||
confirmText="允许"
|
||||
title="权限说明"
|
||||
content='是否允许"灿能物联"使用相机?'
|
||||
@confirm="handleScon('camera')"
|
||||
@close="dialogClose"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<uni-popup ref="message" type="message">
|
||||
<uni-popup-message type="info" :duration="0" style="width: 90%; margin: 5%">
|
||||
<view style="color: #909399; font-style: 16px">相机权限使用说明:</view>
|
||||
<view style="color: #6c6c6c; margin-top: 3rpx; "> 用于相机扫描二维码!</view>
|
||||
</uni-popup-message>
|
||||
</uni-popup>
|
||||
<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CAMERA"></yk-authpup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { roleUpdate, autoLogin } from '@/common/api/user'
|
||||
import { transferDevice, shareDevice } from '@/common/api/device'
|
||||
import ykAuthpup from "@/components/yk-authpup/yk-authpup";
|
||||
export default {
|
||||
components: {
|
||||
ykAuthpup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
messageCount: {},
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roleName() {
|
||||
let roleName = ''
|
||||
switch (this.userInfo.authorities) {
|
||||
case 'tourist':
|
||||
roleName = '游客'
|
||||
break
|
||||
case 'engineering_user':
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = '正式用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
break
|
||||
case 'operation_manager':
|
||||
roleName = '运维管理员'
|
||||
break
|
||||
}
|
||||
return roleName
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
roleUpdate({
|
||||
referralCode: code,
|
||||
userId: this.userInfo.userIndex,
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.removeStorageSync('access_token')
|
||||
// 直接登录
|
||||
autoLogin(this.userInfo.user_name).then((res) => {
|
||||
this.$util.loginSuccess(res.data).then((userInfo) => {
|
||||
this.userInfo = userInfo
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
changeAuth(){
|
||||
//这里是权限通过后执行自己的代码逻辑
|
||||
console.log('权限已授权,可执行自己的代码逻辑了');
|
||||
// this.handleScon()
|
||||
this.handleScon()
|
||||
},
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
case 'scan':
|
||||
if (
|
||||
plus.os.name == 'Android'
|
||||
// && plus.navigator.checkPermission('android.permission.CAMERA') === 'undetermined'
|
||||
) {
|
||||
//未授权
|
||||
// this.$refs.alertDialog.open('bottom')
|
||||
this.$refs['authpup'].open()
|
||||
// this.$refs.message.open()
|
||||
|
||||
} else {
|
||||
console.log(2)
|
||||
this.handleScon()
|
||||
}
|
||||
|
||||
|
||||
break
|
||||
case 'login':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/login`,
|
||||
})
|
||||
break
|
||||
case 'gateway':
|
||||
uni.navigateTo({
|
||||
url: `/pages/gateway/list`,
|
||||
})
|
||||
break
|
||||
case 'upgrade':
|
||||
this.$refs.inputDialog.open()
|
||||
break
|
||||
case 'basic':
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/basic`,
|
||||
})
|
||||
break
|
||||
case 'project':
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/list`,
|
||||
})
|
||||
break
|
||||
case 'engineering/setting':
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/setting`,
|
||||
})
|
||||
break
|
||||
case 'feedback':
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/feedback`,
|
||||
})
|
||||
break
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/${type}`,
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
handleScon(){
|
||||
this.$refs.message.close()
|
||||
uni.scanCode({
|
||||
onlyFromCamera:true,
|
||||
success: (res) => {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
let content = JSON.parse(res.result)
|
||||
switch (content.type) {
|
||||
case 'transferDevice':
|
||||
this.transferDevice(content.id.split(','))
|
||||
break
|
||||
case 'shareDevice':
|
||||
this.shareDevice(content.id.split(','))
|
||||
break
|
||||
default:
|
||||
this.$util.toast('无效二维码')
|
||||
break
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
dialogClose(){this.$refs.message.close()},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
shareDevice(id) {
|
||||
shareDevice(id).then((res) => {
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=shareDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.loading = false
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
this.timer = setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 1000) // 定时请求
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mine {
|
||||
.mine-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
|
||||
.mine-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mine-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
|
||||
.engineering-button {
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 12rpx;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
border-radius: 16rpx;
|
||||
background: $uni-theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mine-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/ .uni-popup-message__box {
|
||||
border-radius: 10rpx !important;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
171
pages/index/report.vue
Normal file
171
pages/index/report.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<view :loading="loading" class="report" style="padding-top: 10px">
|
||||
<view class="navReport">
|
||||
<view class="tabsBox">
|
||||
<uni-segmented-control
|
||||
:current="curTabs"
|
||||
:values="items"
|
||||
style-type="text"
|
||||
active-color="#376cf3"
|
||||
@clickItem="onClickItem"
|
||||
/>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 稳态报表 -->
|
||||
<SteadyState
|
||||
v-if="curTabs == 0"
|
||||
:indexList="indexList"
|
||||
:total="total"
|
||||
:status="status"
|
||||
:navHeight="navHeight"
|
||||
@scrolltolower="scrolltolower"
|
||||
/>
|
||||
<!-- 暂态报表 -->
|
||||
<Transient
|
||||
v-if="curTabs == 1"
|
||||
:indexList="indexList"
|
||||
:total="total"
|
||||
:status="status"
|
||||
:navHeight="navHeight"
|
||||
@scrolltolower="scrolltolower"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import SteadyState from './comp/steadyState.vue'
|
||||
import Transient from './comp/transient.vue'
|
||||
export default {
|
||||
components: {
|
||||
SteadyState,
|
||||
Transient,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
curTabs: 0,
|
||||
|
||||
total: 6,
|
||||
loading: false,
|
||||
items: ['稳态报表', '暂态报表'],
|
||||
status: 'more', //more加载前 loading加载中 noMore加载后
|
||||
|
||||
navHeight: 0,
|
||||
|
||||
indexList: [
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '2',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
name: '测试监测点',
|
||||
item: '2022-01-01至2022-01-01',
|
||||
type: '1',
|
||||
status: '0',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
uni.createSelectorQuery()
|
||||
.select('.navReport')
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.navHeight = rect.height + 60
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.navHeight = rect.height + 10
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClickItem(e) {
|
||||
if (this.curTabs !== e.currentIndex) {
|
||||
this.curTabs = e.currentIndex
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
scrolltolower() {
|
||||
if (this.total != this.indexList.length) {
|
||||
this.status = 'loading'
|
||||
this.info()
|
||||
} else {
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
info() {
|
||||
setTimeout(() => {
|
||||
this.status = 'more'
|
||||
}, 1000)
|
||||
},
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
watch: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.report {
|
||||
overflow: hidden;
|
||||
/deep/ .u-tabs__wrapper__nav {
|
||||
background: #fff;
|
||||
}
|
||||
/deep/ .u-tabs__wrapper__nav__item {
|
||||
flex: 1;
|
||||
}
|
||||
/deep/ .u-tabs__wrapper__nav__line {
|
||||
left: 80rpx;
|
||||
}
|
||||
|
||||
/deep/ .u-u-subsection {
|
||||
width: 80% !important;
|
||||
}
|
||||
/deep/.tabsBox {
|
||||
border-bottom: 1px solid #cccccc70;
|
||||
.segmented-control {
|
||||
height: 49px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.segmented-control__text {
|
||||
font-size: 27rpx !important;
|
||||
color: rgb(96, 98, 102);
|
||||
}
|
||||
.segmented-control__item--text {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user