编辑监测点
This commit is contained in:
@@ -188,22 +188,6 @@ export default {
|
||||
basicData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showtTarget() {
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
let arr = JSON.parse(JSON.stringify(this.deviceInfo.appsLineTopologyDiagramPO))
|
||||
arr.forEach((item) => {
|
||||
item.value = item.value?.filter((item2) => {
|
||||
return item2.showText
|
||||
})
|
||||
})
|
||||
return arr.filter((item) => {
|
||||
return item.value.length
|
||||
})
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
trigger(e) {
|
||||
console.log(e)
|
||||
@@ -266,30 +250,34 @@ export default {
|
||||
uni.pageScrollTo({scrollTop: 0, duration: 0})
|
||||
},
|
||||
init() {
|
||||
if (this.isPrimaryUser == 1) {
|
||||
this.content.splice(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
iconPath: '/static/transfer.png',
|
||||
text: '移交',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/feedback.png',
|
||||
text: '编辑',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/delate.png',
|
||||
text: '删除',
|
||||
},
|
||||
)
|
||||
if (this.userInfo.authorities === 'app_vip_user') {
|
||||
this.content.splice(3, 0, {
|
||||
iconPath: '/static/share.png',
|
||||
text: '分享',
|
||||
console.log('init')
|
||||
|
||||
this.loading = true
|
||||
this.domLoading = true
|
||||
queryTopologyDiagram(this.devId).then((res) => {
|
||||
this.deviceInfo = res.data
|
||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||
this.topolodyData.filter((item) => {
|
||||
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
||||
element.label = element.name
|
||||
item.label = element.name
|
||||
return element.linePostion === item.linePostion
|
||||
})
|
||||
if (index > -1) {
|
||||
item.lat = this.deviceInfo.appsLineTopologyDiagramPO[index].lat
|
||||
item.lng = this.deviceInfo.appsLineTopologyDiagramPO[index].lng
|
||||
return true
|
||||
} else {
|
||||
// 把多余的监测点过滤掉
|
||||
return false
|
||||
}
|
||||
})
|
||||
if (this.client) {
|
||||
this.loading = false
|
||||
} else {
|
||||
this.initMqtt()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
renderFinish(e) {
|
||||
this.img = e
|
||||
@@ -380,31 +368,33 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
|
||||
this.devId = options.id
|
||||
this.isPrimaryUser = options.isPrimaryUser
|
||||
|
||||
this.init()
|
||||
queryTopologyDiagram(options.id).then((res) => {
|
||||
this.deviceInfo = res.data
|
||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||
this.topolodyData.filter((item) => {
|
||||
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
||||
element.label = element.name
|
||||
item.label = element.name
|
||||
return element.linePostion === item.linePostion
|
||||
if (this.isPrimaryUser == 1) {
|
||||
this.content.splice(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
iconPath: '/static/transfer.png',
|
||||
text: '移交',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/feedback.png',
|
||||
text: '编辑',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/delate.png',
|
||||
text: '删除',
|
||||
},
|
||||
)
|
||||
if (this.userInfo.authorities === 'app_vip_user') {
|
||||
this.content.splice(3, 0, {
|
||||
iconPath: '/static/share.png',
|
||||
text: '分享',
|
||||
})
|
||||
if (index > -1) {
|
||||
item.lat = this.deviceInfo.appsLineTopologyDiagramPO[index].lat
|
||||
item.lng = this.deviceInfo.appsLineTopologyDiagramPO[index].lng
|
||||
return true
|
||||
} else {
|
||||
// 把多余的监测点过滤掉
|
||||
return false
|
||||
}
|
||||
})
|
||||
this.initMqtt()
|
||||
})
|
||||
}
|
||||
}
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user