设备编辑
This commit is contained in:
@@ -1,51 +1,80 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='device-list device'>
|
||||
<uni-card title="基础设备" sub-title="副标题" extra="APF" v-for="item in 10" :key="item" @click="jump" padding="0"
|
||||
thumbnail="/static/real_time_data.png">
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="device-list device">
|
||||
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
|
||||
<template v-else>
|
||||
<uni-card
|
||||
:title="item.equipmentName"
|
||||
:sub-title="item.projectName"
|
||||
:extra="item.projectType"
|
||||
padding="0"
|
||||
v-for="(item, index) in projectList"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
thumbnail="/static/device.png"
|
||||
>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
current: 0,
|
||||
items: ['正常', '报警', '离线'],
|
||||
styleType: 'text',
|
||||
activeColor: '#007aff',
|
||||
content: [{
|
||||
iconPath: '/static/add.png',
|
||||
text: '添加 ',
|
||||
},
|
||||
]
|
||||
content: [
|
||||
{
|
||||
iconPath: '/static/add.png',
|
||||
text: '添加 ',
|
||||
},
|
||||
],
|
||||
projectList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClickItem (e) {
|
||||
onClickItem(e) {
|
||||
this.current = e.currentIndex
|
||||
},
|
||||
jump () {
|
||||
jump(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.id
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser,
|
||||
})
|
||||
},
|
||||
trigger (e) {
|
||||
trigger(e) {
|
||||
if (e.index === 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new'
|
||||
url: '/pages/device/new',
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.projectList = JSON.parse(decodeURIComponent(options.projectList))
|
||||
console.log(this.projectList);
|
||||
switch (options.type) {
|
||||
case 'alarmLineDevs':
|
||||
uni.setNavigationBarTitle({
|
||||
title: '报警设备',
|
||||
})
|
||||
break
|
||||
case 'offLineDevs':
|
||||
uni.setNavigationBarTitle({
|
||||
title: '离线设备',
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
<style lang="scss">
|
||||
.device-list {
|
||||
.header {
|
||||
position: sticky;
|
||||
@@ -57,4 +86,4 @@ export default {
|
||||
box-shadow: 0 0 10rpx #eee;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user