From ada4b55b386a043846d86fc49cc614cce510289b Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Mon, 26 Aug 2024 08:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A3=8E=E9=99=A9=E5=9B=9B?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/RiskFourOne.js | 56 +++++++++---------------------------- src/layout/RiskFourThree.js | 36 ++++++------------------ src/layout/RiskFourTwo.js | 46 ++++++++---------------------- 3 files changed, 33 insertions(+), 105 deletions(-) diff --git a/src/layout/RiskFourOne.js b/src/layout/RiskFourOne.js index 871c49d..9896da1 100644 --- a/src/layout/RiskFourOne.js +++ b/src/layout/RiskFourOne.js @@ -36,47 +36,7 @@ class RiskFourOne extends React.Component { constructor(props) { super(props); this.state = { - RiskData: { - IsSuccessful: true, - Data: { - RISKLEVELCOUNTS: [ - { - NAME: "矿石堆场", - LEVEL: 1, - LEVEL1: 1, - LEVEL2: 2, - LEVEL3: 3, - LEVEL4: 4, - }, - { - NAME: "东排土场", - LEVEL: 3, - LEVEL1: 3, - LEVEL2: 2, - LEVEL3: 3, - LEVEL4: 4, - }, - { - NAME: "采场-终了边坡区", - LEVEL: 3, - LEVEL1: 3, - LEVEL2: 2, - LEVEL3: 3, - LEVEL4: 4, - }, - { - NAME: "采场-生产区域", - LEVEL: 2, - LEVEL1: 2, - LEVEL2: 2, - LEVEL3: 3, - LEVEL4: 4, - }, - ], - }, - TotalCount: 0, - MessageType: 0, - }, + RiskData: [], level1: 0, level2: 0, level3: 0, @@ -94,16 +54,18 @@ class RiskFourOne extends React.Component { } componentDidUpdate=(prevProps, prevState)=>{ if(prevProps.riskleveldata !== this.props.riskleveldata){ - console.log('this.props.riskleveldata',this.props.riskleveldata) this.props.riskleveldata.map((item, index) => { this.getTitle(item) + this.setState({ + RiskData:this.props.riskleveldata + }) }); } } componentDidMount() { - this.state.RiskData.Data.RISKLEVELCOUNTS.map((item, index) => { + this.props.riskleveldata?.map((item, index) => { this.getTitle(item) }); } @@ -124,8 +86,10 @@ class RiskFourOne extends React.Component { }} >