消息推送
This commit is contained in:
3
App.vue
3
App.vue
@@ -4,6 +4,9 @@ import {getImageUrl} from '@/common/api/basic'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
|
// uni.onPushMessage((res) => {
|
||||||
|
// console.log("收到推送消息:",res) //监听推送消息
|
||||||
|
// })
|
||||||
console.log(window)
|
console.log(window)
|
||||||
// this.connect()
|
// this.connect()
|
||||||
console.log('App Launch')
|
console.log('App Launch')
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export function apiRebindPhone(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 角色升级
|
// 角色升级
|
||||||
export function roleUpdate({ userId, referralCode }) {
|
export function roleUpdate({userId, referralCode}) {
|
||||||
return request({
|
return request({
|
||||||
url: '/user-boot/appRole/roleUpdate',
|
url: '/user-boot/appRole/roleUpdate',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -207,15 +207,18 @@ export function apiUpdateUser(params) {
|
|||||||
// 更新用户推送标识
|
// 更新用户推送标识
|
||||||
|
|
||||||
export function apiUpdatePush(params) {
|
export function apiUpdatePush(params) {
|
||||||
uni.getPushClientId((res) => {
|
uni.getPushClientId({
|
||||||
let push_clientid = res.cid
|
success: (res) => {
|
||||||
request({
|
let push_clientid = res.cid
|
||||||
url: '/user-boot/appUser/updateDevCode',
|
console.log(push_clientid, 'push_clientid')
|
||||||
data: {
|
request({
|
||||||
devCode: push_clientid,
|
url: '/user-boot/appUser/updateDevCode',
|
||||||
userId: uni.getStorageSync('userInfo').userIndex,
|
data: {
|
||||||
},
|
devCode: push_clientid,
|
||||||
method: 'POST',
|
userId: uni.getStorageSync('userInfo').userIndex,
|
||||||
})
|
},
|
||||||
|
method: 'POST',
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
"push" : {
|
"push" : {
|
||||||
"unipush" : {
|
"unipush" : {
|
||||||
"version" : "2",
|
"version" : "2",
|
||||||
"offline" : false
|
"offline" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"share" : {}
|
"share" : {}
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<view class="item item-title">名称</view>
|
<view class="item item-title">名称</view>
|
||||||
<view class="item item-title">有效值(A)</view>
|
<view class="item item-title">有效值(A)</view>
|
||||||
<view class="item item-title">THDI(%)</view>
|
<view class="item item-title">THDI(%)</view>
|
||||||
<template v-for="(item, index) in renderData.电网侧">
|
<template v-for="(item, index) in renderData.电网电流">
|
||||||
<view class="item">{{ item.phase }}</view>
|
<view class="item">{{ item.phase }}</view>
|
||||||
<view class="item">{{ item['Pq_RmsI(A)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_RmsI_Sys(A)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_ThdI(%)'] || '-'}}</view>
|
<view class="item">{{ item['Apf_ThdA_Sys(%)'] || '-' }}</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
<view class="item item-title">电压(V)</view>
|
<view class="item item-title">电压(V)</view>
|
||||||
<view class="item item-title">频率(Hz)</view>
|
<view class="item item-title">频率(Hz)</view>
|
||||||
<view class="item item-title">THDU(%)</view>
|
<view class="item item-title">THDU(%)</view>
|
||||||
<template v-for="(item, index) in renderData.电网侧">
|
<template v-for="(item, index) in renderData.电网电压">
|
||||||
<view class="item">{{ item.phase }}</view>
|
<view class="item">{{ item.phase }}</view>
|
||||||
<view class="item">{{ item['Pq_RmsLU(V)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_PhV_Sys(V)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_Freq(Hz)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_Freq(Hz)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_ThdU(%)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_ThdU(%)'] || '-' }}</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -34,10 +34,10 @@
|
|||||||
<view class="item item-title">名称</view>
|
<view class="item item-title">名称</view>
|
||||||
<view class="item item-title">有效值(A)</view>
|
<view class="item item-title">有效值(A)</view>
|
||||||
<view class="item item-title">THDI(%)</view>
|
<view class="item item-title">THDI(%)</view>
|
||||||
<template v-for="(item, index) in renderData.负载侧">
|
<template v-for="(item, index) in renderData.负载电流">
|
||||||
<view class="item">{{ item.phase }}</view>
|
<view class="item">{{ item.phase }}</view>
|
||||||
<view class="item">{{ item['Pq_RmsI(A)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_RmsI_Load(A)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_ThdI(%)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_ThdA_Load(%)'] || '-' }}</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -47,10 +47,10 @@
|
|||||||
<view class="item item-title">名称</view>
|
<view class="item item-title">名称</view>
|
||||||
<view class="item item-title">有效值(A)</view>
|
<view class="item item-title">有效值(A)</view>
|
||||||
<view class="item item-title">负载率(%)</view>
|
<view class="item item-title">负载率(%)</view>
|
||||||
<template v-for="(item, index) in renderData.输出侧">
|
<template v-for="(item, index) in renderData.补偿电流">
|
||||||
<view class="item">{{ item.phase }}</view>
|
<view class="item">{{ item.phase }}</view>
|
||||||
<view class="item">{{ item['Apf_RmsI_Sys(A)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_RmsI_TolOut(A)'] || '-' }}</view>
|
||||||
<view class="item"></view>
|
<view class="item">-</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -61,9 +61,11 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
renderData: {
|
renderData: {
|
||||||
电网侧: {},
|
电网电流: [],
|
||||||
负载侧: {},
|
电网电压: [],
|
||||||
输出侧: {},
|
负载电流: [],
|
||||||
|
补偿电流: [],
|
||||||
|
未知:[]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -78,36 +80,55 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
basicData: {
|
basicData: {
|
||||||
handler: function (newVal, oldVal) {
|
handler: function (newVal, oldVal) {
|
||||||
let arr = [
|
|
||||||
{
|
newVal.forEach(item => {
|
||||||
name: '电网侧',
|
|
||||||
linePostion: 'cb23b9ede3b652cd6da194fd7b318124',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '负载侧',
|
|
||||||
linePostion: '32624d4bb3a86f2b9a01bab272e50125',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '输出侧',
|
|
||||||
linePostion: '26eae70fb5ff1c090d2dc7c3a0743948',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
this.basicData.forEach((item) => {
|
|
||||||
if (item.phase === 'avg') {
|
if (item.phase === 'avg') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let index = arr.findIndex((item2) => {
|
let key = ''
|
||||||
return item2.linePostion === item.position
|
switch (item.statisticalName) {
|
||||||
|
case 'Apf_RmsI_Sys(A)':
|
||||||
|
key = '电网电流'
|
||||||
|
break
|
||||||
|
case 'Apf_ThdA_Sys(%)':
|
||||||
|
key = '电网电流'
|
||||||
|
break
|
||||||
|
case 'Apf_PhV_Sys(V)':
|
||||||
|
key = '电网电压'
|
||||||
|
break
|
||||||
|
case 'Apf_Freq(Hz)':
|
||||||
|
key = '电网电压'
|
||||||
|
break
|
||||||
|
case 'Apf_RmsI_Load(A)':
|
||||||
|
key = '负载电流'
|
||||||
|
break
|
||||||
|
case 'Apf_ThdA_Load(%)':
|
||||||
|
key = '负载电流'
|
||||||
|
break
|
||||||
|
case 'Apf_RmsI_TolOut(A)':
|
||||||
|
key = '补偿电流'
|
||||||
|
break
|
||||||
|
case 'Apf_PhV_Sys(V)':
|
||||||
|
key = '补偿电流'
|
||||||
|
break
|
||||||
|
case 'Apf_PhV_Sys(V)':
|
||||||
|
key = '补偿电流'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
key = '未知'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
let index = this.renderData[key].findIndex((item2) => {
|
||||||
|
return item2.phase === item.phase
|
||||||
})
|
})
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
if (this.renderData[arr[index]['name']][item.phase]) {
|
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
|
||||||
this.renderData[arr[index]['name']][item.phase][item.statisticalName] = item.statisticalData || '-'
|
} else {
|
||||||
} else {
|
this.renderData[key].push({
|
||||||
this.renderData[arr[index]['name']][item.phase] = {
|
phase: item.phase,
|
||||||
phase: item.phase,
|
[item.statisticalName]: item.statisticalData || '-',
|
||||||
[item.statisticalName]: item.statisticalData || '-',
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.renderData)
|
console.log(this.renderData)
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
<view class="item item-title">功率因数</view>
|
<view class="item item-title">功率因数</view>
|
||||||
<template v-for="(item, index) in renderData.电网侧">
|
<template v-for="(item, index) in renderData.电网侧">
|
||||||
<view class="item">{{ item.phase }}</view>
|
<view class="item">{{ item.phase }}</view>
|
||||||
<view class="item">{{ item['Pq_P(W)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_P_Sys(W)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_Q(var)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_Q_Sys(Var)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_S(VA)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_S_Sys(VA)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_PF(null)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
<view class="item item-title">无功功率(kVar)</view>
|
<view class="item item-title">无功功率(kVar)</view>
|
||||||
<view class="item item-title">视在功率(kVA)</view>
|
<view class="item item-title">视在功率(kVA)</view>
|
||||||
<view class="item item-title">功率因数</view>
|
<view class="item item-title">功率因数</view>
|
||||||
<template v-for="(item, index) in renderData.电网侧">
|
<template v-for="(item, index) in renderData.负载侧">
|
||||||
<view class="item">{{ item.phase }}</view>
|
<view class="item">{{ item.phase }}</view>
|
||||||
<view class="item">{{ item['Pq_P(W)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_P_Load(W)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_Q(var)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_Q_Load(Var)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_S(VA)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_S_Load(VA)'] || '-' }}</view>
|
||||||
<view class="item">{{ item['Pq_PF(null)'] || '-' }}</view>
|
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -41,9 +41,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
renderData: {
|
renderData: {
|
||||||
电网侧: {},
|
电网侧: [],
|
||||||
负载侧: {},
|
负载侧: [],
|
||||||
输出侧: {},
|
未知: [],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -58,36 +58,52 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
basicData: {
|
basicData: {
|
||||||
handler: function (newVal, oldVal) {
|
handler: function (newVal, oldVal) {
|
||||||
let arr = [
|
|
||||||
{
|
newVal.forEach(item => {
|
||||||
name: '电网侧',
|
|
||||||
linePostion: 'cb23b9ede3b652cd6da194fd7b318124',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '负载侧',
|
|
||||||
linePostion: '32624d4bb3a86f2b9a01bab272e50125',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '输出侧',
|
|
||||||
linePostion: '26eae70fb5ff1c090d2dc7c3a0743948',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
this.basicData.forEach((item) => {
|
|
||||||
if (item.phase === 'avg') {
|
if (item.phase === 'avg') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let index = arr.findIndex((item2) => {
|
let key = ''
|
||||||
return item2.linePostion === item.position
|
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) {
|
if (index > -1) {
|
||||||
if (this.renderData[arr[index]['name']][item.phase]) {
|
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
|
||||||
this.renderData[arr[index]['name']][item.phase][item.statisticalName] = item.statisticalData || '-'
|
} else {
|
||||||
} else {
|
this.renderData[key].push({
|
||||||
this.renderData[arr[index]['name']][item.phase] = {
|
phase: item.phase,
|
||||||
phase: item.phase,
|
[item.statisticalName]: item.statisticalData || '-',
|
||||||
[item.statisticalName]: item.statisticalData || '-',
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.renderData)
|
console.log(this.renderData)
|
||||||
@@ -95,6 +111,7 @@ export default {
|
|||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,23 +69,24 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
basicData: {
|
basicData: {
|
||||||
handler: function (newVal, oldVal) {
|
handler: function (newVal, oldVal) {
|
||||||
|
console.log(this.basicData)
|
||||||
let basicData = JSON.parse(JSON.stringify(this.basicData))
|
let basicData = JSON.parse(JSON.stringify(this.basicData))
|
||||||
let arr = [
|
let arr = [
|
||||||
{
|
{
|
||||||
name: '电网侧',
|
name: '电网侧',
|
||||||
linePostion: 'cb23b9ede3b652cd6da194fd7b318124',
|
key: 'Apf_HarmI_Sys',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '负载侧',
|
name: '负载侧',
|
||||||
linePostion: '32624d4bb3a86f2b9a01bab272e50125',
|
key: 'Apf_HarmI_Load',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
basicData.forEach((item) => {
|
basicData.forEach((item) => {
|
||||||
if (item.statisticalName.indexOf('Pq_HarmI_') === -1) {
|
if (item.statisticalName.indexOf('HarmI') === -1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let index = arr.findIndex((item2) => {
|
let index = arr.findIndex((item2) => {
|
||||||
return item2.linePostion === item.position
|
return item.statisticalName.indexOf(item2.key) > -1
|
||||||
})
|
})
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
if (this.renderData[arr[index]['name']][item.phase]) {
|
if (this.renderData[arr[index]['name']][item.phase]) {
|
||||||
@@ -93,7 +94,6 @@ export default {
|
|||||||
item.statisticalData || 0
|
item.statisticalData || 0
|
||||||
} else {
|
} else {
|
||||||
this.renderData[arr[index]['name']][item.phase] = {
|
this.renderData[arr[index]['name']][item.phase] = {
|
||||||
phase: item.phase,
|
|
||||||
[item.statisticalName]: item.statisticalData || 0,
|
[item.statisticalName]: item.statisticalData || 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,10 +110,11 @@ export default {
|
|||||||
let obj = JSON.parse(
|
let obj = JSON.parse(
|
||||||
JSON.stringify(this.renderData['电网侧'][Object.keys(this.renderData['电网侧'])[0]]),
|
JSON.stringify(this.renderData['电网侧'][Object.keys(this.renderData['电网侧'])[0]]),
|
||||||
)
|
)
|
||||||
delete obj['phase']
|
|
||||||
console.log(
|
console.log(
|
||||||
Object.keys(obj).map((item) => {
|
Object.keys(obj).map((item) => {
|
||||||
return item.match(/Pq_HarmI_(\d+)/)[1]
|
// Apf_HarmI_Sys_36(A) 匹配36
|
||||||
|
return item.match(/\d+/)[0]
|
||||||
|
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
console.log(
|
console.log(
|
||||||
@@ -128,7 +129,8 @@ export default {
|
|||||||
)
|
)
|
||||||
this.chartData = {
|
this.chartData = {
|
||||||
categories: Object.keys(obj).map((item) => {
|
categories: Object.keys(obj).map((item) => {
|
||||||
return Number(item.match(/Pq_HarmI_(\d+)/)[1])
|
// Apf_HarmI_Sys_36(A) 匹配36
|
||||||
|
return Number(item.match(/\d+/)[0])
|
||||||
}),
|
}),
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -156,32 +156,7 @@ export default {
|
|||||||
dictData: [],
|
dictData: [],
|
||||||
isPrimaryUser: 0,
|
isPrimaryUser: 0,
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
topolodyData: [
|
topolodyData: [],
|
||||||
{
|
|
||||||
label: '电网侧',
|
|
||||||
linePostion: 'cb23b9ede3b652cd6da194fd7b318124',
|
|
||||||
lat: '',
|
|
||||||
lng: '',
|
|
||||||
showKey: ['Pq_ThdU(%)', 'Pq_ThdI(%)'], //要展示的指标key
|
|
||||||
value: [],// 展示的指标值
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '负载侧',
|
|
||||||
linePostion: '32624d4bb3a86f2b9a01bab272e50125',
|
|
||||||
lat: '',
|
|
||||||
lng: '',
|
|
||||||
showKey: ['Pq_ThdU(%)', 'Pq_ThdI(%)'], //要展示的指标key
|
|
||||||
value: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '输出侧',
|
|
||||||
linePostion: '26eae70fb5ff1c090d2dc7c3a0743948',
|
|
||||||
lat: '',
|
|
||||||
lng: '',
|
|
||||||
showKey: ['Apf_ThdA_Load(%)', 'Apf_ThdA_Sys(%)'], //要展示的指标key
|
|
||||||
value: [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
basicData: [],
|
basicData: [],
|
||||||
IOData: [],
|
IOData: [],
|
||||||
}
|
}
|
||||||
@@ -268,7 +243,7 @@ export default {
|
|||||||
this.deviceInfo = res.data
|
this.deviceInfo = res.data
|
||||||
this.downloadImg()
|
this.downloadImg()
|
||||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||||
this.topolodyData.filter((item) => {
|
this.topolodyData = this.topolodyData.filter((item) => {
|
||||||
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
||||||
element.label = element.name
|
element.label = element.name
|
||||||
item.label = element.name
|
item.label = element.name
|
||||||
@@ -283,6 +258,7 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(this.topolodyData)
|
||||||
if (this.client) {
|
if (this.client) {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
} else {
|
} else {
|
||||||
@@ -379,18 +355,19 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handlerData(data) {
|
handlerData(data) {
|
||||||
|
this.basicData = data
|
||||||
this.topolodyData.forEach((element) => {
|
this.topolodyData.forEach((element) => {
|
||||||
let arr = []
|
let arr = []
|
||||||
element.showKey.forEach((key) => {
|
element.showKey.forEach((key) => {
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
if (item.statisticalName === key && item.phase === 'avg' && element.linePostion === item.position) {
|
if (item.statisticalName === key && item.phase === 'avg' ) {
|
||||||
arr.push(key + ':' + item.statisticalData)
|
arr.push(key + ':' + item.statisticalData)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
element.value = arr
|
element.value = arr
|
||||||
})
|
})
|
||||||
this.basicData = data
|
console.log(this.topolodyData)
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -434,6 +411,32 @@ export default {
|
|||||||
text: '用户',
|
text: '用户',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.topolodyData = this.$util.getDictData('Line_Position').map(item => {
|
||||||
|
switch (item.name) {
|
||||||
|
case '电网侧':
|
||||||
|
item.showKey = ['Apf_ThdA_Sys(%)']
|
||||||
|
break
|
||||||
|
case '负载侧':
|
||||||
|
item.showKey = ['Apf_ThdA_Load(%)']
|
||||||
|
break
|
||||||
|
case '输出侧':
|
||||||
|
item.showKey = ['Apf_RmsI_TolOut(A)']
|
||||||
|
break
|
||||||
|
case 'PCC公共点':
|
||||||
|
item.showKey = []
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
linePostion: item.id,
|
||||||
|
lat: '',
|
||||||
|
lng: '',
|
||||||
|
showKey: item.showKey, //要展示的指标key
|
||||||
|
value: [],
|
||||||
|
}
|
||||||
|
})
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -455,6 +458,7 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 375px;
|
width: 375px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
image-rendering: -moz-crisp-edges;
|
image-rendering: -moz-crisp-edges;
|
||||||
|
|||||||
20
uniCloud-aliyun/cloudfunctions/push/index.js
Normal file
20
uniCloud-aliyun/cloudfunctions/push/index.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
'use strict';
|
||||||
|
const uniPush = uniCloud.getPushManager({appId: "__UNI__88BC25B"})
|
||||||
|
exports.main = async (event, context) => {
|
||||||
|
//event为客户端上传的参数
|
||||||
|
console.log('event : ', event)
|
||||||
|
let body = JSON.parse(event.body)
|
||||||
|
let res = await uniPush.sendMessage({
|
||||||
|
"push_clientid": body.push_clientid, //填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
|
||||||
|
"title": body.title,
|
||||||
|
"content": body.content,
|
||||||
|
"payload": body.payload,
|
||||||
|
"force_notification": true,
|
||||||
|
"settings": {
|
||||||
|
"strategy": {
|
||||||
|
"default": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return res
|
||||||
|
};
|
||||||
7
uniCloud-aliyun/cloudfunctions/push/package.json
Normal file
7
uniCloud-aliyun/cloudfunctions/push/package.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "push",
|
||||||
|
"dependencies": {},
|
||||||
|
"extensions": {
|
||||||
|
"uni-cloud-push": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "uni-config-center",
|
|
||||||
"version": "0.0.3",
|
|
||||||
"description": "配置中心",
|
|
||||||
"main": "index.js",
|
|
||||||
"keywords": [],
|
|
||||||
"author": "DCloud",
|
|
||||||
"license": "Apache-2.0"
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "uni-id-common",
|
|
||||||
"version": "1.0.14",
|
|
||||||
"description": "uni-id token生成、校验、刷新",
|
|
||||||
"main": "index.js",
|
|
||||||
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id-common.html",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://gitee.com/dcloud/uni-id-common.git"
|
|
||||||
},
|
|
||||||
"author": "DCloud",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user