代码提交

This commit is contained in:
lixiaobang 2023-03-28 10:53:02 +08:00
parent 262ec2866e
commit 30dfd2c45e
10 changed files with 1799 additions and 1463 deletions

View File

@ -118,3 +118,39 @@ export const getCameraHistory = (params) => {
{params},
)
};
//安全检查统计
export const getCheckTotalCensus = (params) => {
return axios.get('api/ems-third-party-service/project/checkTotalCensus',
{params},
)
};
//检查次数统计
export const getCheckTimesCensus = (params) => {
return axios.get('api/ems-third-party-service/project/checkTimesCensus',
{params},
)
};
//隐患检查统计
export const getResolveTroubleCensus = (params) => {
return axios.get('api/ems-third-party-service/project/resolveTroubleCensus',
{params},
)
};
// //高频问题项
export const getMostTroubleCensus = (params) => {
return axios.get('api/ems-third-party-service/project/mostTroubleCensus',
{params},
)
};
//安全告警统计
export const getWarnSurveillance = (params) => {
return axios.get('api/ems-third-party-service/project/warnSurveillance',
{params},
)
};
//隐患整改记录
// export const getMostTroubleCensus = (params) => {
// return axios.get('api/ems-third-party-service/project/mostTroubleCensus',
// {params},
// )
// };

View File

