设备列表
This commit is contained in:
70
components/Cn-device-card/Cn-device-card.vue
Normal file
70
components/Cn-device-card/Cn-device-card.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<uni-card
|
||||
:title="device.equipmentName"
|
||||
:sub-title="device.mac"
|
||||
:extra="device.isPrimaryUser?'主用户':'子用户'"
|
||||
padding="0"
|
||||
@click="jump(device)"
|
||||
:thumbnail="deviceIcon(device.runStatus)"
|
||||
>
|
||||
<template v-slot:title>
|
||||
<slot name="title"></slot>
|
||||
</template>
|
||||
<view class="device-body">
|
||||
<view class="device-body-item">
|
||||
<text>工程名称</text>
|
||||
<text>{{ device.engineeringName }}</text>
|
||||
</view>
|
||||
<view class="device-body-item mt6">
|
||||
<text>项目名称</text>
|
||||
<text>{{ device.projectName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
device: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deviceIcon(e) {
|
||||
let str = ''
|
||||
switch (e) {
|
||||
case 1:
|
||||
str = '/static/device_bad.png'
|
||||
break
|
||||
case 2:
|
||||
str = '/static/device.png'
|
||||
break
|
||||
default:
|
||||
str = '/static/device.png'
|
||||
break
|
||||
}
|
||||
return str
|
||||
},
|
||||
jump() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + this.device.equipmentId + '&isPrimaryUser=' + this.device.isPrimaryUser,
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.device-body {
|
||||
padding: 20rpx;
|
||||
|
||||
.device-body-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user