flx:绑定安全数据

This commit is contained in:
Vce 2024-05-13 01:20:59 +08:00
parent 7ea192fb7c
commit e4e123df8a
3 changed files with 272 additions and 201 deletions

View File

@ -224,3 +224,12 @@ export const entryRecordListApi = data => get('xmgl/workerAccessRecord/page', da
// 逾期预警台账
export const delayAlarmRecordListApi = data => get('xmgl/xzCertificateExpireAlarmRecord/page', data);
// 安全分析
// export const getProjectDetailData = data => post('', data); // 查询对应企业统计数据
export const getSelectQualityStatisticsNumApi = data => post('/xmgl/xzSecurityQualityInspectionRecord/selectQualityStatisticsNum', data); // 检查统计
export const getStatsByEnterpriseApi= data => post('/xmgl/xzSecurityQualityInspectionRecord/statsByEnterprise', data); // 分包单位统计
export const getRiskChartApi = data => post('/xmgl/xzSecurityQualityInspectionRecord/riskChart', data); // 风险走势图
export const getCountDangerLevelApi = data => post('/xmgl/xzSecurityQualityInspectionRecord/countDangerLevel', data); // 隐患数量展示
export const getcountQualityInspectionRecordRegionApi = data => post('/xmgl/xzSecurityQualityInspectionRecord/countQualityInspectionRecordRegion', data); // 责任区域数据统计

View File

@ -84,8 +84,8 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL ='http://101.43.164.214:45011/' //上海优益(上海建工)
// axios.defaults.baseURL = 'http://192.168.34.221:28888/' //郭圣雄本地
// axios.defaults.baseURL = 'http://192.168.34.221:28889/' //郭圣雄本地
// axios.defaults.baseURL ='http://192.168.34.221:9111/' //郭圣雄本地
axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地
axios.defaults.baseURL ='http://192.168.34.221:19111/' //郭圣雄本地
// axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地
// axios.defaults.baseURL = 'http://182.90.224.237:51234' //郭圣雄远程
// axios.defaults.baseURL ='http://101.43.164.214:45020/' //沈阳和盈
// axios.defaults.baseURL ='http://183.249.224.118:9000/' //嘉兴王江泾公用码头
@ -99,7 +99,6 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = 'http://42.180.188.17:11211/'//鞍钢测试地址
// axios.defaults.baseURL = 'http://jxj.zhgdyun.com:19814/'//测试地址
} else if (process.env.NODE_ENV == 'debug') {
axios.defaults.baseURL = 'https://www.ceshi.com'
} else if (process.env.NODE_ENV == 'production') {

View File

@ -6,25 +6,25 @@
<!-- 数据统计 -->
<div class="box-between">
<div>检查统计</div>
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" size="mini">
<el-date-picker value-format="yyyy-MM-dd" v-model="examineTime" type="daterange"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="mini">
</el-date-picker>
</div>
<div class="show-pointer">
<div class="green-bg">
<div class="green-num">143</div>
<div class="green-num">{{ examineInfo.totalNum }}</div>
<div>检查总数</div>
</div>
<div class="org-bg">
<div class="org-num">12</div>
<div class="org-num">{{ examineInfo.dangerNum }}</div>
<div>隐患总数</div>
</div>
<div class="red-bg">
<div class="red-num">143</div>
<div class="red-num">{{ examineInfo.greatFaultLevelNum }}</div>
<div>重大隐患</div>
</div>
<div class="red-bg2">
<div class="red-num">143</div>
<div class="red-num">{{ examineInfo.overdueNotCloseNum }}</div>
<div>超期未闭合</div>
</div>
</div>
@ -37,18 +37,25 @@
<div>分包单位统计TOP10</div>
<div class="flex">
<el-radio-group v-model="radio">
<!-- <el-radio-group v-model="radio">
<el-radio :label="3">分包单位</el-radio>
<el-radio :label="6">队伍</el-radio>
<el-radio :label="9">班组</el-radio>
</el-radio-group>
<el-date-picker v-model="value1" type="daterange" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期" size="mini">
</el-radio-group> -->
<el-date-picker value-format="yyyy-MM-dd" v-model="enterpriseTime" type="daterange"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="mini">
</el-date-picker>
<div class="detail-right">详情 <i class="el-icon-arrow-right"></i></div>
<!-- <div class="detail-right">详情 <i class="el-icon-arrow-right"></i></div> -->
</div>
</div>
<div class="chart" ref="BarGraphChartOne"></div>
<div class="chart" ref="BarGraphChartOne"></div>
<div style="position: relative;height:100%" v-if="enterpriseList.length == 0">
<div class="placeholderBox">
<img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p>
</div>
</div>
<!-- <div class="chart" ref="carTypeChart"></div> -->
</div>
</div>
@ -61,7 +68,7 @@
<div>风险统计</div>
</div>
<div class="identification-info">
<div>5</div>
<div>{{ examineInfo2.dangerNum }}</div>
<div class="flex">
<img width="108px" height="90px" src="@/assets/images/safetyAnalysis/riskIdentLeft.png"
alt="">
@ -75,19 +82,19 @@
</div>
<div class="identification-bottom">
<div class="bg-ff0 color-white">
<div>143</div>
<div>{{ examineInfo2.greatFaultLevelNum }}</div>
<div>重大风险</div>
</div>
<div class="bg-ff9 color-white">
<div>12</div>
<div>{{ examineInfo2.largerRiskNum }}</div>
<div>较大风险</div>
</div>
<div class="bg-fff">
<div>143</div>
<div>{{ examineInfo2.generalRiskNum }}</div>
<div>一般风险</div>
</div>
<div class="bg-00f color-white">
<div class="red-num">143</div>
<div class="red-num">{{ examineInfo2.lowRiskNum }}</div>
<div>低风险</div>
</div>
</div>
@ -107,10 +114,12 @@
<div class="blockInner">
<!-- 分包单位 -->
<div class="box-between">
<div>风险走势图44%比上月4</div>
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
<div>风险走势图{{ riskListup }}%<span :style="riskListup > 0 > 0 ? 'color:green' : 'color:red'">{{
riskListup > 0 ? '↑' : '↓' }}</span>比上月{{ riskList.length > 2 &&
riskList[riskList.length - 1].lastMonth }}</div>
<!-- <el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" size="mini">
</el-date-picker>
</el-date-picker> -->
</div>
<div class="chart" ref="lineCharts"></div>
<!-- <div class="chart" ref="carTypeChart"></div> -->
@ -122,21 +131,29 @@
<div class="blockInner">
<div class="box-between">
<div>隐患数量展示</div>
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" size="mini">
<el-date-picker value-format="yyyy-MM-dd" v-model="dangerLevelTime" type="daterange"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="mini">
</el-date-picker>
</div>
<div class="flex sub-container_box">
<div class="sub-container">
<div>隐患超期未整改</div>
<div>重大隐患超期未整改<span>0</span>占比<span>0</span>%</div>
<div>严重隐患超期未整改<span>0</span>占比<span>0</span>%</div>
<div>重大隐患超期未整改<span>{{ this.dangerLevelInfo1.data ? this.dangerLevelInfo1.data[0].count : '0'
}}</span>占比<span>{{ this.dangerLevelInfo1.data ?
this.dangerLevelInfo1.data[0].percent: '0'}}</span>%</div>
<div>严重隐患超期未整改<span>{{ this.dangerLevelInfo1.data ? this.dangerLevelInfo1.data[1].count : '0'
}}</span>占比<span>{{ this.dangerLevelInfo1.data
? this.dangerLevelInfo1.data[1].percent: '0'}}</span>%</div>
<div class="chart" ref="annulusChartOne"></div>
</div>
<div class="sub-container">
<div>未消项隐患</div>
<div>重大隐患超期未整改<span>0</span>占比<span>0</span>%</div>
<div>严重隐患超期未整改<span>0</span>占比<span>0</span>%</div>
<div>重大隐患未消项<span>{{ this.dangerLevelInfo2.data ? this.dangerLevelInfo2.data[0].count : '0'
}}</span>占比<span>{{ this.dangerLevelInfo2.data ?
this.dangerLevelInfo2.data[0].percent : '0'}}</span>%</div>
<div>严重隐患未消项<span>{{ this.dangerLevelInfo2.data ? this.dangerLevelInfo2.data[0].count : '0'
}}</span>占比<span>{{ this.dangerLevelInfo2.data ?
this.dangerLevelInfo2.data[0].percent : '0'}}</span>%</div>
<div class="chart" ref="annulusChartTwo"></div>
</div>
</div>
@ -149,13 +166,15 @@
<div>责任区域问题统计TOP10</div>
<div class="flex align-center">
<div>
<el-radio-group v-model="radio3" size="small">
<el-radio-button label="全部"></el-radio-button>
<el-radio-button label="重大"></el-radio-button>
<el-radio-button label="严重"></el-radio-button>
<el-radio-group v-model="inspectionRadio" size="small">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">重大</el-radio-button>
<el-radio-button label="2">较大</el-radio-button>
<el-radio-button label="3">一般</el-radio-button>
<el-radio-button label="4"></el-radio-button>
</el-radio-group>
</div>
<i class="el-icon-full-screen"></i>
<!-- <i class="el-icon-full-screen"></i> -->
</div>
</div>
<div class="sub-container_box">
@ -168,11 +187,14 @@
</template>
<script>
import echarts from 'echarts4';
import dayjs from 'dayjs'
import {
selectCarStatisticsByCameraIdApi,
selectCarPassRecordInOutCountApi,
getCarPassRecordListApi,
} from "@/assets/js/api/carManage";
getSelectQualityStatisticsNumApi,
getStatsByEnterpriseApi,
getRiskChartApi,
getCountDangerLevelApi,
getcountQualityInspectionRecordRegionApi
} from "@/assets/js/api/laborPerson";
export default {
data() {
return {
@ -191,72 +213,155 @@ export default {
value1: "",
radio: "",
radio3: "",
projectSn: "",
examineTime: "",
examineInfo: {},
examineInfo2: {},
examineInfoFlag: true,
enterpriseTime: "",
enterpriseList: [],
riskList: [],
dangerLevelTime: "",
dangerLevelInfo1: {},
dangerLevelInfo2: {},
inspectionRadio: "",
inspectionList: [],
};
},
computed: {
riskListup() {
const num = this.riskList.length > 2 && (this.riskList[this.riskList.length - 1].dangerNum - this.riskList[this.riskList.length - 2].dangerNum) / 100;
console.log(this.riskList, num);
return num
}
},
mounted() {
// this.selectCarStatisticsByCameraId();
// this.selectCarPassRecordInOutCount();
// this.getCarPassRecordList();
this.barGraphCharts(this.$refs.BarGraphChartOne);
this.radarCharts(this.$refs.radarCharts);
this.lineCharts(this.$refs.lineCharts);
this.annulusChart(this.$refs.annulusChartOne);
this.annulusChart(this.$refs.annulusChartTwo);
this.barGraphFallCharts(this.$refs.barGraphFallCharts);
this.getRiskChart();
},
watch: {
examineTime: {
handler(newVal) {
console.log(newVal);
this.getSelectQualityStatisticsNum(newVal);
},
immediate: true,
},
"enterpriseTime": {
handler(newVal) {
console.log(newVal);
this.getStatsByEnterprise(newVal);
},
immediate: true,
},
dangerLevelTime: {
handler(newVal) {
console.log(newVal);
this.getCountDangerLevel(newVal, 0, 1);
this.getCountDangerLevel(newVal, 1, 0);
},
immediate: true,
},
inspectionRadio: {
handler(newVal) {
console.log(newVal);
this.getcountQualityInspectionRecordRegion();
},
immediate: true,
},
},
methods: {
selectCarStatisticsByCameraId() {
selectCarStatisticsByCameraIdApi({
getSelectQualityStatisticsNum(time) {
// if(time && time.length > 0 && time && (time[0] == time[1])) {
// time[0] = time[0] + ' 24:00:00'
// time[1] = time[1] + ' 23:59:59'
// }
getSelectQualityStatisticsNumApi({
projectSn: this.$store.state.projectSn,
inspectStartTime: time && time.length > 0 ? time[0] : "",
inspectEndTime: time && time.length > 0 ? time[1] : "",
}).then((res) => {
var carTypeList = res.result.carTypeList;
this.totalNum = res.result.totalnum;
var arr1 = [],
arr2 = [],
xData = [];
carTypeList.forEach((element) => {
xData.push(element.carTypeName);
arr1.push(element.innum);
arr2.push(element.outnum);
});
// this.createdAgeCharts(arr1, arr2, xData, this.$refs.carTypeChart, [
// this.$t('message.carManage.in'),
// this.$t('message.carManage.out'),
// ]);
if (res.code == 200) {
console.log('检查统计', res);
this.examineInfo = res.result;
if (this.examineInfoFlag) {
this.examineInfo2 = res.result;
this.radarCharts(this.$refs.radarCharts);
this.examineInfoFlag = false;
}
}
});
},
getCarPassRecordList() {
getCarPassRecordListApi({
getStatsByEnterprise(time) {
getStatsByEnterpriseApi({
projectSn: this.$store.state.projectSn,
type: 1,
pageNo: 1,
pageSize: 99999,
inspectTime_begin: time && time.length > 0 ? time[0] : "",
inspectTime_end: time && time.length > 0 ? time[1] : "",
}).then((res) => {
this.carCompareList = res.result;
setTimeout(() => {
this.$previewRefresh();
}, 100);
if (res.code == 200) {
console.log('分包单位', res);
this.enterpriseList = res.result.records;
this.barGraphCharts(this.$refs.BarGraphChartOne);
}
});
},
selectCarPassRecordInOutCount() {
selectCarPassRecordInOutCountApi({
//
getRiskChart() {
getRiskChartApi({
projectSn: this.$store.state.projectSn,
type: 1,
}).then((res) => {
var Data = res.result;
var arr1 = [],
arr2 = [],
xData = [];
Data.forEach((element) => {
xData.push(element.passTime);
arr1.push(element.innum);
arr2.push(element.outnum);
});
this.createdAgeCharts(arr1, arr2, xData, this.$refs.inOut24HoursChart, [
this.$t('message.carManage.in'),
this.$t('message.carManage.out'),
]);
if (res.code == 200) {
console.log('风险走势图', res);
this.riskList = res.result;
this.lineCharts(this.$refs.lineCharts);
// this.barGraphCharts(this.$refs.BarGraphChartOne);
}
});
},
//
getCountDangerLevel(time, isNotQualified, isOverdueRectification) {
getCountDangerLevelApi({
projectSn: this.$store.state.projectSn,
isNotQualified: isNotQualified,
isOverdueRectification: isOverdueRectification,
inspectTime_begin: time && time.length > 0 ? time[0] : "",
inspectTime_end: time && time.length > 0 ? time[1] : "",
}).then((res) => {
if (res.code == 200) {
console.log('隐患数量展示', res);
if (isOverdueRectification == 1) {
this.dangerLevelInfo1 = res.result;
this.annulusChart(this.$refs.annulusChartOne, res.result.data, 0, res.result.count);
} else {
this.dangerLevelInfo2 = res.result;
this.annulusChart(this.$refs.annulusChartTwo, res.result.data, 1, res.result.count);
}
// this.enterpriseList = res.result.records;
// this.barGraphCharts(this.$refs.BarGraphChartOne);
}
});
},
//
getcountQualityInspectionRecordRegion(time) {
getcountQualityInspectionRecordRegionApi({
projectSn: this.$store.state.projectSn,
enumType: this.inspectionRadio,
}).then((res) => {
if (res.code == 200) {
console.log('责任区域问题统计', res);
this.inspectionList = res.result;
this.barGraphFallCharts(this.$refs.barGraphFallCharts);
// this.barGraphCharts(this.$refs.BarGraphChartOne);
}
});
},
SizeChange(val) {
@ -282,7 +387,7 @@ export default {
xAxis: {
name: '分包单位', //X
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: this.enterpriseList.map(item => item.enterpriseName),
},
yAxis: {
name: '数量', //Y
@ -302,7 +407,7 @@ export default {
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
data: this.enterpriseList.map(item => item.totalNum),
type: 'bar',
barWidth: '20%',
color: "#268dff"
@ -312,6 +417,9 @@ export default {
};
ageChart.setOption(option);
window.addEventListener("resize", () => {
ageChart.resize();
})
},
//
radarCharts(el) {
@ -330,12 +438,30 @@ export default {
center: ['55%', '60%'],
// shape: 'circle',
indicator: [
{ name: '重大风险', max: 6500 },
{ name: '未闭合', max: 16000 },
{ name: '短期未关闭', max: 30000 },
{ name: '待整改', max: 38000 },
{ name: '待复查', max: 52000 },
{ name: '待核验', max: 25000 }
{
name: '排查记录',
max: parseInt(this.examineInfo2.investigateNum) + 10,
},
{
name: '未闭合',
max: parseInt(this.examineInfo2.notCloseNum) + 10,
},
{
name: '超期未关闭',
max: parseInt(this.examineInfo2.overdueNotCloseNum) + 10,
},
{
name: '待整改',
max: parseInt(this.examineInfo2.rectificationNum) + 10,
},
{
name: '待复查',
max: parseInt(this.examineInfo2.reviewNum) + 10,
},
{
name: '待核验',
max: parseInt(this.examineInfo2.verificationNum) + 10,
},
]
},
tooltip: {
@ -350,7 +476,13 @@ export default {
},
data: [
{
value: [4200, 3000, 20000, 35000, 50000, 18000],
value: [
this.examineInfo2.investigateNum,
this.examineInfo2.notCloseNum,
this.examineInfo2.overdueNotCloseNum,
this.examineInfo2.rectificationNum,
this.examineInfo2.reviewNum,
this.examineInfo2.verificationNum],
name: '安全检查',
itemStyle: { //
color: 'rgba(84,112,198,1)',
@ -361,11 +493,14 @@ export default {
]
};
ageChart.setOption(option);
window.addEventListener("resize", () => {
ageChart.resize();
})
},
// 线
lineCharts(el) {
let ageChart = echarts.init(el);
let option = {
tooltip: {
trigger: 'axis'
@ -390,7 +525,7 @@ export default {
name: '月份', //X
type: 'category',
boundaryGap: false,
data: ['2023-11', '2023-12', '2024-01', '2024-02', '2024-03', '2024-04', '2024-05']
data: this.riskList.map(item => item.yearMonth),
},
yAxis: {
name: '数量', //Y
@ -422,7 +557,7 @@ export default {
name: '全部',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210],
data: this.riskList.map(item => item.dangerNum),
itemStyle: { //
color: 'rgba(5,193,179,1)',
},
@ -433,7 +568,7 @@ export default {
name: '重大风险',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310],
data: this.riskList.map(item => item.greatFaultLevelNum),
itemStyle: { //
color: 'rgba(255,0,0,1)',
},
@ -444,7 +579,7 @@ export default {
name: '较大风险',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410],
data: this.riskList.map(item => item.largerRiskNum),
itemStyle: { //
color: 'rgba(255,153,1,1)',
},
@ -455,7 +590,7 @@ export default {
name: '一般风险',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320],
data: this.riskList.map(item => item.generalRiskNum),
itemStyle: { //
color: 'rgba(255,255,2,1)',
},
@ -466,7 +601,7 @@ export default {
name: '低风险',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320],
data: this.riskList.map(item => item.lowRiskNum),
itemStyle: { //
color: 'rgba(0,0,255,1)',
},
@ -476,13 +611,16 @@ export default {
]
};
ageChart.setOption(option);
window.addEventListener("resize", () => {
ageChart.resize();
})
},
//
annulusChart(el) {
annulusChart(el, data, flag, count) {
let ageChart = echarts.init(el);
let option = {
title: {
subtext: '超期未销项\n9个',//
subtext: `${flag == 0 ? '超期未整改' : '未消项'}\n${count}`,//
left: 'center',
top: '40%',
subtextStyle: {
@ -540,16 +678,25 @@ export default {
show: true,
length: 15, // 线
},
data: [
{ value: 0, name: '重大隐患超期未整改' },
{ value: 735, name: '严重隐患超期未整改' },
{ value: 580, name: '其它隐患超期未整改' },
{ value: 484, name: '一般隐患超期未整改' },
]
data: data.map(item => {
return {
value: item.count,
name: item.name
}
})
// [
// { value: 0, name: '' },
// { value: 735, name: '' },
// { value: 580, name: '' },
// { value: 484, name: '' },
// ]
}
]
};
ageChart.setOption(option);
window.addEventListener("resize", () => {
ageChart.resize();
})
},
//
barGraphFallCharts(el) {
@ -589,7 +736,7 @@ export default {
},
yAxis: {
type: 'category',
data: ['三期一号楼', '研发楼', '10号楼', '3#办公楼', '1号楼'],
data: this.inspectionList.map(item => item.x),
axisTick: {
//
show: false,
@ -602,7 +749,7 @@ export default {
},
series: [
{
data: [120, 200, 150, 80, 70],
data: this.inspectionList.map(item => item.y),
type: 'bar',
barWidth: '35%',
color: "#268dff"
@ -612,93 +759,9 @@ export default {
};
ageChart.setOption(option);
},
//---
createdAgeCharts(arr1, arr2, xData, el, legendData) {
console.log(arr1, arr2, xData, el, legendData);
let that = this;
let ageChart = echarts.init(el);
// ageChart.clear();
let option = {
grid: {
top: 40,
left: 20,
bottom: 0,
right: 20,
containLabel: true,
},
color: ["#5181F6", "#61D2B9"],
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
show: true,
align: "left",
top: 5,
left: 20,
itemWidth: 13,
itemHeight: 5,
textStyle: {
color: "#9fa2ad",
},
},
xAxis: [
{
type: "category",
data: xData,
boundaryGap: true,
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
color: "#9fa2ad",
fontSize: 12,
},
},
],
yAxis: {
type: "value",
axisTick: {
show: false,
},
axisLine: {
show: false,
},
splitLine: {
lineStyle: {
type: "dashed",
color: "rgba(231, 233, 243, 0.5)",
},
},
axisLabel: {
color: "#9fa2ad",
},
},
series: [
{
name: legendData[0],
type: "bar",
data: arr1,
barWidth: 14,
barGap: 0.1,
},
{
name: legendData[1],
type: "bar",
data: arr2,
barWidth: 14,
},
],
};
ageChart.setOption(option);
window.addEventListener("resize", () => {
ageChart.resize();
})
},
},
};