细节优化

This commit is contained in:
仲么了
2023-11-02 13:40:48 +08:00
parent a60cdc066e
commit f01f764fcf
8 changed files with 82 additions and 50 deletions

View File

@@ -2,7 +2,7 @@
<uni-card <uni-card
:title="device.equipmentName" :title="device.equipmentName"
:sub-title="device.mac" :sub-title="device.mac"
:extra="device.isPrimaryUser == 1 ? '主用户' : '分享用户'" :extra="device.isPrimaryUser == 1 ? '主设备' : '分享设备'"
padding="0" padding="0"
@click="jump(device)" @click="jump(device)"
:thumbnail="deviceIcon(device.runStatus)" :thumbnail="deviceIcon(device.runStatus)"

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.3.9", "versionName" : "1.4.1",
"versionCode" : 139, "versionCode" : 141,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -6,7 +6,7 @@
<view class="about-text">设备类型{{ deviceInfo.devTypeName }}</view> <view class="about-text">设备类型{{ deviceInfo.devTypeName }}</view>
<view class="about-text">设备型号{{ deviceInfo.devModelName }}</view> <view class="about-text">设备型号{{ deviceInfo.devModelName }}</view>
<view class="about-text" <view class="about-text"
>设备接入方式{{ deviceInfo.devAccessMethod === 'cloud' ? '云直连' : 'MQTT' }}</view >设备接入方式{{ deviceInfo.devAccessMethod === 'cloud' ? 'CLD' : 'MQTT' }}</view
> >
<!-- <view class="about-text">设备注册时间永久使用</view> --> <!-- <view class="about-text">设备注册时间永久使用</view> -->
<view class="about-text">程序版本{{ deviceInfo.programVersionName }}</view> <view class="about-text">程序版本{{ deviceInfo.programVersionName }}</view>

View File

@@ -1,8 +1,22 @@
<template> <template>
<view> <view>
<uni-data-checkbox v-model="parity" :localdata="parityOption" @change="initEcharts"></uni-data-checkbox> <div class="header-form">
<!-- <uni-data-checkbox v-model="dataRadio" :localdata="dataOptions" @change="initEcharts"></uni-data-checkbox> --> <uni-data-select
<uni-data-select v-model="dataRadio" :localdata="dataOptions" @change="initEcharts"></uni-data-select> v-model="parity"
:localdata="parityOption"
@change="initEcharts"
style="flex: 1"
:clear="false"
></uni-data-select>
<!-- <uni-data-checkbox v-model="dataRadio" :localdata="dataOptions" @change="initEcharts"></uni-data-checkbox> -->
<uni-data-select
v-model="dataRadio"
:localdata="dataOptions"
@change="initEcharts"
style="flex: 2; margin-left: 20rpx"
:clear="false"
></uni-data-select>
</div>
<view class="charts-box"> <view class="charts-box">
<qiun-data-charts type="bar" :ontouch="true" :opts="opts" :chartData="chartData" /> <qiun-data-charts type="bar" :ontouch="true" :opts="opts" :chartData="chartData" />
</view> </view>
@@ -46,7 +60,7 @@ export default {
//您可以通过修改 config-ucharts.js 文件中下标为 ['column'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。 //您可以通过修改 config-ucharts.js 文件中下标为 ['column'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: { opts: {
// enableScroll: true, // enableScroll: true,
dataLabel:false, dataLabel: false,
color: [ color: [
'#1890FF', '#1890FF',
'#91CB74', '#91CB74',
@@ -59,7 +73,9 @@ export default {
'#ea7ccc', '#ea7ccc',
], ],
padding: [20, 10, 0, 0], padding: [20, 10, 0, 0],
legend: {}, legend: {
position: 'top',
},
xAxis: { xAxis: {
disableGrid: true, disableGrid: true,
itemCount: 8, itemCount: 8,
@@ -69,6 +85,7 @@ export default {
min: 0, min: 0,
}, },
], ],
position: 'top',
}, },
yAxis: {}, yAxis: {},
extra: { extra: {
@@ -166,39 +183,41 @@ export default {
}, },
methods: { methods: {
initEcharts() { initEcharts() {
let obj = JSON.parse( setTimeout(() => {
JSON.stringify( let obj = JSON.parse(
this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]], JSON.stringify(
), this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]],
) ),
let key = this.dataOptions[this.dataRadio].pointer.split('_') )
console.log(key) let key = this.dataOptions[this.dataRadio].pointer.split('_')
let name1 = key[0] + '_' + key[1] console.log(key)
let name2 = key[2] let name1 = key[0] + '_' + key[1]
this.chartData = { let name2 = key[2]
categories: Object.keys(obj) this.chartData = {
.map((item) => { categories: Object.keys(obj)
// Apf_HarmI_Sys_36(A) 匹配36 .map((item) => {
return Number(item.match(/\d+/)[0]) // Apf_HarmI_Sys_36(A) 匹配36
}) return Number(item.match(/\d+/)[0])
.filter((item) => { })
return item % 2 === this.parity - 1 .filter((item) => {
}), return item % 2 === this.parity - 1
series: [
{
name: '电网侧',
data: Object.values(this.renderData['电网侧'][name1][name2]).filter((item, index) => {
return index % 2 === this.parity - 1
}), }),
}, series: [
{ {
name: '负载侧', name: '电网侧',
data: Object.values(this.renderData['负载侧'][name1][name2]).filter((item, index) => { data: Object.values(this.renderData['电网侧'][name1][name2]).filter((item, index) => {
return index % 2 === this.parity - 1 return index % 2 === this.parity - 1
}), }),
}, },
], {
} name: '负载侧',
data: Object.values(this.renderData['负载侧'][name1][name2]).filter((item, index) => {
return index % 2 === this.parity - 1
}),
},
],
}
}, 100)
}, },
}, },
} }
@@ -209,4 +228,7 @@ export default {
margin-top: 20rpx; margin-top: 20rpx;
height: 100vh; height: 100vh;
} }
.header-form {
display: flex;
}
</style> </style>

