调整app页面图标样式

This commit is contained in:
guanj
2026-04-17 08:50:07 +08:00
parent bac0f83f64
commit 747d3139cf
40 changed files with 1345 additions and 553 deletions

View File

@@ -1,62 +1,76 @@
<template>
<Cn-page :loading="loading">
<view slot="body">
<view class="about">
<view class="about-title">{{ deviceInfo.name }}</view>
<view class="about-text">设备类型{{ deviceInfo.devTypeName }}</view>
<view class="about-text">设备型号{{ deviceInfo.devModelName }}</view>
<view class="about-text"
>设备接入方式{{ deviceInfo.devAccessMethod === 'cloud' ? 'CLD' : 'MQTT' }}</view
>
<!-- <view class="about-text">设备注册时间永久使用</view> -->
<view class="about-text">程序版本{{ deviceInfo.programVersionName }}</view>
<view class="about-text">网络设备ID{{ deviceInfo.ndid }}</view>
</view>
</view>
</Cn-page>
</template>
<script>
import { queryDeivceById } from '@/common/api/device'
import { queryByCode, queryCsDictTree, queryByid, queryEdDataPage } from '@/common/api/dictionary'
export default {
data() {
return {
loading: true,
deviceInfo: {},
}
},
methods: {},
onLoad(options) {
queryDeivceById(options.id).then((res) => {
console.log(res)
this.deviceInfo = res.data[0]
queryByCode('Device_Type').then((res) => {
Promise.all([queryCsDictTree(res.data.id), queryByid(res.data.id), queryEdDataPage()]).then((resp) => {
console.log(resp)
this.deviceInfo.devTypeName = resp[0].data.find((item) => item.id === this.deviceInfo.devType)?.name
this.deviceInfo.devModelName = resp[1].data.find(
(item) => item.id === this.deviceInfo.devModel,
)?.name
this.loading = false
})
})
})
},
}
</script>
<style lang="scss">
.about {
padding: 34rpx;
.about-title {
font-size: 34rpx;
font-weight: bold;
color: #333333;
margin-bottom: 34rpx;
}
.about-text {
font-size: 28rpx;
color: #666666;
margin-bottom: 34rpx;
}
}
</style>
<template>
<Cn-page :loading="loading">
<view slot="body">
<view class="about">
<view class="about-title">{{ deviceInfo.name }}</view>
<view class="about-text">设备类型{{ deviceInfo.devTypeName }}</view>
<view class="about-text">设备型号{{ deviceInfo.devModelName }}</view>
<view class="about-text">设备接入方式{{ deviceInfo.devAccessMethod }}</view>
<!-- <view class="about-text">设备注册时间永久使用</view> -->
<view class="about-text">程序版本{{ deviceInfo.programVersionName }}</view>
<view class="about-text">网络设备ID{{ deviceInfo.ndid }}</view>
</view>
</view>
</Cn-page>
</template>
<script>
import { queryDeivceById } from '@/common/api/device'
import { queryByCode, queryCsDictTree, queryByid, queryEdDataPage } from '@/common/api/dictionary'
export default {
data() {
return {
loading: true,
deviceInfo: {},
}
},
methods: {},
onLoad(options) {
queryDeivceById(options.id).then((res) => {
this.deviceInfo = res.data[0]
if (this.deviceInfo.devAccessMethod == 'MQTT') {
queryByCode('Device_Type').then((res) => {
Promise.all([queryCsDictTree(res.data.id), queryByid(res.data.id), queryEdDataPage()]).then(
(resp) => {
this.deviceInfo.devTypeName = resp[0].data.find(
(item) => item.id === this.deviceInfo.devType,
)?.name
this.deviceInfo.devModelName = resp[1].data.find(
(item) => item.id === this.deviceInfo.devModel,
)?.name
this.loading = false
},
)
})
} else {
queryByCode('DEV_CLD').then((res) => {
this.deviceInfo.devTypeName = res.data.name
Promise.all([queryCsDictTree(res.data.id), queryByid(res.data.id), queryEdDataPage()]).then(
(resp) => {
this.deviceInfo.devModelName = resp[1].data.find(
(item) => item.id === this.deviceInfo.devModel,
)?.name
this.loading = false
},
)
})
}
})
},
}
</script>
<style lang="scss">
.about {
padding: 34rpx;
.about-title {
font-size: 34rpx;
font-weight: bold;
color: #333333;
margin-bottom: 34rpx;
}
.about-text {
font-size: 28rpx;
color: #666666;
margin-bottom: 34rpx;
}
}
</style>

