湖里大屏(数字工地):封装 DeviceCard 组件
This commit is contained in:
parent
d950a89b2f
commit
b422afc48e
@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<div class="h-device-card">
|
||||||
|
<div class="counts">
|
||||||
|
<div class="count">
|
||||||
|
<div class="icon"></div>
|
||||||
|
<div class="info">
|
||||||
|
<div class="num blue">{{ leftCount.value }}</div>
|
||||||
|
<div class="label">{{ leftCount.label }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="count">
|
||||||
|
<div class="icon"></div>
|
||||||
|
<div class="info">
|
||||||
|
<div class="num red">{{ rightCount.value }}</div>
|
||||||
|
<div class="label">{{ rightCount.label }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
leftCount: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({
|
||||||
|
img: '',
|
||||||
|
value: '',
|
||||||
|
label: ''
|
||||||
|
})
|
||||||
|
},
|
||||||
|
rightCount: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({
|
||||||
|
img: '',
|
||||||
|
value: '',
|
||||||
|
label: '',
|
||||||
|
color: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.h-device-card {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.counts {
|
||||||
|
padding: 10px 26px 20px;
|
||||||
|
display: flex;
|
||||||
|
.count {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.icon {
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 52px;
|
||||||
|
height: 52px;
|
||||||
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
color: #fff;
|
||||||
|
.num {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
.label {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,42 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 人员类别 -->
|
<Card :title="title">
|
||||||
<div class="container">
|
<DeviceCard :leftCount="{ value: 22, label: '塔吊设备数' }" :rightCount="{ value: 65, label: '今日报警数' }">
|
||||||
<div class="titleTxt">{{ title }}</div>
|
hello
|
||||||
|
</DeviceCard>
|
||||||
</div>
|
</Card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Card from '../components/Card.vue'
|
||||||
|
import DeviceCard from './components/DeviceCard.vue'
|
||||||
export default {
|
export default {
|
||||||
|
components: { Card, DeviceCard },
|
||||||
props: {
|
props: {
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "default title"
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {}
|
||||||
|
}
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped></style>
|
||||||
.container {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: 1px solid #0081c3;
|
|
||||||
|
|
||||||
.titleTxt {
|
|
||||||
font-size: 18px;
|
|
||||||
color: #6ee4f0;
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user