From c550b714fb0bab9929cb625be95ac89a3cdf46f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 29 Jul 2022 16:22:36 +0800 Subject: [PATCH] =?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 | 1 - .../main/resources/static/js/board/week.js | 10 +-- .../main/resources/static/js/echartsCommon.js | 68 ++----------------- 3 files changed, 12 insertions(+), 67 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 7ea7964..13b3e72 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js +++ b/ruoyi-admin/src/main/resources/static/js/board/orderVisualization.js @@ -176,7 +176,6 @@ $(() => { }, '#cardOne') break case '安全检测': - debugger arr = data.find(val => val.code === '安全检测').list.sort(function (a, b) { return b.qty - a.qty }) diff --git a/ruoyi-admin/src/main/resources/static/js/board/week.js b/ruoyi-admin/src/main/resources/static/js/board/week.js index 2fb0b57..ca4368f 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/week.js +++ b/ruoyi-admin/src/main/resources/static/js/board/week.js @@ -85,27 +85,27 @@ $(() => { xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), yData: yDataOne, yDataName: "内胆检漏" - }, document.getElementById("equipmentPowerOne")) + }, document.getElementById("equipmentPowerOne"),undefined,undefined,'#389af4') lineChart({ xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), yData: yDataTwo, yDataName: "安全检测" - }, document.getElementById("equipmentPowerTwo")) + }, document.getElementById("equipmentPowerTwo"),undefined,undefined,'#ff8c37') lineChart({ xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), yData: yDataThree, yDataName: "成品检漏" - }, document.getElementById("equipmentPowerThree")) + }, document.getElementById("equipmentPowerThree"),undefined,undefined,'#ffc257') lineChart({ xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), yData: yDataFour, yDataName: "测温性能" - }, document.getElementById("equipmentPowerFour")) + }, document.getElementById("equipmentPowerFour"),undefined,undefined,'#fd6f97') lineChart({ xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), yData: yDataFive, yDataName: "成品外观" - }, document.getElementById("equipmentPowerFive")) + }, document.getElementById("equipmentPowerFive"),undefined,undefined,'#a181fc') // pieChart(data.map((val, index) => { // if (index == 0 ) { // return { diff --git a/ruoyi-admin/src/main/resources/static/js/echartsCommon.js b/ruoyi-admin/src/main/resources/static/js/echartsCommon.js index d22076d..9275fdb 100644 --- a/ruoyi-admin/src/main/resources/static/js/echartsCommon.js +++ b/ruoyi-admin/src/main/resources/static/js/echartsCommon.js @@ -946,19 +946,17 @@ const barChartAndLineChartFour = function (data, id) { } // 折线图 -const lineChart = function (data, id, unit = '',smooth=false) { +const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') { let charts = echarts.init(id); if (!data) { data = { xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], yData: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73], yDataName: "提升百分比", - yDataTwo: [60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60], - yDataTwoName: "百分比" } } - let min = Math.ceil(Math.min(...data.yData,...(data.yDataTwo || []))) - let max = Math.ceil(Math.max(...data.yData,...(data.yDataTwo || []))) + let min = Math.ceil(Math.min(...data.yData)) + let max = Math.ceil(Math.max(...data.yData)) let option = { grid: { top: '28%', @@ -1050,12 +1048,12 @@ const lineChart = function (data, id, unit = '',smooth=false) { symbolSize: 4, //标记的大小 itemStyle: { //折线拐点标志的样式 - color: '#14bd2d', + color: color, borderWidth: '2', - borderColor: '#14bd2d', + borderColor: color, }, lineStyle: { - color: '#14bd2d', + color: color, }, label: { //图形上的文本标签 @@ -1064,7 +1062,7 @@ const lineChart = function (data, id, unit = '',smooth=false) { show: true, position: "top", textStyle: { - color: "#14bd2d", + color: color, fontStyle: "normal", fontFamily: "微软雅黑", fontSize: 0.5 * vw, @@ -1073,58 +1071,6 @@ const lineChart = function (data, id, unit = '',smooth=false) { }, data: data.yData, }, - { - name: data.yDataTwoName, - type: 'line', - smooth:smooth, - showAllSymbol: true, //显示所有图形。 - symbol: 'circle', //标记的图形为实心圆 - symbolSize: 4, //标记的大小 - itemStyle: { - //折线拐点标志的样式 - color: '#3094ea', - borderWidth: '2', - borderColor: '#3094ea', - }, - lineStyle: { - color: '#3094ea', - }, - label: { - //图形上的文本标签 - normal: { - formatter: `{c}${unit}`, - show: true, - position: "top", - textStyle: { - color: "#3094ea", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.5 * vw, - }, - }, - }, - // areaStyle: { - // normal: { - // color: new echarts.graphic.LinearGradient( - // 0, - // 0, - // 0, - // 1, - // [ - // { - // offset: 0, - // color: "rgb(76,82,193,0.7)", - // }, - // { - // offset: 0.8, - // color: "rgb(191,194,220,0.4)", - // }, - // ], - // ), - // }, - // }, - data: data.yDataTwo, - }, ], };