提交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

204
App.vue
View File

@@ -4,6 +4,7 @@ import { getImageUrl } from '@/common/api/basic'
export default { export default {
onLaunch: function () { onLaunch: function () {
// this.checkAppUpdate()
// uni.onPushMessage((res) => { // uni.onPushMessage((res) => {
// console.log("收到推送消息:",res) //监听推送消息 // console.log("收到推送消息:",res) //监听推送消息
// }) // })
@@ -39,6 +40,209 @@ export default {
onHide: function () { onHide: function () {
console.log('App Hide') console.log('App Hide')
}, },
methods: {
// 1. 检查应用更新(已分平台:安卓 + iOS
checkAppUpdate() {
// 开发环境跳过检查
const isDev = process.env.NODE_ENV === 'development'
if (isDev) {
return console.log('开发环境,不执行更新检查')
}
let isforce = 1
// uni.showModal({
// title: '更新提示',
// content: '发现新版本,是否立即更新?',
// showCancel: isforce == '0', // 强制更新隐藏取消按钮
// confirmText: '去更新',
// success: (modalRes) => {
// if (modalRes.confirm) {
// this.downloadAndInstallApk('http://112.4.144.18:8040/shiningCloud/file/canneng_wulian.apk')
// } else {
// }
// },
// })
// 获取当前应用信息
plus.runtime.getProperty(plus.runtime.appid, (info) => {
const currentVersion = info.version // 当前本地版本号
// 调用 API 获取服务器上的最新版本信息
getLastestVersion()
.then((res) => {
if (!res.data) {
return
}
const { version, appFileList, iosUrl } = res?.data || {}
// let isforce = 1
// 版本不一样才更新
if (currentVersion != version) {
// ==============================================
// 🔴 关键:判断手机系统(安卓 / iOS
// ==============================================
const isAndroid = plus.os.name === 'Android'
const isIos = plus.os.name === 'iOS'
// ----------------------
// ① iOS跳 App Store
// ----------------------
if (isIos) {
uni.showModal({
title: '更新提示',
content: '发现新版本,请前往 App Store 更新',
showCancel: isforce === '0', // 强制更新隐藏取消按钮
confirmText: '去更新',
success: (modalRes) => {
if (modalRes.confirm) {
// 跳转到 App Store 链接
plus.runtime.openURL(iosUrl)
// 强制更新:退出 App
if (isforce !== '0') {
plus.runtime.quit()
}
} else {
// 不更新直接退出 App强制
if (isforce !== '0') {
plus.runtime.quit()
}
}
},
})
return
}
// ----------------------
// ② Android下载安装
// ----------------------
if (isAndroid) {
uni.showModal({
title: '更新提示',
content: '发现新版本,是否立即更新?',
showCancel: isforce === '0', // 强制更新隐藏取消按钮
confirmText: '去更新',
success: (modalRes) => {
if (modalRes.confirm) {
// 跳转到 App Store 链接
this.downloadAndInstallApk(appFileList[0].filePath)
}
},
})
return
}
}
})
.catch((err) => {
console.log('获取版本接口失败', err)
})
})
},
// 2. 安卓专用:下载并安装 APK
downloadAndInstallApk(url) {
// 防止重复点击下载
if (this.downloadLoading) return
this.downloadLoading = true
uni.showLoading({
title: '正在下载更新...',
mask: true, // 加遮罩,防止重复点
})
// 下载配置(修复路径、覆盖安装)
const options = {
filename: '_doc/update/canneng_wulian.apk', // 固定文件名,更稳定
timeout: 120, // 超时时间
}
// 创建下载任务
const downloadTask = plus.downloader.createDownload(url, options, (downloadedFile, status) => {
this.downloadLoading = false
uni.hideLoading()
if (status === 200) {
// 开始安装
plus.runtime.install(
downloadedFile.filename,
{
force: true, // 强制覆盖安装
},
() => {
uni.showModal({
title: '安装成功',
content: '请重启APP',
showCancel: false,
confirmText: '确定',
success() {
plus.runtime.restart()
},
})
},
(e) => {
console.error('安装失败', e)
uni.showModal({
title: '安装失败',
content: '请开启安装权限后重试:' + e.message,
confirmText: '重试',
success: () => {
this.downloadAndInstallApk(url)
},
})
},
)
} else {
uni.showModal({
title: '下载失败',
content: '网络异常或下载链接失效',
confirmText: '重试',
success: () => {
this.downloadAndInstallApk(url)
},
})
}
})
// 下载进度(优化体验)
downloadTask.addEventListener('statechanged', (task) => {
if (task.state === 3 && task.totalSize > 0) {
const percent = ((task.downloadedSize / task.totalSize) * 100).toFixed(0)
uni.showLoading({
title: `正在下载更新 ${percent}%`,
mask: true,
})
}
})
// 开始下载
downloadTask.start()
},
// downloadAndInstallApk(url) {
// uni.showLoading({ title: '下载新版本...' })
// const downloadTask = plus.downloader.createDownload(
// url,
// { filename: '_doc/update/' },
// (downloadedFile, status) => {
// uni.hideLoading()
// if (status === 200) {
// plus.runtime.install(
// downloadedFile.filename,
// { force: true },
// () => {
// // 安装成功
// },
// (e) => {
// uni.showToast({ title: '安装失败: ' + e.message, icon: 'none' })
// },
// )
// } else {
// uni.showToast({ title: '下载失败', icon: 'none' })
// }
// },
// )
// downloadTask.start()
// },
},
} }
</script> </script>

View File

@@ -1,7 +1,7 @@
const debug = true // true 是连地服务端本地false 是连接线上 const debug = true // true 是连地服务端本地false 是连接线上
const development = { const development = {
domain: 'http://192.168.2.126:10215', domain: 'http://192.168.1.103:10215',
} }
const production = { const production = {

View File

@@ -228,8 +228,8 @@ export default {
// 在线 // 在线
.zx-tag { .zx-tag {
background-color: #67c23a20; background-color: #10b98120;
color: #67c23a; color: #10b981;
} }
.lx-tag { .lx-tag {
background-color: #ff3b3020; background-color: #ff3b3020;

View File

@@ -212,6 +212,12 @@ export default {
} }
}) })
this._hide() this._hide()
console.log('🚀 ~ rt:', rt)
if (rt.length == 0) return
if (this.singleChoice) {
if (rt[0].rank != 3) return
}
this.$emit('confirm', rt) this.$emit('confirm', rt)
}, },
//扁平化树结构 //扁平化树结构

View File

@@ -139,7 +139,7 @@
"/api" : { "/api" : {
"https" : true, "https" : true,
// "target" : "https://pqmcn.com:8092/api", // "target" : "https://pqmcn.com:8092/api",
"target" : "http://192.168.2.126:10215", "target" : "http://192.168.1.103:10215",
"changOrigin" : true, "changOrigin" : true,
"pathRewrite" : { "pathRewrite" : {
"/api" : "" "/api" : ""

View File

@@ -46,7 +46,13 @@
{ {
"path": "pages/index/report", "path": "pages/index/report",
"style": { "style": {
"navigationBarTitleText": "报表" "navigationBarTitleText": "报表",
"enablePullDownRefresh": true, // 开启下拉刷新
"pullToRefresh": {
"support":true,
"style": "circle",
"color":"#007aff"
}
} }
}, },
{ {
@@ -161,7 +167,12 @@
"path": "pages/device/APF/detail", "path": "pages/device/APF/detail",
"style": { "style": {
"navigationBarTitleText": "APF 设备名称 + 型号", "navigationBarTitleText": "APF 设备名称 + 型号",
"enablePullDownRefresh": true "enablePullDownRefresh": true,
"pullToRefresh": {
"support":true,
"style": "circle",
"color":"#007aff"
}
} }
}, },
{ {

View File

@@ -1,19 +1,25 @@
<template> <template>
<view class="basic"> <view>
<uni-load-more status="loading" v-if="IOData.length == 0"></uni-load-more>
<view class="basic" v-else>
<view class="grid-card"> <view class="grid-card">
<view class="grid-card-title">温度</view> <view class="grid-card-title">温度</view>
<view class="grid-card-content-4"> <view class="grid-card-content-4">
<template v-for="item in renderData"> <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> <template v-if="item[0].clDid"> (°C)</template>
</view> </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> <template v-if="item[1].clDid"> (°C)</template>
</view> </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> <template v-if="item[2].clDid"> (°C)</template>
</view> </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> <template v-if="item[3].clDid"> (°C)</template>
</view> </view>
<view class="item">{{ item[0].clDid ? Math.round(item[0].value) || '-' : '' }}</view> <view class="item">{{ item[0].clDid ? Math.round(item[0].value) || '-' : '' }}</view>
@@ -24,20 +30,27 @@
</view> </view>
</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'"
>
<view class="grid-card-title">状态</view> <view class="grid-card-title">状态</view>
<view class="grid-card-content-4"> <view class="grid-card-content-4">
<template v-for="(item, index) in moduleData"> <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> <template v-if="item[0].moduleName"></template>
</view> </view>
<view class="item item-title">{{ item[1].moduleName }} <view class="item item-title"
>{{ item[1].moduleName }}
<template v-if="item[1].moduleName"></template> <template v-if="item[1].moduleName"></template>
</view> </view>
<view class="item item-title">{{ item[2].moduleName }} <view class="item item-title"
>{{ item[2].moduleName }}
<template v-if="item[2].moduleName"></template> <template v-if="item[2].moduleName"></template>
</view> </view>
<view class="item item-title">{{ item[3].moduleName }} <view class="item item-title"
>{{ item[3].moduleName }}
<template v-if="item[3].moduleName"></template> <template v-if="item[3].moduleName"></template>
</view> </view>
<!-- <uni-tag :text="item[0].moduleState" :type=" item[0].moduleState=='离线'?'error' : 'success'" /> --> <!-- <uni-tag :text="item[0].moduleState" :type=" item[0].moduleState=='离线'?'error' : 'success'" /> -->
@@ -62,13 +75,11 @@
<!-- </view>--> <!-- </view>-->
<!-- </view>--> <!-- </view>-->
</view> </view>
</view>
</template> </template>
<script> <script>
import { import { getModuleState } from '@/common/api/harmonic.js'
getModuleState export default {
} from '@/common/api/harmonic.js'
export default {
props: { props: {
IOData: { IOData: {
type: Array, type: Array,
@@ -84,7 +95,7 @@
return { return {
list: [], list: [],
userInfo: {}, userInfo: {},
flag: false flag: false,
} }
}, },
computed: { computed: {
@@ -93,7 +104,8 @@
// 把IOData转换成每4个一组的二维数组 // 把IOData转换成每4个一组的二维数组
for (let i = 0; i < this.IOData.length; i += 4) { for (let i = 0; i < this.IOData.length; i += 4) {
this.IOData.slice(i, i + 4).forEach((item) => { this.IOData.slice(i, i + 4).forEach((item) => {
if (Number.isInteger(item.value) || item.value == '') {} else { if (Number.isInteger(item.value) || item.value == '') {
} else {
item.value = (item.value - 0).toFixed(2) item.value = (item.value - 0).toFixed(2)
} }
}) })
@@ -133,7 +145,7 @@
methods: { methods: {
info() { info() {
getModuleState({ getModuleState({
id: this.ndid id: this.ndid,
}).then((res) => { }).then((res) => {
this.list = res.data this.list = res.data
}) })
@@ -144,8 +156,9 @@
this.info() this.info()
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.basic {} .basic {
}
</style> </style>

View File

@@ -1,5 +1,7 @@
<template> <template>
<view class="basic"> <view>
<uni-load-more status="loading" v-if="basicData.length == 0"></uni-load-more>
<view class="basic" v-else>
<view class="grid-card"> <view class="grid-card">
<view class="grid-card-title">电网电流</view> <view class="grid-card-title">电网电流</view>
<view class="grid-card-content-3"> <view class="grid-card-content-3">
@@ -47,10 +49,14 @@
<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">{{ <view class="item">{{
item['Apf_RmsI_Load(A)'] > 0 ? item['Apf_RmsI_Load(A)'].toFixed(2) : item['Apf_RmsI_Load(A)'] item['Apf_RmsI_Load(A)'] > 0
? item['Apf_RmsI_Load(A)'].toFixed(2)
: item['Apf_RmsI_Load(A)']
}}</view> }}</view>
<view class="item">{{ <view class="item">{{
item['Apf_ThdA_Load(%)'] > 0 ? item['Apf_ThdA_Load(%)'].toFixed(2) : item['Apf_ThdA_Load(%)'] item['Apf_ThdA_Load(%)'] > 0
? item['Apf_ThdA_Load(%)'].toFixed(2)
: item['Apf_ThdA_Load(%)']
}}</view> }}</view>
</template> </template>
</view> </view>
@@ -64,19 +70,24 @@
<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">{{ <view class="item">{{
item['Apf_RmsI_TolOut(A)'] == 3.1415926 ? '-' : item['Apf_RmsI_TolOut(A)'] == 3.1415926
item['Apf_RmsI_TolOut(A)'] > 0 ? '-'
: item['Apf_RmsI_TolOut(A)'] > 0
? item['Apf_RmsI_TolOut(A)'].toFixed(2) ? item['Apf_RmsI_TolOut(A)'].toFixed(2)
: item['Apf_RmsI_TolOut(A)'] : item['Apf_RmsI_TolOut(A)']
}}</view> }}</view>
<view class="item">{{ <view class="item">{{
item['load_Rate'] == 3.1415926 ? '-' : item['load_Rate'] > 0 ? item['load_Rate'].toFixed(2) : item['load_Rate'] == 3.1415926
item['load_Rate'] ? '-'
: item['load_Rate'] > 0
? item['load_Rate'].toFixed(2)
: item['load_Rate']
}}</view> }}</view>
</template> </template>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
export default { export default {
@@ -168,5 +179,6 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.basic {} .basic {
}
</style> </style>

View File

@@ -1,5 +1,7 @@
<template> <template>
<view class="basic"> <view>
<uni-load-more status="loading" v-if="basicData.length == 0"></uni-load-more>
<view class="basic" v-else>
<view class="grid-card"> <view class="grid-card">
<view class="grid-card-title">电网侧</view> <view class="grid-card-title">电网侧</view>
<view class="grid-card-content-5"> <view class="grid-card-content-5">
@@ -10,11 +12,14 @@
<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_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>
<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>
<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>
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view> <view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
</template> </template>
@@ -30,17 +35,21 @@
<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_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>
<view class="item">{{ item['Apf_Q_Load(Var)'] == '-' ? '-' : (item['Apf_Q_Load(Var)'] / 1000).toFixed(2) <view class="item">{{
item['Apf_Q_Load(Var)'] == '-' ? '-' : (item['Apf_Q_Load(Var)'] / 1000).toFixed(2)
}}</view> }}</view>
<view class="item">{{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] / 1000).toFixed(2) }} <view class="item"
>{{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] / 1000).toFixed(2) }}
</view> </view>
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view> <view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
</template> </template>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
export default { export default {
@@ -121,5 +130,6 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.basic {} .basic {
}
</style> </style>

View File

@@ -1,5 +1,8 @@
<template> <template>
<view> <view>
<uni-load-more status="loading" v-if="basicData.length == 0"></uni-load-more>
<view v-else>
<div class="header-form"> <div class="header-form">
<uni-data-select <uni-data-select
v-model="parity" v-model="parity"
@@ -23,6 +26,7 @@
<view style="width: 100%; height: 100%"><l-echart ref="chartRef" @finished="init"></l-echart></view> <view style="width: 100%; height: 100%"><l-echart ref="chartRef" @finished="init"></l-echart></view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
@@ -133,7 +137,6 @@ export default {
show: true, show: true,
position: 'right', position: 'right',
fontSize: '8px', fontSize: '8px',
}, },
}, },
barGap: '10%', barGap: '10%',
@@ -142,7 +145,7 @@ export default {
{ {
name: '负载侧', name: '负载侧',
type: 'bar', type: 'bar',
barCateGoryGap:20, barCateGoryGap: 20,
label: { label: {
normal: { normal: {
color: '#666', color: '#666',
@@ -298,7 +301,11 @@ barCateGoryGap:20,
}, },
initEcharts() { initEcharts() {
setTimeout(() => { setTimeout(() => {
if(this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]] == undefined) return if (
this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]] ==
undefined
)
return
let obj = JSON.parse( let obj = JSON.parse(
JSON.stringify( JSON.stringify(
this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]], this.renderData['电网侧']['Apf_HarmI'][Object.keys(this.renderData['电网侧']['Apf_HarmI'])[0]],
@@ -340,17 +347,20 @@ barCateGoryGap:20,
}) })
.filter((item) => { .filter((item) => {
return item % 2 === this.parity - 1 return item % 2 === this.parity - 1
}).reverse() })
this.option.series[0].data = Object.values(this.renderData['电网侧'][name1][name2]).filter( .reverse()
(item, index) => { this.option.series[0].data = Object.values(this.renderData['电网侧'][name1][name2])
.filter((item, index) => {
return index % 2 === this.parity - 1 return index % 2 === this.parity - 1
}, })
).reverse().map(item=>item.toFixed(2)) .reverse()
this.option.series[1].data = Object.values(this.renderData['负载侧'][name1][name2]).filter( .map((item) => item.toFixed(2))
(item, index) => { this.option.series[1].data = Object.values(this.renderData['负载侧'][name1][name2])
.filter((item, index) => {
return index % 2 === this.parity - 1 return index % 2 === this.parity - 1
}, })
).reverse().map(item=>item.toFixed(2)) .reverse()
.map((item) => item.toFixed(2))
this.init() this.init()
}, 100) }, 100)
}, },
@@ -371,5 +381,5 @@ barCateGoryGap:20,
} }
.header-form { .header-form {
display: flex; display: flex;
} }
</style> </style>

View File

@@ -186,7 +186,7 @@ export default {
content: [ content: [
{ {
iconPath: '/static/report.png', iconPath: '/static/report.png',
text: '告警', text: '详情',
}, },
// { // {
// iconPath: '/static/record.png', // iconPath: '/static/record.png',
@@ -196,10 +196,10 @@ export default {
iconPath: '/static/about.png', iconPath: '/static/about.png',
text: '关于', text: '关于',
}, },
{ // {
iconPath: '/static/access.png', // iconPath: '/static/access.png',
text: '接入', // text: '接入',
}, // },
], ],
client: null, client: null,
timer: null, timer: null,
@@ -243,7 +243,7 @@ export default {
this.$util.toast('下载成功') this.$util.toast('下载成功')
} else if (e.text === '记录') { } else if (e.text === '记录') {
uni.navigateTo({ url: '/pages/device/APF/record' }) uni.navigateTo({ url: '/pages/device/APF/record' })
} else if (e.text === '告警') { } else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.devId }) uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.devId })
} else if (e.text === '关于') { } else if (e.text === '关于') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId }) uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
@@ -353,7 +353,7 @@ export default {
this.downloadImg() this.downloadImg()
uni.setNavigationBarTitle({ title: this.deviceInfo.devName || '设备详情' }) uni.setNavigationBarTitle({ title: this.deviceInfo.devName || '设备详情' })
this.topolodyData = 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
return element.linePostion === item.linePostion return element.linePostion === item.linePostion
@@ -577,6 +577,12 @@ export default {
text: '用户', text: '用户',
}) })
} }
if (this.userInfo.authorities === 'operation_manager') {
this.content.push({
iconPath: '/static/access.png',
text: '接入',
})
}
} }
this.$util.getDictData('Line_Position').then((res) => { this.$util.getDictData('Line_Position').then((res) => {
this.topolodyData = res.map((item) => { this.topolodyData = res.map((item) => {

View File

@@ -90,20 +90,20 @@ export default {
content: [ content: [
{ {
iconPath: '/static/report.png', iconPath: '/static/report.png',
text: '告警', text: '详情',
},
{
iconPath: '/static/record.png',
text: '记录',
}, },
// {
// iconPath: '/static/record.png',
// text: '记录',
// },
{ {
iconPath: '/static/about.png', iconPath: '/static/about.png',
text: '关于', text: '关于',
}, },
{ // {
iconPath: '/static/access.png', // iconPath: '/static/access.png',
text: '接入', // text: '接入',
}, // },
], ],
} }
}, },
@@ -128,7 +128,7 @@ export default {
this.$util.toast('下载成功') this.$util.toast('下载成功')
} else if (e.text === '记录') { } else if (e.text === '记录') {
uni.navigateTo({ url: '/pages/device/DVR/record' }) uni.navigateTo({ url: '/pages/device/DVR/record' })
} else if (e.text === '告警') { } else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/DVR/report' }) uni.navigateTo({ url: '/pages/device/DVR/report' })
} else if (e.text === '关于') { } else if (e.text === '关于') {
uni.navigateTo({ url: '/pages/device/DVR/about' }) uni.navigateTo({ url: '/pages/device/DVR/about' })
@@ -195,6 +195,12 @@ export default {
break break
default: default:
break break
}
if (this.userInfo.authorities === 'operation_manager') {
this.content.push({
iconPath: '/static/access.png',
text: '接入',
})
} }
setTimeout(() => { setTimeout(() => {
// 获取nav高度 // 获取nav高度

View File

@@ -69,7 +69,7 @@
@finished="initChart('echartV3', 'echartsDataV3')" @finished="initChart('echartV3', 'echartsDataV3')"
></l-echart> ></l-echart>
</view> </view>
<view class="text"> 电压有效值 </view> <view class="text"> 电压有效值(kV) </view>
</view> </view>
<view class="middle" style="width: 100%"> <view class="middle" style="width: 100%">
<l-echart <l-echart
@@ -103,7 +103,7 @@
@finished="initChart('echartA3', 'echartsDataA3')" @finished="initChart('echartA3', 'echartsDataA3')"
></l-echart> ></l-echart>
</view> </view>
<view class="text"> 有效值 </view> <view class="text"> 有效值(A) </view>
</view> </view>
</view> </view>
</view> </view>
@@ -125,6 +125,7 @@
</view> </view>
</view> </view>
</view> </view>
<hover-menu :btnList="content" @trigger="trigger"></hover-menu>
</view> </view>
</Cn-page> </Cn-page>
</template> </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_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
import mqtt from 'mqtt/dist/mqtt.js' import mqtt from 'mqtt/dist/mqtt.js'
import { getBaseRealData } from '@/common/api/harmonic.js' import { getBaseRealData } from '@/common/api/harmonic.js'
import hoverMenu from '@/hover-menu/components/hover-menu/hover-menu.vue'
export default { export default {
components: {}, components: { hoverMenu },
props: {}, props: {},
data() { data() {
return { return {
loading: true, loading: true,
devId: '',
// 使用上面定义的图表配置项 // 使用上面定义的图表配置项
option: {}, option: {},
echartsData0: {}, echartsData0: {},
@@ -183,30 +186,72 @@ export default {
equipmentName: '', equipmentName: '',
runStatus: 1, runStatus: 1,
connection: false, connection: false,
content: [
{
iconPath: '/static/report.png',
text: '详情',
},
{
iconPath: '/static/about.png',
text: '关于',
},
],
isPrimaryUser: 0,
} }
}, },
onLoad(options) { onLoad(options) {
console.log('🚀 ~ options:', options)
this.lineKey = 0 this.lineKey = 0
this.devId = options.id
this.lineList = JSON.parse(options.lineList) this.lineList = JSON.parse(options.lineList)
this.lineId = this.lineList[0].lineId this.lineId = this.lineList[0].lineId
this.engineeringName = options.engineeringName this.engineeringName = options.engineeringName
this.equipmentName = options.equipmentName this.equipmentName = options.equipmentName
this.runStatus = options.runStatus this.runStatus = options.runStatus
this.isPrimaryUser = options.isPrimaryUser
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.echartsData0 = this.initEcharts0() this.echartsData0 = this.initEcharts0()
this.echartsData1 = this.initEcharts1() this.echartsData1 = this.initEcharts1()
this.echartsDataV1 = this.initEcharts('#DAA520', 0, 'A相(kV)') this.echartsDataV1 = this.initEcharts('#DAA520', 0, 'A相')
this.echartsDataV2 = this.initEcharts('#2E8B57', 0, 'B相(kV)') this.echartsDataV2 = this.initEcharts('#2E8B57', 0, 'B相')
this.echartsDataV3 = this.initEcharts('#A52a2a', 0, 'C相(kV)') this.echartsDataV3 = this.initEcharts('#A52a2a', 0, 'C相')
this.echartsDataA1 = this.initEcharts('#DAA520', 1, 'A相(A)') this.echartsDataA1 = this.initEcharts('#DAA520', 1, 'A相')
this.echartsDataA2 = this.initEcharts('#2E8B57', 1, 'B相(A)') this.echartsDataA2 = this.initEcharts('#2E8B57', 1, 'B相')
this.echartsDataA3 = this.initEcharts('#A52a2a', 1, 'C相(A)') this.echartsDataA3 = this.initEcharts('#A52a2a', 1, 'C相')
this.loading = false this.loading = false
this.$nextTick(() => { this.$nextTick(() => {
this.setMqtt(0) this.setMqtt(0)
this.initMqtt() 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() { onUnload() {
const charts = [ const charts = [
@@ -623,7 +668,9 @@ export default {
.then((res) => { .then((res) => {
if (res.code == 'A0000') { if (res.code == 'A0000') {
this.connection = true this.connection = true
setTimeout(() => {
this.$util.toast(e == 0 ? '连接成功!' : '刷新成功!') this.$util.toast(e == 0 ? '连接成功!' : '刷新成功!')
}, 3000)
if (this.timer) { if (this.timer) {
clearInterval(this.timer) clearInterval(this.timer)
this.timer = null this.timer = null
@@ -878,6 +925,46 @@ export default {
await this.setMqtt(0) await this.setMqtt(0)
await this.initMqtt() 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: {}, computed: {},
@@ -990,7 +1077,7 @@ export default {
} }
.text { .text {
text-align: center; text-align: center;
font-size: 30rpx; font-size: 28rpx;
} }
.text_center { .text_center {
position: absolute; position: absolute;

View File

@@ -42,7 +42,7 @@
<script> <script>
import list from '../../common/js/list' import list from '../../common/js/list'
import {queryAllEnginner, csMarketDataAdd, queryEngineering} from '@/common/api/engineering' import { queryAllEnginner, csMarketDataAdd, queryEngineering } from '@/common/api/engineering'
export default { export default {
data() { data() {
@@ -70,12 +70,6 @@ export default {
} else { } else {
this.selectList.push(e.engineerId) this.selectList.push(e.engineerId)
} }
csMarketDataAdd({
engineerIds: this.selectList,
}).then((res) => {
console.log(res)
})
}, },
init() { init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
@@ -108,15 +102,22 @@ export default {
}) })
}, },
}, },
onUnload() {
csMarketDataAdd({
engineerIds: this.selectList,
}).then((res) => {
console.log(res)
})
},
onBackPress() { onBackPress() {
console.log('onBackPress') console.log('onBackPress')
let engineering = uni.getStorageSync('engineering') let engineering = uni.getStorageSync('engineering')
queryEngineering().then(res => { queryEngineering().then((res) => {
if (res.data.length === 0) { if (res.data.length === 0) {
uni.removeStorage({ uni.removeStorage({
key: this.$cacheKey.engineering, key: this.$cacheKey.engineering,
}) })
} else if (engineering && !res.data.some(item => item.id = engineering.id)) { } else if (engineering && !res.data.some((item) => (item.id = engineering.id))) {
uni.removeStorage({ uni.removeStorage({
key: this.$cacheKey.engineering, key: this.$cacheKey.engineering,
}) })

View File

@@ -107,9 +107,7 @@ export default {
array: ['发生时间', '暂降深度', '持续时间'], array: ['发生时间', '暂降深度', '持续时间'],
} }
}, },
mounted() { mounted() {},
this.setHeight()
},
methods: { methods: {
setHeight() { setHeight() {
@@ -118,10 +116,10 @@ export default {
.boundingClientRect((rect) => { .boundingClientRect((rect) => {
// //
// #ifdef H5 // #ifdef H5
this.height = rect?.height + 100 || 0 this.height = rect?.height + 170 || 0
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.height = rect?.height + 90 || 0 this.height = rect?.height + 100 || 0
// #endif // #endif
}) })
.exec() .exec()
@@ -129,7 +127,9 @@ export default {
async select(val) { async select(val) {
this.selectValue = val this.selectValue = val
await this.init() await this.init()
setTimeout(() => {
this.setHeight() this.setHeight()
}, 200)
}, },
init() { init() {
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage') this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')

View File

@@ -35,13 +35,12 @@
<view class="header-item-label">离线设备</view> <view class="header-item-label">离线设备</view>
</view> </view>
</view> </view>
<view style="padding: 20rpx 20rpx 0"> <!-- <view style="padding: 20rpx 20rpx 0">
<Cn-grid title=""> <Cn-grid title="">
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item> <Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
<Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item> <Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>
</Cn-grid> </Cn-grid>
</view> </view> -->
</view> </view>
</template> </template>

View File

@@ -35,11 +35,11 @@
<view class="header-item-label">离线设备</view> <view class="header-item-label">离线设备</view>
</view> </view>
<view class="header-item" @click="jumpMessage('0')"> <view class="header-item" @click="jumpMessage('0')">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view> <view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
<view class="header-item-label">暂态事件数</view> <view class="header-item-label">暂态事件数</view>
</view> </view>
<view class="header-item" @click="jumpMessage('1')"> <view class="header-item" @click="jumpMessage('1')">
<view class="header-item-value">{{ devCount.harmonicCount || 0 }}</view> <view class="header-item-value">{{ devCount.currentHarmonicCount || 0 }}</view>
<view class="header-item-label">稳态事件数</view> <view class="header-item-label">稳态事件数</view>
</view> </view>
</view> </view>

View File

@@ -1,5 +1,6 @@
<template> <template>
<view class="dateReport"> <view class="dateReport">
<!-- {{ height }} -->
<!-- <view class="pd20"> <!-- <view class="pd20">
<uni-segmented-control <uni-segmented-control
:current="curSub" :current="curSub"
@@ -97,7 +98,7 @@ export default {
}, },
created() {}, created() {},
mounted() { mounted() {
this.setHeight() // this.setHeight()
}, },
methods: { methods: {
setHeight() { setHeight() {
@@ -106,7 +107,7 @@ export default {
.boundingClientRect((rect) => { .boundingClientRect((rect) => {
// //
// #ifdef H5 // #ifdef H5
this.height = rect?.height + 20 || 0 this.height = rect?.height + 80 || 0
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.height = rect?.height + 30 || 0 this.height = rect?.height + 30 || 0
@@ -136,10 +137,11 @@ export default {
select(value) { select(value) {
this.selectValue = value this.selectValue = value
this.init()
setTimeout(() => { setTimeout(() => {
this.setHeight() this.setHeight()
}, 100) }, 200)
this.init()
}, },
// 下载 // 下载
download(item) { download(item) {

View File

@@ -13,7 +13,7 @@
<!-- 申请报告 --> <!-- 申请报告 -->
<view v-show="curSub == 0"> <view v-show="curSub == 0">
<!-- apply --> <!-- apply -->
<Apply :navHeight="navHeight" /> <Apply ref="applyRef" :navHeight="navHeight" />
</view> </view>
<!-- 申请记录 --> <!-- 申请记录 -->
@@ -158,10 +158,10 @@ export default {
.boundingClientRect((rect) => { .boundingClientRect((rect) => {
// //
// #ifdef H5 // #ifdef H5
this.height = rect?.height + 115 || 0 this.height = rect?.height + 180 || 0
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.height = rect?.height + 10 || 0 this.height = rect?.height + 110 || 0
// #endif // #endif
}) })
.exec() .exec()
@@ -174,9 +174,11 @@ export default {
this.store.reload() this.store.reload()
}, },
async select(val) { async select(val) {
setTimeout(() => {
this.setHeight()
}, 200)
this.selectValue = val this.selectValue = val
await this.init() await this.init()
this.setHeight()
}, },
sectionChange(index) { sectionChange(index) {
@@ -270,6 +272,19 @@ export default {
}) })
}) })
}, },
// 刷新
reload() {
console.log(123, this.curSub)
switch (this.curSub) {
case 0:
this.$refs.applyRef.store.reload()
break
case 1:
this.store && this.store.reload()
break
}
},
}, },
watch: {}, watch: {},
} }
@@ -340,4 +355,9 @@ export default {
color: #fff; color: #fff;
} }
} }
.segmented-control {
flex: 1;
margin-right: 24rpx;
height: 60rpx;
}
</style> </style>

View File

@@ -41,18 +41,18 @@
<view class="mine-nav-label">扫一扫</view> <view class="mine-nav-label">扫一扫</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view class="mine-nav" @click="jump('engineering')"> <view class="mine-nav" @click="jump('engineering')" v-if="userInfo.authorities !== 'tourist'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/gongcheng.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/gongcheng.png" />
<view class="mine-nav-label">工程管理</view> <view class="mine-nav-label">工程管理</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view class="mine-nav" @click="jump('project')"> <view class="mine-nav" @click="jump('project')" v-if="userInfo.authorities !== 'tourist'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
<view class="mine-nav-label">项目管理</view> <view class="mine-nav-label">项目管理</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view class="mine-nav" @click="jump('feedback')"> <view class="mine-nav" @click="jump('feedback')" v-if="userInfo.authorities !== 'tourist'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/feedback.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/feedback.png" />
<view class="mine-nav-label">反馈列表</view> <view class="mine-nav-label">反馈列表</view>
<uni-badge :text="messageCount.feedBackCount"></uni-badge> <uni-badge :text="messageCount.feedBackCount"></uni-badge>
@@ -67,24 +67,24 @@
<view class="mine-nav-label">网关列表</view> <view class="mine-nav-label">网关列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> --> </view> -->
<view class="mine-nav" @click="jump('setupMessage')"> <view class="mine-nav" @click="jump('setupMessage')" v-if="userInfo.authorities !== 'tourist'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/message4.png" />
<view class="mine-nav-label">推送通知</view> <view class="mine-nav-label">推送通知</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view <view
class="mine-nav" class="mine-nav"
@click="jump('engineering/setting')" @click="jump('engineering/setting')"
v-if="userInfo.authorities === 'engineering_user'" v-if="userInfo.authorities === 'engineering_user' || userInfo.authorities !== 'tourist'"
> >
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
<view class="mine-nav-label">关注工程配置</view> <view class="mine-nav-label">关注工程配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view class="mine-nav" @click="jump('transientSetting')" > <view class="mine-nav" @click="jump('transientSetting')" v-if="userInfo.authorities !== 'tourist'">
<!-- 调试内容配置 serverSetting--> <!-- 调试内容配置 serverSetting-->
<image mode="aspectFill" class="mine-nav-icon" src="/static/server2.png" /> <image mode="aspectFill" class="mine-nav-icon" src="/static/server2.png" />
<view class="mine-nav-label">暂态事件</view> <view class="mine-nav-label">暂态统计配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons> <uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> </view>
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none"> <view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
@@ -118,21 +118,20 @@
<uni-popup ref="message" type="message"> <uni-popup ref="message" type="message">
<uni-popup-message type="info" :duration="0" style="width: 90%; margin: 5%"> <uni-popup-message type="info" :duration="0" style="width: 90%; margin: 5%">
<view style="color: #909399; font-style: 16px">相机权限使用说明:</view> <view style="color: #909399; font-style: 16px">相机权限使用说明:</view>
<view style="color: #6c6c6c; margin-top: 3rpx; "> 用于相机扫描二维码!</view> <view style="color: #6c6c6c; margin-top: 3rpx"> 用于相机扫描二维码!</view>
</uni-popup-message> </uni-popup-message>
</uni-popup> </uni-popup>
<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CAMERA"></yk-authpup> <yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CAMERA"></yk-authpup>
</view> </view>
</template> </template>
<script> <script>
import { roleUpdate, autoLogin } from '@/common/api/user' import { roleUpdate, autoLogin } from '@/common/api/user'
import { transferDevice, shareDevice } from '@/common/api/device' import { transferDevice, shareDevice } from '@/common/api/device'
import ykAuthpup from "@/components/yk-authpup/yk-authpup"; import ykAuthpup from '@/components/yk-authpup/yk-authpup'
export default { export default {
components: { components: {
ykAuthpup ykAuthpup,
}, },
data() { data() {
return { return {
@@ -189,9 +188,9 @@ export default {
}) })
}) })
}, },
changeAuth(){ changeAuth() {
//这里是权限通过后执行自己的代码逻辑 //这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,可执行自己的代码逻辑了'); console.log('权限已授权,可执行自己的代码逻辑了')
// this.handleScon() // this.handleScon()
this.handleScon() this.handleScon()
}, },
@@ -206,13 +205,11 @@ export default {
// this.$refs.alertDialog.open('bottom') // this.$refs.alertDialog.open('bottom')
this.$refs['authpup'].open() this.$refs['authpup'].open()
// this.$refs.message.open() // this.$refs.message.open()
} else { } else {
console.log(2) console.log(2)
this.handleScon() this.handleScon()
} }
break break
case 'login': case 'login':
uni.navigateTo({ uni.navigateTo({
@@ -259,10 +256,10 @@ export default {
break break
} }
}, },
handleScon(){ handleScon() {
this.$refs.message.close() this.$refs.message.close()
uni.scanCode({ uni.scanCode({
onlyFromCamera:true, onlyFromCamera: true,
success: (res) => { success: (res) => {
console.log('条码类型:' + res.scanType) console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res.result) console.log('条码内容:' + res.result)
@@ -281,7 +278,9 @@ export default {
}, },
}) })
}, },
dialogClose(){this.$refs.message.close()}, dialogClose() {
this.$refs.message.close()
},
transferDevice(id) { transferDevice(id) {
transferDevice(id).then((res) => { transferDevice(id).then((res) => {
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id }) uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
@@ -380,4 +379,3 @@ export default {
background-color: #fff; background-color: #fff;
} }
</style> </style>

View File

@@ -1,5 +1,6 @@
<template> <template>
<view :loading="loading" class="report" style="padding-top: 10px"> <view :loading="loading" class="report" style="padding-top: 10px">
<view class="navReport"> <view class="navReport">
<view class="tabsBox"> <view class="tabsBox">
<uni-segmented-control <uni-segmented-control
@@ -14,6 +15,7 @@
<!-- 稳态报表 --> <!-- 稳态报表 -->
<SteadyState <SteadyState
v-if="curTabs == 0" v-if="curTabs == 0"
ref="SteadyStateRef"
:indexList="indexList" :indexList="indexList"
:total="total" :total="total"
:status="status" :status="status"
@@ -23,6 +25,7 @@
<!-- 暂态报表 --> <!-- 暂态报表 -->
<Transient <Transient
v-if="curTabs == 1" v-if="curTabs == 1"
ref="TransientRef"
:indexList="indexList" :indexList="indexList"
:total="total" :total="total"
:status="status" :status="status"
@@ -51,58 +54,25 @@ export default {
navHeight: 0, navHeight: 0,
indexList: [ indexList: [],
{
name: '测试监测点',
item: '2022-01-01至2022-01-01',
type: '1',
status: '1',
},
{
name: '测试监测点',
item: '2022-01-01至2022-01-01',
type: '2',
status: '1',
},
{
name: '测试监测点',
item: '2022-01-01至2022-01-01',
type: '1',
status: '1',
},
{
name: '测试监测点',
item: '2022-01-01至2022-01-01',
type: '1',
status: '0',
},
{
name: '测试监测点',
item: '2022-01-01至2022-01-01',
type: '1',
status: '0',
},
{
name: '测试监测点',
item: '2022-01-01至2022-01-01',
type: '1',
status: '0',
},
],
} }
}, },
created() {}, created() {},
onPullDownRefresh() {
this.refresh()
},
mounted() { mounted() {
uni.createSelectorQuery() uni.createSelectorQuery()
.select('.navReport') .select('.navReport')
.boundingClientRect((rect) => { .boundingClientRect((rect) => {
// //
// #ifdef H5 this.navHeight = rect.height
this.navHeight = rect.height + 65 // // #ifdef H5
// #endif
// #ifdef APP-PLUS // // #endif
this.navHeight = rect.height + 25 // // #ifdef APP-PLUS
// #endif // this.navHeight = rect.height
// // #endif
}) })
.exec() .exec()
}, },
@@ -127,6 +97,16 @@ export default {
this.status = 'more' this.status = 'more'
}, 1000) }, 1000)
}, },
refresh() {
switch (this.curTabs) {
case 0:
this.$refs.SteadyStateRef.store.reload()
break
case 1:
this.$refs.TransientRef.reload()
break
}
},
}, },
computed: {}, computed: {},

View File

@@ -11,9 +11,9 @@
<view class="mb5"> 项目名称{{ detail.projectName }} </view> <view class="mb5"> 项目名称{{ detail.projectName }} </view>
<view class="mb5"> 工程名称{{ detail.engineeringName }} </view> <view class="mb5"> 工程名称{{ detail.engineeringName }} </view>
<view class="mb5"> 暂态类型{{ detail.showName }}</view> <view class="mb5"> 暂态类型{{ detail.showName }}</view>
<view class="mb5"> 持续时间{{ detail.evtParamTm }}</view> <view class="mb5"> 持续时间{{ detail.evtParamTm || '-' }}%</view>
<view class="mb5"> 幅值{{ detail.evtParamVVaDepth }}</view> <view class="mb5"> 幅值{{ detail.evtParamVVaDepth || '-' }}s</view>
<view class="mb5"> 相别{{ detail.evtParamPhase }}</view> <view class="mb5"> 相别{{ detail.evtParamPhase || '-' }}</view>
<!-- <view class="mb5" v-for="(item, textIndex) in detail.dataSet" :key="textIndex"> <!-- <view class="mb5" v-for="(item, textIndex) in detail.dataSet" :key="textIndex">
{{ item.showName + '' + (item.value == 3.1415926 ? '-' : item.value) + (item.unit || '') }} {{ item.showName + '' + (item.value == 3.1415926 ? '-' : item.value) + (item.unit || '') }}
</view> --> </view> -->

View File

@@ -3,14 +3,20 @@
<!-- 稳态 --> <!-- 稳态 -->
<view class="transientBox"> <view class="transientBox">
<view class="statistics pd20"> <view class="statistics pd20">
<view class="box" :class="{ boxClick: item.label == '稳态数量' }" v-for="item in list"> <view
class="box"
:class="{ boxClick: item.label == filterValue }"
v-for="item in list"
@click="filterValue = item.label"
>
<text class="num">{{ item.value }}</text> <text class="num">{{ item.value }}</text>
<text class="label">{{ item.label }}</text> <text class="label">{{ item.label }}</text>
</view> </view>
</view> </view>
</view> </view>
<!-- 卡片 --> <!-- 稳态数量 -->
<scroll-view <scroll-view
v-if="filterValue == '稳态数量'"
scroll-y="true" scroll-y="true"
@refresherrefresh="refresherrefresh" @refresherrefresh="refresherrefresh"
:refresher-triggered="triggered" :refresher-triggered="triggered"
@@ -66,6 +72,17 @@
></uni-load-more> ></uni-load-more>
<Cn-empty v-else style="top: 20%"></Cn-empty> <Cn-empty v-else style="top: 20%"></Cn-empty>
</scroll-view> </scroll-view>
<!-- 越限天数 -->
<view v-if="filterValue == '越限天数'">
<uni-calendar
:insert="true"
:lunar="false"
:date="startData"
:selected="selected"
:start-date="startData"
:end-date="endData"
/>
</view>
</view> </view>
</template> </template>
<script> <script>
@@ -86,11 +103,20 @@ export default {
data() { data() {
return { return {
height: 0, height: 0,
filterValue: '稳态数量',
list: [ list: [
{ value: 0, label: '稳态数量' }, { value: 0, label: '稳态数量' },
{ value: 0, label: '越限天数' }, { value: 0, label: '越限天数' },
{ value: 0, label: '越限测点数' }, { value: 0, label: '越限测点数' },
], ],
startData: '',
endData: '',
selected: [
{ date: '2026-04-10', info: '' },
{ date: '2026-04-11', info: '' },
{ date: '2026-04-12', info: '' },
// { date: '2026-04-13', info: '' },
],
triggered: true, triggered: true,
status: 'noMore', //more加载前 loading加载中 noMore加载后 status: 'noMore', //more加载前 loading加载中 noMore加载后
} }
@@ -125,11 +151,14 @@ export default {
this.store.params.devId = this.selectValue.deviceId this.store.params.devId = this.selectValue.deviceId
this.store.params.lineId = this.selectValue.lineId this.store.params.lineId = this.selectValue.lineId
this.store.params.time = this.selectValue.date this.store.params.time = this.selectValue.date
this.store.loadedCallback = () => { this.store.loadedCallback = () => {
this.list[0].value = this.store.copyData.harmonicNums this.list[0].value = this.store.copyData.harmonicNums
this.list[1].value = this.store.copyData.overDays this.list[1].value = this.store.copyData.overDays
this.list[2].value = this.store.copyData.overLineNums this.list[2].value = this.store.copyData.overLineNums
this.loading = false this.loading = false
this.startData = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
this.endData = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
} }
this.store.reload() this.store.reload()
}, },
@@ -202,4 +231,44 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
word-break: break-all; word-break: break-all;
} }
/deep/ .uni-calendar-item--checked {
background-color: #ffffff00;
color: #000000e6;
opacity: 1;
}
/deep/ .uni-calendar-item--isDay {
background-color: #ffffff00;
color: #000000e6;
opacity: 1;
.uni-calendar-item__weeks-lunar-text {
background-color: #ffffff00;
color: #000000e6;
opacity: 1;
}
}
/deep/ .uni-calendar-item__weeks-box-text {
z-index: 1;
}
/deep/ .uni-calendar-item__weeks-box-circle {
position: absolute;
top: 9px;
right: 9px;
width: 39px;
height: 39px;
border-radius: 50%;
z-index: 0;
background-color: #e43d33;
}
/* 核心:选中圆圈下的 子元素(日期数字) */
/deep/ .uni-calendar-item__weeks-box-circle + .uni-calendar-item__weeks-box-text {
color: #fff !important; /* 改成你想要的颜色 */
}
/deep/ .uni-calendar__backtoday,
/deep/ .uni-calendar__header-btn-box {
display: none;
}
/deep/ .uni-calendar__header {
pointer-events: none !important;
}
</style> </style>

View File

@@ -95,9 +95,9 @@
<!-- 详情区域 --> <!-- 详情区域 -->
<view class="event-detail"> <view class="event-detail">
<text> <text>
发生时间:{{ item.startTime }},幅值:{{ item.evtParamVVaDepth }},持续时间:{{ 发生时间:{{ item.startTime }},幅值:{{ item.evtParamVVaDepth || '-' }}%,持续时间:{{
item.evtParamTm item.evtParamTm || '-'
}},相别:{{ item.evtParamPhase }} }}s,相别:{{ item.evtParamPhase || '-' }}
</text> </text>
</view> </view>
</uni-card> </uni-card>

View File

@@ -48,7 +48,7 @@
<!-- @click="jump('about')" --> <!-- @click="jump('about')" -->
<view class="mine-nav" style="border-bottom: none"> <view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">版本信息</view> <view class="mine-nav-label">版本信息</view>
<view style="color: #828282; font-size: 14rpx">当前版本V<1.6.7</view> <view style="color: #828282; font-size: 14rpx">当前版本V{{ version }}</view>
<!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> --> <!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
</view> </view>
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none"> <view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">
@@ -64,10 +64,19 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
version: '1.0.0',
} }
}, },
methods: { methods: {
async init() {}, async init() {
const isDev = process.env.NODE_ENV === 'development'
if (isDev) {
return console.log('开发环境,不执行更新检查')
}
plus.runtime.getProperty(plus.runtime.appid, (info) => {
this.version = info.version // 当前本地版本号
})
},
jump(type) { jump(type) {
switch (type) { switch (type) {
case 'changePwd': case 'changePwd':