@ -7,7 +7,7 @@
width="100%"
height="100%"
></Chart>
<div class="lineBox"></div>
<!-- <div class="lineBox"></div> -->
</div>
</template>
<script>
@ -20,10 +20,10 @@ export default {
default: ''
},
//
chartData: {
type: Array,
required: true
},
// chartData: {
// type: Array,
// required: true
// },
colorArray: {
type: Array,
default: () => {
@ -52,6 +52,10 @@ export default {
yAxisPadding: {
type: Array,
default: null
},
checkCountList:{
type:Array,
default:null
}
},
@ -68,9 +72,15 @@ export default {
watch: {
// Echarts
chartData: {
// chartData: {
// deep: true,
// handler () {
// this.resetOption()
// }
// },
checkCountList:{
deep: true,
handler () {
handler (newVal) {
this.resetOption()
}
}
@ -99,6 +109,12 @@ export default {
}
},
option () {
let dataX = [] //X
let dataY = [] //Y
this.checkCountList.forEach((item,index) => {
dataX.push(item.time)
dataY.push(item.count)
});
const self = this
return {
tooltip: {
@ -145,7 +161,7 @@ export default {
},
triggerEvent: true,
type: 'category',
data: this.xAxisData
data: dataX
},
yAxis: {
name: '次数',
@ -183,7 +199,7 @@ export default {
series: [
{
name:'检查次数',
data: this.chartData,
data: dataY,
type: 'line',
color:'#76E679'
},

View File

@ -11,10 +11,14 @@ const MAX_LABEL = 8
export default {
props: {
//
chartData: {
type: Array,
required: true
},
// chartData: {
// type: Array,
// required: true
// },
highIssues:{
type:Array,
default:null
}
},
components: {
Chart
@ -45,7 +49,13 @@ export default {
watch: {
// Echarts
chartData: {
// chartData: {
// deep: true,
// handler() {
// this.resetOption()
// }
// },
highIssues:{
deep: true,
handler() {
this.resetOption()
@ -55,6 +65,12 @@ export default {
computed: {
option() {
let dataX= [] //
let dataY = [] //
this.highIssues.forEach((item,index) => {
dataX.push(item.name)
dataY.push(item.count)
});
const self = this
return {
tooltip: {
@ -131,14 +147,13 @@ export default {
padding: [-20, 0, 14, 0],
},
},
data:['焊接:','现场作业准备及布置:','保护接地或接零:','建筑用电:','电缆沟挖方:',],
data:dataX,
triggerEvent: true,
}
],
series: [
{
data: this.list,
data: dataY,
type: 'bar',
barWidth: 16,
barGap: '-30%',

View File

@ -1,7 +1,7 @@
<template>
<div style="width:100%;height:100%;">
<div ref="chart" style="width:100%;height:100%;"></div>
<!-- <div class="boxPeople aa">
<div style="width: 100%; height: 100%">
<div ref="chart" style="width: 100%; height: 100%"></div>
<!-- <div class="boxPeople aa">
<div class="name" style="color: #F2DA8D;">施工工作组</div>
<div class="nucm" style="color: #F9EBBD;font-weight: bold;font-size: 24px; ">33<span style=" font-size: 14px; color: #F2DA8D;"></span></div>
</div>
@ -17,173 +17,178 @@
<div class="name" style="color: #53E3FF">项目监理组</div>
<div class="nucm" style="color: #E3FAFF;font-weight: bold;font-size: 24px; ">33<span style=" font-size: 14px; color: #53E3FF;"></span></div>
</div> -->
</div>
</div>
</template>
<script>
import { List } from 'echarts/lib/export'
import giftImageUrl from '../../assets/pic/circle.png'
export default {
props: {
picIsShow: {
type: Boolean,
default: true
},
colorList: {
type: Array,
default(){
return ['#00A572', '#008AA4', '#7968D9', '#C7A73E']
}
},
projectUser:{
type:Array,
default: []
}
import { List } from "echarts/lib/export";
import giftImageUrl from "../../assets/pic/circle.png";
export default {
props: {
picIsShow: {
type: Boolean,
default: true,
},
colorList: {
type: Array,
default() {
return ["#00A572", "#008AA4", "#7968D9", "#C7A73E", "rgb(28,241,235)"];
},
},
projectUser: {
type: Array,
default: [],
},
},
components: {
},
components: {},
data() {
return {}
},
mounted() {
},
watch: {
// Echarts
chartData: {
deep: true,
handler() {
this.resetOption()
}
data() {
return {};
},
mounted() {},
watch: {
// Echarts
chartData: {
deep: true,
handler() {
this.resetOption();
},
projectUser: {
deep: true,
handler(newVal) {
this.initCharts(newVal)
}
}
},
methods: {
initCharts(value) {
let myChart = this.$echarts.init(this.$refs.chart)
var val1data2 = [{
projectUser: {
deep: true,
handler(newVal) {
this.initCharts(newVal);
},
},
},
methods: {
initCharts(value) {
let myChart = this.$echarts.init(this.$refs.chart);
var val1data2 = [
{
value: 33,
name: '电工',
name: "电工",
},
{
value: 13,
name: '项目监理组',
name: "项目监理组",
},
{
value: 14,
name: '土建专工',
name: "土建专工",
},
{
value: 43,
name: '架子工',
}
]
val1data2 = Object.keys(value).map((item,index)=>{
return {name:value[item].groupName,value:value[item].number}
})
var arr = ['middleLost', 0.6, val1data2, '今日完成进度']
//
myChart.setOption({
tooltip:{
trigger:'item',
formatter: '{b}{c}',
name: "架子工",
},
graphic: {
elements: [{
type: 'image',//,image,, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
style: {
image: this.picIsShow ? giftImageUrl : '', //
width: 120,
height: 120
},
left: '161',//
top: '97' //
}]
},
series: [
];
val1data2 = Object.keys(value).map((item, index) => {
return { name: value[item].groupName, value: value[item].number };
});
var arr = ["middleLost", 0.6, val1data2, "今日完成进度"];
//
myChart.setOption({
backgroundColor: "rgba(255,255,255,0)",
tooltip: {
trigger: "item",
formatter: "{b}{c}",
},
graphic: {
elements: [
{
type: 'pie',
radius: this.picIsShow ? ['53%', '65%'] : ['60%', '60%'],
center: ['50%', '157'],
color: this.colorList,
hoverAnimation: true, /// /
label: {
show: true,
formatter: '{b}{c}',
rich: {
d: {
color: '#fff',
fontSize: 25,
// lineHeight: 24,
height: 24,
},
c: {
color: "red",
fontSize: 25,
// lineHeight: 20,
align: 'left',
}
type: "image", //,image,, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
style: {
image: this.picIsShow ? giftImageUrl : "", //
width: 120,
height: 120,
},
left: "161", //
top: "97", //
},
],
},
series: [
{
type: "pie",
radius: this.picIsShow ? ["53%", "65%"] : ["60%", "60%"],
center: ["50%", "157"],
color: this.colorList,
hoverAnimation: true, /// /
label: {
show: true,
formatter: "{b|{b}}{c|{c}}人",
rich: {
b: {
fontSize: 15,
lineHeight: 33,
},
c: {
fontSize: 25,
lineHeight: 22,
align: "center",
opacity: 0.1
},
position: '',
},
labelLine: {
normal: {
show: false
}
textStyle: {
fontSize: 15,
},
itemStyle: { //
normal: {
borderWidth: 2,
borderColor: '#fff'
}
position: "",
},
labelLine: {
normal: {
show: false,
},
data: arr[2]
}
]
})
}
}
}
</script>
},
// itemStyle: { //
// normal: {
// borderWidth: 2,
// borderColor: 'rgba(255,255,255,0.7)'
// }
// },
itemStyle: {
borderRadius: 2,
borderColor: "rgb(255,255,255)",
borderWidth: 2,
},
data: arr[2],
},
],
});
},
},
};
</script>
<style scoped lang="scss">
.dd{
top: 214px;
right: 17px;
}
.cc{
top: 214px;
left: 34px;
}
.aa{
top: 66px;
left: 33px;
}
.bb{
top: 52px;
right: 44px;
}
.dd {
top: 214px;
right: 17px;
}
.cc {
top: 214px;
left: 34px;
}
.aa {
top: 66px;
left: 33px;
}
.bb {
top: 52px;
right: 44px;
}
.boxPeople{
position: absolute;
display: flex;
align-items: center;
.nucm{
font-size: 20px;
font-weight: 700;
}
.name{
font-size: 14px;
font-weight: 500;
}
.boxPeople {
position: absolute;
display: flex;
align-items: center;
.nucm {
font-size: 20px;
font-weight: 700;
}
</style>
.name {
font-size: 14px;
font-weight: 500;
}
}
</style>

View File

@ -105,27 +105,25 @@ export default {
hoverAnimation: true, /// /
label: {
show: true,
formatter: '{b}{c}%',
padding:[0,10,0,50],
formatter: '{b|{b}}:{c|{c}}%',
padding:[0,0,0,0],
itemStyle: { //
normal: {
borderWidth: 2,
borderColor: '#52FFC1'
}
},
rich: {
d: {
color: '#fff',
fontSize: 20,
lineHeight: 24,
height: 24
rich: {
b: {
fontSize: 15,
lineHeight: 33,
},
c: {
color: "red",
fontSize: 20,
lineHeight: 20,
align: 'left',
}
fontSize: 18,
lineHeight: 22,
align: "center",
opacity: 0.1
},
},
position: '',
},

View File

@ -92,19 +92,17 @@ export default {
borderColor: "#52FFC1",
},
},
formatter: "{b}{c}%",
rich: {
d: {
color: "#fff",
fontSize: 20,
lineHeight: 24,
height: 24,
formatter: "{b|{b}}{c|{c}}%",
rich: {
b: {
fontSize: 15,
lineHeight: 33,
},
c: {
color: "red",
fontSize: 20,
lineHeight: 20,
align: "left",
fontSize: 18,
lineHeight: 22,
align: "center",
opacity: 0.1
},
},
position: "",

View File

@ -1,266 +1,354 @@
<template>
<div style="position: relative">
<Chart ref="chart" :chartOption="option" :className="className" width="100%" height="100%"
></Chart>
<div class="lineBox"></div>
</div>
<div style="position: relative">
<Chart
ref="chart"
:chartOption="option"
:className="className"
width="100%"
height="100%"
></Chart>
<!-- <div class="lineBox"></div> -->
</div>
</template>
<script>
import Chart from '../chart.vue'
const MAX_LABEL = 8
import Chart from "../chart.vue";
const MAX_LABEL = 8;
export default {
props: {
className: {
type: String,
default: ''
},
//
chartData: {
type: Array,
required: true
},
chartData2: {
type: Array,
required: true
},
chartData3: {
type: Array,
required: true
},
colorArray: {
type: Array,
default: () => {
return ['#84F5DE', '#56E8F2', '#4CC5F8']
}
},
yAxisName: {
type: String,
default: ''
},
// x
xAxisData: {
type: Array,
default: () => {
return []
}
},
tooltipFormatter: {
type: Function | String,
default: null
},
yAxisPosition: {
type: String,
default: 'left'
},
yAxisPadding: {
type: Array,
default: null
}
props: {
className: {
type: String,
default: "",
},
components: {
Chart
//
chartData: {
type: Array,
required: true,
},
data() {
return {
tipStyle: { visibility: 'hidden', position: 'absolute', top: 0, left: 0 },
tipContent: ''
}
chartData2: {
type: Array,
required: true,
},
watch: {
// Echarts
chartData: {
deep: true,
handler() {
this.resetOption()
}
}
chartData3: {
type: Array,
required: true,
},
colorArray: {
type: Array,
default: () => {
return ["#84F5DE", "#56E8F2", "#4CC5F8"];
},
},
yAxisName: {
type: String,
default: "",
},
// x
xAxisData: {
type: Array,
default: () => {
return [];
},
},
tooltipFormatter: {
type: Function | String,
default: null,
},
yAxisPosition: {
type: String,
default: "left",
},
yAxisPadding: {
type: Array,
default: null,
},
safeList: {
type: Array,
default: null,
},
},
computed: {
option() {
const self = this
return {
tooltip: {
trigger: "axis",
axisPointer: {
components: {
Chart,
},
data() {
return {
tipStyle: { visibility: "hidden", position: "absolute", top: 0, left: 0 },
tipContent: "",
};
},
watch: {
// Echarts
// chartData: {
// deep: true,
// handler() {
// this.resetOption()
// }
// },
safeList: {
deep: true,
handler() {
this.resetOption();
},
},
},
computed: {
option() {
let dataX = [];
let equipment = []; //
let fire = []; //
let gas = []; //
let power = []; //
let water = []; //
this.safeList.forEach((item, index) => {
dataX.push(item.time);
equipment.push(item.equipment);
fire.push(item.fire);
gas.push(item.gas);
power.push(item.power);
water.push(item.water);
});
const self = this;
return {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
label: {
show: false
}
}
},
title: {
textStyle: {
fontSize: 18,
fontWeight: 'bold',
color: '#1EBBFC'
}
},
legend: { //
left: '97',
y: 63,
itemHeight: 12,
data: ['人员安全', '环境安全','设备安全'],
textStyle: {
fontSize: 12, //
color: ['#66D19B','#ECBF00','#00C1F0'], //
}
},
grid: {
left: '26',
right: '26',
bottom: '33',
top:'103',
containLabel: true
},
xAxis: {
axisLine: {
// x线
show: true,
lineStyle: {
color: '#fff',
height: 0
}
},
axisTick: {
show: false
},
axisLabel: {
interval: 0, //
margin: 6, // 线
align: 'center',
fontSize: 13, //
color: '#bde9e4', //
},
triggerEvent: true,
type: 'category',
data: this.xAxisData
},
yAxis: {
name: ['次数'],
type: 'value',
position: this.yAxisPosition || null,
nameTextStyle: {
color: '#64D5CD',
padding: this.yAxisPadding || [0, 28, 2, 0],
fontSize: 12,
opacity: 0.5
},
axisLine: {
show: true,
lineStyle: {
color: 'white'
}
},
splitLine: {
// 线
show: false,
lineStyle: {
color: '#078DF0',
opacity: 0.3
}
},
axisLabel: {
color: '#bde9e4',
fontSize: 14,
opacity: 0.5
},
axisTick: {
show: false
},
},
series: [
{
name: '人员安全',
data: this.chartData,
type: 'bar',
barWidth: 12,
itemStyle: {
normal: {
color: {
type: 'bar',
colorStops: [{
offset: 0,
color: '#6FD8A5' // 0%
}, {
offset: 1,
color: '#3CB06C' // 100%
}],
globalCoord: false, // false
}
},
},
},
{
name: '环境安全',
data: this.chartData2,
type: 'bar',
barWidth: 12,
itemStyle: {
normal: {
color: {
type: 'bar',
colorStops: [{
offset: 0,
color: '#EFC500' // 0%
}, {
offset: 1,
color: '#DA9300' // 100%
}],
globalCoord: false, // false
}
},
},
},
{
name: '设备安全',
data: this.chartData3,
type: 'bar',
barWidth: 12,
itemStyle: {
normal: {
color: {
type: 'bar',
colorStops: [{
offset: 0,
color: '#00C4F1' // 0%
}, {
offset: 1,
color: '#0091DF' // 100%
}],
globalCoord: false, // false
}
},
},
}
]
}
}
},
methods: {
resetOption() {
this.$refs.chart.setOption(this.option)
show: false,
},
},
},
title: {
textStyle: {
fontSize: 18,
fontWeight: "bold",
color: "#1EBBFC",
},
},
legend: {
//
left: "97",
y: 63,
itemHeight: 12,
data: ["用电告警", "消防告警", "给水告警", "设备告警", "耗气告警"],
textStyle: {
fontSize: 12, //
color: [
"#66D19B",
"#ECBF00",
"#00C1F0",
"rgb(236,218,75)",
"rgb(190,109,254)",
], //
},
},
grid: {
left: "26",
right: "26",
bottom: "33",
top: "103",
containLabel: true,
},
xAxis: {
axisLine: {
// x线
show: true,
lineStyle: {
color: "#fff",
height: 0,
},
},
axisTick: {
show: false,
},
axisLabel: {
interval: 0, //
margin: 10, // 线
align: "center",
fontSize: 13, //
color: "#bde9e4", //
},
// triggerEvent: true,
type: "category",
data: dataX,
},
yAxis: {
name: ["次数"],
type: "value",
position: this.yAxisPosition || null,
nameTextStyle: {
color: "#64D5CD",
padding: this.yAxisPadding || [0, 28, 2, 0],
fontSize: 12,
opacity: 0.5,
},
axisLine: {
show: true,
lineStyle: {
color: "white",
},
},
splitLine: {
// 线
show: false,
lineStyle: {
color: "#078DF0",
opacity: 0.3,
},
},
axisLabel: {
color: "#bde9e4",
fontSize: 14,
opacity: 0.5,
},
axisTick: {
show: false,
},
},
series: [
{
name: "用电告警",
data: power,
type: "bar",
barWidth: 12,
itemStyle: {
normal: {
color: {
type: "bar",
colorStops: [
{
offset: 0,
color: "#6FD8A5", // 0%
},
{
offset: 1,
color: "#3CB06C", // 100%
},
],
globalCoord: false, // false
},
},
},
},
{
name: "消防告警",
data: fire,
type: "bar",
barWidth: 12,
itemStyle: {
normal: {
color: {
type: "bar",
colorStops: [
{
offset: 0,
color: "#EFC500", // 0%
},
{
offset: 1,
color: "#DA9300", // 100%
},
],
globalCoord: false, // false
},
},
},
},
{
name: "给水告警",
data: water,
type: "bar",
barWidth: 12,
itemStyle: {
normal: {
color: {
type: "bar",
colorStops: [
{
offset: 0,
color: "#00C4F1", // 0%
},
{
offset: 1,
color: "#0091DF", // 100%
},
],
globalCoord: false, // false
},
},
},
},
{
name: "设备告警",
data: equipment,
type: "bar",
barWidth: 12,
itemStyle: {
normal: {
color: {
type: "bar",
colorStops: [
{
offset: 0,
color: "rgb(236,218,75)", // 0%
},
{
offset: 1,
color: "rgb(236,218,75)", // 100%
},
],
globalCoord: false, // false
},
},
},
},
{
name: "耗气告警",
data: gas,
type: "bar",
barWidth: 12,
itemStyle: {
normal: {
color: {
type: "bar",
colorStops: [
{
offset: 0,
color: "rgb(190,109,254)", // 0%
},
{
offset: 1,
color: "rgb(190,109,254)", // 100%
},
],
globalCoord: false, // false
},
},
},
},
],
};
},
},
}
}
methods: {
resetOption() {
this.$refs.chart.setOption(this.option);
},
},
};
</script>
<style scoped>
.lineBox{
height: 14px;
position: absolute;
top: 89px;
left: 50px;
border-left: 1px solid #fff;
.lineBox {
height: 14px;
position: absolute;
top: 89px;
left: 50px;
border-left: 1px solid #fff;
}
</style>

View File

@ -34,7 +34,7 @@ class mqttHandle {
//配置链接
const { host, port, endpoint, ...options } = this.connect;
console.log("this.connect.host",this.connect.host)
const connectUrl = 'ws://172.16.1.51:7788/';
const connectUrl = 'ws://175.27.191.156:10083/mgtt';
// const connectUrl = `ws://${this.connect.host}:${this.connect.port}`;
// if (!client.connected) {
// client.on('connect', function () {

File diff suppressed because it is too large Load Diff

View File

@ -71,6 +71,9 @@
</template>
<script>
import {
getMostTroubleCensus
} from "../api/api";
export default {
components: {},
props: {},
@ -114,7 +117,15 @@ export default {
},
},
methods: {
getData(){
getMostTroubleCensus({
projectId: sessionStorage.getItem("projectId"),
// size:10,
// current:1
}).then((res) => {
console.log(res.data,'==================');
});
},
changePage(index) {
if (index == 1) {
this.$refs.carousel.prev()
@ -145,16 +156,18 @@ export default {
//
this.setTimer();
},
mounted() { },
mounted() {
this.getData()
},
};
</script>
<style scoped lang="less">
@marginLeft:50px;
.home {
display: flex;
align-items: center;
margin-left: 49px;
margin-left: @marginLeft;
.boxChild {
display: flex;
@ -247,11 +260,16 @@ export default {
// }
// }
// }
}
</style>
<style>
.el-carousel__arrow--left,
.el-carousel__arrow--right {
display: none;
}
.el-carousel__container {
position: relative;
height: 180px !important;
}
</style>