135 lines
2.7 KiB
Vue
Raw Normal View History

<template>
<view class="towerManage">
<levitatedsphere :x="100" :y="80"></levitatedsphere>
<headers :showBack="true">
<view class="headerName">
项目塔吊
</view>
</headers>
<view class="">
<!-- <image src="../../../static/bg1.png"></image> -->
<view>
</view>
</view>
<view class="item_list">
<view class="item" v-if="listData.length>0" v-for="(item,index) in listData" :key="index" @click="goDetails(item)">
<view class="item_title flex2">
<text class="name">{{item.devName}}</text>
<text class="state1" v-if="item.devonline==1">在线</text>
<text class="state2" v-else>离线</text>
</view>
<view class="type">塔机臂长{{item.forearmLength}}</view>
<view class="type flex"><text>塔机编号</text><view style="width:75%; word-wrap: break-word; line-height: initial;">{{item.devSn}}</view></view>
<view class="type">最后数据时间{{timestampToTime(item.realTime,'time')}}</view>
</view>
</view>
</view>
</template>
<script>
import { timestampToTime } from '../../../static/js/util.js'
export default {
data() {
return {
projectSn:'',
listData:[],
timestampToTime: timestampToTime
}
},
onLoad(){
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.getListData();
},
methods: {
//获取列表数据
getListData(){
this.sendRequest({
url:'xmgl/tower/list',
method:"post",
data:{
projectSn:this.projectSn
},
success:res=>{
if(res.code==200){
this.listData = res.result
}
}
})
},
//详情
goDetails(val){
uni.navigateTo({
url:'./towerDetails?devSn='+val.devSn+'&id='+val.id+'&forearmLength='+val.forearmLength+'&towerHeight='+val.towerHeight
})
}
}
}
</script>
<style>
.flex {
display: flex;
align-items: center;
}
.flex2 {
display: flex;
align-items: center;
justify-content: space-between;
}
.item_list {
width: 100%;
padding: 20rpx 30rpx;
box-sizing: border-box;
}
.item_list .item {
width: 100%;
padding: 24rpx 30rpx;
box-sizing: border-box;
box-shadow: 0px 0px 20rpx #dedede;
border-radius: 10rpx;
font-size: 30rpx;
margin-bottom: 30rpx;
}
.item_title {
padding: 0px 0px 16rpx;
border-bottom: 1px solid #DEDEDE;
margin-bottom: 10rpx;
}
.item .state1 {
color: #fff;
padding: 4px 24rpx;
font-size: 24rpx;
background-color: #06c232;
border-radius: 60rpx;
}
.item .state2 {
color: #fff;
padding: 4px 24rpx;
font-size: 24rpx;
background-color: #999;
border-radius: 60rpx;
}
.item_title .name {
font-weight: 700;
}
.type {
line-height: 28rpx;
color: #999;
font-size: 28rpx;
}
</style>