From 5582e317ce2f9d832af857ce8950f2c25ca42fe9 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 23 Jul 2025 15:07:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/dataAnalysis/commonStyle.css | 68 +++ js/pages/newDataAnalysis/newDataAnalysis.js | 2 +- .../workerEfficiencyAnalysis.js | 493 ++++++++++++++++++ pages/newDataAnalysis/newDataAnalysis.html | 3 - .../workerEfficiencyAnalysis.html | 63 +++ 5 files changed, 625 insertions(+), 4 deletions(-) create mode 100644 css/dataAnalysis/commonStyle.css create mode 100644 js/pages/newDataAnalysis/workerEfficiencyAnalysis.js create mode 100644 pages/newDataAnalysis/workerEfficiencyAnalysis.html diff --git a/css/dataAnalysis/commonStyle.css b/css/dataAnalysis/commonStyle.css new file mode 100644 index 0000000..e48892b --- /dev/null +++ b/css/dataAnalysis/commonStyle.css @@ -0,0 +1,68 @@ +html, +body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + color: #fff; + font-family: 'Alibaba PuHuiTi R'; +} +#main-box { + width: 100%; + height: 100%; + justify-content: space-evenly; +} + +.layout { + display: flex; + align-items: center; + justify-content: center; +} + +#left-box{ + width: 68%; + height: 100%; + padding: 2% 0; + box-sizing: border-box; +} +#right-box{ + width: 30%; + height: 100%; + padding: 2% 0; + box-sizing: border-box; +} + +.basic-search-box{ + width: 100%; + height: 60px; + justify-content: flex-start; +} +.layui-table .layui-table-cell { + height: auto; + word-break: normal; + display: block; + white-space: pre-wrap; + word-wrap: break-word; + overflow: hidden; + padding: 0 10px !important; +} +.basic-search-box .layui-input-inline{ + width: 190px; +} + +.basic-search-box button{ + background-color: #16baaa; +} + +.layui-form-item { + margin: 0; +} + +#oneEcharts{ + width: 100%; + height: 49%; +} +#twoEcharts{ + width: 100%; + height: 49%; +} \ No newline at end of file diff --git a/js/pages/newDataAnalysis/newDataAnalysis.js b/js/pages/newDataAnalysis/newDataAnalysis.js index d6b6d7b..da9c525 100644 --- a/js/pages/newDataAnalysis/newDataAnalysis.js +++ b/js/pages/newDataAnalysis/newDataAnalysis.js @@ -38,7 +38,7 @@ function changeData(that, type) { }else if(type == 5){ // 节能减排分析 src = ''; }else if(type == 6){ // 工人效率分析 - src = ''; + src = 'workerEfficiencyAnalysis.html'; }else if(type == 7){ // 环境监测分析 src = ''; }else if(type == 8){ // 项目管理分析 diff --git a/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js b/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js new file mode 100644 index 0000000..3c6132f --- /dev/null +++ b/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js @@ -0,0 +1,493 @@ +// 1512P017007Y01-凌云变 1612P021000T01-红枫变 +let dataList = [{ + bidCode: '1512P017007Y01', + list: [{ + userName: '宋跃进', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '刘振', + teamName: '变电土建-朱润生3班', + postName: '导线压线工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '黄照飞', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '王玉华', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '黄丹', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '赵光伟', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '刘磊', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '化苏碧', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '曹先应', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '陆乃怀', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '袁加纯', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }, + { + userName: '张友顺', + teamName: '变电土建-朱润生3班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + } + ] +}, +{ + bidCode: '1612P021000T01', + list: [{ + userName: '宋跃进', + teamName: '变电土建-宋鹏2班', + postName: '组塔工', + attDay: 22, + workTime: 176, + completeWorkload: '15座', + unitTimeOutput: '0.085座/小时', + rateLevel: '高效', + }] +}]; + +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 || []); +}); + + +function initTable(data) { + table.render({ + elem: '#demo2', + id: 'demo2', + skin: 'line', + page: true, + height: 'full-120', + 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%' }, + { field: 'completeWorkload', title: '完成工作量', align: 'center', width: '15%' }, + { field: 'unitTimeOutput', title: '单位时间产量', align: 'center', width: '15%' }, + { + 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 '

