编辑监测点
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
"name" : "灿能物联",
|
||||
"appid" : "__UNI__88BC25B",
|
||||
"description" : "",
|
||||
"versionName" : "1.1.6",
|
||||
"versionCode" : 116,
|
||||
"versionName" : "1.1.8",
|
||||
"versionCode" : 118,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
@@ -132,7 +132,7 @@
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
// "target" : "https://china.indpecker.com",
|
||||
"target" : "http://192.168.1.115:10215",
|
||||
"target" : "http://192.168.1.13:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -176,10 +176,10 @@ export default {
|
||||
this.userInfo.authorities == 5 ||
|
||||
this.userInfo.authorities === 'tourist'
|
||||
) {
|
||||
uni.setTabBarBadge({
|
||||
index: 1,
|
||||
text: '6',
|
||||
})
|
||||
// uni.setTabBarBadge({
|
||||
// index: 1,
|
||||
// text: '6',
|
||||
// })
|
||||
}
|
||||
this.init()
|
||||
},
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
<view class="message-nav" @click="jump('report')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/report.png" />
|
||||
<view class="message-nav-label">稳态越限</view>
|
||||
<uni-badge text="3"></uni-badge>
|
||||
<!-- <uni-badge text="3"></uni-badge>-->
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="message-nav" @click="jump('incident')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/incident.png" />
|
||||
<view class="message-nav-label">暂态事件</view>
|
||||
<uni-badge text="2"></uni-badge>
|
||||
<!-- <uni-badge text="2"></uni-badge>-->
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="message-nav" @click="jump('term')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/term.png" />
|
||||
<view class="message-nav-label">设备状态</view>
|
||||
<uni-badge text="1"></uni-badge>
|
||||
<!-- <uni-badge text="1"></uni-badge>-->
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user