湖里大屏(劳务管理):企业出勤排名接口对接

This commit is contained in:
骆乐 2022-08-16 15:07:58 +08:00
parent 1001bc99f4
commit f20bc48e6f
3 changed files with 110 additions and 32 deletions

View File

@ -45,16 +45,16 @@ 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',
// FILEURL: 'http://124.71.178.44:100/image/',
/* 2022-06-06 */ // BASEURL:'http://192.168.34.174:6023/',
// UPLOADURL: 'http://192.168.34.125:6023/upload/image',
// FILEURL: 'http://192.168.34.125:6023/image/',
UPLOADURL: 'http://192.168.34.125:6023/upload/image',
FILEURL: 'http://192.168.34.125:6023/image/',
// UPLOADURL:'http://192.168.34.246:6023/upload/image',
// FILEURL:'http://192.168.34.246:6023/image',

View File

@ -21,18 +21,16 @@
<span>总人数</span>
</div>
</div>
<div class="mychart">
<JBarChart :xData="xData" :series="series" :color="color" :grid="grid" />
</div>
<div class="companyChart" ref="companyChart"></div>
</Card>
</template>
<script>
import Card from "../components/Card.vue";
import JBarChart from "../jChart/bar/JBarChart.vue";
import { selectProjectWorkerTypeTotalListApi } from "@/assets/js/api/dataBoard.js";
import echarts from 'echarts4';
import { selectProjectWorkerTypeTotalListApi,selectProjectComapnyWorkTotalListApi } from "@/assets/js/api/dataBoard.js";
export default {
components: { Card, JBarChart },
components: { Card, },
props: {
title: {
type: String,
@ -42,27 +40,14 @@ export default {
data() {
return {
workerTypeList: [],
xData: [
"中建一局",
"中建一局",
"中建一局",
"中建一局",
"中建一局",
"中建一局",
"中建一局",
"中建一局"
],
series: [
{ data: [170, 180, 90, 70, 60, 50, 50, 50] },
{ data: [220, 280, 190, 180, 300, 200, 200, 200] }
],
color: ["#5be2f6", "#5281f7"],
grid: ["10%", "5%", "15%", "5%"]
};
},
created() {
this.getWokerType();
},
mounted(){
this.getComapnyWorkList();
},
methods: {
//
getWokerType() {
@ -72,7 +57,99 @@ export default {
console.log(res);
this.workerTypeList = res.result;
});
}
},
//
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);
},
}
};
</script>
@ -155,9 +232,10 @@ export default {
width: 3px;
color: #636364;
}
.mychart {
width: 100%;
height: 40%;
}
.companyChart{
margin-left: 5%;
width: 90%;
height: 40%;
}
</style>

View File

@ -135,6 +135,6 @@ export default {
}
.mychart {
width: 100%;
height: calc(100% - 28px);
height: calc(100% - 30px);
}
</style>