This commit is contained in:
花有清香月有阴
2022-02-17 16:07:34 +08:00
parent 6db67c6fcc
commit 6470a2b52f
5 changed files with 23 additions and 16 deletions

View File

@@ -292,6 +292,7 @@ export default {
return arr.indexOf(item, 0) === index return arr.indexOf(item, 0) === index
}) })
}, },
nameAvatar(name) { nameAvatar(name) {
return name?.split('')?.slice(-2) || '游客' return name?.split('')?.slice(-2) || '游客'
}, },

View File

@@ -66,6 +66,17 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getList() {
this.$instance.post(`/app/appzyvideoequipment/getAreaEquipment?areaId=${this.areaId}`).then((res) => {
if (res?.data) {
this.list = res.data.list
this.count = res.data.count
this.onlineRate = (this.count.online / this.count.sum).toFixed(2)
this.offlineRate = (1 - this.onlineRate).toFixed(2)
}
})
},
getMonitors(nodeId, queryType = 0) { getMonitors(nodeId, queryType = 0) {
this.monitors = [] this.monitors = []
this.$instance this.$instance
@@ -79,31 +90,26 @@ export default {
} }
}) })
}, },
getMore(row) { getMore(row) {
this.nodes.push(row) this.nodes.push(row)
this.getMonitors(row.nodeId, row.hasChild == 1 ? 0 : 1) this.getMonitors(row.nodeId, row.hasChild == 1 ? 0 : 1)
}, },
isCurrent(index) { isCurrent(index) {
return index == Math.max(this.nodes?.length - 1, 0) return index == Math.max(this.nodes?.length - 1, 0)
}, },
gotoNode(node, index) { gotoNode(node, index) {
this.nodes.splice(index + 1) this.nodes.splice(index + 1)
this.getMonitors(node.nodeId) this.getMonitors(node.nodeId)
}, },
getList() {
this.$instance.post(`/app/appzyvideoequipment/getAreaEquipment?areaId=${this.areaId}`).then((res) => {
if (res?.data) {
this.list = res.data.list
this.count = res.data.count
this.onlineRate = (this.count.online / this.count.sum).toFixed(2)
this.offlineRate = (1 - this.onlineRate).toFixed(2)
}
})
},
areaSelect(e) { areaSelect(e) {
this.areaId = e this.areaId = e
this.getList() this.getList()
}, },
showMonitor(row) { showMonitor(row) {
if (row.deviceStatus != 1) return if (row.deviceStatus != 1) return
uni.navigateTo({ url: `./monitorDetail?id=${row.id}` }) uni.navigateTo({ url: `./monitorDetail?id=${row.id}` })

View File

@@ -22,7 +22,7 @@
<div class="datas" v-if="data.length"> <div class="datas" v-if="data.length">
<div class="card" v-for="(item, index) in 3" :key="index" @click="toDetail(item)"> <div class="card" v-for="(item, index) in 3" :key="index" @click="toDetail(item)">
<div class="cardTop"> <div class="cardTop">
<img src="../../static/workOnline/池夏2.jpg" alt="" /> <img src="../../static/workOnline/icon3@2x.png" alt="" />
<div class="rightTop"> <div class="rightTop">
<div class="leftStaus"> <div class="leftStaus">
@@ -40,7 +40,7 @@
<div class="cardConts">秋穿上漫步森林在阳光下呼吸伸展在安逸的天也许是兰天名字的由来吧</div> <div class="cardConts">秋穿上漫步森林在阳光下呼吸伸展在安逸的天也许是兰天名字的由来吧</div>
<div class="cardImg"> <div class="cardImg">
<img src="../../static/workOnline/池夏2.jpg" alt="" v-for="(items, i) in 4" :key="i" /> <img src="../../static/workOnline/icon3@2x.png" alt="" v-for="(items, i) in 4" :key="i" />
</div> </div>
<div class="cardBot"> <div class="cardBot">

View File

@@ -6,7 +6,7 @@
<div class="middle"> <div class="middle">
<div class="cardTop"> <div class="cardTop">
<img src="../../static/workOnline/池夏2.jpg" alt="" /> <img src="../../static/workOnline/icon3@2x.png" alt="" />
<div class="rightTop"> <div class="rightTop">
<div class="leftStaus"> <div class="leftStaus">
@@ -23,7 +23,7 @@
<div class="cardConts">秋穿上漫步森林在阳光下呼吸伸展在安逸的天也许是兰天名字的由来吧</div> <div class="cardConts">秋穿上漫步森林在阳光下呼吸伸展在安逸的天也许是兰天名字的由来吧</div>
<div class="cardImg"> <div class="cardImg">
<img src="../../static/workOnline/池夏2.jpg" alt="" v-for="(items, i) in 4" :key="i" /> <img src="../../static/workOnline/icon3@2x.png" alt="" v-for="(items, i) in 4" :key="i" />
</div> </div>
<div class="cardBot"> <div class="cardBot">
@@ -107,7 +107,7 @@ export default {
return this.$u.toast('请输入你的想法') return this.$u.toast('请输入你的想法')
} }
this.$http this.$instance
.post(`/app/appvillagediscussmessage/addOrUpdate`, { .post(`/app/appvillagediscussmessage/addOrUpdate`, {
content: this.content, content: this.content,
avatar: this.user.avatar, avatar: this.user.avatar,
@@ -127,7 +127,7 @@ export default {
}, },
like(id) { like(id) {
this.$http this.$instance
.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`) .post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`)
.then((res) => { .then((res) => {
this.$hideLoading() this.$hideLoading()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB