This commit is contained in:
cwchen 2025-07-23 18:08:05 +08:00
parent 5d2c836fbc
commit d09de4d09d
7 changed files with 682 additions and 9 deletions

View File

@ -0,0 +1,346 @@
let table, layer, form;
let myChart = null, myChart2 = null;
layui.use(['layer', 'table', 'form'], function () {
layer = layui.layer;
table = layui.table;
form = layui.form;
let bidCode = parent.parent.$('#bidPro').val()
let filterList = dataList.filter(item => {
return item.bidCode === bidCode;
});
initTable(filterList[0].list || []);
initEcharts(filterList[0].list[0]);
});
function initTable(data) {
table.render({
elem: '#demo2',
id: 'demo2',
skin: 'line',
page: true,
height: 'full-140',
headers: {
"decrypt": "decrypt",
"Authorization": token
},
data: data,
cols: [[
{ type: 'numbers', title: '序号', width: '10%' }, // 添加序号列
{ field: 'userName', title: '工人', align: 'center', width: '10%' },
{ field: 'teamName', title: '班组', align: 'center', width: '10%' },
{ field: 'postName', title: '工种', align: 'center', width: '10%' },
{ field: 'attDay', title: '出勤天数', align: 'center', width: '10%' },
{
field: 'workTime', title: '工作时长', align: 'center', width: '10%',
templet: function (d) {
return d.workTime + '小时';
}
},
{
field: 'completeWorkload', title: '完成工作量', align: 'center', width: '10%',
templet: function (d) {
return d.completeWorkload + d.completeWorkloadUnit;
}
},
{
field: 'unitTimeOutput', title: '单位时间产量', align: 'center', width: '10%',
templet: function (d) {
return d.unitTimeOutput + d.unitTimeOutputUnit;
}
},
{
field: 'unitTimeOutput', title: '单位时间标准产量', align: 'center', width: '10%',
templet: function (d) {
return d.standardTimeOutput + d.unitTimeOutputUnit;
}
},
{
field: 'rateLevel', title: '效率评级', align: 'center', width: '10%',
templet: function (d) {
let color = '';
if (d.rateLevel === '高效') {
color = 'green';
} else if (d.rateLevel === '达标') {
color = 'yellow';
} else if (d.rateLevel === '低效') {
color = 'red';
}
return '<p style="color:' + color + '">' + d.rateLevel + '</p>';
}
}
]],
initComplete: function () {
// 在表格渲染完成后,重新渲染序号列
var that = this.elem.next();
var tool = that.children('.layui-table-box').children('.layui-table-fixed').children('.layui-table-body').children('.layui-table');
tool.find("tr").each(function (index, item) {
$(this).find('td[data-field="LAY_TABLE_INDEX"]').text(index + 1);
});
},
done: function (res, curr, count, origin) {
// console.log(res);
}
})
table.on('rowDouble(demo2)', function (obj) {
initEcharts(obj.data);
});
}
function query(type) {
let userName = $('#userName').val();
let bidCode = parent.parent.$('#bidPro').val()
let filterList = dataList.filter(item => {
return item.bidCode === bidCode;
});
let list = filterList[0].list || []
let data = [];
if (userName) {
data = list.filter(item => {
return item.userName.indexOf(userName) > -1;
});
} else {
data = list;
}
initTable(data);
if(data && data.length > 0){
initEcharts(data[0]);
}
}
// 初始化 echarts
function initEcharts(data) {
if (myChart && myChart2) {
myChart.dispose();
myChart2.dispose();
}
myChart = echarts.init(document.getElementById("oneEcharts"));
myChart2 = echarts.init(document.getElementById("twoEcharts"));
initEchartsOne(data);
}
function initEchartsOne(obj) {
const data = [obj.unitTimeOutput];
const data2 = [obj.standardTimeOutput];
const colorArr1 = ["rgba(11, 83, 128)", "rgba(2, 143, 224)", "#2a7fcc"];
const colorArr2 = ["rgb(12, 109, 122)", "rgba(1, 241, 228)", "#5ce1d6"];
var color1 = {
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{
offset: 0,
color: colorArr1[0],
},
{
offset: 0.5,
color: colorArr1[0],
},
{
offset: 0.5,
color: colorArr1[1],
},
{
offset: 1,
color: colorArr1[1],
},
],
};
var color2 = {
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{
offset: 0,
color: colorArr2[0],
},
{
offset: 0.5,
color: colorArr2[0],
},
{
offset: 0.5,
color: colorArr2[1],
},
{
offset: 1,
color: colorArr2[1],
},
],
};
var barWidth = 18;
const option = {
backgroundColor: 'transparent',
legend: {
top: '3%',
right: '3%',
textStyle: {
fontSize: '12px',
color: '#FFF',
}
},
tooltip: {
trigger: 'axis',
formatter: function (params) {
var str = params[0].name + ":";
params.filter(function (item) {
if (item.componentSubType == "bar") {
str += "<br/>" + item.seriesName + "" + item.value + obj.unitTimeOutputUnit;
}
});
return str;
},
},
//图表大小位置限制
grid: {
x: '10%',
x2: '5%',
y: '15%',
y2: '15%',
},
xAxis: {
data: [obj.userName],
//坐标轴
axisLine: {
show: true,
lineStyle: {
width: 1,
color: '#214776'
},
textStyle: {
color: '#fff',
fontSize: '10'
}
},
type: 'category',
axisLabel: {
textStyle: {
color: '#C5DFFB',
fontWeight: 500,
fontSize: '14'
}
},
axisTick: {
textStyle: {
color: '#fff',
fontSize: '16'
},
show: false,
},
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
type: 'dashed',//线的类型 虚线
color: '#DEDEDE',
},
},
},
yAxis: {
name: '效率对标分析',
nameTextStyle: {
color: '#DEDEDE',
fontSize: 12,
padding: 10,
},
min: 0,//最小
max: obj.max,//最大
interval: obj.interval,//相差
type: 'value',
splitLine: {
show: true,
lineStyle: {
type: 'dashed',//线的类型 虚线0
opacity: 0.2//透明度
},
},
axisTick: {
show: false
},
axisLine: {
show: false,
},
//坐标值标注
axisLabel: {
show: true,
textStyle: {
color: '#C5DFFB',
}
},
},
series: [
{
z: 1,
name: '单位时间产量',
type: "bar",
barWidth: barWidth,
barGap: "0%",
data: data,
itemStyle: {
normal: {
color: color1,
}
},
},
{
z: 3,
name: '单位时间产量',
type: "pictorialBar",
symbolPosition: "end",
data: data,
symbol: "diamond",
symbolOffset: ["-75%", "-60%"],
symbolSize: [18, 12],
itemStyle: {
normal: {
borderWidth: 2,
color: colorArr1[2]
},
},
},
{
z: 1,
name: '单位时间标准产量',
type: "bar",
barWidth: barWidth,
barGap: "50%",
data: data2,
itemStyle: {
normal: {
color: color2,
}
},
},
{
z: 3,
name: '单位时间标准产量',
type: "pictorialBar",
symbolPosition: "end",
data: data2,
symbol: "diamond",
symbolOffset: ["75%", "-60%"],
symbolSize: [18, 12],
itemStyle: {
normal: {
borderWidth: 2,
color: colorArr2[2]
},
},
tooltip: {
show: false,
},
},
],
}
myChart.setOption(option, true);
window.addEventListener("resize", function () {
myChart.resize();
});
}

