提交app

This commit is contained in:
guanj
2026-04-13 10:12:04 +08:00
parent db097bc64a
commit bac0f83f64
26 changed files with 2344 additions and 1901 deletions

View File

@@ -69,7 +69,7 @@
@finished="initChart('echartV3', 'echartsDataV3')"
></l-echart>
</view>
<view class="text"> 电压有效值 </view>
<view class="text"> 电压有效值(kV) </view>
</view>
<view class="middle" style="width: 100%">
<l-echart
@@ -103,7 +103,7 @@
@finished="initChart('echartA3', 'echartsDataA3')"
></l-echart>
</view>
<view class="text"> 有效值 </view>
<view class="text"> 有效值(A) </view>
</view>
</view>
</view>
@@ -125,6 +125,7 @@
</view>
</view>
</view>
<hover-menu :btnList="content" @trigger="trigger"></hover-menu>
</view>
</Cn-page>
</template>
@@ -133,12 +134,14 @@ const echarts = require('../../../uni_modules/lime-echart/static/echarts.min')
import { MQTT_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
import mqtt from 'mqtt/dist/mqtt.js'
import { getBaseRealData } from '@/common/api/harmonic.js'
import hoverMenu from '@/hover-menu/components/hover-menu/hover-menu.vue'
export default {
components: {},
components: { hoverMenu },
props: {},
data() {
return {
loading: true,
devId: '',
// 使用上面定义的图表配置项
option: {},
echartsData0: {},
@@ -183,30 +186,72 @@ export default {
equipmentName: '',
runStatus: 1,
connection: false,
content: [
{
iconPath: '/static/report.png',
text: '详情',
},
{
iconPath: '/static/about.png',
text: '关于',
},
],
isPrimaryUser: 0,
}
},
onLoad(options) {
console.log('🚀 ~ options:', options)
this.lineKey = 0
this.devId = options.id
this.lineList = JSON.parse(options.lineList)
this.lineId = this.lineList[0].lineId
this.engineeringName = options.engineeringName
this.equipmentName = options.equipmentName
this.runStatus = options.runStatus
this.isPrimaryUser = options.isPrimaryUser
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.echartsData0 = this.initEcharts0()
this.echartsData1 = this.initEcharts1()
this.echartsDataV1 = this.initEcharts('#DAA520', 0, 'A相(kV)')
this.echartsDataV2 = this.initEcharts('#2E8B57', 0, 'B相(kV)')
this.echartsDataV3 = this.initEcharts('#A52a2a', 0, 'C相(kV)')
this.echartsDataA1 = this.initEcharts('#DAA520', 1, 'A相(A)')
this.echartsDataA2 = this.initEcharts('#2E8B57', 1, 'B相(A)')
this.echartsDataA3 = this.initEcharts('#A52a2a', 1, 'C相(A)')
this.echartsDataV1 = this.initEcharts('#DAA520', 0, 'A相')
this.echartsDataV2 = this.initEcharts('#2E8B57', 0, 'B相')
this.echartsDataV3 = this.initEcharts('#A52a2a', 0, 'C相')
this.echartsDataA1 = this.initEcharts('#DAA520', 1, 'A相')
this.echartsDataA2 = this.initEcharts('#2E8B57', 1, 'B相')
this.echartsDataA3 = this.initEcharts('#A52a2a', 1, 'C相')
this.loading = false
this.$nextTick(() => {
this.setMqtt(0)
this.initMqtt()
})
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 (this.userInfo.authorities !== 'tourist') {
this.content.splice(0, 0, {
iconPath: '/static/subordinate.png',
text: '用户',
})
}
},
onUnload() {
const charts = [
@@ -623,7 +668,9 @@ export default {
.then((res) => {
if (res.code == 'A0000') {
this.connection = true
this.$util.toast(e == 0 ? '连接成功!' : '刷新成功!')
setTimeout(() => {
this.$util.toast(e == 0 ? '连接成功!' : '刷新成功!')
}, 3000)
if (this.timer) {
clearInterval(this.timer)
this.timer = null
@@ -878,6 +925,46 @@ export default {
await this.setMqtt(0)
await this.initMqtt()
},
trigger(e) {
console.log(e)
if (e.text === '分享') {
uni.navigateTo({ url: '/pages/device/share?id=' + this.lineId })
} else if (e.text === '删除') {
uni.showModal({
title: '提示',
content: '确定删除该设备吗?',
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
deleteDevice(this.devId).then((res) => {
uni.showToast({
title: '删除成功',
icon: 'none',
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
})
} else if (res.cancel) {
console.log('用户点击取消')
}
},
})
} else if (e.text === '记录') {
uni.navigateTo({ url: '/pages/device/APF/record' })
} else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.devId })
} else if (e.text === '关于') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
} else if (e.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId })
} else if (e.text === '反馈') {
uni.navigateTo({ url: '/pages/device/feedback' })
} else if (e.text === '用户') {
uni.navigateTo({ url: '/pages/device/user?id=' + this.devId + '&isPrimaryUser=' + this.isPrimaryUser })
}
// this.$refs.fab.close()
},
},
computed: {},
@@ -990,7 +1077,7 @@ export default {
}
.text {
text-align: center;
font-size: 30rpx;
font-size: 28rpx;
}
.text_center {
position: absolute;