数据切换到正式环境
This commit is contained in:
@@ -13,19 +13,19 @@
|
||||
<view class="item">20.0</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">干接点</view>
|
||||
<view class="grid-card-content-4">
|
||||
<view class="item item-title">干接点1</view>
|
||||
<view class="item item-title">干接点2</view>
|
||||
<view class="item item-title"></view>
|
||||
<view class="item item-title"></view>
|
||||
<view class="item">正常</view>
|
||||
<view class="item">正常</view>
|
||||
<view class="item"></view>
|
||||
<view class="item"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="grid-card">-->
|
||||
<!-- <view class="grid-card-title">干接点</view>-->
|
||||
<!-- <view class="grid-card-content-4">-->
|
||||
<!-- <view class="item item-title">干接点1</view>-->
|
||||
<!-- <view class="item item-title">干接点2</view>-->
|
||||
<!-- <view class="item item-title"></view>-->
|
||||
<!-- <view class="item item-title"></view>-->
|
||||
<!-- <view class="item">正常</view>-->
|
||||
<!-- <view class="item">正常</view>-->
|
||||
<!-- <view class="item"></view>-->
|
||||
<!-- <view class="item"></view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
@@ -29,18 +29,15 @@
|
||||
<view class="module">
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-content-2">
|
||||
<view class="item">模块一</view>
|
||||
<view class="item">
|
||||
<view class="status-point-success mr10"></view>
|
||||
<view style="width: 30rpx"> 15</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
<view class="item">模块二</view>
|
||||
<view class="item">
|
||||
<view class="status-point-error mr10"></view>
|
||||
<view style="width: 30rpx"> 0</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
<template v-for="(item,index) in IOData">
|
||||
<view class="item">{{ item.clDid }}</view>
|
||||
<view class="item">
|
||||
<!-- <view class="status-point-success mr10"></view>-->
|
||||
<view style="width: 30rpx"> {{ item.value }}</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -185,7 +182,8 @@ export default {
|
||||
value: [],
|
||||
},
|
||||
],
|
||||
basicData: []
|
||||
basicData: [],
|
||||
IOData: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -255,6 +253,7 @@ export default {
|
||||
this.loading = true
|
||||
this.domLoading = true
|
||||
queryTopologyDiagram(this.devId).then((res) => {
|
||||
res.data.filePath = this.$config.static + res.data.filePath
|
||||
this.deviceInfo = res.data
|
||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||
this.topolodyData.filter((item) => {
|
||||
@@ -312,13 +311,22 @@ export default {
|
||||
this.client
|
||||
.on('connect', () => {
|
||||
console.log('连接成功')
|
||||
this.client.subscribe(`/zl/TemperData/${this.devId}`, (err) => {
|
||||
if (!err) {
|
||||
console.log(`订阅成功:/zl/TemperData/${this.devId}`)
|
||||
}
|
||||
})
|
||||
this.client.subscribe(`/zl/devData/${this.devId}`, (err) => {
|
||||
if (!err) {
|
||||
console.log(`订阅成功:/zl/devData/${this.devId}`)
|
||||
|
||||
// 默认推送
|
||||
this.client.publish(`/zl/askDevData/${this.devId}`)
|
||||
this.client.publish(`/zl/askTemperData/${this.devId}`)
|
||||
this.timer = setInterval(() => {
|
||||
console.log('askDevData')
|
||||
this.client.publish(`/zl/askDevData/${this.devId}`)
|
||||
this.client.publish(`/zl/askTemperData/${this.devId}`)
|
||||
}, 1000 * 60)
|
||||
}
|
||||
})
|
||||
@@ -335,14 +343,20 @@ export default {
|
||||
})
|
||||
.on('message', (topic, message) => {
|
||||
console.log('接收推送信息:', message.toString(), topic)
|
||||
if (topic !== `/zl/devData/${this.devId}`) return
|
||||
if ((!message.toString() || message.toString().length < 10) && this.loading) {
|
||||
this.$util.toast('该设备暂无数据')
|
||||
if (topic === `/zl/devData/${this.devId}`) {
|
||||
if ((!message.toString() || message.toString().length < 10) && this.loading) {
|
||||
this.$util.toast('该设备暂无数据')
|
||||
}
|
||||
this.loading = false
|
||||
this.handlerData(JSON.parse(message.toString()))
|
||||
} else if (topic === `/zl/TemperData/${this.devId}`) {
|
||||
// this.basicData.forEach((item) => {
|
||||
// if (item.statisticalName === '温度' && item.phase === 'avg') {
|
||||
// item.statisticalData = message.toString()
|
||||
// }
|
||||
// })
|
||||
this.IOData = JSON.parse(message.toString())
|
||||
}
|
||||
this.loading = false
|
||||
this.handlerData(JSON.parse(message.toString()))
|
||||
|
||||
this.$forceUpdate()
|
||||
})
|
||||
},
|
||||
handlerData(data) {
|
||||
|
||||
@@ -236,7 +236,12 @@ export default {
|
||||
queryTopologyDiagramPage({
|
||||
projectId: this.formData.projectId,
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records
|
||||
this.imageList = res.data.records.map(item=>{
|
||||
return {
|
||||
...item,
|
||||
filePath: this.$config.static + item.filePath
|
||||
}
|
||||
})
|
||||
this.activeGplot = this.imageList.findIndex(item => {
|
||||
return item.id === this.deviceInfo.id
|
||||
})
|
||||
|
||||
@@ -271,7 +271,12 @@ export default {
|
||||
queryTopologyDiagramPage({
|
||||
projectId: this.formData.projectId,
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records
|
||||
this.imageList = res.data.records.map(item=>{
|
||||
return {
|
||||
...item,
|
||||
filePath: this.$config.static + item.filePath
|
||||
}
|
||||
})
|
||||
this.activeGplot = 0
|
||||
if (this.imageList.length) {
|
||||
this.confirmGplot()
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
return {
|
||||
"name": item,
|
||||
"extname": item.split('.')[1],
|
||||
"url": item,
|
||||
"url": this.$config.static + item,
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
|
||||
@@ -249,7 +249,7 @@ export default {
|
||||
return {
|
||||
name: item.name,
|
||||
extname: 'img',
|
||||
url: item.filePath,
|
||||
url: this.$config.static + item.filePath,
|
||||
...item,
|
||||
}
|
||||
})
|
||||
@@ -297,6 +297,9 @@ export default {
|
||||
}, 1000)
|
||||
console.log(option.project)
|
||||
this.project = JSON.parse(decodeURIComponent(option.project))
|
||||
this.project.topologyDiagramPaths.forEach(item=>{
|
||||
item.filePath = this.$config.static + item.filePath
|
||||
})
|
||||
this.init()
|
||||
// uni.setNavigationBarTitle({ title: this.project })
|
||||
},
|
||||
|
||||
@@ -164,14 +164,19 @@ export default {
|
||||
})
|
||||
getTopoTemplate().then((res) => {
|
||||
console.log(res)
|
||||
this.tempList = res.data
|
||||
this.tempList = res.data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
filePath:this.$config.static + item.filePath
|
||||
}
|
||||
})
|
||||
if (this.project) {
|
||||
this.project.topologyDiagramPaths.forEach((item) => {
|
||||
if (this.tempList.some((item2) => item2.id === item.topoId)) {
|
||||
this.formData.tempFiles.push(item)
|
||||
} else {
|
||||
this.formData.files.push({
|
||||
url: item.filePath,
|
||||
url: this.$config.static + item.filePath,
|
||||
extname: item.name.split('.')[1],
|
||||
name: item.name,
|
||||
...item,
|
||||
|
||||
@@ -38,14 +38,10 @@ export default {
|
||||
headSculpture: result.data.minFileUrl,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
getImageUrl(result.data.minFileUrl).then((url) => {
|
||||
console.log(url.data)
|
||||
this.userInfo.headSculpture = result.data.minFileUrl
|
||||
this.userInfo.avatar = url.data
|
||||
console.warn(this.userInfo)
|
||||
uni.setStorageSync(this.$cacheKey.userInfo, this.userInfo)
|
||||
this.$forceUpdate()
|
||||
})
|
||||
this.userInfo.headSculpture = result.data.minFileUrl
|
||||
this.userInfo.avatar = this.$config.static + result.data.minFileUrl
|
||||
uni.setStorageSync(this.$cacheKey.userInfo, this.userInfo)
|
||||
this.$forceUpdate()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
return {
|
||||
checkbox: false,
|
||||
loading: false,
|
||||
loginType: 'yzm',
|
||||
loginType: 'pwd',
|
||||
phone: '',
|
||||
pwdForm: {
|
||||
pwd: '',
|
||||
|
||||
Reference in New Issue
Block a user