diff --git a/manifest.json b/manifest.json index 25c9748..430bb28 100644 --- a/manifest.json +++ b/manifest.json @@ -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" : "" diff --git a/pages/device/APF/detail.vue b/pages/device/APF/detail.vue index 4d30097..e91e4fa 100644 --- a/pages/device/APF/detail.vue +++ b/pages/device/APF/detail.vue @@ -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() }, } diff --git a/pages/device/edit.vue b/pages/device/edit.vue index cce7924..2ab3aa4 100644 --- a/pages/device/edit.vue +++ b/pages/device/edit.vue @@ -100,7 +100,7 @@ - + {{ point.alias || point.name }} @@ -108,7 +108,7 @@ - 请拖动图中的蓝色定位图标选择监测点位置(左上角) + 请拖动图中的文字选择监测点位置 { 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) }) }, diff --git a/pages/device/new.vue b/pages/device/new.vue index 6975d76..bf34f1c 100644 --- a/pages/device/new.vue +++ b/pages/device/new.vue @@ -128,7 +128,7 @@ - + {{ point.alias || point.name }} @@ -136,7 +136,7 @@ - 请拖动图中的蓝色定位图标选择监测点位置(左上角) + 请拖动图中的文字选择监测点位置 稳态越限 - + 暂态事件 - + 设备状态 - +