From 511896653fa68a9ee0f10c801d4fa4962f6c31ea Mon Sep 17 00:00:00 2001 From: wuqun Date: Thu, 9 Mar 2023 11:41:18 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E9=A6=96=E9=A1=B5=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/alarm/alarmStatistics.js | 32 +++++++++---------- .../src/sections/shouye/containers/shouye.js | 8 ++--- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/web/client/src/sections/shouye/components/alarm/alarmStatistics.js b/web/client/src/sections/shouye/components/alarm/alarmStatistics.js index a58b125..9ced90a 100644 --- a/web/client/src/sections/shouye/components/alarm/alarmStatistics.js +++ b/web/client/src/sections/shouye/components/alarm/alarmStatistics.js @@ -6,32 +6,30 @@ class AlarmStatistics extends Component { constructor(props) { super(props); this.state = { - workers: { - wTypePieData: [ - { item: '点位1', count: 214 }, - { item: '点位2', count: 135 }, - { item: '点位3', count: 88 }, - { item: '点位4', count: 63 }, - { item: '点位5', count: 56 }, - { item: '点位6', count: 115 }, - { item: '点位7', count: 67 }, - { item: '点位8', count: 144 }, - { item: '点位9', count: 21 }, - { item: '点位10', count: 83 }, - ] - } + alarmList: [ + { item: '点位1', count: 214 }, + { item: '点位2', count: 135 }, + { item: '点位3', count: 88 }, + { item: '点位4', count: 63 }, + { item: '点位5', count: 56 }, + { item: '点位6', count: 115 }, + { item: '点位7', count: 67 }, + { item: '点位8', count: 144 }, + { item: '点位9', count: 21 }, + { item: '点位10', count: 83 }, + ] } } render() { const { height } = this.props; - const { workers } = this.state; + const { alarmList } = this.state; let max = null, content = null; - let data = workers.wTypePieData.sort((a, b) => b.count - a.count); + let data = alarmList.sort((a, b) => b.count - a.count); max = data[0].count; content =
{ - workers.wTypePieData.map((wd, i) => { + alarmList.map((wd, i) => { let cls = i < 3 ? 'alarm-row rank1' : 'alarm-row rank2'; return No.{i + 1} diff --git a/web/client/src/sections/shouye/containers/shouye.js b/web/client/src/sections/shouye/containers/shouye.js index 71298ae..535fe62 100644 --- a/web/client/src/sections/shouye/containers/shouye.js +++ b/web/client/src/sections/shouye/containers/shouye.js @@ -141,14 +141,14 @@ const Information = (props) => {
cd.value).reverse()} yAxis={chartData1.map(cd => cd.name).reverse()} />
cd.name)} yAxis1={chartData2.map(cd => cd.num)} yAxis2={chartData2.map(cd => cd.repairNum)} /> @@ -156,12 +156,12 @@ const Information = (props) => {
- +
cd.name)} yAxis={chartData4.map(cd => cd.cost)} />