Files
app-govern/pages/device/APF/about.vue

67 lines
2.4 KiB
Vue
Raw Normal View History

2023-02-07 17:59:54 +08:00
<template>
2023-08-02 09:10:45 +08:00
<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' ? '云直连' : 'mqtt' }}</view
>
<!-- <view class="about-text">装置注册时间永久使用</view> -->
<view class="about-text">程序版本{{ deviceInfo.programVersionName }}</view>
<view class="about-text">网络设备ID{{ deviceInfo.ndid }}</view>
2023-02-07 17:59:54 +08:00
</view>
</view>
</Cn-page>
</template>
<script>
2023-08-02 09:10:45 +08:00
import { queryDeivceById } from '@/common/api/device'
import { queryByCode, queryCsDictTree, queryByid, queryEdDataPage } from '@/common/api/dictionary'
2023-02-07 17:59:54 +08:00
export default {
2023-08-02 09:10:45 +08:00
data() {
2023-02-07 17:59:54 +08:00
return {
2023-08-02 09:10:45 +08:00
loading: true,
deviceInfo: {},
2023-02-07 17:59:54 +08:00
}
},
2023-08-02 09:10:45 +08:00
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
console.log(resp[2])
this.deviceInfo.programVersionName = resp[2].data.records.find(
(item) => item.id === this.deviceInfo.programVersion,
)?.versionNo
this.loading = false
})
})
})
},
2023-02-07 17:59:54 +08:00
}
</script>
2023-08-02 09:10:45 +08:00
<style lang="scss">
2023-02-07 17:59:54 +08:00
.about {
2023-08-02 09:10:45 +08:00
padding: 34rpx;
2023-02-07 17:59:54 +08:00
.about-title {
font-size: 34rpx;
font-weight: bold;
color: #333333;
margin-bottom: 34rpx;
}
.about-text {
font-size: 28rpx;
color: #666666;
margin-bottom: 34rpx;
}
}
2023-08-02 09:10:45 +08:00
</style>