' + d.rateLevel + '

'; + } + + } + ]], + 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) { + console.log(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); +} + +// 初始化 echarts +function initEcharts() { + myChart.dispose(); + myChart2.dispose(); + myChart = echarts.init(document.getElementById("oneEcharts")); + myChart2 = echarts.init(document.getElementById("twoEcharts")); + initEchartsOne(); +} + +function initEchartsOne() { + let fontSize = '14', fontFamily = 'Alibaba PuHuiTi R', fontColor = '#fff'; + const graphicColors = [ + ['rgba(7, 209, 250, 1)', 'rgba(7, 209, 250, .2)'], + ['rgba(7, 131, 250, 1)', 'rgba(7, 131, 250, .2)'], + ['rgba(31, 237, 190, 1)', 'rgba(31, 237, 190, .2)'], + ['rgba(255, 209, 92, 1)', 'rgba(255, 209, 92, .2)'], + ['rgba(255, 136, 136, 1)', 'rgba(255, 136, 136, .2)'], + ['rgba(157, 222, 255, 1)', 'rgba(157, 222, 255, .2)'], + ['rgba(94, 255, 108, 1)', 'rgba(94, 255, 108, .2)'], + ['rgba(146, 119, 255, 1)', 'rgba(146, 119, 255, .2)'], + ['rgba(0, 246, 255, 1)', 'rgba(0, 246, 255, .2)'], + ['rgba(255, 162, 77, 1)', 'rgba(255, 162, 77, .2)'], + ['rgba(255, 105, 207, 1)', 'rgba(255, 105, 207, .2)'] + ] + const option = { + backgroundColor: "#08244d", + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + textStyle: { + color: '#fff', + fontSize: 12 + }, + confine: true, // 超出范围 + backgroundColor: 'rgba(17,95,182,0.5)', //设置背景颜色 + formatter: params => { + let str = `
${params[0]?.name}
` + params.map((item, index) => { + if ([0, 2, 4].includes(index)) { + let str1 = '' + if (item.data[index + 2]) { + str1 = `${item.data[index + 2]} : ${item.data[index + 3]}` + str += `
${item.marker} ${str1} 批
` + } + } + }) + return str + } + }, + legend: {}, + dataset: { + dimensions: ['product', 'sort', 'company1', 'num1', 'company2', 'num2', 'company3', 'num3'], + source: [ + ['总匝开关', 1, 'a', 43.3, 'b', 85.8, 'c', 93.7], + ['电线', 2, 'd', 83.1, 'e', 73.4, 'f', 55.1], + ['电池', 3, 'g', 86.4, 'h', 65.2, 'i', 82.5], + ['外壳', 4, 'j', 72.4, 'k', 53.9, 'l', 39.1], + ['充电器', 4, 'j', 62.4, 'k', 43.9, 'l', 79.1] + ] + }, + xAxis: { + type: 'category', + axisLabel: { + width: 80, + padding: [8, 0], + borderColor: '#6AAFFF', + borderWidth: 1, + borderRadius: 4, + margin: 20, + backgroundColor: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: 'rgba(7, 131, 250, 1)' // 0% 处的颜色 + }, + { + offset: 1, + color: 'rgba(7, 131, 250, 0.2)'// 100% 处的颜色 + } + ], + global: false // 缺省为 false + }, + color: '#fff', + } + }, + yAxis: { + // show: false, // 不显示坐标轴线、坐标轴刻度线和坐标轴上的文字 + // axisTick: { + // show: false // 不显示坐标轴刻度线 + // }, + // axisLine: { + // show: false, // 不显示坐标轴线 + // }, + // axisLabel: { + // show: false, // 不显示坐标轴上的文字 + // }, + // splitLine: { + // show: false // 不显示网格线 + // }, + splitLine: { + lineStyle: { + type: 'dashed', + color: '#D9E7FF33' + } + } + }, + series: [ + { + type: 'bar', + stack: 'num1', + label: { + // show: true, + // rotate: 90, + // position: 'insideBottom', + // align: 'left', + // verticalAlign: 'middle' + show: true, + position: 'bottom', + }, + itemStyle: { + normal: { + opacity: 1, + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: graphicColors[0][0] || 'rgba(7, 209, 250, 1)' // 0% 处的颜色 + }, + { + offset: 1, + color: graphicColors[0][1] || 'rgba(7, 209, 250, .2)' // 100% 处的颜色 + } + ], + global: false // 缺省为 false + } + } + }, + encode: { x: 'product', y: 'num1', label: ['company1'] } + }, + { + type: 'bar', + stack: 'num1', + itemStyle: { + color: 'transparent' //颜色透明 + }, + label: { + show: true, + position: 'top' + }, + encode: { x: 'product', y: 'sort', label: ['num1'] } + }, + { + type: 'bar', + stack: 'num2', + label: { + // show: true, + // rotate: 90, + // position: 'insideBottom', + // align: 'left', + // verticalAlign: 'middle' + show: true, + position: 'bottom', + }, + itemStyle: { + normal: { + opacity: 1, + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: graphicColors[1][0] || 'rgba(7, 209, 250, 1)' // 0% 处的颜色 + }, + { + offset: 1, + color: graphicColors[1][1] || 'rgba(7, 209, 250, .2)' // 100% 处的颜色 + } + ], + global: false // 缺省为 false + } + } + }, + encode: { x: 'product', y: 'num2', label: ['company2'] } + }, + { + type: 'bar', + stack: 'num2', + itemStyle: { + color: 'transparent' //颜色透明 + }, + label: { + show: true, + position: 'top' + }, + encode: { x: 'product', y: 'sort', label: ['num1'] } + }, + { + type: 'bar', + stack: 'num3', + label: { + // show: true, + // rotate: 90, + // position: 'insideBottom', + // align: 'left', + // verticalAlign: 'middle' + show: true, + position: 'bottom', + }, + itemStyle: { + normal: { + opacity: 1, + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: graphicColors[2][0] || 'rgba(7, 209, 250, 1)' // 0% 处的颜色 + }, + { + offset: 1, + color: graphicColors[2][1] || 'rgba(7, 209, 250, .2)' // 100% 处的颜色 + } + ], + global: false // 缺省为 false + } + } + }, + encode: { x: 'product', y: 'num3', label: ['company3'] } + }, + { + type: 'bar', + stack: 'num3', + itemStyle: { + color: 'transparent' //颜色透明 + }, + label: { + show: true, + position: 'top' + }, + encode: { x: 'product', y: 'sort', label: ['num3'] } + } + ] + }; + myChart.setOption(option, true); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} \ No newline at end of file diff --git a/pages/newDataAnalysis/newDataAnalysis.html b/pages/newDataAnalysis/newDataAnalysis.html index 8632922..64b5679 100644 --- a/pages/newDataAnalysis/newDataAnalysis.html +++ b/pages/newDataAnalysis/newDataAnalysis.html @@ -40,9 +40,6 @@
  • 环境监测分析
  • 项目管理分析
  • 整体效能分析
  • -
  • 风险值班分析
  • -
  • 穿戴设备监测设备指标分析
  • -
  • 延期原因分析
  • diff --git a/pages/newDataAnalysis/workerEfficiencyAnalysis.html b/pages/newDataAnalysis/workerEfficiencyAnalysis.html new file mode 100644 index 0000000..c1115d0 --- /dev/null +++ b/pages/newDataAnalysis/workerEfficiencyAnalysis.html @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + 工人效率分析 + + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + + + +