编辑监测点

This commit is contained in:
仲么了
2023-08-29 20:31:34 +08:00
parent 38b827af46
commit d0168235d4
6 changed files with 68 additions and 75 deletions

View File

@@ -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>

View File

@@ -100,7 +100,7 @@
<movable-area class="map-pin-box-area">
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
<view class="point center">
<view class="point">
{{ point.alias || point.name }}
</view>
</movable-view>
@@ -108,7 +108,7 @@
</view>
</view>
<view class="content">
<view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view>
<view class="content-des">请拖动图中的文字选择监测点位置</view>
<uni-forms>
<uni-data-select
v-model="point.linePostion"
@@ -366,8 +366,11 @@ export default {
}).then((res) => {
console.log(res)
this.$util.toast('提交成功')
let prePage = this.$util.prePage()
prePage.init()
console.log(prePage)
setTimeout(() => {
uni.navigateBack({delta: 2})
uni.navigateBack({delta: 1})
}, 1500)
})
},

View File

@@ -128,7 +128,7 @@
<movable-area class="map-pin-box-area">
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
<view class="point center">
<view class="point">
{{ point.alias || point.name }}
</view>
</movable-view>
@@ -136,7 +136,7 @@
</view>
</view>
<view class="content">
<view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view>
<view class="content-des">请拖动图中的文字选择监测点位置</view>
<uni-forms>
<uni-data-select
v-model="point.position"