From 86d35e84b80e1a229100b7c492e6662c9dba0c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Sat, 23 Jul 2022 11:13:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/board/finalAssemblyProductionData.js | 160 ++++++++++-------- .../broad/finalAssemblyProductionData.html | 3 +- 2 files changed, 91 insertions(+), 72 deletions(-) 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 4ac065b..af88a71 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js +++ b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js @@ -8,16 +8,16 @@ $(() => { const INTERVAL = 30000 - const request = () => { + const request = async () => { // 目标 - $.post(url + "/selectProductInTarget", {}, data => { + await $.post(url + "/selectProductInTarget", {}, data => { data = JSON.parse(data) - target.topTips = data.find(val => val.name == "进度目标").qty - Tips('#Tips') - if (isFirst){ - isFirst = false - request() - } + targetTop.tips = data.find(val => val.name == "目标").qty + }) + // 终检一次不合格率目标 + await $.post(url + "/selectOneBadRateMb", {}, data => { + data = JSON.parse(data) + targetBottom.tips = data.rate }) // LOSS(分类) $.post(url + "/selectLossInfo", {}, data => { @@ -33,61 +33,52 @@ $(() => { data = JSON.parse(data) jp(data.qty) }) - // 终检一次不合格率目标 - $.post(url + "/selectOneBadRateMb", {}, data => { - data = JSON.parse(data) - target.bottomTips = data.rate - for (let i = 0; i < 12; i++) { - target.bottom.push(data.rate) - } - }) // 产量 $.post(url + `/selectProductInByTeam/${yieldType}`, {}, data => { data = JSON.parse(data) - console.log(data) - target.topReality = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) - target.topGap = target.topProgress - target.topReality - if (target.topProgress != 0){ - target.topRate = ((target.topReality / target.topProgress).toFixed(4) * 100 + '').substring(0, 5) - }else{ - target.topRate = 0 - } - Tips('#Tips') + // 实际 + targetTop.reality = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) + // 起始时间 let oneTime = parseFloat(data[0].name.split(':')[0]) + // 横坐标 let xName = [] if (yieldType == 0) { let arr = [] for (let i = 0; i < 12; i++) { - arr.push(Math.ceil(target.topTips / 11)) + arr.push(Math.ceil(targetTop.tips / 11)) } - arr[3] = Math.ceil(target.topTips / 22) - arr[8] = Math.ceil(target.topTips / 22) - arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - target.topTips) - target.top = arr - target.topProgress = arr.slice(0,data.length).reduce((val1, val2) => val1 + val2, 0) - target.topProgress = 399 + arr[3] = Math.ceil(targetTop.tips / 22) + arr[8] = Math.ceil(targetTop.tips / 22) + arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - targetTop.tips) + targetTop.targetArr = arr + targetTop.progress = arr.slice(0, data.length).reduce((val1, val2) => val1 + val2, 0) for (let i = 0; i < 12; i++) { xName.push(`${(oneTime + i) % 24}:30`) } } else { let arr = [] for (let i = 0; i < 24; i++) { - arr.push(Math.ceil(target.topTips / 23)) + arr.push(Math.ceil(targetTop.tips / 23)) } - arr[8] = Math.ceil(target.topTips / 46) - arr[13] = Math.ceil(target.topTips / 46) - arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - target.topTips) - target.top = arr - target.topProgress = arr.slice(0,data.length).reduce((val1, val2) => val1 + val2, 0) - - // target.topProgress = 399 - xName = ['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00'] + arr[8] = Math.ceil(targetTop.tips / 46) + arr[13] = Math.ceil(targetTop.tips / 46) + arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - targetTop.tips) + targetTop.targetArr = arr + targetTop.progress = arr.slice(0, data.length).reduce((val1, val2) => val1 + val2, 0) + xName = ['0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'] } + // 达成率 + if (targetTop.progress != 0) { + targetTop.rate = ((targetTop.reality / targetTop.progress).toFixed(4) * 100 + '').substring(0, 5) + } else { + targetTop.rate = 0 + } + targetTop.gap = targetTop.progress - targetTop.reality barChartAndLineChartThree({ xName: xName, yDataOne: data.map(val => val.qty), yDataOneName: "实际产量", - yDataTwo: target.top, + yDataTwo: targetTop.targetArr, yDataTwoName: "目标产量", }, document.getElementById("yield")); }) @@ -98,22 +89,29 @@ $(() => { let oneTime = parseFloat(data[0].name.split(':')[0]) let xName = [] if (yieldType == 0) { + let arr = [] for (let i = 0; i < 12; i++) { + arr.push(targetBottom.tips) xName.push(`${(oneTime + i) % 24}:30`) } + targetBottom.targetArr = arr } else { - xName = ['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00'] + let arr = [] + for (let i = 0; i < 24; i++) { + arr.push(targetBottom.tips) + } + targetBottom.targetArr = arr + xName = ['0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'] } - target.bottomReality = (data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length).toFixed(2) - target.bottomTotal = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) - Tips('#Tips') + targetBottom.reality = (data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length).toFixed(4) + targetBottom.total = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) barChartAndLineChartFour({ xName: xName, yDataOne: data.map(val => val.qty), yDataOneName: "不良数", yDataTwo: data.map(val => val.rate), yDataTwoName: "一次不合格率", - yDataThree: target.bottom, + yDataThree: targetBottom.targetArr, yDataThreeName: "目标", }, document.getElementById("fractionDefective")); }) @@ -121,7 +119,7 @@ $(() => { //追踪事件轮询 $.post(url + "/selectInStoreOrderInfo", {}, data => { data = JSON.parse(data) - total('#total',data.map(val => val.actual_number).reduce((val1,val2) => val1 + val2 ,0)) + total('#total', data.map(val => val.actual_number).reduce((val1, val2) => val1 + val2, 0)) $('#trackEvents').remove() $('.trackEventsScrollTable').html('
') dynamicTable({ @@ -129,7 +127,7 @@ $(() => { rowNum: 5, timeout: 0, header: ["订单编号", '产品型号', "计划数量", "完成数量", "执行进度", "时间"], - data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), value.name.split('-')[1], value.plan_number, value.actual_number, ((value.actual_number /value.plan_number).toFixed(4) * 100 + '').slice(0,5) + '%', value.day]), + data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), value.name.split('-')[1], value.plan_number, value.actual_number, ((value.actual_number / value.plan_number).toFixed(4) * 100 + '').slice(0, 5) + '%', value.day]), index: false, fontColor: '#B4B7BF ', indexBGC: '#86F3FF', @@ -156,19 +154,40 @@ $(() => { }) let yieldType = '0' -let isFirst = true -let target = { - top: [], - bottom: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], - topTips: 0, - bottomTips: 3.05, - topProgress: 0, - topReality: 0, - topGap: 0, - topRate: 0, - bottomReality:0, - bottomTotal:0, +let targetTopRaw = { + targetArr: [], + tips: 0, + progress: 0, + reality: 0, + gap: 0, + rate: 0, } +let targetBottomRaw = { + targetArr: [], + tips: 0, + reality: 0, + total: 0, +} +const targetTopProxy = { + get: function (target, key) { + return target[key]; + }, + set: function (target, key, value) { + target[key] = value; + TipsTop('#TipsTop') + } +} +const targetBottomProxy = { + get: function (target, key) { + return target[key]; + }, + set: function (target, key, value) { + target[key] = value; + TipsBottom('#TipsBottom') + } +} +const targetTop = new Proxy(targetTopRaw, targetTopProxy) +const targetBottom = new Proxy(targetBottomRaw, targetBottomProxy) const LOSS = (val = 0) => { const html = ` ${val} @@ -195,21 +214,20 @@ const moduleTitle = () => { $('body').append(html) } // 目标 -const Tips = (el, top = { - target: target.topTips, - progress: target.topProgress, - reality: target.topReality, - gap: target.topGap, - rate: target.topRate, -}, bottom = {target: target.bottomTips, reality: target.bottomReality, total: target.bottomTotal}) => { +const TipsTop = (el) => { const html = ` - 目标:${top.target}  进度目标:${top.progress}  实际:${top.reality}  差异:${top.gap}  达成率:${top.rate}% - 目标:${bottom.target}%    实际:${bottom.reality}%    累计不良数:${bottom.total} + 目标:${targetTop.tips}  进度目标:${targetTop.progress}  实际:${targetTop.reality}  差异:${targetTop.gap}  达成率:${targetTop.rate}% + ` + $(el).html(html) +} +const TipsBottom = (el) => { + const html = ` + 目标:${targetBottom.tips}%    实际:${targetBottom.reality}%    累计不良数:${targetBottom.total} ` $(el).html(html) } // 入库执行订单合计 -const total = (el,val=0) => { +const total = (el, val = 0) => { const html = ` 合计:${val} ` diff --git a/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html b/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html index bd96f73..a22fbcb 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html +++ b/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html @@ -53,7 +53,8 @@ -
+
+
From 515d18369f31fdbf69ec09e6c45066d025ba8982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Sat, 23 Jul 2022 11:28:01 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/board/finalAssemblyProductionData.js | 4 ++-- ruoyi-admin/src/main/resources/static/js/echartsCommon.js | 3 +++ .../templates/broad/finalAssemblyProductionData.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) 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 af88a71..786a474 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js +++ b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js @@ -116,7 +116,7 @@ $(() => { }, document.getElementById("fractionDefective")); }) - //追踪事件轮询 + //当班入库执行订单 $.post(url + "/selectInStoreOrderInfo", {}, data => { data = JSON.parse(data) total('#total', data.map(val => val.actual_number).reduce((val1, val2) => val1 + val2, 0)) @@ -127,7 +127,7 @@ $(() => { rowNum: 5, timeout: 0, header: ["订单编号", '产品型号', "计划数量", "完成数量", "执行进度", "时间"], - data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), value.name.split('-')[1], value.plan_number, value.actual_number, ((value.actual_number / value.plan_number).toFixed(4) * 100 + '').slice(0, 5) + '%', value.day]), + data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), value.name.split('-')[1], value.plan_number, value.actual_number, value.plan_number === 0? 0 :((value.actual_number / value.plan_number)* 100 + '').slice(0, 5) + '%', value.day]), index: false, fontColor: '#B4B7BF ', indexBGC: '#86F3FF', diff --git a/ruoyi-admin/src/main/resources/static/js/echartsCommon.js b/ruoyi-admin/src/main/resources/static/js/echartsCommon.js index f012fe5..9b9f301 100644 --- a/ruoyi-admin/src/main/resources/static/js/echartsCommon.js +++ b/ruoyi-admin/src/main/resources/static/js/echartsCommon.js @@ -913,6 +913,9 @@ const barChartAndLineChartFour = function (data, id) { } ] }; + if (Math.max(...data.yDataOne) <=5){ + option.yAxis[0].max = 5 + } charts.setOption(option); $(window).resize(charts.resize); diff --git a/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html b/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html index a22fbcb..af03661 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html +++ b/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html @@ -46,7 +46,7 @@
- +
From fc414bb88e030a8d1e2dfa45483651c32624aab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Sat, 23 Jul 2022 12:10:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/board/orderVisualization.js | 259 ++++++++++++------ .../main/resources/static/js/echartsCommon.js | 34 +-- 2 files changed, 184 insertions(+), 109 deletions(-) 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 aadd5f4..8c8bbca 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js +++ b/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js @@ -1,103 +1,188 @@ $(() => { moduleTitle() 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') + 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 = 'mtk' - // let url = '' + let url = '/broad/mtk' // 轮询间隔时间 const INTERVAL = 30000 //每日人力出勤轮询 autoUpdate(url + "/team6s ", INTERVAL, data => { - console.log(data) - data ??= [ - { - teamName: '班组1', - teamNumber: 72, - path:'' - }, - { - teamName: '班组2', - teamNumber: 52, - path:'' - }, - { - teamName: '班组3', - teamNumber: 72, - path:'' - }, - { - teamName: '班组4', - teamNumber: 29, - path:'' - }, - { - teamName: '班组5', - teamNumber: 82, - path:'' - }, - { - teamName: '班组6', - teamNumber: 82, - path:'' - }, - { - teamName: '班组7', - teamNumber: 28, - path:'' - }, - { - teamName: '班组8', - teamNumber: 62, - path:'' - }, - { - teamName: '班组9', - teamNumber: 82, - path:'' - }, - { - teamName: '班组10', - teamNumber: 38, - path:'' - }, - { - teamName: '班组11', - teamNumber: 93, - path:'' - }, - ] - data.sort((a,b)=>{ - return b.teamNumber - a.teamNumber - }) - console.log(data) - singleVerticalBarChartTwo({ - xName: data.map(val => val.teamName), - yData: data.map(val => val.teamNumber), - yImg: data.map(val => val.path), - }, document.getElementById("manpowerAttendance")) + data ??= [ + { + teamName: '班组1', + teamNumber: 72, + path: '' + }, + { + teamName: '班组2', + teamNumber: 52, + path: '' + }, + { + teamName: '班组3', + teamNumber: 72, + path: '' + }, + { + teamName: '班组4', + teamNumber: 29, + path: '' + }, + { + teamName: '班组5', + teamNumber: 82, + path: '' + }, + { + teamName: '班组6', + teamNumber: 82, + path: '' + }, + { + teamName: '班组7', + teamNumber: 28, + path: '' + }, + { + teamName: '班组8', + teamNumber: 62, + path: '' + }, + { + teamName: '班组9', + teamNumber: 82, + path: '' + }, + { + teamName: '班组10', + teamNumber: 38, + path: '' + }, + { + teamName: '班组11', + teamNumber: 93, + path: '' + }, + ] + data.sort((a, b) => { + return b.teamNumber - a.teamNumber + }) + singleVerticalBarChartTwo({ + xName: data.map(val => val.teamName), + yData: data.map(val => val.teamNumber), + yImg: data.map(val => val.path), + }, document.getElementById("manpowerAttendance")) }) - // IQC - horizontalRoundedBarChartWithBackgroundTwo(null, document.getElementById("IQC")) + // 三日订单执行情况 + autoUpdate(url + "/inStore3d", INTERVAL, data => { + console.log(data) + horizontalRoundedBarChartWithBackgroundTwo({ + yNameOne: data.map(val => val.name), + yData: data.map(val => val.rate), + xDataName: "达成率", + }, document.getElementById("IQC")) + }) // 设备功率 - singleVerticalBarChart(null, document.getElementById("equipmentPower")) + // autoUpdate(url + "/inStore3d", INTERVAL, data => { + singleVerticalBarChart({ + xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月"], + yData: [12, 20, 11, 30, 14, 80, 50], + }, document.getElementById("equipmentPower")) + // }) // 生产效率 // autoUpdate(url + "/ ", INTERVAL, data => { - singleVerticalBarChart(null, document.getElementById("productionEfficiency")) + singleVerticalBarChart({ + xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月"], + yData: [12, 20, 11, 30, 14, 80, 50], + }, document.getElementById("productionEfficiency")) // }) // 成品入库统计 - percentageRingDiagram(null, document.getElementById("mainData")) + // autoUpdate(url + "/inStore3d", INTERVAL, data => { + percentageRingDiagram([ + { + name: "内胆检漏", + value: 54, + }, + { + name: "安全检测", + value: 44, + }, + { + name: "成品检漏", + value: 35, + }, + { + name: "测温性能", + value: 30, + }, + { + name: "成品外观", + value: 44, + }, + ], document.getElementById("mainData")) + // }) }) const today = () => { @@ -141,7 +226,17 @@ const safe = (el) => { $(el).html(html) } -const card = (val = {top: 1, left: 1,title:'',name1:'',value1:'',name2:'',value2:'',name3:'',value3:''},el) => { +const card = (val = { + top: 1, + left: 1, + title: '', + name1: '', + value1: '', + name2: '', + value2: '', + name3: '', + value3: '' +}, el) => { const html = `
diff --git a/ruoyi-admin/src/main/resources/static/js/echartsCommon.js b/ruoyi-admin/src/main/resources/static/js/echartsCommon.js index 9b9f301..78d170e 100644 --- a/ruoyi-admin/src/main/resources/static/js/echartsCommon.js +++ b/ruoyi-admin/src/main/resources/static/js/echartsCommon.js @@ -1587,12 +1587,11 @@ const singleVerticalBarChart = function (data, id) { } const singleVerticalBarChartTwo = function (data, id) { let charts = echarts.init(id); - let walk = - 'path://M29.902,23.275c1.86,0,3.368-1.506,3.368-3.365c0-1.859-1.508-3.365-3.368-3.365 c-1.857,0-3.365,1.506-3.365,3.365C26.537,21.769,28.045,23.275,29.902,23.275z M36.867,30.74c-1.666-0.467-3.799-1.6-4.732-4.199 c-0.932-2.6-3.131-2.998-4.797-2.998s-7.098,3.894-7.098,3.894c-1.133,1.001-2.1,6.502-0.967,6.769 c1.133,0.269,1.266-1.533,1.934-3.599c0.666-2.065,3.797-3.466,3.797-3.466s0.201,2.467-0.398,3.866 c-0.599,1.399-1.133,2.866-1.467,6.198s-1.6,3.665-3.799,6.266c-2.199,2.598-0.6,3.797,0.398,3.664 c1.002-0.133,5.865-5.598,6.398-6.998c0.533-1.397,0.668-3.732,0.668-3.732s0,0,2.199,1.867c2.199,1.865,2.332,4.6,2.998,7.73 s2.332,0.934,2.332-0.467c0-1.401,0.269-5.465-1-7.064c-1.265-1.6-3.73-3.465-3.73-5.265s1.199-3.732,1.199-3.732 c0.332,1.667,3.335,3.065,5.599,3.399C38.668,33.206,38.533,31.207,36.867,30.74z'; if (!data) { data = { xName: ['0时', '2时', '4时', '6时', '8时', '10时', '12时', '14时'], yData: [38, 60, 40, 55, 42, 39, 45, 40], + yImg: ['','','','','','','',''], } } let option = { @@ -1677,23 +1676,6 @@ const singleVerticalBarChartTwo = function (data, id) { type: 'bar', barMaxWidth: 'auto', barWidth: 1.5 * vw, - - // label: { - // show: true, - // position: 'top', - // // distance: 10, - // color: '#fff', - // formatter: '{a|}', - // rich: { - // a: { - // width: 3 * vw, - // height: 3 * vw, - // backgroundColor: { - // image: 'http://10.100.70.5:9090/profile/upload/2022/07/22/%E9%99%88%E5%A6%82%E5%8D%8E_20220722161444A002.jpeg' - // }, - // }, - // } - // }, }, { data: data.yData, @@ -1721,19 +1703,17 @@ const singleVerticalBarChartTwo = function (data, id) { type: 'pictorialBar', name: 'pictorial element', symbol: function(val,index){ - console.log(val) - console.log(index) - // return walk + return 'image://' + 'http://10.100.70.5:9090/' + data.yImg[index.dataIndex] }, - symbolSize: [20, 20], + symbolSize: [40, 40], z: 10, - data: [ - { - value: data.yData[0], + data: data.yData.map(val => { + return { + value: val, symbolPosition: 'end', symbolOffset: [0, '-120%'] } - ] + }) }, ], }; From b0a439b7c9a7a38458110d2538efe7b2323236ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Sat, 23 Jul 2022 12:27:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/board/finalAssemblyProductionData.js | 4 ++-- ruoyi-admin/src/main/resources/templates/broad/fp.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 786a474..ada37e5 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js +++ b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js @@ -69,7 +69,7 @@ $(() => { } // 达成率 if (targetTop.progress != 0) { - targetTop.rate = ((targetTop.reality / targetTop.progress).toFixed(4) * 100 + '').substring(0, 5) + targetTop.rate = ((targetTop.reality / targetTop.progress)).toFixed(4) * 100 } else { targetTop.rate = 0 } @@ -103,7 +103,7 @@ $(() => { targetBottom.targetArr = arr xName = ['0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'] } - targetBottom.reality = (data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length).toFixed(4) + targetBottom.reality = ((data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length)).toFixed(4) targetBottom.total = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) barChartAndLineChartFour({ xName: xName, diff --git a/ruoyi-admin/src/main/resources/templates/broad/fp.html b/ruoyi-admin/src/main/resources/templates/broad/fp.html index 7676c48..e122345 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/fp.html +++ b/ruoyi-admin/src/main/resources/templates/broad/fp.html @@ -505,10 +505,10 @@ times++ } getTable(classes,dataOne) - total(((data.filter(val => val.status === '生产中').length / 28).toFixed(4) * 100 + '').substring(0, 5) + '%', + total(((data.filter(val => val.status === '生产中').length / 28)).toFixed(4) * 100 + '%', eval(data.map(val => val.plan_number).join('+')), eval(data.map(val => val.qty).join('+')), - ((eval(data.map(val => val.qty).join('+')) / eval(data.map(val => val.plan_number).join('+'))).toFixed(4) * 100 + '').substring(0, 5) + '%', + ((eval(data.map(val => val.qty).join('+')) / eval(data.map(val => val.plan_number).join('+')))).toFixed(4) * 100+ '%', eval(data.map(val => val.h1).join('+')), eval(data.map(val => val.h2).join('+')), eval(data.map(val => val.h3).join('+')),