湖里大屏(数字工地):塔吊设备联调

This commit is contained in:
Jack 2022-08-13 11:53:47 +08:00
parent c39af50010
commit 343ecebd3d
2 changed files with 44 additions and 53 deletions

View File

@ -17,15 +17,17 @@
</div> </div>
</div> </div>
<div class="list"> <div class="list">
<div class="list-item" :class="i === 2 ? 'offline' : 'online'" v-for="i in 3" :key="i"> <vue-scroll>
<div class="status">在线</div> <div class="list-item" :class="item.devonline == '0' ? 'online' : 'offline'" v-for="(item, i) in list" :key="i">
<div class="label">1号塔吊</div> <div class="status">{{ item.devonline == '0' ? '在线' : '离线' }}</div>
<div class="num" v-if="type === 'waring'">今日报警2</div> <div class="label">{{ item.devName }}</div>
<div class="num" v-if="type === 'waring'">今日报警{{ item.alarmNum }}</div>
<div class="persons" v-if="type === 'persons'"> <div class="persons" v-if="type === 'persons'">
<div class="person">进场人数67</div> <div class="person">进场人数67</div>
<div class="person">出场人数67</div> <div class="person">出场人数67</div>
</div> </div>
</div> </div>
</vue-scroll>
</div> </div>
</div> </div>
</template> </template>
@ -69,6 +71,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.h-count-list { .h-count-list {
height: 100%;
.counts { .counts {
padding: 10px 26px 20px; padding: 10px 26px 20px;
display: flex; display: flex;
@ -85,9 +88,15 @@ export default {
&.towercrane { &.towercrane {
background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-tower-crane.png'); background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-tower-crane.png');
} }
&.towercrane2 {
background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-tower-crane2.png');
}
&.warring { &.warring {
background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-warring.png'); background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-warring.png');
} }
&.warring2 {
background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-warring2.png');
}
&.facegate { &.facegate {
background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-face-gate.png'); background-image: url('~@/views/projectAdmin/dataBoard/projectHuScreen/assets/images/icons/i-face-gate.png');
} }
@ -109,6 +118,7 @@ export default {
} }
.list { .list {
height: calc(100% - 90px);
padding: 0 10px; padding: 0 10px;
.list-item { .list-item {
margin-bottom: 6px; margin-bottom: 6px;

View File

@ -1,6 +1,7 @@
<template> <template>
<Card :title="title"> <Card :title="title">
<DeviceCard <!-- 无用功 -->
<!-- <DeviceCard
:leftCount="{ value: totalTowerDev, label: '塔吊设备数', img: 'towercrane2' }" :leftCount="{ value: totalTowerDev, label: '塔吊设备数', img: 'towercrane2' }"
:rightCount="{ value: totalDangerTowerDev, label: '今日报警数', img: 'warring2' }" :rightCount="{ value: totalDangerTowerDev, label: '今日报警数', img: 'warring2' }"
> >
@ -9,20 +10,28 @@
<div class="item">离线</div> <div class="item">离线</div>
</div> </div>
<JBarChart :tooltip="{}" :xData="xData" :yData="yData" /> <JBarChart :tooltip="{}" :xData="xData" :yData="yData" />
</DeviceCard> </DeviceCard> -->
<CountList
:allCount="{ value: totalTowerDev, label: '塔吊总数', img: 'towercrane2' }"
:todayCount="{ value: totalDangerTowerDev, label: '今日报警总数', img: 'warring2' }"
:list="towerList"
/>
</Card> </Card>
</template> </template>
<script> <script>
import Card from "../components/Card.vue"; import Card from '../components/Card.vue'
import DeviceCard from "./components/DeviceCard.vue"; // import DeviceCard from './components/DeviceCard.vue'
import JBarChart from "../jChart/bar/JBarChart.vue"; // import JBarChart from '../jChart/bar/JBarChart.vue'
import CountList from '../components/CountList.vue'
export default { export default {
components: { Card, DeviceCard, JBarChart }, // components: { Card, DeviceCard, JBarChart },
components: { Card, CountList },
props: { props: {
title: { title: {
type: String, type: String,
default: "" default: ''
}, },
towerList: { towerList: {
type: Array, type: Array,
@ -30,48 +39,20 @@ export default {
}, },
totalTowerDev: { totalTowerDev: {
type: Number, type: Number,
default: "" default: ''
}, },
totalDangerTowerDev: { totalDangerTowerDev: {
type: Number, type: Number,
default: "" default: ''
} }
},
data() {
const yData = [23, 44, 63, 12, 45, 78, 34, 67].map((value, i) => {
if (i > 4 && i < 7) {
return {
name: "离线",
value,
itemStyle: { color: "#FF6C7F" }
};
} else {
return {
name: "报警数",
value,
itemStyle: { color: "#3CABFD" }
};
} }
}); // data() {
return { // return {
xData: ["1号", "2号", "3号", "4号", "5号", "6号", "7号", "8号"], // xData: [],
yData // yData: []
}; // }
},
mounted() {
// console.log("------", this.towerList, this.totalTowerDev);
// xy 0
//var datax = [],datay =[]
//this.towerList.forEach((item)=>{
// datax.push(item.devName)
// datay.push(item.alarmNum)
// if(item.deviceState == 1){
// } // }
//})
// this.xData = datax
// console.log('--------', this.xData)
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -87,7 +68,7 @@ export default {
align-items: center; align-items: center;
&::before { &::before {
margin-right: 8px; margin-right: 8px;
content: ""; content: '';
width: 16px; width: 16px;
height: 6px; height: 6px;
border-radius: 2px; border-radius: 2px;