中建四(安全管理):人员增长趋势接口对接

This commit is contained in:
骆乐 2022-09-19 10:21:18 +08:00
parent 6fed0ef976
commit 5608634878
4 changed files with 130 additions and 74 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -45,8 +45,8 @@ export default new Vuex.Store({
// UPLOADURL:'http://10.0.1.43:6023/upload/image',//测试
// FILEURL:'http://10.0.1.43:6023/image/',//测试
BASEURL: baseUrl ? baseUrl : window.location.protocol + '//' + window.location.host + '/', //
// UPLOADURL: window.location.protocol + '//' + window.location.host + '/upload/image', //
// FILEURL: window.location.protocol + '//' + window.location.host + '/image/', //测试 // tag: 本地测试接口
UPLOADURL: window.location.protocol + '//' + window.location.host + '/upload/image', //
FILEURL: window.location.protocol + '//' + window.location.host + '/image/', //测试 // tag: 本地测试接口
/* 2022-05-16 */
// tag: 部署河南项目时,需要打开这两行代码
// UPLOADURL: 'http://124.71.178.44:100/upload/image',
@ -56,8 +56,8 @@ export default new Vuex.Store({
// UPLOADURL: 'http://182.90.224.237:7000/upload/image',
// FILEURL: 'http://182.90.224.237:7000/image/',
// 邱平毅的
UPLOADURL: 'http://192.168.34.216:6023/upload/image',
FILEURL: 'http://192.168.34.216:6023/image/',
// UPLOADURL: 'http://192.168.34.216:6023/upload/image',
// FILEURL: 'http://192.168.34.216:6023/image/',
// UPLOADURL:'http://'+"61.190.32.219:9050"+'/upload/image',//正式
// FILEURL:'http://'+"61.190.32.219:9050"+'/image/',//正式

View File

@ -55,7 +55,7 @@ export default {
return {
//
pollingData: {
rectificationNum: '', //
rectificationNum: undefined, //
totalNum: undefined, //
closeRatio: undefined, //
days: undefined, //

View File

@ -4,35 +4,35 @@
<div class="topbox">
<div class="item">
<span>总人数</span>
<p>{{WorkerNum.sumNumber}}</p>
<p>{{ WorkerNum.sumNumber }}</p>
</div>
<div class="item">
<span>实际出勤人数</span>
<p>{{WorkerNum.attendanceNumber}}</p>
<p>{{ WorkerNum.attendanceNumber }}</p>
</div>
<div class="item">
<span>未出勤人数</span>
<p>{{WorkerNum.noAttendanceNumber}}</p>
<p>{{ WorkerNum.noAttendanceNumber }}</p>
</div>
<div class="item">
<span>实名制人数</span>
<p>{{WorkerNum.realNameNumber}}</p>
<p>{{ WorkerNum.realNameNumber }}</p>
</div>
<div class="item margin">
<span>入职培训人数</span>
<p>{{WorkerNum.inductionTrainingNumber}}</p>
<p>{{ WorkerNum.inductionTrainingNumber }}</p>
</div>
<div class="item margin">
<span>特殊工种人数</span>
<p>{{WorkerNum.specialNumber}}</p>
<p>{{ WorkerNum.specialNumber }}</p>
</div>
<div class="item margin">
<span>普通工种人数</span>
<p>{{WorkerNum.commonNumber}}</p>
<p>{{ WorkerNum.commonNumber }}</p>
</div>
<div class="item margin">
<span>管理人员人数</span>
<p>{{WorkerNum.managerNumber}}</p>
<p>{{ WorkerNum.managerNumber }}</p>
</div>
</div>
<div class="bunbox">
@ -47,7 +47,12 @@
value-format="yyyy-MM-DD"
@change="getTime1"
></el-date-picker>
<JBarChart :tooltip="{}" :xData="xData" :series="series" :grid="grid" />
<JBarChart
:tooltip="{}"
:xData="xData"
:series="series"
:grid="grid"
/>
</div>
<div class="right">
<span>人员增长趋势</span>
@ -60,7 +65,11 @@
value-format="yyyy-MM-DD"
@change="getTime2"
></el-date-picker>
<div class="rightChart" ref="rightChart"></div>
<div v-if="xdata2.length != 0" class="rightChart" ref="rightChart"></div>
<div class="nodata" v-else>
<img src="@/assets/images/noData3.png" alt srcset />
<p>暂无数据</p>
</div>
</div>
</div>
</div>
@ -70,15 +79,18 @@
<script>
import Card from "../components/Card.vue";
import JBarChart from "../../common/jChart/bar/JBarChart.vue";
import { getWorkerNumApi,getWorkerGrowthApi } from '@/assets/js/api/zhongjianFourth';
import {
getWorkerNumApi,
getWorkerGrowthApi,
} from "@/assets/js/api/zhongjianFourth";
import echarts from "echarts4";
export default {
components: { Card, JBarChart },
data() {
return {
WorkerNum:{},
time1:[],
time2:[],
WorkerNum: {},
time1: [],
time2: [],
value1: "",
value2: "",
xData: ["18-24", "25-34", "34-49", "50-55", "未登记"],
@ -89,72 +101,112 @@ export default {
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#DE5F2A" },
{ offset: 1, color: "#DE5F2A24" }
])
}
}
]
{ offset: 1, color: "#DE5F2A24" },
]),
},
},
],
xdata2: [],
ydata2: [],
};
},
mounted() {
this.getData();
this.createChart();
},
watch:{
time1:{
handler(oldVal,newVal){
if(oldVal!=newVal){
this.getYearData()
watch: {
time2: {
handler(oldVal, newVal) {
if (oldVal != newVal) {
this.getYearData();
}
}
}
},
},
},
methods: {
getData(){
getWorkerNumApi({projectSn: this.$store.state.projectSn}).then((res)=>{
this.WorkerNum = res.result
})
getData() {
getWorkerNumApi({ projectSn: this.$store.state.projectSn }).then(
(res) => {
this.WorkerNum = res.result;
}
);
},
getTime1(val){
// console.log('-----',val)
this.time1 = val
getTime1(val) {
console.log("-----时间", val);
this.time1 = val;
},
getTime2(val){
// console.log('-----',val)
getTime2(val) {
console.log("-----时间", val);
this.time2 = val;
},
getYearData(){
let data ={}
data.projectSn = this.$store.state.projectSn
if(this.time1 != null){
data.startDate = this.time1[0]
data.endDate = this.time1[1]
getWorkerGrowthApi(data).then((res)=>{
console.log('======',res)
})
getYearData() {
let data = {};
data.projectSn = this.$store.state.projectSn;
if (this.time2 != null) {
data.startDate = this.time2[0];
data.endDate = this.time2[1];
getWorkerGrowthApi(data).then((res) => {
console.log("======", res);
if (res.reult != null) {
this.xdata2 = result.map((item) => {
return item.date;
});
this.ydata2 = result.map((item) => {
return item.count;
});
this.createChart();
}
// let result = [
// {
// date: "2021-07",
// count: "3",
// },
// {
// date: "2021-09",
// count: "2",
// },
// {
// date: "2021-11",
// count: "3",
// },
// {
// date: "2021-12",
// count: "7",
// },
// {
// date: "2022-03",
// count: "2",
// },
// {
// date: "2022-07",
// count: "3",
// },
// ]
});
}
},
createChart() {
let myChart = echarts.init(this.$refs.rightChart);
const option = {
tooltip: {
trigger: "axis"
trigger: "axis",
},
grid: {
top: '10%',
right: '2%',
bottom: '18%',
left: '2%',
containLabel: true
top: "10%",
right: "2%",
bottom: "18%",
left: "2%",
containLabel: true,
},
xAxis: {
type: "category",
boundaryGap: false,
data: ["05月", "06月", "07月", "08月", "09月", "10月", "11月"],
axisLabel: {
data: this.xdata2,
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
color: "#fff",
},
},
},
yAxis: {
@ -164,34 +216,34 @@ export default {
show: true,
lineStyle: {
type: "dashed",
color: "#777f8a"
}
color: "#777f8a",
},
},
axisLabel: {
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
color: "#fff",
},
},
},
series: [
{
name: "人员数",
data: [70, 65, 60, 65, 70, 75, 80, 85],
data: this.ydata2,
type: "line",
color: "#62c2ce",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "rgba(194, 92, 50,1)" },
{ offset: 1, color: "rgba(99, 193, 204,1)" }
])
}
}
]
{ offset: 1, color: "rgba(99, 193, 204,1)" },
]),
},
},
],
};
myChart.setOption(option);
}
}
},
},
};
</script>
@ -222,7 +274,7 @@ export default {
font-size: 14px;
margin-top: 10%;
}
p{
p {
font-size: 26px;
}
}
@ -249,6 +301,10 @@ export default {
width: 100%;
height: 100%;
}
.nodata{
text-align: center;
margin-top: 20%;
}
}
}
}