2022-08-12 10:21:25 +08:00
|
|
|
|
<template>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<Card title="安全管理">
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
|
<div class="left">
|
|
|
|
|
|
<div class="top">
|
|
|
|
|
|
<div class="image">
|
2022-09-14 17:59:36 +08:00
|
|
|
|
<img src="../assets/images/common/echart_orange.gif" alt="">
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<div class="value">
|
2022-09-14 17:30:03 +08:00
|
|
|
|
<span class="number">{{ pollingData.closeRatio || 0 }}</span>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<span class="unit">%</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="bottom">
|
2022-09-14 17:30:03 +08:00
|
|
|
|
<span class="label">已完成整改/巡检总数</span>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<div class="value">
|
2022-09-14 17:40:09 +08:00
|
|
|
|
<span class="number">{{ pollingData.rectificationNum || 0 }}</span>/<span class="number">{{ pollingData.totalNum || 0 }}</span>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-08-24 15:52:18 +08:00
|
|
|
|
</div>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<div class="right">
|
|
|
|
|
|
<div class="content">
|
|
|
|
|
|
<div class="top-title">安全生产天数</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="days">
|
2022-09-14 17:40:09 +08:00
|
|
|
|
<div class="number item">{{ days.kilobit || 0 }}</div>
|
|
|
|
|
|
<div class="number item">{{ days.hundreds || 0 }}</div>
|
|
|
|
|
|
<div class="number item">{{ days.decade || 0 }}</div>
|
|
|
|
|
|
<div class="number item">{{ days.units || 0 }}</div>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<div class="text item">天</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="bottom">
|
2022-09-08 11:10:59 +08:00
|
|
|
|
<span class="label">起始日期:</span>
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<div class="value">
|
2022-09-14 17:30:03 +08:00
|
|
|
|
<span>{{ startDate.year }} </span>年
|
|
|
|
|
|
<span>{{ startDate.month }} </span>月
|
|
|
|
|
|
<span>{{ startDate.day }} </span>日
|
2022-09-01 17:57:36 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Card>
|
2022-08-12 10:21:25 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-08-24 15:52:18 +08:00
|
|
|
|
import Card from '../components/Card'
|
2022-09-14 17:30:03 +08:00
|
|
|
|
|
|
|
|
|
|
import { resourceManagement } from '@/assets/js/api/zhongjianFourth'
|
|
|
|
|
|
|
|
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
|
2022-08-12 10:21:25 +08:00
|
|
|
|
export default {
|
2022-08-24 15:52:18 +08:00
|
|
|
|
components: { Card },
|
2022-08-12 10:21:25 +08:00
|
|
|
|
data() {
|
2022-09-14 17:30:03 +08:00
|
|
|
|
return {
|
|
|
|
|
|
// 巡检数据
|
|
|
|
|
|
pollingData: {
|
|
|
|
|
|
rectificationNum: undefined, // 完成整改数
|
|
|
|
|
|
totalNum: undefined, // 巡检总数
|
|
|
|
|
|
closeRatio: undefined, // 占比
|
|
|
|
|
|
days: undefined, // 安全生产天数
|
|
|
|
|
|
startWorkDate: undefined, // 起始日期
|
|
|
|
|
|
},
|
|
|
|
|
|
// 天数
|
|
|
|
|
|
days : {
|
|
|
|
|
|
units: undefined,
|
|
|
|
|
|
decade: undefined,
|
|
|
|
|
|
hundreds: undefined,
|
|
|
|
|
|
kilobit: undefined,
|
|
|
|
|
|
},
|
|
|
|
|
|
// 起始日期
|
|
|
|
|
|
startDate: {
|
|
|
|
|
|
year: undefined,
|
|
|
|
|
|
month: undefined,
|
|
|
|
|
|
day: undefined,
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(['projectSn']),
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
/** 查询列表 */
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
resourceManagement({ projectSn: this.projectSn }).then(res => {
|
|
|
|
|
|
console.log('安全管理: ', res);
|
|
|
|
|
|
const pollingData = this.pollingData;
|
|
|
|
|
|
Object.keys(pollingData).forEach(key => {
|
|
|
|
|
|
pollingData[key] = res.result[key]
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
pollingData.days = pollingData.days.toString()
|
|
|
|
|
|
if (pollingData.days.length < 4) {
|
|
|
|
|
|
pollingData.days = pollingData.days.padStart(4, 0)
|
|
|
|
|
|
const days = this.days;
|
|
|
|
|
|
|
|
|
|
|
|
days.units = pollingData.days[3];
|
|
|
|
|
|
days.decade = pollingData.days[2];
|
|
|
|
|
|
days.hundreds = pollingData.days[1];
|
|
|
|
|
|
days.kilobit = pollingData.days[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const startDate = pollingData.startWorkDate.split('-');
|
|
|
|
|
|
console.log('startDate: ', startDate);
|
|
|
|
|
|
this.startDate.year = startDate[0]
|
|
|
|
|
|
this.startDate.month = startDate[1]
|
|
|
|
|
|
this.startDate.day = startDate[2]
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2022-08-24 15:52:18 +08:00
|
|
|
|
}
|
2022-08-12 10:21:25 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
2022-09-01 17:57:36 +08:00
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
.left {
|
2022-09-06 11:25:11 +08:00
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
padding: 10px 0;
|
|
|
|
|
|
|
2022-09-01 17:57:36 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2022-09-05 18:02:08 +08:00
|
|
|
|
justify-content: space-around;
|
2022-09-01 17:57:36 +08:00
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
.top {
|
|
|
|
|
|
display: flex;
|
2022-09-06 11:25:11 +08:00
|
|
|
|
align-items: center;
|
2022-09-01 17:57:36 +08:00
|
|
|
|
justify-content: center;
|
2022-09-06 11:25:11 +08:00
|
|
|
|
|
|
|
|
|
|
width: 100%;
|
2022-09-14 17:30:03 +08:00
|
|
|
|
height: 150px;
|
2022-09-06 11:25:11 +08:00
|
|
|
|
|
2022-09-01 17:57:36 +08:00
|
|
|
|
.image {
|
2022-09-05 18:02:08 +08:00
|
|
|
|
display: grid;
|
|
|
|
|
|
place-items: center;
|
2022-09-01 17:57:36 +08:00
|
|
|
|
position: relative;
|
2022-09-06 11:25:11 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
img {
|
2022-09-14 17:30:03 +08:00
|
|
|
|
height: 150px;
|
2022-09-06 11:25:11 +08:00
|
|
|
|
}
|
2022-09-01 17:57:36 +08:00
|
|
|
|
.value {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
left: 50%;
|
2022-09-06 11:25:11 +08:00
|
|
|
|
transform: translate(-50%, -50%);
|
2022-09-01 17:57:36 +08:00
|
|
|
|
font-size: 23px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bottom {
|
2022-09-06 11:25:11 +08:00
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
2022-09-01 17:57:36 +08:00
|
|
|
|
font-size: 13px;
|
2022-09-14 17:30:03 +08:00
|
|
|
|
|
|
|
|
|
|
.number:nth-child(1) {
|
|
|
|
|
|
color: #af5320;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.number:nth-child(2) {
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
2022-09-01 17:57:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.label {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
color: #a5b2c0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.value {
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
place-items: center;
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
padding: 16px 6px 8px;
|
|
|
|
|
|
width: 175px;
|
|
|
|
|
|
height: 152px;
|
|
|
|
|
|
background-image: url('../assets/images/command-center/max-block.png');
|
|
|
|
|
|
|
|
|
|
|
|
.top-title {
|
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
color: #65b3b5;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.days {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
.item {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
place-items: center;
|
|
|
|
|
|
width: 34px;
|
|
|
|
|
|
height: 64px;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
&.number {
|
|
|
|
|
|
background-image: url('../assets/images/command-center/block.png');
|
|
|
|
|
|
}
|
|
|
|
|
|
&.text {
|
|
|
|
|
|
width: 28px !important;
|
|
|
|
|
|
font-size: 17px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bottom {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
color: #a5b2c0;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
transform: scale(65%);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|