修改 app

This commit is contained in:
GGJ
2024-09-02 09:50:59 +08:00
parent 8214b40495
commit fd55306d1a
30 changed files with 2380 additions and 2091 deletions

View File

@@ -1,80 +1,92 @@
<template>
<view class='basic'>
<view class="grid-card">
<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 }}
<template v-if="item[0].clDid "> (°C)</template>
</view>
<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 }}
<template v-if="item[2].clDid "> (°C)</template>
</view>
<view class="item item-title">{{ item[3].clDid }}
<template v-if="item[3].clDid "> (°C)</template>
</view>
<view class="item">{{ item[0].clDid ? item[0].value || '-' : '' }}</view>
<view class="item">{{ item[1].clDid ? item[1].value || '-' : '' }}</view>
<view class="item">{{ item[2].clDid ? item[2].value || '-' : '' }}</view>
<view class="item">{{ item[3].clDid ? item[3].value || '-' : '' }}</view>
</template>
</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>
<view class="basic">
<view class="grid-card">
<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 }}
<template v-if="item[0].clDid"> (°C)</template>
</view>
<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 }}
<template v-if="item[2].clDid"> (°C)</template>
</view>
<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>
<view class="item">{{ item[1].clDid ? Math.round(item[1].value) || '-' : '' }}</view>
<view class="item">{{ item[2].clDid ? Math.round(item[2].value) || '-' : '' }}</view>
<view class="item">{{ item[3].clDid ? Math.round(item[3].value) || '-' : '' }}</view>
</template>
</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>
export default {
data() {
return {}
},
props: {
IOData: {
type: Array,
default: () => {
return []
},
},
},
computed: {
renderData() {
let arr = []
// 把IOData转换成每4个一组的二维数组
for (let i = 0; i < this.IOData.length; i += 4) {
arr.push(this.IOData.slice(i, i + 4))
}
// 把每组的长度补齐到4
arr.forEach((item) => {
if (item.length < 4) {
let length = 4 - item.length
for (let i = 0; i < length; i++) {
item.push({})
}
}
})
console.warn(arr)
return arr
}
},
methods: {}
data() {
return {}
},
props: {
IOData: {
type: Array,
default: () => {
return []
},
},
},
computed: {
renderData() {
let arr = []
// 把IOData转换成每4个一组的二维数组
for (let i = 0; i < this.IOData.length; i += 4) {
this.IOData.slice(i, i + 4).forEach((item) => {
if (Number.isInteger(item.value) || item.value =='') {
}else {
item.value = (item.value-0).toFixed(4)
}
})
arr.push(this.IOData.slice(i, i + 4))
}
// 把每组的长度补齐到4
arr.forEach((item) => {
if (item.length < 4) {
let length = 4 - item.length
for (let i = 0; i < length; i++) {
item.push({})
}
}
})
console.warn(arr)
return arr
},
},
methods: {},
}
</script>
<style lang='scss'>
<style lang="scss">
.basic {
}
</style>
</style>

View File

@@ -8,8 +8,8 @@
<view class="item item-title">畸变率(%)</view>
<template v-for="(item, index) in renderData.电网电流">
<view class="item">{{ item.phase }}</view>
<view class="item">{{ item['Apf_RmsI_Sys(A)'] || '-' }}</view>
<view class="item">{{ item['Apf_ThdA_Sys(%)'] || '-' }}</view>
<view class="item">{{ item['Apf_RmsI_Sys(A)'] }}</view>
<view class="item">{{ item['Apf_ThdA_Sys(%)'] }}</view>
</template>
</view>
</view>
@@ -22,9 +22,9 @@
<view class="item item-title">畸变率(%)</view>
<template v-for="(item, index) in renderData.电网电压">
<view class="item">{{ item.phase }}</view>
<view class="item">{{ item['Apf_PhV_Sys(V)'] || '-' }}</view>
<view class="item">{{ item['Apf_Freq(Hz)'] || '-' }}</view>
<view class="item">{{ item['Apf_ThdU_Sys(%)'] || '-' }}</view>
<view class="item">{{ item['Apf_PhV_Sys(V)'] }}</view>
<view class="item">{{ item['Apf_Freq(Hz)'] }}</view>
<view class="item">{{ item['Apf_ThdU_Sys(%)'] }}</view>
</template>
</view>
</view>
@@ -36,8 +36,8 @@
<view class="item item-title">畸变率(%)</view>
<template v-for="(item, index) in renderData.负载电流">
<view class="item">{{ item.phase }}</view>
<view class="item">{{ item['Apf_RmsI_Load(A)'] || '-' }}</view>
<view class="item">{{ item['Apf_ThdA_Load(%)'] || '-' }}</view>
<view class="item">{{ item['Apf_RmsI_Load(A)'] }}</view>
<view class="item">{{ item['Apf_ThdA_Load(%)'] }}</view>
</template>
</view>
</view>
@@ -49,8 +49,8 @@
<view class="item item-title">负载率(%)</view>
<template v-for="(item, index) in renderData.补偿电流">
<view class="item">{{ item.phase }}</view>
<view class="item">{{ item['Apf_RmsI_TolOut(A)'] || '-' }}</view>
<view class="item">{{ item['load_Rate'] || '-' }}</view>
<view class="item">{{ item['Apf_RmsI_TolOut(A)'] }}</view>
<view class="item">{{ item['load_Rate'] }}</view>
</template>
</view>
</view>
@@ -129,11 +129,11 @@ export default {
return item2.phase === item.phase
})
if (index > -1) {
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
this.renderData[key][index][item.statisticalName] = item.statisticalData //
} else {
this.renderData[key].push({
phase: item.phase,
[item.statisticalName]: item.statisticalData || '-',
[item.statisticalName]: item.statisticalData //,
})
}
})

View File

@@ -1,119 +1,117 @@
<template>
<view class="basic">
<view class="grid-card">
<view class="grid-card-title">电网侧</view>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
<view class="item item-title">有功功率(kw)</view>
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<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)'] || '-' }}</view>
<view class="item">{{ item['Apf_Q_Sys(Var)'] || '-' }}</view>
<view class="item">{{ item['Apf_S_Sys(VA)'] || '-' }}</view>
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
</template>
</view>
</view>
<view class="grid-card">
<view class="grid-card-title">负载侧</view>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
<view class="item item-title">有功功率(kw)</view>
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<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)'] || '-' }}</view>
<view class="item">{{ item['Apf_Q_Load(Var)'] || '-' }}</view>
<view class="item">{{ item['Apf_S_Load(VA)'] || '-' }}</view>
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
</template>
</view>
</view>
</view>
<view class="basic">
<view class="grid-card">
<view class="grid-card-title">电网侧</view>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
<view class="item item-title">有功功率(kw)</view>
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<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)'] / 1000).toFixed(4) || '-' }}</view>
<view class="item">{{ (item['Apf_Q_Sys(Var)'] / 1000).toFixed(4) || '-' }}</view>
<view class="item">{{ (item['Apf_S_Sys(VA)'] / 1000).toFixed(4) || '-' }}</view>
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
</template>
</view>
</view>
<view class="grid-card">
<view class="grid-card-title">负载侧</view>
<view class="grid-card-content-5">
<view class="item item-title">名称</view>
<view class="item item-title">有功功率(kw)</view>
<view class="item item-title">无功功率(kVar)</view>
<view class="item item-title">视在功率(kVA)</view>
<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)'] / 1000).toFixed(4) || '-' }}</view>
<view class="item">{{ (item['Apf_Q_Load(Var)'] / 1000).toFixed(4) || '-' }}</view>
<view class="item">{{ (item['Apf_S_Load(VA)'] / 1000).toFixed(4) || '-' }}</view>
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
</template>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
renderData: {
电网侧: [],
负载侧: [],
未知: [],
},
}
},
props: {
basicData: {
type: Array,
default: () => {
return []
},
},
},
watch: {
basicData: {
handler: function (newVal, oldVal) {
data() {
return {
renderData: {
电网侧: [],
负载侧: [],
未知: [],
},
}
},
props: {
basicData: {
type: Array,
default: () => {
return []
},
},
},
watch: {
basicData: {
handler: function (newVal, oldVal) {
newVal.forEach((item) => {
if (item.phase === 'avg') {
return
}
let key = ''
switch (item.statisticalName) {
case 'Apf_P_Sys(W)':
key = '电网侧'
break
case 'Apf_Q_Sys(Var)':
key = '电网侧'
break
case 'Apf_S_Sys(VA)':
key = '电网侧'
break
case 'Apf_PF_Sys(null)':
key = '电网侧'
break
case 'Apf_P_Load(W)':
key = '负载侧'
break
case 'Apf_Q_Load(Var)':
key = '负载侧'
break
case 'Apf_S_Load(VA)':
key = '负载侧'
break
case 'Apf_PF_Load(null)':
key = '负载侧'
break
default:
key = '未知'
break
}
newVal.forEach(item => {
if (item.phase === 'avg') {
return
}
let key = ''
switch (item.statisticalName) {
case 'Apf_P_Sys(W)':
key = '电网侧'
break
case 'Apf_Q_Sys(Var)':
key = '电网侧'
break
case 'Apf_S_Sys(VA)':
key = '电网侧'
break
case 'Apf_PF_Sys(null)':
key = '电网侧'
break
case 'Apf_P_Load(W)':
key = '负载侧'
break
case 'Apf_Q_Load(Var)':
key = '负载侧'
break
case 'Apf_S_Load(VA)':
key = '负载侧'
break
case 'Apf_PF_Load(null)':
key = '负载侧'
break
default:
key = '未知'
break
}
let index = this.renderData[key].findIndex((item2) => {
return item2.phase === item.phase
})
if (index > -1) {
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
} else {
this.renderData[key].push({
phase: item.phase,
[item.statisticalName]: item.statisticalData || '-',
})
}
})
console.log(this.renderData)
},
deep: true,
immediate: true,
},
},
methods: {},
let index = this.renderData[key].findIndex((item2) => {
return item2.phase === item.phase
})
if (index > -1) {
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
} else {
this.renderData[key].push({
phase: item.phase,
[item.statisticalName]: item.statisticalData || '-',
})
}
})
console.log(this.renderData)
},
deep: true,
immediate: true,
},
},
methods: {},
}
</script>
<style lang="scss">

View File

@@ -18,7 +18,7 @@
></uni-data-select>
</div>
<view class="charts-box">
<view class="data-time">{{ time }}</view>
<!-- <view class="data-time">{{ time }}</view> -->
<qiun-data-charts type="bar" :ontouch="true" :opts="opts" :chartData="chartData" />
</view>
</view>
@@ -32,7 +32,7 @@ export default {
default: () => [],
},
dataTime: {
type: String,
type: [String,Number],
default: '',
},
},
@@ -103,8 +103,8 @@ export default {
meterFillColor: '#FFFFFF',
activeBgColor: '#000000',
activeBgOpacity: 0.08,
seriesGap: 2,
categoryGap: 6,
seriesGap: 1,
categoryGap: 4,
},
},
},
@@ -163,11 +163,11 @@ export default {
let dataOptions = []
let type = [
{
name: '电网谐波电流幅值序列',
name: '谐波电流幅值序列',
key: 'Apf_HarmI',
},
{
name: '负载谐波电压含有率序列',
name: '谐波电压含有率序列',
key: 'Apf_HarmUR',
},
]
@@ -183,7 +183,6 @@ export default {
this.dataOptions = dataOptions
console.log(dataOptions)
this.initEcharts()
console.log(this.dataTime)
this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60)
},
deep: true,