From d084bb860824d86ea36ac917c65f089a5654a4cc 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, 14 Oct 2022 14:19:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=93=9D=E5=86=85=E8=83=86?= =?UTF-8?q?=E6=88=90=E5=9E=8B=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/common/echarts.common.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/productionboard/src/main/resources/static/js/common/echarts.common.js b/productionboard/src/main/resources/static/js/common/echarts.common.js index 80ab7ca..7bc52a6 100644 --- a/productionboard/src/main/resources/static/js/common/echarts.common.js +++ b/productionboard/src/main/resources/static/js/common/echarts.common.js @@ -1169,9 +1169,22 @@ const bluePolygonHistogram = (res, ids) => { //多个立体柱状图 const multipleThreeDimensionalCylindrical = (res, ids) => { let mycharts = echarts.init(ids); - const xValue = res.map(val => val.materialName?.split(',')[0] || ' ') - const lineStoreAmount = res.map(val => val.lineStoreAmount) || [] - const hullStoreAmount = res.map(val => val.hullStoreAmount || '0') + const value = [] + res.forEach(e=>{ + if(!(value.includes(e.materialName))){ + value.push(e.materialName) + } + }) + const data = value.map(e => { + return { + materialName:e, + lineStoreAmount:res.filter( val => val.materialName === e).filter(val => val.locationNumber === 'L001')[0].lineStoreAmount, + hullStoreAmount:res.filter( val => val.materialName === e).filter(val => val.locationNumber === 'U001')[0].lineStoreAmount + } + }) + const xValue = data.map(val => val.materialName) + const lineStoreAmount = data.map(val => val.lineStoreAmount) + const hullStoreAmount = data.map(val => val.hullStoreAmount) let lineColor = "#406A92"; let labelColor = "#fff"; let fontSize = "12";