View File

@@ -3,7 +3,7 @@
<template v-if="devCount.engineeringListLength > 1"> <template v-if="devCount.engineeringListLength > 1">
<view class="canneng-index-title mb20">所有工程设备统计</view> <view class="canneng-index-title mb20">所有工程设备统计</view>
<view class="header"> <view class="header">
<view class="header-item" @click="jump('allEngineering')"> <view class="header-item" @click="jump('allEngineering')">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view> <view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view> <view class="header-item-label">设备总数</view>
</view> </view>
@@ -20,7 +20,9 @@
<view class="header-item-label">告警数量</view> <view class="header-item-label">告警数量</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view> <view class="header-item-value">{{
devCount.eventCount + devCount.runCount + devCount.harmonicCount || 0
}}</view>
<view class="header-item-label">事件数量</view> <view class="header-item-label">事件数量</view>
</view> </view>
<view class="header-item" @click="projectNum"> <view class="header-item" @click="projectNum">
@@ -32,7 +34,7 @@
</template> </template>
<view class="canneng-index-title mb20">当前工程设备统计</view> <view class="canneng-index-title mb20">当前工程设备统计</view>
<view class="header"> <view class="header">
<view class="header-item" @click="jump('nowEngineering')"> <view class="header-item" @click="jump('nowEngineering')">
<view class="header-item-value">{{ <view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0 devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view> }}</view>
@@ -51,7 +53,9 @@
<view class="header-item-label">告警数量</view> <view class="header-item-label">告警数量</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view> <view class="header-item-value">{{
devCount.currentEventCount + devCount.currentRunCount + devCount.currentHarmonicCount || 0
}}</view>
<view class="header-item-label">事件数量</view> <view class="header-item-label">事件数量</view>
</view> </view>
<view class="header-item" @click="projectNum"> <view class="header-item" @click="projectNum">
@@ -87,8 +91,7 @@ export default {
}, },
jump(type) { jump(type) {
uni.navigateTo({ uni.navigateTo({
url: url: '/pages/device/list?type=' + type,
'/pages/device/list?type=' + type
}) })
}, },
}, },

View File

@@ -20,7 +20,9 @@
<view class="header-item-label">告警数量</view> <view class="header-item-label">告警数量</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view> <view class="header-item-value">{{
devCount.eventCount + devCount.runCount + devCount.harmonicCount || 0
}}</view>
<view class="header-item-label">事件数量</view> <view class="header-item-label">事件数量</view>
</view> </view>
<view class="header-item" @click="projectNum(false)"> <view class="header-item" @click="projectNum(false)">
@@ -52,7 +54,9 @@
<view class="header-item-label">告警数量</view> <view class="header-item-label">告警数量</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view> <view class="header-item-value">{{
devCount.currentEventCount + devCount.currentRunCount + devCount.currentHarmonicCount || 0
}}</view>
<view class="header-item-label">事件数量</view> <view class="header-item-label">事件数量</view>
</view> </view>
<view class="header-item" @click="projectNum(true)"> <view class="header-item" @click="projectNum(true)">

View File

@@ -193,6 +193,9 @@ export default {
index: 2, index: 2,
}) })
} }
// #ifdef APP-PLUS
plus.runtime.setBadgeNumber(messagePage + minePage)
// #endif
}) })
}, },
}, },

View File

@@ -4,7 +4,7 @@
<view class='about'> <view class='about'>
<image src="/static/logo.png" class="logo"></image> <image src="/static/logo.png" class="logo"></image>
<view class="name">灿能物联</view> <view class="name">灿能物联</view>
<view class="version">Version 1.0.0</view> <view class="version">Version 1.0.1</view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>