编辑监测点
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
"name" : "灿能物联",
|
"name" : "灿能物联",
|
||||||
"appid" : "__UNI__88BC25B",
|
"appid" : "__UNI__88BC25B",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.1.6",
|
"versionName" : "1.1.8",
|
||||||
"versionCode" : 116,
|
"versionCode" : 118,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
"/api" : {
|
"/api" : {
|
||||||
"https" : true,
|
"https" : true,
|
||||||
// "target" : "https://china.indpecker.com",
|
// "target" : "https://china.indpecker.com",
|
||||||
"target" : "http://192.168.1.115:10215",
|
"target" : "http://192.168.1.13:10215",
|
||||||
"changOrigin" : true,
|
"changOrigin" : true,
|
||||||
"pathRewrite" : {
|
"pathRewrite" : {
|
||||||
"/api" : ""
|
"/api" : ""
|
||||||
|
|||||||
@@ -188,22 +188,6 @@ export default {
|
|||||||
basicData: []
|
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: {
|
methods: {
|
||||||
trigger(e) {
|
trigger(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
@@ -266,30 +250,34 @@ export default {
|
|||||||
uni.pageScrollTo({scrollTop: 0, duration: 0})
|
uni.pageScrollTo({scrollTop: 0, duration: 0})
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
if (this.isPrimaryUser == 1) {
|
console.log('init')
|
||||||
this.content.splice(
|
|
||||||
0,
|
this.loading = true
|
||||||
0,
|
this.domLoading = true
|
||||||
{
|
queryTopologyDiagram(this.devId).then((res) => {
|
||||||
iconPath: '/static/transfer.png',
|
this.deviceInfo = res.data
|
||||||
text: '移交',
|
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||||
},
|
this.topolodyData.filter((item) => {
|
||||||
{
|
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
||||||
iconPath: '/static/feedback.png',
|
element.label = element.name
|
||||||
text: '编辑',
|
item.label = element.name
|
||||||
},
|
return element.linePostion === item.linePostion
|
||||||
{
|
|
||||||
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (this.client) {
|
||||||
|
this.loading = false
|
||||||
|
} else {
|
||||||
|
this.initMqtt()
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
},
|
},
|
||||||
renderFinish(e) {
|
renderFinish(e) {
|
||||||
this.img = e
|
this.img = e
|
||||||
@@ -380,31 +368,33 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
|
||||||
this.devId = options.id
|
this.devId = options.id
|
||||||
this.isPrimaryUser = options.isPrimaryUser
|
this.isPrimaryUser = options.isPrimaryUser
|
||||||
|
if (this.isPrimaryUser == 1) {
|
||||||
this.init()
|
this.content.splice(
|
||||||
queryTopologyDiagram(options.id).then((res) => {
|
0,
|
||||||
this.deviceInfo = res.data
|
0,
|
||||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
{
|
||||||
this.topolodyData.filter((item) => {
|
iconPath: '/static/transfer.png',
|
||||||
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
text: '移交',
|
||||||
element.label = element.name
|
},
|
||||||
item.label = element.name
|
{
|
||||||
return element.linePostion === item.linePostion
|
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
|
this.init()
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
// 把多余的监测点过滤掉
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.initMqtt()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
|
|
||||||
<movable-area class="map-pin-box-area">
|
<movable-area class="map-pin-box-area">
|
||||||
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
|
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
|
||||||
<view class="point center">
|
<view class="point">
|
||||||
{{ point.alias || point.name }}
|
{{ point.alias || point.name }}
|
||||||
</view>
|
</view>
|
||||||
</movable-view>
|
</movable-view>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view>
|
<view class="content-des">请拖动图中的文字选择监测点位置</view>
|
||||||
<uni-forms>
|
<uni-forms>
|
||||||
<uni-data-select
|
<uni-data-select
|
||||||
v-model="point.linePostion"
|
v-model="point.linePostion"
|
||||||
@@ -366,8 +366,11 @@ export default {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
this.$util.toast('提交成功')
|
this.$util.toast('提交成功')
|
||||||
|
let prePage = this.$util.prePage()
|
||||||
|
prePage.init()
|
||||||
|
console.log(prePage)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack({delta: 2})
|
uni.navigateBack({delta: 1})
|
||||||
}, 1500)
|
}, 1500)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
|
|
||||||
<movable-area class="map-pin-box-area">
|
<movable-area class="map-pin-box-area">
|
||||||
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
|
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
|
||||||
<view class="point center">
|
<view class="point">
|
||||||
{{ point.alias || point.name }}
|
{{ point.alias || point.name }}
|
||||||
</view>
|
</view>
|
||||||
</movable-view>
|
</movable-view>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view>
|
<view class="content-des">请拖动图中的文字选择监测点位置</view>
|
||||||
<uni-forms>
|
<uni-forms>
|
||||||
<uni-data-select
|
<uni-data-select
|
||||||
v-model="point.position"
|
v-model="point.position"
|
||||||
|
|||||||
@@ -176,10 +176,10 @@ export default {
|
|||||||
this.userInfo.authorities == 5 ||
|
this.userInfo.authorities == 5 ||
|
||||||
this.userInfo.authorities === 'tourist'
|
this.userInfo.authorities === 'tourist'
|
||||||
) {
|
) {
|
||||||
uni.setTabBarBadge({
|
// uni.setTabBarBadge({
|
||||||
index: 1,
|
// index: 1,
|
||||||
text: '6',
|
// text: '6',
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,19 +10,19 @@
|
|||||||
<view class="message-nav" @click="jump('report')">
|
<view class="message-nav" @click="jump('report')">
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/report.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/report.png" />
|
||||||
<view class="message-nav-label">稳态越限</view>
|
<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>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('incident')">
|
<view class="message-nav" @click="jump('incident')">
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/incident.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/incident.png" />
|
||||||
<view class="message-nav-label">暂态事件</view>
|
<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>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('term')">
|
<view class="message-nav" @click="jump('term')">
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/term.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/term.png" />
|
||||||
<view class="message-nav-label">设备状态</view>
|
<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>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user