412 lines
9.8 KiB
Vue
Raw Normal View History

2022-10-17 10:13:22 +08:00
<template>
<Card title="安全巡检">
<div class="charts">
<div class="dllm">
<div class="woria">
<JRingChart
2022-12-14 18:31:34 +08:00
:title="{
text: '检查总数',
subTitle: `${safetyPatrolInspection.allTotalNum}`,
fontSize: 18,
}"
2022-10-17 10:13:22 +08:00
:color="['#6EE4F0', '#E7622A']"
2022-12-14 18:31:34 +08:00
:data="[
{
value: safetyPatrolInspection.allRectificationNum,
name: '已处理',
},
{
value: safetyPatrolInspection.allNoRectificationNum,
name: '未处理',
},
]"
2022-10-17 10:13:22 +08:00
:radius="['60%', '85%']"
:legend="false"
/>
</div>
<div class="legend">
<div class="row">
2022-12-14 18:31:34 +08:00
<span>已闭合</span>
2022-10-17 10:13:22 +08:00
<span>占比</span>
</div>
<div class="row">
2022-12-14 18:31:34 +08:00
<span>{{ safetyPatrolInspection.allRectificationNum || 0 }}</span>
<span
>{{ safetyPatrolInspection.allRectificationRatio || 0 }}%</span
>
2022-10-17 10:13:22 +08:00
</div>
</div>
<div class="legend">
<div class="row">
2022-12-14 18:31:34 +08:00
<span>未闭合</span>
2022-10-17 10:13:22 +08:00
<span>占比</span>
</div>
<div class="row">
2022-12-14 18:31:34 +08:00
<span>{{ safetyPatrolInspection.allNoRectificationNum || 0 }}</span>
<span>{{ safetyPatrolInspection.noRectificationRatio || 0 }}%</span>
2022-10-17 10:13:22 +08:00
</div>
</div>
</div>
<div class="dllm">
<div class="woria">
<JRingChart
2022-12-14 18:31:34 +08:00
:title="{
text: '今日巡检',
subTitle: `${safetyPatrolInspection.todayTotalNum}`,
fontSize: 18,
}"
2022-10-17 10:13:22 +08:00
:color="['#6EE4F0', '#E7622A']"
2022-12-14 18:31:34 +08:00
:data="[
{
value: safetyPatrolInspection.todayRectificationNum,
name: '已巡检',
},
{
value: safetyPatrolInspection.todayNoRectificationRatio,
name: '未巡检',
},
]"
2022-10-17 10:13:22 +08:00
:radius="['60%', '85%']"
:legend="false"
/>
</div>
<div class="legend">
<div class="row">
2022-12-14 18:31:34 +08:00
<span>已闭合</span>
2022-10-17 10:13:22 +08:00
<span>占比</span>
</div>
<div class="row">
2022-12-14 18:31:34 +08:00
<span>{{ safetyPatrolInspection.todayRectificationNum || 0 }}</span>
<span
>{{ safetyPatrolInspection.todayRectificationRatio || 0 }}%</span
>
2022-10-17 10:13:22 +08:00
</div>
</div>
<div class="legend">
<div class="row">
2022-12-14 18:31:34 +08:00
<span>未闭合</span>
2022-10-17 10:13:22 +08:00
<span>占比</span>
</div>
<div class="row">
2022-12-14 18:31:34 +08:00
<span>{{
safetyPatrolInspection.todayNoRectificationRatio || 0
}}</span>
<span
>{{
safetyPatrolInspection.todayNoRectificationRatio || 0
}}%</span
>
2022-10-17 10:13:22 +08:00
</div>
</div>
</div>
</div>
<div class="security-list">
<div class="thead">
<div class="row">
<div class="td">事件类型</div>
2022-12-14 18:31:34 +08:00
<div class="td">检查时间</div>
2022-10-17 10:13:22 +08:00
<div class="td">处理状态</div>
</div>
</div>
<div class="tbody">
<vue-scroll>
2022-12-14 18:31:34 +08:00
<div
class="row"
:class="fmtStatusColor(item.status)"
v-for="(item, index) in detailData"
:key="index"
>
<div class="td">{{ item.checkContent }}</div>
<div class="td">{{ item.createTime }}</div>
<div class="td" :class="fmtStatusColor(item.status)">
{{ fmtStatus(item.status) }}
</div>
</div>
<div
class="row"
v-if="
safetyPatrolInspection.hiddenDangerInspectRecordList.length == 0
"
>
<div
style="
font-size: 14px;
color: #999;
text-align: center;
width: 100%;
line-height: 200px;
"
>
暂无数据
</div>
2022-10-17 10:13:22 +08:00
</div>
</vue-scroll>
</div>
</div>
</Card>
</template>
<script>
2022-12-14 18:31:34 +08:00
import {
getAllTodayDataHdirApi,
getTodayInspectionInfo,
} from "@/assets/js/api/zhongjianFourth";
import { gethiddenDangerInspectRecordApi } from "@/assets/js/api/safeManage.js";
import { mapState } from "vuex";
2022-10-17 10:13:22 +08:00
2022-12-14 18:31:34 +08:00
import Card from "../components/Card.vue";
import JRingChart from "../../common/jChart/pie/JRingChart.vue";
2022-10-17 10:13:22 +08:00
export default {
components: { Card, JRingChart },
data() {
return {
2022-12-14 18:31:34 +08:00
safetyPatrolInspection: {
hiddenDangerInspectRecordList: [],
},
2022-10-17 10:13:22 +08:00
// 安全隐患
safetyPeril: {
rectificationNum: 0,
rectificationRatio: 0,
noRectificationNum: 0,
noRectificationRatio: 0,
totalNum: 0,
},
// 今日巡检
todayInspection: {
rectificationNum: 0,
rectificationRatio: 0,
noRectificationNum: 0,
noRectificationRatio: 0,
totalNum: 0,
},
// 事件列表
list: [
2022-12-14 18:31:34 +08:00
{ type: 1, datetime: "2022-02-02 13:39:09", status: 1 },
{ type: 2, datetime: "2022-02-02 13:39:09", status: 2 },
{ type: 3, datetime: "2022-02-02 13:39:09", status: 3 },
{ type: 1, datetime: "2022-02-02 13:39:09", status: 1 },
2022-10-17 10:13:22 +08:00
],
2022-12-14 18:31:34 +08:00
//隐患类型
detailData: [],
};
2022-10-17 10:13:22 +08:00
},
created() {
2022-12-14 18:31:34 +08:00
// this.getSafetyPerilInfo()
this.getTodayInspectionInfo();
this.getAllTodayDataHdir();
this.loadList();
2022-10-17 10:13:22 +08:00
},
computed: {
2022-12-14 18:31:34 +08:00
...mapState(["projectSn"]),
2022-10-17 10:13:22 +08:00
},
methods: {
2022-12-14 18:31:34 +08:00
//隐患事件类型
loadList() {
gethiddenDangerInspectRecordApi({ projectSn: this.projectSn }).then(
(result) => {
console.log("隐患事件类型数据", result.result);
this.detailData = result.result.records;
// result.result.records.forEach(item=>{
// this.detailData.push(item.checkContent)
// })
}
);
},
getAllTodayDataHdir() {
getAllTodayDataHdirApi({ projectSn: this.projectSn }).then((res) => {
console.log(res, "getAllTodayDataHdir");
this.safetyPatrolInspection = res.result;
});
2022-10-17 10:13:22 +08:00
},
2022-12-14 18:31:34 +08:00
// /** 查询安全隐患数据 */
// getSafetyPerilInfo() {
// getSafetyPerilInfo({ projectSn: this.projectSn }).then(res => {
// console.log('查询安全隐患数据: ', res);
// const safetyPeril = this.safetyPeril;
// Object.keys(safetyPeril).forEach(key => {
// safetyPeril[key] = res.result[key];
// })
// })
// },
2022-10-17 10:13:22 +08:00
/** 查询今日巡检数据 */
getTodayInspectionInfo() {
2022-12-14 18:31:34 +08:00
getTodayInspectionInfo({ projectSn: this.projectSn }).then((res) => {
console.log("查询今日巡检数据: ", res);
2022-10-17 10:13:22 +08:00
const todayInspection = this.todayInspection;
2022-12-14 18:31:34 +08:00
Object.keys(todayInspection).forEach((key) => {
2022-10-17 10:13:22 +08:00
todayInspection[key] = res.result[key];
2022-12-14 18:31:34 +08:00
});
});
2022-10-17 10:13:22 +08:00
},
fmtType(type) {
2022-12-14 18:31:34 +08:00
return type == 1 ? "隐患问题" : type == 2 ? "排查记录" : "";
// return type === 1 ? '物料堆放' : type === 2 ? '未戴安全帽' : type === 3 ? '未穿反光衣' : '--'
2022-10-17 10:13:22 +08:00
},
fmtStatus(status) {
2022-12-14 18:31:34 +08:00
return status === 1
? "无需整改"
: status === 2
? "待整改"
: status === 3
? "待复查"
: status === 4
? "合格"
: status === 5
? "不合格"
: "";
2022-10-17 10:13:22 +08:00
},
fmtStatusColor(status) {
2022-12-14 18:31:34 +08:00
return status === 1
? "orange"
: status === 2
? "green"
: status === 3
? "blue"
: "";
},
},
};
2022-10-17 10:13:22 +08:00
</script>
<style lang="less" scoped>
.charts {
margin-top: 2%;
height: 47%;
display: flex;
color: #fff;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.dllm {
flex: 1;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.woria {
width: 100%;
height: calc(100% - 92px);
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.legend {
position: relative;
width: 100px;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&::before {
2022-12-14 18:31:34 +08:00
content: "";
2022-10-17 10:13:22 +08:00
position: absolute;
top: 1px;
left: -10px;
2022-10-17 10:13:22 +08:00
width: 6px;
height: 6px;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:nth-child(2)::before {
width: 12px;
height: 12px;
2022-10-17 10:13:22 +08:00
background-color: #6ee4ef;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:nth-child(3)::before {
2022-12-14 18:31:34 +08:00
width: 12px;
height: 12px;
2022-10-17 10:13:22 +08:00
background-color: #e7622a;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.row {
display: flex;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
span {
text-align: center;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:first-child {
width: 60%;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:last-child {
width: 40%;
}
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:first-child {
font-size: 14px;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:last-child {
height: 30px;
line-height: 30px;
font-size: 12px;
color: #6ae3eb;
}
}
}
}
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.security-list {
margin-top: 3%;
height: 48%;
color: #fff;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.thead {
color: #6ae3eb;
margin-bottom: 5px;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.tbody {
height: calc(100% - 50px);
font-size: 12px;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.row {
width: 98%;
height: 50px;
line-height: 50px;
display: flex;
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&.orange {
//background: linear-gradient(90deg, #356f83, #213c4f);
2022-10-17 10:13:22 +08:00
&::before {
2022-12-14 18:31:34 +08:00
content: "";
// width: 4px;
// height: 100%;
// background-color: #67d4d9;
2022-10-17 10:13:22 +08:00
}
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
.td {
text-align: center;
2022-12-14 18:31:34 +08:00
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
cursor: pointer;
2022-10-17 10:13:22 +08:00
&:nth-child(1) {
2022-12-14 18:31:34 +08:00
width: 35%;
2022-10-17 10:13:22 +08:00
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:nth-child(2) {
2022-12-14 18:31:34 +08:00
width: calc(30% - -38px);
2022-10-17 10:13:22 +08:00
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&:nth-child(3) {
2022-12-14 18:31:34 +08:00
width: 70px;
2022-10-17 10:13:22 +08:00
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&.orange {
color: #e7622a;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&.green {
color: #40cdad;
}
2022-12-14 18:31:34 +08:00
2022-10-17 10:13:22 +08:00
&.blue {
color: #64ccd9;
}
}
}
}
</style>