View File

@@ -159,6 +159,7 @@ export default {
domLoading: true,
loading: true,
deviceInfo: {},
device: {},
navMenuActive: 0,
navHeight: 0,
img: '',
@@ -185,8 +186,8 @@ export default {
],
content: [
{
iconPath: '/static/report.png',
text: '详情',
iconPath: '/static/tongji.png',
text: '事件',
},
// {
// iconPath: '/static/record.png',
@@ -243,8 +244,22 @@ export default {
this.$util.toast('下载成功')
} 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/report?id=' + this.devId })
uni.setStorageSync('messageParams', {
engineeringName: this.device.engineeringName,
engineeringId: this.device.engineeringId, //工程ID
projectName: this.device.projectName,
projectId: this.device.projectId, //項目ID
deviceName: this.device.equipmentName,
deviceId: this.device.equipmentId, //设备ID
lineName: '',
lineId: '', //测点ID
type: 0,
})
uni.switchTab({
url: '/pages/index/message1',
})
} else if (e.text === '关于') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
} else if (e.text === '移交') {
@@ -526,6 +541,8 @@ export default {
onLoad(options) {
this.pageOptions = options
this.device = JSON.parse(options.device)
console.log('🚀 ~ options:', options)
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.devId = options.id
this.isPrimaryUser = options.isPrimaryUser

View File

@@ -12,17 +12,16 @@
style="margin-top: 30rpx"
>
<view class="content-item-header-icon">
<image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image>
<!-- <image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image> -->
<Cn-icon-transient :name="`运行告警`" />
</view>
</uni-badge>
<view class="content-item-header-right">
<view class="content-item-header-right-title">{{ item.equipmentName }}</view>
<!-- <view class="content-item-header-right-des">{{ item.engineeringName }} {{ item.projectName }}</view> -->
<view class="content-item-header-right-des">工程名称{{ item.engineeringName }}</view>
<view class="content-item-header-right-des">项目名称{{ item.projectName }}</view>
<!-- <view class="content-item-header-right-des">监测点名称{{ item.lineName }}</view> -->
<!-- <view class="content-item-header-right-des">暂态类型{{ item.showName }}</view> -->
<!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> -->
</view>
<view class="ml10" v-if="type === '0' || item.status != '1'">
<uni-icons type="search" size="25" color="#376cf3"></uni-icons
@@ -30,21 +29,7 @@
</view>
<view class="content-item-footer">{{ item.subTitle }}</view>
</view>
<!-- <uni-card
:title="item.equipmentName"
:extra="item.status == '1' ? '' : '未读'"
:sub-title="item.subTitle"
thumbnail="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
@click="jump(item)"
v-for="(item, index) in store.data"
:key="index"
>
<view class="term-list-bottom">
<view class="term-list-bottom-item" v-for="(item2, textIndex) in item.dataSet" :key="textIndex">
{{ item2.showName + ':' + (item2.value == 3.1415926 ? '-' : item2.value) + (item2.unit || '') }}
</view>
</view>
</uni-card> -->
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
<uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
@@ -143,17 +128,17 @@ export default {
this.store.reload()
},
jump(item) {
if (this.type === '0') {
// if (this.type === '0') {
let str = JSON.stringify(item).replace(/%/g, '百分比')
uni.navigateTo({ url: '/pages/message/messageDetail?detail=' + encodeURIComponent(str) })
} else {
if (item.status != '1') {
item.status = '1'
updateStatus({
eventIds: [item.id],
})
}
}
// } else {
// if (item.status != '1') {
// item.status = '1'
// updateStatus({
// eventIds: [item.id],
// })
// }
// }
},
},
}
@@ -178,10 +163,11 @@ export default {
display: flex;
align-items: center;
justify-content: center;
width: 100rpx;
height: 100rpx;
width: 110rpx;
height: 110rpx;
border-radius: 8rpx;
background: $uni-theme-color;
// background: $uni-theme-color;
background-color: #376cf320;
}
.content-item-header-right {

View File

@@ -89,8 +89,8 @@ export default {
],
content: [
{
iconPath: '/static/report.png',
text: '详情',
iconPath: '/static/tongji.png',
text: '事件',
},
// {
// iconPath: '/static/record.png',
@@ -128,7 +128,7 @@ export default {
this.$util.toast('下载成功')
} else if (e.text === '记录') {
uni.navigateTo({ url: '/pages/device/DVR/record' })
} else if (e.text === '详情') {
} else if (e.text === '事件') {
uni.navigateTo({ url: '/pages/device/DVR/report' })
} else if (e.text === '关于') {
uni.navigateTo({ url: '/pages/device/DVR/about' })

View File

@@ -4,7 +4,13 @@
<view class="device">
<view class="nav" :style="{ top: navTabHeight + 'px' }">
<view class="nav-menu" @click="selectEngineering"
>{{ select.engineeringName || '全部工程' }}
>{{
select.engineeringName
? select.engineeringName.length > 6
? select.engineeringName.substring(0, 6) + '...'
: select.engineeringName
: '全部工程'
}}
<uni-icons type="bottom" size="14"></uni-icons>
</view>
<picker
@@ -19,7 +25,7 @@
{{
select.projectName
? select.projectName.length > 6
? select.projectName.substring(0, 12) + '...'
? select.projectName.substring(0, 6) + '...'
: select.projectName
: '全部项目'
}}

View File

@@ -22,17 +22,17 @@
></view>
</view>
<view class="info-item">
所属工程<view>{{ engineeringName }}</view>
所属工程<view>{{ device.engineeringName }}</view>
</view>
<view class="info-item">
所属项目<view>{{ equipmentName }}</view>
所属项目<view>{{ device.equipmentName }}</view>
</view>
<view class="info-item status">
通讯状态<view
class="status-normal"
:style="{ color: runStatus == 1 ? '#ff3b30' : '#00ff88' }"
>{{ runStatus == 1 ? '离线' : '在线' }}
:style="{ color: device.runStatus == 1 ? '#ff3b30' : '#00ff88' }"
>{{ device.runStatus == 1 ? '离线' : '在线' }}
</view>
</view>
</view>
@@ -69,7 +69,7 @@
@finished="initChart('echartV3', 'echartsDataV3')"
></l-echart>
</view>
<view class="text"> 电压有效值(kV) </view>
<view class="text" style="left: 20rpx"> 电压有效值(kV) </view>
</view>
<view class="middle" style="width: 100%">
<l-echart
@@ -103,7 +103,7 @@
@finished="initChart('echartA3', 'echartsDataA3')"
></l-echart>
</view>
<view class="text"> 电流有效值(A) </view>
<view class="text" style="right: 20rpx"> 电流有效值(A) </view>
</view>
</view>
</view>
@@ -135,13 +135,15 @@ import { MQTT_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
import mqtt from 'mqtt/dist/mqtt.js'
import { getBaseRealData } from '@/common/api/harmonic.js'
import hoverMenu from '@/hover-menu/components/hover-menu/hover-menu.vue'
import { queryTopologyDiagram, deleteDevice, cancelDebug, finishDebug } from '@/common/api/device'
export default {
components: { hoverMenu },
props: {},
data() {
return {
loading: true,
devId: '',
deviceInfo: {},
// 使用上面定义的图表配置项
option: {},
echartsData0: {},
@@ -182,32 +184,25 @@ export default {
lineId: '00B78D00A87A1',
lineKey: 0,
lineList: [],
engineeringName: '',
equipmentName: '',
runStatus: 1,
connection: false,
content: [
{
iconPath: '/static/report.png',
text: '详情',
iconPath: '/static/tongji.png',
text: '事件',
},
{
iconPath: '/static/about.png',
text: '关于',
},
],
isPrimaryUser: 0,
device: {},
}
},
onLoad(options) {
this.device= JSON.parse(options.device)
this.lineKey = 0
this.devId = options.id
this.lineList = JSON.parse(options.lineList)
this.lineList = this.device.lineList
this.lineId = this.lineList[0].lineId
this.engineeringName = options.engineeringName
this.equipmentName = options.equipmentName
this.runStatus = options.runStatus
this.isPrimaryUser = options.isPrimaryUser
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.echartsData0 = this.initEcharts0()
this.echartsData1 = this.initEcharts1()
@@ -222,7 +217,7 @@ export default {
this.setMqtt(0)
this.initMqtt()
})
if (this.isPrimaryUser == 1) {
if (this.device.isPrimaryUser == 1) {
this.content.splice(
0,
0,
@@ -230,10 +225,7 @@ export default {
iconPath: '/static/transfer.png',
text: '移交',
},
{
iconPath: '/static/feedback.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
@@ -715,21 +707,21 @@ export default {
}
})
// this.client.subscribe(`/zl/devData/${this.devId}/${id}`, (err) => {
// this.client.subscribe(`/zl/devData/${this.device.equipmentId}/${id}`, (err) => {
// if (!err) {
// console.log(`订阅成功:/zl/devData/${this.devId}/${id}`)
// console.log(`订阅成功:/zl/devData/${this.device.equipmentId}/${id}`)
// // 默认推送
// this.client.publish(`/zl/askDevData/${this.devId}/${id}`)
// this.client.publish(`/zl/askTemperData/${this.devId}`)
// this.client.publish(`/zl/askDevData/${this.device.equipmentId}/${id}`)
// this.client.publish(`/zl/askTemperData/${this.device.equipmentId}`)
// if (this.timer) {
// clearInterval(this.timer)
// this.timer = null
// }
// this.timer = setInterval(() => {
// console.log('askDevData')
// this.client.publish(`/zl/askDevData/${this.devId}/${id}`)
// this.client.publish(`/zl/askTemperData/${this.devId}`)
// this.client.publish(`/zl/askDevData/${this.device.equipmentId}/${id}`)
// this.client.publish(`/zl/askTemperData/${this.device.equipmentId}`)
// }, 1000 * 60)
// }
// })
@@ -936,7 +928,7 @@ export default {
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
deleteDevice(this.devId).then((res) => {
deleteDevice(this.device.equipmentId).then((res) => {
uni.showToast({
title: '删除成功',
icon: 'none',
@@ -952,16 +944,30 @@ export default {
})
} 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.setStorageSync('messageParams', {
engineeringName: this.device.engineeringName,
engineeringId: this.device.engineeringId, //工程ID
projectName: this.device.projectName,
projectId: this.device.projectId, //項目ID
deviceName: this.device.equipmentName,
deviceId: this.device.equipmentId, //设备ID
lineName: '',
lineId: '', //测点ID
type: 0,
})
uni.switchTab({
url: '/pages/index/message1',
})
// uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.device.equipmentId })
} else if (e.text === '关于') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.device.equipmentId })
} else if (e.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId })
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.device.equipmentId })
} 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 })
uni.navigateTo({ url: '/pages/device/user?id=' + this.device.equipmentId + '&isPrimaryUser=' + this.device.isPrimaryUser })
}
// this.$refs.fab.close()
},
@@ -994,9 +1000,9 @@ export default {
margin-bottom: 10rpx;
view {
// font-size: 28rpx;
.nav-menu {
font-size: 32rpx;
}
// .nav-menu {
// font-size: 32rpx;
// }
}
&:last-child {
margin-bottom: 0rpx;
@@ -1058,6 +1064,7 @@ export default {
background-color: #fff;
padding: 0 0rpx 20rpx;
display: flex;
padding-bottom: 55rpx;
.middle {
display: flex;
position: relative;
@@ -1078,10 +1085,10 @@ export default {
.text {
text-align: center;
font-size: 28rpx;
position: absolute;
}
.text_center {
position: absolute;
bottom: 0;
bottom: -5px;
left: 50%;
transform: translateX(-50%) translateY(50%);
}