View File

@ -0,0 +1,221 @@
/** 工人效率分析数据*/
// 1512P017007Y01-凌云变 1612P021000T01-红枫变
let dataList = [{
bidCode: '1512P017007Y01',
list: [{
userName: '宋跃进',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '低效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1,
nameList:['技能不足','工具故障'],
},
{
userName: '刘振',
teamName: '变电土建-朱润生3班',
postName: '导线压线工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.1,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '黄照飞',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '王玉华',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '黄丹',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '赵光伟',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '刘磊',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '化苏碧',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '曹先应',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '陆乃怀',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '袁加纯',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '张友顺',
teamName: '变电土建-朱润生3班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
}
]
},
{
bidCode: '1612P021000T01',
list: [{
userName: '袁加纯',
teamName: '变电土建-宋鹏2班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
},
{
userName: '李仲恒',
teamName: '变电土建-宋鹏2班',
postName: '组塔工',
attDay: 22,
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
}]
}];

View File

@ -40,7 +40,7 @@ function changeData(that, type) {
}else if(type == 6){ // 工人效率分析
src = 'workerEfficiencyAnalysis.html';
}else if(type == 7){ // 环境监测分析
src = '';
src = 'environDetection.html';
}else if(type == 8){ // 项目管理分析
src = '';
}else if(type == 9){ // 整体效能分析

View File

@ -19,7 +19,7 @@ function initTable(data) {
id: 'demo2',
skin: 'line',
page: true,
height: 'full-120',
height: 'full-140',
headers: {
"decrypt": "decrypt",
"Authorization": token
@ -104,7 +104,7 @@ function query(type) {
data = list;
}
initTable(data);
if(data && data.length > 0){
if (data && data.length > 0) {
initEcharts(data[0]);
}
}
@ -118,6 +118,9 @@ function initEcharts(data) {
myChart = echarts.init(document.getElementById("oneEcharts"));
myChart2 = echarts.init(document.getElementById("twoEcharts"));
initEchartsOne(data);
if (data.unitTimeOutput < data.standardTimeOutput) {
initEchartsTwo(data);
}
}
function initEchartsOne(obj) {
@ -343,4 +346,47 @@ function initEchartsOne(obj) {
window.addEventListener("resize", function () {
myChart.resize();
});
}
/* 变化趋势 */
function initEchartsTwo(data) {
let nameList = ['技能不足','工具故障'];
let valueList = [{name:'技能不足',value:1},{name:'工具故障',value:3}];
const option = {
grid: {
top: 0,
bottom: 0,
left: 0,
right: 0,
},
title: {
text: "",
x: "center",
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
},
legend: {
show: false,
data: nameList,
},
series: [
{
name: "效率低下分析",
type: "pie",
radius: "65%",
center: ["50%", "50%"],
label: {
show: true,
formatter: "{b} {d}%",
},
data: valueList,
},
],
};
myChart2.setOption(option, true);
window.addEventListener("resize", function () {
myChart2.resize();
});
}

View File

@ -13,7 +13,7 @@ let dataList = [{
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutputUnit: '座/小时',
rateLevel: '效',
rateLevel: '效',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
@ -27,9 +27,9 @@ let dataList = [{
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutput: 0.1,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
rateLevel: '达标',
standardTimeOutput:0.1,
max:0.2,
interval:0.1
@ -42,7 +42,7 @@ let dataList = [{
workTime: 176,
completeWorkload: 15,
completeWorkloadUnit:'座',
unitTimeOutput: 0.085,
unitTimeOutput: 0.11,
unitTimeOutputUnit: '座/小时',
rateLevel: '高效',
standardTimeOutput:0.1,

View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../../css/font.css">
<link rel="stylesheet" href="../../plugin/layui-v2.9.7/layui/css/layui.css">
<link rel="stylesheet" href="../../css/dataAnalysis/commonStyle.css">
<link rel="stylesheet" href="../../css/shuiYin/shuiYin.css">
<link rel="stylesheet" href="../../css/coreTable.css"/>
<script src="../../js/publics/sm4.js" type="text/javascript"></script>
<script src="../../js/publics/jquery-3.6.0.min.js" type="text/javascript"></script>
<script src="../../js/publics/public.js"></script>
<script src="../../plugin/scroll/jquery.nicescroll.min.js"></script>
<script src="../../js/publics/echarts.js"></script>
<script src="../../plugin/layui-v2.9.7/layui/layui.js"></script>
<script src="../../js/publics/aescbc.js"></script>
<script src="../../js/publics/sm3.js"></script>
<script src="../../api/commonRequest.js"></script>
<script src="../../plugin/watermark.js"></script>
<title>环境检测</title>
</head>
<body>
<div id="main-box" class="layout">
<div id="left-box">
<div class="basic-search-box layout">
<form class="layui-form basic-form layout" onclick="return false;" onsubmit="return false;">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="width: 80px;">工人:</label>
<div class="layui-input-inline">
<input type="text" id="userName" class="layui-input" autocomplete="off">
</div>
</div>
<button type="button" class="layui-btn layui-btn-normal" onclick="query(1)">
<i class="layui-icon layui-icon-query"></i>查询
</button>
</div>
</form>
</div>
<table id="demo2" lay-filter="demo2"></table>
</div>
<div id="right-box" class="layout">
<div id="oneEcharts">
</div>
<div id="twoEcharts">
</div>
</div>
</div>
</body>
<style>
.layui-table-init {
background-color: transparent !important;
}
</style>
<script src="../../js/pages/newDataAnalysis/environDetectionData.js" type="text/javascript"></script>
<script src="../../js/pages/newDataAnalysis/environDetection.js" type="text/javascript"></script>
</html>

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" href="../../css/dataAnalysis/commonStyle.css">
<link rel="stylesheet" href="../../css/shuiYin/shuiYin.css">
<link rel="stylesheet" href="../../css/coreTable.css"/>
<!-- <link rel="stylesheet" href="../../css/accessMge/accessMge.css"> -->
<script src="../../js/publics/sm4.js" type="text/javascript"></script>
<script src="../../js/publics/jquery-3.6.0.min.js" type="text/javascript"></script>
<script src="../../js/publics/public.js"></script>
@ -19,7 +18,6 @@
<script src="../../js/publics/aescbc.js"></script>
<script src="../../js/publics/sm3.js"></script>
<script src="../../api/commonRequest.js"></script>
<!-- <script src="../../js/publics/shuiYin.js"></script> -->
<script src="../../plugin/watermark.js"></script>
<title>工人效率分析</title>
</head>