2022-08-08 19:02:56 +08:00
|
|
|
<template>
|
|
|
|
|
<!-- 出勤统计 -->
|
|
|
|
|
<Card :title="title">
|
|
|
|
|
<div class="contents">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="point"></div>
|
|
|
|
|
<span class="smallTit">工种出勤统计</span>
|
|
|
|
|
<div class="box">
|
2022-08-09 13:58:24 +08:00
|
|
|
<div class="outBox" v-for="(item,index) in workerTypeList" :key="index">
|
|
|
|
|
<span class="name">{{item.typeName}}</span>
|
|
|
|
|
<p class="num">{{item.workerNum}}</p>
|
2022-08-08 19:02:56 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="point botBox"></div>
|
|
|
|
|
<span class="smallTit">企业出勤排名</span>
|
|
|
|
|
<div class="topTit">
|
|
|
|
|
<div class="blue"></div>
|
|
|
|
|
<span>在场</span>
|
|
|
|
|
<div class="purple"></div>
|
|
|
|
|
<span>总人数</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-08-16 15:07:58 +08:00
|
|
|
<div class="companyChart" ref="companyChart"></div>
|
2022-08-08 19:02:56 +08:00
|
|
|
</Card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import Card from "../components/Card.vue";
|
2022-08-16 15:07:58 +08:00
|
|
|
import echarts from 'echarts4';
|
|
|
|
|
import { selectProjectWorkerTypeTotalListApi,selectProjectComapnyWorkTotalListApi } from "@/assets/js/api/dataBoard.js";
|
2022-08-08 19:02:56 +08:00
|
|
|
export default {
|
2022-08-16 15:07:58 +08:00
|
|
|
components: { Card, },
|
2022-08-08 19:02:56 +08:00
|
|
|
props: {
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: "default title"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-08-09 13:58:24 +08:00
|
|
|
workerTypeList: [],
|
2022-08-08 19:02:56 +08:00
|
|
|
};
|
2022-08-09 13:58:24 +08:00
|
|
|
},
|
2022-08-09 15:08:09 +08:00
|
|
|
created() {
|
2022-08-09 13:58:24 +08:00
|
|
|
this.getWokerType();
|
|
|
|
|
},
|
2022-08-16 15:07:58 +08:00
|
|
|
mounted(){
|
|
|
|
|
this.getComapnyWorkList();
|
|
|
|
|
},
|
2022-08-09 15:08:09 +08:00
|
|
|
methods: {
|
2022-08-09 13:58:24 +08:00
|
|
|
//获取工种出勤统计
|
|
|
|
|
getWokerType() {
|
|
|
|
|
selectProjectWorkerTypeTotalListApi({
|
2022-08-09 15:08:09 +08:00
|
|
|
projectSn: this.$store.state.projectSn
|
|
|
|
|
}).then(res => {
|
2022-08-09 13:58:24 +08:00
|
|
|
console.log(res);
|
|
|
|
|
this.workerTypeList = res.result;
|
|
|
|
|
});
|
2022-08-16 15:07:58 +08:00
|
|
|
},
|
|
|
|
|
//获取企业列表
|
|
|
|
|
getComapnyWorkList() {
|
|
|
|
|
selectProjectComapnyWorkTotalListApi({
|
|
|
|
|
projectSn: this.$store.state.projectSn,
|
|
|
|
|
type: 1,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
var Data = res.result;
|
|
|
|
|
var xData = [],
|
|
|
|
|
yData1 = [],
|
|
|
|
|
yData2 = [];
|
|
|
|
|
Data.forEach((element) => {
|
|
|
|
|
xData.push(element.enterpriseName);
|
|
|
|
|
yData1.push(element.attendancePersonNum);
|
|
|
|
|
yData2.push(element.totalPersonNum);
|
|
|
|
|
});
|
|
|
|
|
this.createdBarCharts(xData, yData1, yData2, this.$refs.companyChart ,["在场","总人数"] );
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//年龄结构---图表
|
|
|
|
|
createdBarCharts(xData, yData1, yData2, el, legendData) {
|
|
|
|
|
let that = this;
|
|
|
|
|
let ageChart = echarts.init(el);
|
|
|
|
|
let option = {
|
|
|
|
|
grid: {
|
|
|
|
|
top: 20,
|
|
|
|
|
left: 0,
|
|
|
|
|
bottom: 5,
|
|
|
|
|
right: 20,
|
|
|
|
|
containLabel: true,
|
|
|
|
|
},
|
|
|
|
|
color: ["#5CE2F6", "#5181F6"],
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: "shadow",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
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.2)",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
axisLabel: {
|
|
|
|
|
color: "#9fa2ad",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: legendData[0],
|
|
|
|
|
type: "bar",
|
|
|
|
|
data: yData1,
|
|
|
|
|
barWidth: 14,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: legendData[1],
|
|
|
|
|
type: "bar",
|
|
|
|
|
data: yData2,
|
|
|
|
|
barWidth: 14,
|
|
|
|
|
barGap: 0.1,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ageChart.setOption(option);
|
|
|
|
|
},
|
2022-08-08 19:02:56 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.contents {
|
|
|
|
|
margin: 20px 0px 20px 30px;
|
|
|
|
|
|
|
|
|
|
.point {
|
|
|
|
|
width: 8px;
|
|
|
|
|
height: 8px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background-color: #5be1f5;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
.smallTit {
|
|
|
|
|
color: #51cadd;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
}
|
|
|
|
|
.box {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-flow: wrap;
|
2022-08-09 13:58:24 +08:00
|
|
|
justify-content: left;
|
2022-08-08 19:02:56 +08:00
|
|
|
align-items: center;
|
|
|
|
|
width: 95%;
|
2022-08-09 13:58:24 +08:00
|
|
|
height: 170px;
|
|
|
|
|
margin-left: 3%;
|
2022-08-08 19:02:56 +08:00
|
|
|
margin-top: 2%;
|
2022-08-09 13:58:24 +08:00
|
|
|
overflow: auto;
|
|
|
|
|
|
2022-08-09 15:08:09 +08:00
|
|
|
.outBox {
|
|
|
|
|
width: 33%;
|
|
|
|
|
height: 33%;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
.name {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
height: 50px;
|
|
|
|
|
width: 35%;
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
margin-right: 35px;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
.num {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 30%;
|
|
|
|
|
height: 40px;
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #4fc5d9;
|
|
|
|
|
background-image: url(~@/assets/images/projectImg/numBgc.png);
|
|
|
|
|
background-size: 100%;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
}
|
2022-08-08 19:02:56 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.botBox {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
.topTit {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #5d6674;
|
|
|
|
|
.blue,
|
|
|
|
|
.purple {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 15px;
|
|
|
|
|
height: 5px;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
margin-left: 30px;
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
background-color: #5be2f6;
|
|
|
|
|
}
|
|
|
|
|
.purple {
|
|
|
|
|
background-color: #5181f7;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-09 13:58:24 +08:00
|
|
|
::-webkit-scrollbar {
|
2022-08-09 15:08:09 +08:00
|
|
|
width: 3px;
|
|
|
|
|
color: #636364;
|
2022-08-09 13:58:24 +08:00
|
|
|
}
|
2022-08-16 15:07:58 +08:00
|
|
|
.companyChart{
|
|
|
|
|
margin-left: 5%;
|
|
|
|
|
width: 90%;
|
|
|
|
|
height: 40%;
|
|
|
|
|
}
|
2022-08-08 19:02:56 +08:00
|
|
|
</style>
|
|
|
|
|
|