绘制电脑治理信息页面
This commit is contained in:
@@ -6,20 +6,16 @@
|
||||
<view class="grid-card-title">温度</view>
|
||||
<view class="grid-card-content-4">
|
||||
<template v-for="item in renderData">
|
||||
<view class="item item-title"
|
||||
>{{ item[0].clDid }}
|
||||
<view class="item item-title">{{ item[0].clDid }}
|
||||
<template v-if="item[0].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[1].clDid }}
|
||||
<view class="item item-title">{{ item[1].clDid }}
|
||||
<template v-if="item[1].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[2].clDid }}
|
||||
<view class="item item-title">{{ item[2].clDid }}
|
||||
<template v-if="item[2].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[3].clDid }}
|
||||
<view class="item item-title">{{ item[3].clDid }}
|
||||
<template v-if="item[3].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item">{{ item[0].clDid ? Math.round(item[0].value) || '-' : '' }}</view>
|
||||
@@ -30,27 +26,21 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 运维管理员、工程用户 可看 -->
|
||||
<view
|
||||
class="grid-card"
|
||||
v-if="userInfo.authorities == 'operation_manager' || userInfo.authorities == 'engineering_user'"
|
||||
>
|
||||
<view class="grid-card"
|
||||
v-if="(userInfo.authorities == 'operation_manager' || userInfo.authorities == 'engineering_user') && moduleData.length > 0">
|
||||
<view class="grid-card-title">状态</view>
|
||||
<view class="grid-card-content-4">
|
||||
<template v-for="(item, index) in moduleData">
|
||||
<view class="item item-title"
|
||||
>{{ item[0].moduleName }}
|
||||
<view class="item item-title">{{ item[0].moduleName }}
|
||||
<template v-if="item[0].moduleName"></template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[1].moduleName }}
|
||||
<view class="item item-title">{{ item[1].moduleName }}
|
||||
<template v-if="item[1].moduleName"></template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[2].moduleName }}
|
||||
<view class="item item-title">{{ item[2].moduleName }}
|
||||
<template v-if="item[2].moduleName"></template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[3].moduleName }}
|
||||
<view class="item item-title">{{ item[3].moduleName }}
|
||||
<template v-if="item[3].moduleName"></template>
|
||||
</view>
|
||||
<!-- <uni-tag :text="item[0].moduleState" :type=" item[0].moduleState=='离线'?'error' : 'success'" /> -->
|
||||
@@ -101,6 +91,7 @@ export default {
|
||||
computed: {
|
||||
renderData() {
|
||||
let arr = []
|
||||
|
||||
// 把IOData转换成每4个一组的二维数组
|
||||
for (let i = 0; i < this.IOData.length; i += 4) {
|
||||
this.IOData.slice(i, i + 4).forEach((item) => {
|
||||
@@ -120,7 +111,6 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
console.warn(arr)
|
||||
return arr
|
||||
},
|
||||
moduleData() {
|
||||
@@ -159,6 +149,5 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.basic {
|
||||
}
|
||||
.basic {}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-load-more status="loading" v-if="basicData.length == 0"></uni-load-more>
|
||||
<uni-load-more status="loading"
|
||||
v-if="renderData.电网电流.length == 0 || renderData.电网电压.length == 0 || renderData.负载电流.length == 0 || renderData.补偿电流.length == 0 "></uni-load-more>
|
||||
<view class="basic" v-else>
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">电网电流</view>
|
||||
@@ -12,10 +13,10 @@
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{
|
||||
item['Apf_RmsI_Sys(A)'] > 0 ? item['Apf_RmsI_Sys(A)'].toFixed(2) : item['Apf_RmsI_Sys(A)']
|
||||
}}</view>
|
||||
}}</view>
|
||||
<view class="item">{{
|
||||
item['Apf_ThdA_Sys(%)'] > 0 ? item['Apf_ThdA_Sys(%)'].toFixed(2) : item['Apf_ThdA_Sys(%)']
|
||||
}}</view>
|
||||
}}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -30,13 +31,13 @@
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{
|
||||
item['Apf_PhV_Sys(V)'] > 0 ? item['Apf_PhV_Sys(V)'].toFixed(2) : item['Apf_PhV_Sys(V)']
|
||||
}}</view>
|
||||
}}</view>
|
||||
<view class="item">{{
|
||||
item['Apf_Freq(Hz)'] > 0 ? item['Apf_Freq(Hz)'].toFixed(2) : item['Apf_Freq(Hz)']
|
||||
}}</view>
|
||||
}}</view>
|
||||
<view class="item">{{
|
||||
item['Apf_ThdU_Sys(%)'] > 0 ? item['Apf_ThdU_Sys(%)'].toFixed(2) : item['Apf_ThdU_Sys(%)']
|
||||
}}</view>
|
||||
}}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -73,15 +74,15 @@
|
||||
item['Apf_RmsI_TolOut(A)'] == 3.1415926
|
||||
? '-'
|
||||
: item['Apf_RmsI_TolOut(A)'] > 0
|
||||
? item['Apf_RmsI_TolOut(A)'].toFixed(2)
|
||||
: item['Apf_RmsI_TolOut(A)']
|
||||
? item['Apf_RmsI_TolOut(A)'].toFixed(2)
|
||||
: item['Apf_RmsI_TolOut(A)']
|
||||
}}</view>
|
||||
<view class="item">{{
|
||||
item['load_Rate'] == 3.1415926
|
||||
? '-'
|
||||
: item['load_Rate'] > 0
|
||||
? item['load_Rate'].toFixed(2)
|
||||
: item['load_Rate']
|
||||
? item['load_Rate'].toFixed(2)
|
||||
: item['load_Rate']
|
||||
}}</view>
|
||||
</template>
|
||||
</view>
|
||||
@@ -179,6 +180,5 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.basic {
|
||||
}
|
||||
.basic {}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-load-more status="loading" v-if="basicData.length == 0"></uni-load-more>
|
||||
<uni-load-more status="loading" v-if="renderData.电网侧.length == 0 || renderData.负载侧.length == 0"></uni-load-more>
|
||||
<view class="basic" v-else>
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">电网侧</view>
|
||||
@@ -12,14 +12,14 @@
|
||||
<view class="item item-title">功率因数</view>
|
||||
<template v-for="(item, index) in renderData.电网侧">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item"
|
||||
>{{ item['Apf_P_Sys(W)'] == '-' ? '-' : (item['Apf_P_Sys(W)'] / 1000).toFixed(2) }}
|
||||
<view class="item">{{ item['Apf_P_Sys(W)'] == '-' ? '-' : (item['Apf_P_Sys(W)'] /
|
||||
1000).toFixed(2) }}
|
||||
</view>
|
||||
<view class="item"
|
||||
>{{ item['Apf_Q_Sys(Var)'] == '-' ? '-' : (item['Apf_Q_Sys(Var)'] / 1000).toFixed(2) }}
|
||||
<view class="item">{{ item['Apf_Q_Sys(Var)'] == '-' ? '-' : (item['Apf_Q_Sys(Var)'] /
|
||||
1000).toFixed(2) }}
|
||||
</view>
|
||||
<view class="item"
|
||||
>{{ item['Apf_S_Sys(VA)'] == '-' ? '-' : (item['Apf_S_Sys(VA)'] / 1000).toFixed(2) }}
|
||||
<view class="item">{{ item['Apf_S_Sys(VA)'] == '-' ? '-' : (item['Apf_S_Sys(VA)'] /
|
||||
1000).toFixed(2) }}
|
||||
</view>
|
||||
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
|
||||
</template>
|
||||
@@ -35,14 +35,14 @@
|
||||
<view class="item item-title">功率因数</view>
|
||||
<template v-for="(item, index) in renderData.负载侧">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item"
|
||||
>{{ item['Apf_P_Load(W)'] == '-' ? '-' : (item['Apf_P_Load(W)'] / 1000).toFixed(2) }}
|
||||
<view class="item">{{ item['Apf_P_Load(W)'] == '-' ? '-' : (item['Apf_P_Load(W)'] /
|
||||
1000).toFixed(2) }}
|
||||
</view>
|
||||
<view class="item">{{
|
||||
item['Apf_Q_Load(Var)'] == '-' ? '-' : (item['Apf_Q_Load(Var)'] / 1000).toFixed(2)
|
||||
}}</view>
|
||||
<view class="item"
|
||||
>{{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] / 1000).toFixed(2) }}
|
||||
}}</view>
|
||||
<view class="item">{{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] /
|
||||
1000).toFixed(2) }}
|
||||
</view>
|
||||
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
|
||||
</template>
|
||||
@@ -130,6 +130,5 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.basic {
|
||||
}
|
||||
.basic {}
|
||||
</style>
|
||||
|
||||
@@ -5,18 +5,10 @@
|
||||
<view class="detail-header">
|
||||
<Cn-htmlToImg domId="header" @renderFinish="renderFinish">
|
||||
<view class="header" id="header" ref="header" @click="previewImg">
|
||||
<img
|
||||
:src="topoImg"
|
||||
style="width: 375px; display: block"
|
||||
mode="widthFix"
|
||||
@load="domLoading = false"
|
||||
/>
|
||||
<view
|
||||
class="point"
|
||||
:style="{ left: item.lat + 'px', top: item.lng + 'px' }"
|
||||
v-for="(item, index) in topolodyData"
|
||||
:key="index"
|
||||
>
|
||||
<img :src="topoImg" style="width: 375px; display: block" mode="widthFix"
|
||||
@load="domLoading = false" />
|
||||
<view class="point" :style="{ left: item.lat + 'px', top: item.lng + 'px' }"
|
||||
v-for="(item, index) in topolodyData" :key="index">
|
||||
<view class="grid-card mt10" style="width: fit-content">
|
||||
<view class="grid-card-content-1">
|
||||
<view class="item">{{ item.label }}</view>
|
||||
@@ -51,13 +43,9 @@
|
||||
<text class="ml10">设备状态</text>
|
||||
</view> -->
|
||||
<view class="nav" style="margin-top: -10rpx">
|
||||
<view
|
||||
class="nav-menu"
|
||||
:class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList"
|
||||
:key="index"
|
||||
@click="navMenuClick(index)"
|
||||
>{{ item.text }}
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -107,22 +95,10 @@
|
||||
</uni-popup> -->
|
||||
<!-- 输入框示例 -->
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
ref="inputClose"
|
||||
type="info"
|
||||
mode="input"
|
||||
:title="dialogType"
|
||||
value="对话框预置提示内容!"
|
||||
placeholder="请输入内容"
|
||||
@confirm="dialogInputConfirm"
|
||||
>
|
||||
<uni-easyinput
|
||||
type="textarea"
|
||||
:maxlength="250"
|
||||
autoHeight
|
||||
v-model="remarkContent"
|
||||
placeholder="请输入备注"
|
||||
></uni-easyinput>
|
||||
<uni-popup-dialog ref="inputClose" type="info" mode="input" :title="dialogType" value="对话框预置提示内容!"
|
||||
placeholder="请输入内容" @confirm="dialogInputConfirm">
|
||||
<uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="remarkContent"
|
||||
placeholder="请输入备注"></uni-easyinput>
|
||||
</uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@@ -140,6 +116,7 @@ import { manualAccess } from '@/common/api/accessBoot'
|
||||
import { MQTT_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
|
||||
import mqtt from 'mqtt/dist/mqtt.js'
|
||||
import { base64ToPath, pathToBase64 } from 'image-tools'
|
||||
import { queryByCode, queryStatistical } from '@/common/api/dictionary'
|
||||
import hoverMenu from '@/hover-menu/components/hover-menu/hover-menu.vue'
|
||||
export default {
|
||||
components: {
|
||||
@@ -164,6 +141,7 @@ export default {
|
||||
navHeight: 0,
|
||||
img: '',
|
||||
topoImg: '',
|
||||
targetLists: [],
|
||||
navMenuList: [
|
||||
{
|
||||
text: '基本',
|
||||
@@ -177,9 +155,6 @@ export default {
|
||||
text: '功率',
|
||||
id: 'a16aceae7d1565bf9f94dd7410cf9bce',
|
||||
},
|
||||
// {
|
||||
// text: '波形',
|
||||
// },
|
||||
{
|
||||
text: '其他',
|
||||
},
|
||||
@@ -358,11 +333,21 @@ export default {
|
||||
},
|
||||
})
|
||||
},
|
||||
init() {
|
||||
|
||||
getTarget() {
|
||||
return queryByCode('app_harmonic_code').then((res) => {
|
||||
return queryStatistical({ id: res.data.id }).then((resp) => {
|
||||
this.targetLists = resp.data.selectedList
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
async init() {
|
||||
console.log('init')
|
||||
this.loading = true
|
||||
this.domLoading = true
|
||||
queryTopologyDiagram(this.devId).then((res) => {
|
||||
|
||||
await queryTopologyDiagram(this.devId).then((res) => {
|
||||
res.data.filePath = this.$config.static + res.data.filePath
|
||||
this.deviceInfo = res.data
|
||||
this.downloadImg()
|
||||
@@ -371,6 +356,7 @@ export default {
|
||||
let index = this.deviceInfo.appsLineTopologyDiagramPO?.findIndex((element) => {
|
||||
element.label = element.name
|
||||
item.label = element.name
|
||||
item.target = element.target
|
||||
return element.linePostion === item.linePostion
|
||||
})
|
||||
if (index > -1) {
|
||||
@@ -384,10 +370,14 @@ export default {
|
||||
})
|
||||
console.log(this.topolodyData)
|
||||
if (this.client) {
|
||||
this.client.publish(`/zl/askDevData/${this.devId}/${this.navMenuList[0].id}`)
|
||||
this.loading = false
|
||||
} else {
|
||||
this.initMqtt(this.navMenuList[0].id)
|
||||
}
|
||||
console.log("🚀 ~ this.client:", this.client)
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
renderFinish(e) {
|
||||
@@ -460,22 +450,28 @@ export default {
|
||||
console.log('连接断开')
|
||||
})
|
||||
.on('message', (topic, message) => {
|
||||
console.log('接收推送信息:', JSON.parse(message.toString()), topic)
|
||||
console.log('🚀 ~ .on ~ topic:', topic)
|
||||
// console.log('接收推送信息:', JSON.parse(message.toString()), topic)
|
||||
// console.log('🚀 ~ .on ~ topic:', topic)
|
||||
|
||||
if (topic === `/zl/devData/${this.devId}/${id}`) {
|
||||
|
||||
const data = JSON.parse(message.toString())
|
||||
if (Array.isArray(data) && !data.length) return
|
||||
|
||||
if ((!message.toString() || message.toString().length < 10) && this.loading) {
|
||||
this.$util.toast('该设备暂无数据')
|
||||
}
|
||||
this.loading = false
|
||||
this.handlerData(JSON.parse(message.toString()))
|
||||
this.handlerData(data)
|
||||
} else if (topic === `/zl/TemperData/${this.devId}`) {
|
||||
const data = JSON.parse(message.toString())
|
||||
if (Array.isArray(data) && !data.length) return
|
||||
// this.basicData.forEach((item) => {
|
||||
// if (item.statisticalName === '温度' && item.phase === 'avg') {
|
||||
// item.statisticalData = message.toString()
|
||||
// }
|
||||
// })
|
||||
this.IOData = JSON.parse(message.toString())
|
||||
this.IOData = data
|
||||
// this.IOData = this.IOData.filter((item) => item.value !== 0)
|
||||
this.IOData.forEach((item) => {
|
||||
if (!item.value) {
|
||||
@@ -490,37 +486,60 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
handlerData(data) {
|
||||
async handlerData(data) {
|
||||
this.basicData = data
|
||||
|
||||
this.topolodyData.forEach((element) => {
|
||||
let arr = []
|
||||
let list = this.targetLists.filter(key => key.dataType == element.target)
|
||||
|
||||
element.showKey.forEach((key) => {
|
||||
if (list.length > 0) {
|
||||
let id = list[0]?.eleEpdPqdVOS.filter(key => key.phase == 'A')[0]?.id || ''
|
||||
data.forEach((item) => {
|
||||
if (item.statisticalName === key && item.phase === 'avg') {
|
||||
if (key === 'Apf_RmsI_TolOut(A)') {
|
||||
arr.push({
|
||||
label: '总输出电流:',
|
||||
value: Math.round(item.statisticalData) + 'A',
|
||||
})
|
||||
} else {
|
||||
arr.push({
|
||||
label: '电流畸变率:',
|
||||
value: Math.round(item.statisticalData) + '%',
|
||||
})
|
||||
// arr.push('电流畸变率:' + item.statisticalData + '%')
|
||||
}
|
||||
if (item.statisticalIndex === id && item.phase === 'avg') {
|
||||
|
||||
arr.push({
|
||||
label: list[0].dataTypeName.split('-')[1] + ':',
|
||||
value: (item.statisticalData) + `${item.unit || ''}`,
|
||||
})
|
||||
|
||||
}
|
||||
if (item.time) {
|
||||
this.dataTime = item.time.seconds
|
||||
this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60)
|
||||
// console.log(11111111,this.dataTime);
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
else {
|
||||
element.showKey.forEach((key) => {
|
||||
data.forEach((item) => {
|
||||
if (item.statisticalName === key && item.phase === 'avg') {
|
||||
if (key === 'Apf_RmsI_TolOut(A)') {
|
||||
arr.push({
|
||||
label: '总输出电流:',
|
||||
value: (item.statisticalData) + 'A',
|
||||
})
|
||||
} else {
|
||||
arr.push({
|
||||
label: '电流畸变率:',
|
||||
value: (item.statisticalData) + '%',
|
||||
})
|
||||
}
|
||||
}
|
||||
if (item.time) {
|
||||
this.dataTime = item.time.seconds
|
||||
this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
element.value = arr
|
||||
})
|
||||
console.log("🚀 ~ this.topolodyData:", this.topolodyData)
|
||||
|
||||
console.log(this.topolodyData)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
@@ -539,13 +558,16 @@ export default {
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
async onLoad(options) {
|
||||
await this.getTarget()
|
||||
|
||||
this.pageOptions = options
|
||||
this.device = JSON.parse(options.device)
|
||||
console.log('🚀 ~ options:', options)
|
||||
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.devId = options.id
|
||||
this.isPrimaryUser = options.isPrimaryUser
|
||||
|
||||
if (this.pageOptions.process == 2 || this.pageOptions.process == 3) {
|
||||
this.content.splice(
|
||||
0,
|
||||
@@ -626,9 +648,11 @@ export default {
|
||||
lng: '',
|
||||
showKey: item.showKey, //要展示的指标key
|
||||
value: [],
|
||||
target: item.target
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
@@ -636,6 +660,7 @@ export default {
|
||||
|
||||
<style lang="scss">
|
||||
.detail {
|
||||
|
||||
// background: $uni-theme-white;
|
||||
.header-bg {
|
||||
position: absolute;
|
||||
@@ -666,7 +691,7 @@ export default {
|
||||
z-index: 2;
|
||||
text-align: center;
|
||||
color: #111;
|
||||
width: 110rpx;
|
||||
width: 150rpx;
|
||||
font-size: 16rpx;
|
||||
opacity: 0.8;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,13 +6,8 @@
|
||||
<uni-forms-item label="设备识别码">
|
||||
<view style="display: flex">
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码" />
|
||||
<uni-icons
|
||||
type="camera"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="scanCode"
|
||||
></uni-icons>
|
||||
<uni-icons type="camera" color="#007aff" size="26" class="ml20"
|
||||
@click="scanCode"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
@@ -28,36 +23,18 @@
|
||||
<uni-forms>
|
||||
<uni-forms-item label="工程">
|
||||
<view style="display: flex; align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.engineeringId"
|
||||
:localdata="engineeringList"
|
||||
@change="engineeringChang($event, true)"
|
||||
:clear="false"
|
||||
></uni-data-select>
|
||||
<uni-icons
|
||||
type="plusempty"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="createEngineering"
|
||||
></uni-icons>
|
||||
<uni-data-select v-model="formData.engineeringId" :localdata="engineeringList"
|
||||
@change="engineeringChang($event, true)" :clear="false"></uni-data-select>
|
||||
<uni-icons type="plusempty" color="#007aff" size="26" class="ml20"
|
||||
@click="createEngineering"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="项目">
|
||||
<view style="display: flex; align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage"
|
||||
:clear="false"
|
||||
></uni-data-select>
|
||||
<uni-icons
|
||||
type="plusempty"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="createProject"
|
||||
></uni-icons>
|
||||
<uni-data-select v-model="formData.projectId" :localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage" :clear="false"></uni-data-select>
|
||||
<uni-icons type="plusempty" color="#007aff" size="26" class="ml20"
|
||||
@click="createProject"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
|
||||
@@ -69,25 +46,14 @@
|
||||
</view>
|
||||
<view v-else class="gplot gplot-empty center" @click="chooseGplot"> 选择拓扑图</view>
|
||||
</view>
|
||||
<uni-icons
|
||||
type="image"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="chooseGplot"
|
||||
></uni-icons>
|
||||
<uni-icons type="image" color="#007aff" size="26" class="ml20"
|
||||
@click="chooseGplot"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item
|
||||
label="监测点"
|
||||
v-if="pointList.length && formData.topologyDiagramUrl && formData.projectId"
|
||||
>
|
||||
<view
|
||||
class="point-item"
|
||||
v-for="(item2, index2) in pointList"
|
||||
:key="index2"
|
||||
@click="editPoint(item2, index2)"
|
||||
>
|
||||
<uni-forms-item label="监测点"
|
||||
v-if="pointList.length && formData.topologyDiagramUrl && formData.projectId">
|
||||
<view class="point-item" v-for="(item2, index2) in pointList" :key="index2"
|
||||
@click="editPoint(item2, index2)">
|
||||
<view style="flex: 1" v-if="item2.name">{{ item2.name }}</view>
|
||||
<view style="flex: 1; color: #999" v-else>请选择监测点</view>
|
||||
<uni-icons type="compose" color="#007aff" size="26" class="ml20"></uni-icons>
|
||||
@@ -106,17 +72,10 @@
|
||||
<uni-drawer ref="gplot" mode="right" :mask-click="false">
|
||||
<scroll-view style="height: 100%" scroll-y="true">
|
||||
<view class="content">
|
||||
<image
|
||||
class="gplot gplot-box"
|
||||
mode="aspectFill"
|
||||
:class="{ 'gplot-active': key == activeGplot }"
|
||||
:src="item.filePath"
|
||||
@click="activeGplot = key"
|
||||
v-for="(item, key) in imageList"
|
||||
:key="key"
|
||||
/>
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50"
|
||||
>暂无拓扑图
|
||||
<image class="gplot gplot-box" mode="aspectFill" :class="{ 'gplot-active': key == activeGplot }"
|
||||
:src="item.filePath" @click="activeGplot = key" v-for="(item, key) in imageList"
|
||||
:key="key" />
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50">暂无拓扑图
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
@@ -142,22 +101,18 @@
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="content-des">请拖动图中的文字选择监测点位置</view>
|
||||
<uni-forms>
|
||||
<uni-data-select
|
||||
v-model="point.position"
|
||||
:localdata="positionList"
|
||||
@change="positionChange"
|
||||
disabled
|
||||
:clear="false"
|
||||
></uni-data-select>
|
||||
<uni-easyinput
|
||||
:clearable="false"
|
||||
class="mt20"
|
||||
type="text"
|
||||
v-model="point.alias"
|
||||
@change="aliasChange"
|
||||
placeholder="别名(非必填)"
|
||||
/>
|
||||
<uni-forms labelWidth="70px">
|
||||
<uni-forms-item label="位置">
|
||||
<uni-data-select v-model="point.position" :localdata="positionList"
|
||||
@change="positionChange" disabled :clear="false"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="别名">
|
||||
<uni-easyinput :clearable="false" type="text" v-model="point.alias"
|
||||
@change="aliasChange" placeholder="别名(非必填)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="绑定指标">
|
||||
<uni-data-select v-model="point.target" :localdata="targetList"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
@@ -181,6 +136,7 @@ import {
|
||||
} from '@/common/api/device.js'
|
||||
import { getProjectList, queryTopologyDiagramPage } from '@/common/api/project.js'
|
||||
import ykAuthpup from '@/components/yk-authpup/yk-authpup'
|
||||
import { queryByCode, queryStatistical } from '@/common/api/dictionary'
|
||||
export default {
|
||||
components: {
|
||||
ykAuthpup,
|
||||
@@ -204,6 +160,8 @@ export default {
|
||||
activeGplot: 0,
|
||||
positionList: [],
|
||||
imageList: [],
|
||||
targetLists: [],//总数据
|
||||
targetList: [],//根据位置切换数据
|
||||
isAdaptive: false, // 是否适应当前项目
|
||||
dialogOpen: false,
|
||||
options: {},
|
||||
@@ -226,9 +184,20 @@ export default {
|
||||
onLoad(o) {
|
||||
this.options = o
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
queryByCode('app_harmonic_code').then((res) => {
|
||||
queryStatistical({ id: res.data.id }).then((resp) => {
|
||||
this.targetLists = resp.data.selectedList.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.dataTypeName,
|
||||
value: item.dataType,
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
this.positionList = item.children.map((item) => {
|
||||
this.positionList = item.children.filter((child) => child.name !== 'PCC公共点').map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.name,
|
||||
@@ -264,6 +233,19 @@ export default {
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
// 设置绑定指标
|
||||
settarget(e) {
|
||||
let pointName = this.positionList.find((item) => item.id == this.point.position).name
|
||||
|
||||
this.targetList = this.targetLists.filter(item => item.dataTypeName.includes(pointName)).map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.dataTypeName.split('-')[1],
|
||||
value: item.dataType,
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
getEngineering() {
|
||||
queryEngineeringPage({ pageNum: 1, pageSize: 9999 }).then((res) => {
|
||||
let arr = [
|
||||
@@ -377,7 +359,7 @@ export default {
|
||||
console.log(e)
|
||||
},
|
||||
|
||||
projectChange(e) {},
|
||||
projectChange(e) { },
|
||||
scanCode() {
|
||||
if (plus.os.name == 'Android') {
|
||||
this.$refs['authpup'].open()
|
||||
@@ -509,6 +491,7 @@ export default {
|
||||
this.point.alias = ''
|
||||
}
|
||||
}
|
||||
this.settarget()
|
||||
this.dialogOpen = true
|
||||
this.$refs.point.open()
|
||||
this.$forceUpdate()
|
||||
|
||||
@@ -739,126 +739,129 @@ export default {
|
||||
// console.log('接收推送信息:', JSON.parse(message.toString()), topic)
|
||||
if (!this.connection) return
|
||||
// console.log('🚀 ~ .on ~ topic:', topic, this.userInfo.userIndex)
|
||||
|
||||
|
||||
if (topic == `/Web/RealData/${this.lineId}`) {
|
||||
if (
|
||||
topic == `/Web/RealData/${this.lineId}` ||
|
||||
topic == `/Web/RealData/${this.userInfo.userIndex}`
|
||||
) {
|
||||
let list = JSON.parse(message.toString())
|
||||
if (list.lineId != this.lineId) return
|
||||
// if (list.userId == this.userInfo.userIndex) {
|
||||
// console.log(list)
|
||||
this.realTime = list.dataTime
|
||||
let pt = list.pt || 0
|
||||
let ct = list.ct || 0
|
||||
// console.log(list)
|
||||
this.realTime = list.dataTime
|
||||
let pt = list.pt || 0
|
||||
let ct = list.ct || 0
|
||||
|
||||
let data = {
|
||||
vRmsA: ((list.vRmsA * pt) / 1000).toFixed(2),
|
||||
vRmsB: ((list.vRmsB * pt) / 1000).toFixed(2),
|
||||
vRmsC: ((list.vRmsC * pt) / 1000).toFixed(2),
|
||||
iRmsA: (list.iRmsA * ct).toFixed(2),
|
||||
iRmsB: (list.iRmsB * ct).toFixed(2),
|
||||
iRmsC: (list.iRmsC * ct).toFixed(2),
|
||||
v1A: ((list.v1A * pt) / 1000).toFixed(2),
|
||||
v1B: ((list.v1B * pt) / 1000).toFixed(2),
|
||||
v1C: ((list.v1C * pt) / 1000).toFixed(2),
|
||||
v1AngA: list.v1AngA.toFixed(2),
|
||||
v1AngB: list.v1AngB.toFixed(2),
|
||||
v1AngC: list.v1AngC.toFixed(2),
|
||||
let data = {
|
||||
vRmsA: ((list.vRmsA * pt) / 1000).toFixed(2),
|
||||
vRmsB: ((list.vRmsB * pt) / 1000).toFixed(2),
|
||||
vRmsC: ((list.vRmsC * pt) / 1000).toFixed(2),
|
||||
iRmsA: (list.iRmsA * ct).toFixed(2),
|
||||
iRmsB: (list.iRmsB * ct).toFixed(2),
|
||||
iRmsC: (list.iRmsC * ct).toFixed(2),
|
||||
v1A: ((list.v1A * pt) / 1000).toFixed(2),
|
||||
v1B: ((list.v1B * pt) / 1000).toFixed(2),
|
||||
v1C: ((list.v1C * pt) / 1000).toFixed(2),
|
||||
v1AngA: list.v1AngA.toFixed(2),
|
||||
v1AngB: list.v1AngB.toFixed(2),
|
||||
v1AngC: list.v1AngC.toFixed(2),
|
||||
|
||||
i1A: (list.i1A * ct).toFixed(2),
|
||||
i1B: (list.i1B * ct).toFixed(2),
|
||||
i1C: (list.i1C * ct).toFixed(2),
|
||||
i1AngA: list.i1AngA.toFixed(2),
|
||||
i1AngB: list.i1AngB.toFixed(2),
|
||||
i1AngC: list.i1AngC.toFixed(2),
|
||||
vDevA: list.vDevA.toFixed(2),
|
||||
vDevB: list.vDevB.toFixed(2),
|
||||
vDevC: list.vDevC.toFixed(2),
|
||||
vThdA: list.vThdA.toFixed(2),
|
||||
vThdB: list.vThdB.toFixed(2),
|
||||
vThdC: list.vThdC.toFixed(2),
|
||||
i1A: (list.i1A * ct).toFixed(2),
|
||||
i1B: (list.i1B * ct).toFixed(2),
|
||||
i1C: (list.i1C * ct).toFixed(2),
|
||||
i1AngA: list.i1AngA.toFixed(2),
|
||||
i1AngB: list.i1AngB.toFixed(2),
|
||||
i1AngC: list.i1AngC.toFixed(2),
|
||||
vDevA: list.vDevA.toFixed(2),
|
||||
vDevB: list.vDevB.toFixed(2),
|
||||
vDevC: list.vDevC.toFixed(2),
|
||||
vThdA: list.vThdA.toFixed(2),
|
||||
vThdB: list.vThdB.toFixed(2),
|
||||
vThdC: list.vThdC.toFixed(2),
|
||||
}
|
||||
this.realTimeData = [
|
||||
{ name: '电压有效值(kV)', A: data.vRmsA, B: data.vRmsB, C: data.vRmsC },
|
||||
{ name: '电流有效值(A)', A: data.iRmsA, B: data.iRmsB, C: data.iRmsC },
|
||||
{ name: '基波电压幅值(kV)', A: data.v1A, B: data.v1B, C: data.v1C },
|
||||
{ name: '基波电压相位(°)', A: data.v1AngA, B: data.v1AngB, C: data.v1AngC },
|
||||
{ name: '基波电流幅值(A)', A: data.i1A, B: data.i1B, C: data.i1C },
|
||||
{ name: '基波电流相位(°)', A: data.i1AngA, B: data.i1AngB, C: data.i1AngC },
|
||||
{ name: '电压偏差(%)', A: data.vDevA, B: data.vDevB, C: data.vDevC },
|
||||
{ name: '电压总谐波畸变率(%)', A: data.vThdA, B: data.vThdB, C: data.vThdC },
|
||||
]
|
||||
// 电压
|
||||
let vMax =
|
||||
Math.ceil(
|
||||
(Math.max(
|
||||
...[
|
||||
Math.floor(data.vRmsA * 100) / 100 || 1,
|
||||
Math.floor(data.vRmsB * 100) / 100 || 1,
|
||||
Math.floor(data.vRmsC * 100) / 100 || 1,
|
||||
],
|
||||
) *
|
||||
1.2) /
|
||||
10,
|
||||
) * 10
|
||||
this.echartsDataV1.series[0].max = vMax
|
||||
this.echartsDataV2.series[0].max = vMax
|
||||
this.echartsDataV3.series[0].max = vMax
|
||||
this.echartsDataV1.series[0].data[0].value = data.vRmsA
|
||||
this.echartsDataV2.series[0].data[0].value = data.vRmsB
|
||||
this.echartsDataV3.series[0].data[0].value = data.vRmsC
|
||||
|
||||
// 电流
|
||||
let aMax =
|
||||
Math.ceil(
|
||||
(Math.max(
|
||||
...[
|
||||
Math.floor(data.iRmsA * 100) / 100 || 1,
|
||||
Math.floor(data.iRmsB * 100) / 100 || 1,
|
||||
Math.floor(data.iRmsC * 100) / 100 || 1,
|
||||
],
|
||||
) *
|
||||
1.2) /
|
||||
10,
|
||||
) * 10
|
||||
this.echartsDataA1.series[0].max = aMax
|
||||
this.echartsDataA2.series[0].max = aMax
|
||||
this.echartsDataA3.series[0].max = aMax
|
||||
this.echartsDataA1.series[0].data[0].value = data.iRmsA
|
||||
this.echartsDataA2.series[0].data[0].value = data.iRmsB
|
||||
this.echartsDataA3.series[0].data[0].value = data.iRmsC
|
||||
|
||||
this.echartsData0.series[0].data[0].value = data.i1AngA
|
||||
this.echartsData0.series[0].data[1].value = data.i1AngB
|
||||
this.echartsData0.series[0].data[2].value = data.i1AngC
|
||||
|
||||
this.echartsData1.series[0].data[0].value = data.v1AngA
|
||||
this.echartsData1.series[0].data[1].value = data.v1AngB
|
||||
this.echartsData1.series[0].data[2].value = data.v1AngC
|
||||
|
||||
const charts = [
|
||||
{ instance: this.echart0, data: this.echartsData0 },
|
||||
{ instance: this.echart1, data: this.echartsData1 },
|
||||
{ instance: this.echartV1, data: this.echartsDataV1 },
|
||||
{ instance: this.echartV2, data: this.echartsDataV2 },
|
||||
{ instance: this.echartV3, data: this.echartsDataV3 },
|
||||
{ instance: this.echartA1, data: this.echartsDataA1 },
|
||||
{ instance: this.echartA2, data: this.echartsDataA2 },
|
||||
{ instance: this.echartA3, data: this.echartsDataA3 },
|
||||
]
|
||||
|
||||
charts.forEach(({ instance, data }) => {
|
||||
if (instance && instance.setOption) {
|
||||
instance.setOption(data, true)
|
||||
}
|
||||
this.realTimeData = [
|
||||
{ name: '电压有效值(kV)', A: data.vRmsA, B: data.vRmsB, C: data.vRmsC },
|
||||
{ name: '电流有效值(A)', A: data.iRmsA, B: data.iRmsB, C: data.iRmsC },
|
||||
{ name: '基波电压幅值(kV)', A: data.v1A, B: data.v1B, C: data.v1C },
|
||||
{ name: '基波电压相位(°)', A: data.v1AngA, B: data.v1AngB, C: data.v1AngC },
|
||||
{ name: '基波电流幅值(A)', A: data.i1A, B: data.i1B, C: data.i1C },
|
||||
{ name: '基波电流相位(°)', A: data.i1AngA, B: data.i1AngB, C: data.i1AngC },
|
||||
{ name: '电压偏差(%)', A: data.vDevA, B: data.vDevB, C: data.vDevC },
|
||||
{ name: '电压总谐波畸变率(%)', A: data.vThdA, B: data.vThdB, C: data.vThdC },
|
||||
]
|
||||
// 电压
|
||||
let vMax =
|
||||
Math.ceil(
|
||||
(Math.max(
|
||||
...[
|
||||
Math.floor(data.vRmsA * 100) / 100 || 1,
|
||||
Math.floor(data.vRmsB * 100) / 100 || 1,
|
||||
Math.floor(data.vRmsC * 100) / 100 || 1,
|
||||
],
|
||||
) *
|
||||
1.2) /
|
||||
10,
|
||||
) * 10
|
||||
this.echartsDataV1.series[0].max = vMax
|
||||
this.echartsDataV2.series[0].max = vMax
|
||||
this.echartsDataV3.series[0].max = vMax
|
||||
this.echartsDataV1.series[0].data[0].value = data.vRmsA
|
||||
this.echartsDataV2.series[0].data[0].value = data.vRmsB
|
||||
this.echartsDataV3.series[0].data[0].value = data.vRmsC
|
||||
})
|
||||
|
||||
// 电流
|
||||
let aMax =
|
||||
Math.ceil(
|
||||
(Math.max(
|
||||
...[
|
||||
Math.floor(data.iRmsA * 100) / 100 || 1,
|
||||
Math.floor(data.iRmsB * 100) / 100 || 1,
|
||||
Math.floor(data.iRmsC * 100) / 100 || 1,
|
||||
],
|
||||
) *
|
||||
1.2) /
|
||||
10,
|
||||
) * 10
|
||||
this.echartsDataA1.series[0].max = aMax
|
||||
this.echartsDataA2.series[0].max = aMax
|
||||
this.echartsDataA3.series[0].max = aMax
|
||||
this.echartsDataA1.series[0].data[0].value = data.iRmsA
|
||||
this.echartsDataA2.series[0].data[0].value = data.iRmsB
|
||||
this.echartsDataA3.series[0].data[0].value = data.iRmsC
|
||||
|
||||
this.echartsData0.series[0].data[0].value = data.i1AngA
|
||||
this.echartsData0.series[0].data[1].value = data.i1AngB
|
||||
this.echartsData0.series[0].data[2].value = data.i1AngC
|
||||
|
||||
this.echartsData1.series[0].data[0].value = data.v1AngA
|
||||
this.echartsData1.series[0].data[1].value = data.v1AngB
|
||||
this.echartsData1.series[0].data[2].value = data.v1AngC
|
||||
|
||||
const charts = [
|
||||
{ instance: this.echart0, data: this.echartsData0 },
|
||||
{ instance: this.echart1, data: this.echartsData1 },
|
||||
{ instance: this.echartV1, data: this.echartsDataV1 },
|
||||
{ instance: this.echartV2, data: this.echartsDataV2 },
|
||||
{ instance: this.echartV3, data: this.echartsDataV3 },
|
||||
{ instance: this.echartA1, data: this.echartsDataA1 },
|
||||
{ instance: this.echartA2, data: this.echartsDataA2 },
|
||||
{ instance: this.echartA3, data: this.echartsDataA3 },
|
||||
]
|
||||
|
||||
charts.forEach(({ instance, data }) => {
|
||||
if (instance && instance.setOption) {
|
||||
instance.setOption(data, true)
|
||||
}
|
||||
})
|
||||
|
||||
// this.echart0.setOption(this.echartsData0, true)
|
||||
// this.echart1.setOption(this.echartsData1, true)
|
||||
// this.echartV1.setOption(this.echartsDataV1, true)
|
||||
// this.echartV2.setOption(this.echartsDataV2, true)
|
||||
// this.echartV3.setOption(this.echartsDataV3, true)
|
||||
// this.echartA1.setOption(this.echartsDataA1, true)
|
||||
// this.echartA2.setOption(this.echartsDataA2, true)
|
||||
// this.echartA3.setOption(this.echartsDataA3, true)
|
||||
// this.echart0.setOption(this.echartsData0, true)
|
||||
// this.echart1.setOption(this.echartsData1, true)
|
||||
// this.echartV1.setOption(this.echartsDataV1, true)
|
||||
// this.echartV2.setOption(this.echartsDataV2, true)
|
||||
// this.echartV3.setOption(this.echartsDataV3, true)
|
||||
// this.echartA1.setOption(this.echartsDataA1, true)
|
||||
// this.echartA2.setOption(this.echartsDataA2, true)
|
||||
// this.echartA3.setOption(this.echartsDataA3, true)
|
||||
// }
|
||||
}
|
||||
})
|
||||
@@ -1029,7 +1032,8 @@ export default {
|
||||
.table-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 30rpx;
|
||||
padding: 15rpx 30rpx;
|
||||
height: 20px;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
text {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user