diff --git a/ruoyi-admin/src/main/resources/static/css/board/orderVisualization.css b/ruoyi-admin/src/main/resources/static/css/board/orderVisualization.css index 2bdc458..b83d21d 100644 --- a/ruoyi-admin/src/main/resources/static/css/board/orderVisualization.css +++ b/ruoyi-admin/src/main/resources/static/css/board/orderVisualization.css @@ -17,32 +17,11 @@ body { top: 15%; left: 3.5%; } -.IQCOne{ - position: absolute; - width: 20%; - height: 15%; - top: 15%; - left: 30%; -} -.IQCTwo{ - position: absolute; - width: 13%; - height: 15%; - top: 15%; - left: 50%; -} -.IQCThree{ - position: absolute; - width: 7%; - height: 15%; - top: 15%; - left: 63%; -} -.IQCFour{ +.IQC{ position: absolute; width: 40%; - height: 20%; - top: 30%; + height: 35%; + top: 15%; left: 30%; } .productionEfficiency{ @@ -57,19 +36,12 @@ body { width: 25%; height: 35%; top: 59%; - left: 3.7%; + left: 72%; } -.equipmentPowerOne{ +.equipmentPower{ position: absolute; - width: 20%; + width: 39%; height: 19%; top: 76%; left: 30.5%; -} -.equipmentPowerTwo{ - position: absolute; - width: 20%; - height: 19%; - top: 76%; - left: 50.5%; } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/img/board/orderVisualization/backgroundImg.jpg b/ruoyi-admin/src/main/resources/static/img/board/orderVisualization/backgroundImg.jpg index af68f23..65b9e64 100644 Binary files a/ruoyi-admin/src/main/resources/static/img/board/orderVisualization/backgroundImg.jpg and b/ruoyi-admin/src/main/resources/static/img/board/orderVisualization/backgroundImg.jpg differ diff --git a/ruoyi-admin/src/main/resources/static/js/autoscroll-table.js b/ruoyi-admin/src/main/resources/static/js/autoscroll-table.js index 3ca02d6..a29847b 100644 --- a/ruoyi-admin/src/main/resources/static/js/autoscroll-table.js +++ b/ruoyi-admin/src/main/resources/static/js/autoscroll-table.js @@ -260,7 +260,7 @@ class AutoScrollTable { thead.style.width = window.getComputedStyle(tbody).width let tr = this.el.querySelectorAll(".autoscroll-table .autoscroll-table_tbody1 tr") tr.forEach(val => { - val.style.lineHeight = `${(parseFloat(window.getComputedStyle(parent).height) - parseFloat(window.getComputedStyle(theadRow).height))/this.lineNum}px` + val.style.lineHeight = `${(parseFloat(window.getComputedStyle(parent).height) - parseFloat(window.getComputedStyle(theadRow).height))/this.lineNum - 1.5}px` }) shadow.style.display ='none' diff --git a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js index 7adcc50..d746d27 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js +++ b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js @@ -1,7 +1,6 @@ $(() => { moduleTitle() LOSS() - Tips() // 公共请求地址 let url = '/broad/zz' @@ -11,11 +10,25 @@ $(() => { // 目标 $.post(url + "/selectProductInByTeam/0", {}, data => { data = JSON.parse(data) + console.log(isFirst) if (isFirst) { - // target.top = data.map(val => val.val) - // target.bottom = data.val - // request() - // isFirst = false + let arr = [] + for (let i = 0; i < 12; i++) { + arr.push(Math.ceil(target.topTips/11)) + } + arr[2] = Math.ceil(target.topTips/22) + arr[7] = Math.ceil(target.topTips/22) + target.top = arr + target.topProgress = arr.reduce((val1,val2) => { + console.log(val1) + console.log(val2) + return val1 + val2 + } , 0) + // target.top = data.map(val => val.val) + // target.bottom = data.val + isFirst = false + request() + Tips('#Tips') } }) // LOSS(分类) @@ -30,8 +43,17 @@ $(() => { // 产量 $.post(url + `/selectProductInByTeam/${yieldType}`, {}, data => { data = JSON.parse(data) + let oneTime = parseFloat(data[0].name.split(':')[0]) + let xName = [] + if (yieldType == 0) { + for (let i = 0; i < 12; i++) { + xName.push(`${(oneTime + i) % 24}:30`) + } + } else { + xName = data.map(val => val.name) + } barChartAndLineChartThree({ - xName: data.map(val => val.name), + xName: xName, yDataOne: data.map(val => val.qty), yDataOneName: "实际产量", yDataTwo: target.top, @@ -42,8 +64,17 @@ $(() => { // 一次装配不合格率 $.post(url + `/selectProductInByTeam/${yieldType}`, {}, data => { data = JSON.parse(data) + let oneTime = parseFloat(data[0].name.split(':')[0]) + let xName = [] + if (yieldType == 0) { + for (let i = 0; i < 12; i++) { + xName.push(`${(oneTime + i) % 24}:30`) + } + } else { + xName = data.map(val => val.name) + } barChartAndLineChartFour({ - xName: data.map(val => val.name), + xName: xName, yDataOne: data.map(val => val.qty), yDataOneName: "不良数", yDataTwo: [9, 3, 7, 7, 7, 2, 7, 1, 6, 7, 2, 1, 5], @@ -56,22 +87,21 @@ $(() => { //追踪事件轮询 $.post("/broad/beforeLibrary/selectOrderInfo", {}, data => { data = JSON.parse(data) - console.log(data) $('#trackEvents').remove() $('.trackEventsScrollTable').html('
') dynamicTable({ el: '#trackEvents', rowNum: 5, timeout: 0, - header: ["订单编号",'产品型号', "计划数量", "完成数量", "执行进度", "时间"], - data: data.map(value => [value.plan_code.slice(4, value.plan_code.length),'', value.plan_number, value.actual_number, value.plan_number - value.actual_number, value.day]), + header: ["订单编号", '产品型号', "计划数量", "完成数量", "执行进度", "时间"], + data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), '', value.plan_number, value.actual_number, value.plan_number - value.actual_number, value.day]), index: false, fontColor: '#B4B7BF ', indexBGC: '#86F3FF', headerBGC: 'rgba(8,36,75,0.2)', oddRowBGC: 'rgba(8,36,75,0.2)', evenRowBGC: 'rgba(8,36,75,0.2)', - colWidth: ['25%','22%', '10%', '10%', '10%', '23%'] + colWidth: ['25%', '22%', '10%', '10%', '10%', '23%'] }); }) } @@ -93,12 +123,16 @@ $(() => { let yieldType = '0' let isFirst = true let target = { - top: [382, 102, 186, 200, 102, 186, 315, 1, 1, 1, 1], + top: [], bottom: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], - topTips: '2000', - bottomTips: '3.05', + topTips: 2000, + bottomTips: 3.05, + topProgress:0, + topReality:0, + topGap:0, + topRate:0, } -const LOSS = (val1=0,val2=24) => { +const LOSS = (val1 = 0, val2 = 24) => { const html = ` ${val1} ${val2} @@ -117,10 +151,16 @@ const moduleTitle = () => { ` $('body').append(html) } -const Tips = (top={target:target.topTips,progress:0,reality:0,gap:0,rate:0},bottom={target:target.bottomTips,reality:0,total:0}) => { +const Tips = (el,top = { + target: target.topTips, + progress: target.topProgress, + reality: target.topReality, + gap: target.topGap, + rate: target.topRate, +}, bottom = {target: target.bottomTips, reality: 0, total: 0}) => { const html = ` 目标:${top.target} 进度目标:${top.progress} 实际:${top.reality} 差异:${top.gap} 达成率:${top.rate}% 目标:${bottom.target}% 实际:${bottom.reality}% 累计不良数:${bottom.total} ` - $('body').append(html) + $(el).append(html) } diff --git a/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js b/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js index 930d4e4..c5096b3 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js +++ b/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js @@ -1,93 +1,177 @@ $(() => { moduleTitle() - safe() - card({top: 60, left: 30.5}) - card({top: 60, left: 38.5}) - card({top: 60, left: 46.5}) - card({top: 60, left: 54.5}) - card({top: 60, left: 62.5}) + safe('#safe') + Tips(0,0,0,'#Tips') + total( 0,'#total') + card({top: 60, left: 30.5,title:'内胆检漏',name1:'问题1',value1:'值1',name2:'问题2',value2:'值2',name3:'问题3',value3:'值3'},'#cardOne') + card({top: 60, left: 38.5,title:'安全检测',name1:'问题1',value1:'值1',name2:'问题2',value2:'值2',name3:'问题3',value3:'值3'},'#cardTwo') + card({top: 60, left: 46.5,title:'成品检漏',name1:'问题1',value1:'值1',name2:'问题2',value2:'值2',name3:'问题3',value3:'值3'},'#cardThree') + card({top: 60, left: 54.5,title:'测温性能',name1:'问题1',value1:'值1',name2:'问题2',value2:'值2',name3:'问题3',value3:'值3'},'#cardFour') + card({top: 60, left: 62.5,title:'成品外观',name1:'问题1',value1:'值1',name2:'问题2',value2:'值2',name3:'问题3',value3:'值3'},'#cardFive') // 公共请求地址 let url = '/broad/beforeLibrary' // 轮询间隔时间 const INTERVAL = 30000 - // IQC3 - const IQCTwo = new AutoScrollTable(document.getElementById("IQCTwo"), ["编号", "计划数量", "完成数量", "差异值", "时间"], {width: ['30%', null, null, null, '17%']}) - //每日人力出勤轮询 // autoUpdate(url + "/ ", INTERVAL, data => { - singleVerticalBarChartTwo(null, document.getElementById("manpowerAttendance")) + let data = [ + { + name: '班组1', + value: 72, + }, + { + name: '班组2', + value: 52, + }, + { + name: '班组3', + value: 72, + }, + { + name: '班组4', + value: 29, + }, + { + name: '班组5', + value: 82, + }, + { + name: '班组6', + value: 82, + }, + { + name: '班组7', + value: 28, + }, + { + name: '班组8', + value: 62, + }, + { + name: '班组9', + value: 82, + }, + { + name: '班组10', + value: 38, + }, + { + name: '班组11', + value: 93, + }, + ] + data.sort((a,b)=>{ + return b.value - a.value + }) + console.log(data) + singleVerticalBarChartTwo({ + xName: ['班组1', '班组2', '班组3', '班组4', '班组5', '班组6', '班组7', '班组8', '班组9', '班组10'], + yData: [38, 60, 40, 55, 42, 39, 45, 40, 63, 38], + }, document.getElementById("manpowerAttendance")) // }) // IQC - multipleVerticalBarChartTwo(null, document.getElementById("IQCOne")) - IQCTwo.loadData([[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]], Object.keys(["编号", "计划数量", "完成数量", "差异值", "时间"])) - hollowPieChart(null, document.getElementById("IQCThree")) - barChartAndLineChartTwo(null, document.getElementById("IQCFour")) + horizontalRoundedBarChartWithBackgroundTwo(null, document.getElementById("IQC")) // 设备功率 - singleVerticalBarChart(null, document.getElementById("equipmentPowerOne")) - singleVerticalBarChart(null, document.getElementById("equipmentPowerTwo")) + singleVerticalBarChart(null, document.getElementById("equipmentPower")) // 生产效率 // autoUpdate(url + "/ ", INTERVAL, data => { - horizontalRoundedBarChartWithBackgroundTwo(null, document.getElementById("productionEfficiency")) + singleVerticalBarChart(null, document.getElementById("productionEfficiency")) // }) // 成品入库统计 percentageRingDiagram(null, document.getElementById("mainData")) }) +const today = () => { + const currentYear = new Date().getFullYear().toString(); + const hasTimestamp = new Date() - new Date(currentYear); + const hasDays = Math.ceil(hasTimestamp / 86400000); + return hasDays +} + +const curWeek = () => { + let today = new Date(); + let firstDayOfYear = new Date(today.getFullYear(), 0, 1); + let dayOfWeek = firstDayOfYear.getDay(); + let spendDay = 1; + if (dayOfWeek != 0) { + spendDay = 7 - dayOfWeek + 1; + } + firstDayOfYear = new Date(today.getFullYear(), 0, spendDay); + let d = Math.ceil((today.valueOf() - firstDayOfYear.valueOf()) / 86400000); + return Math.ceil(d / 7); +} + const moduleTitle = () => { const html = ` 订单可视化、6S 及安全生产看板 - 班组生产6S - 成品入库数量统计 - - 成品入库统计 - 问题 - 安全生产 + 第${curWeek()}周 班组6S排行榜 + 三日订单执行情况 + 当日订单入库统计 + 安全生产 + 质量分析(TOP3) + 重点工序质量监控 ` $('body').append(html) } -const safe = () => { + +const safe = (el) => { const html = ` - 1809天 - QSR连续安全生产天数 + ${today()}天 + QSR连续安全生产天数 ` - $('body').append(html) + $(el).html(html) } -const card = (val = {top: 1, left: 1}) => { + +const card = (val = {top: 1, left: 1,title:'',name1:'',value1:'',name2:'',value2:'',name3:'',value3:''},el) => { const html = `