Skip to content

Commit 7273706

Browse files
committed
fixed bugs
1 parent 9ffab29 commit 7273706

File tree

6 files changed

+706
-632
lines changed

6 files changed

+706
-632
lines changed

package-lock.json

Lines changed: 461 additions & 389 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import './App.css';
33
import { makeStyles } from '@material-ui/core/styles';
4-
import {AppBar,IconButton,Typography,Button,Toolbar,Grid,Slide} from '@material-ui/core';
4+
import {AppBar,Typography,Button,Toolbar,Grid,Slide} from '@material-ui/core';
55
import coverPic from './image/cover.jpg';
66
import CRCP from './component/CRCP'
77
import TransferFunc from './component/TransferFunc'
@@ -56,7 +56,6 @@ const useStyles = makeStyles((theme) => ({
5656

5757
function App() {
5858
const [page, setPage] = React.useState('home');
59-
const [reportData, setReportData] = React.useState({});
6059
const [AnalysisPunchouts, setAnalysisPunchouts] = React.useState(0);
6160
const [AnalysisSlabThickness, setAnalysisSlabThickness] = React.useState(0);
6261
const classes = useStyles();
@@ -67,9 +66,8 @@ function App() {
6766
<div >
6867
<div className={classes.cover}></div>
6968
<AppBar position="static" style={{backgroundImage: `url(${headerPic})`, backgroundSize:'cover'}}>
70-
{/*<AppBar position="static">*/}
7169
<Toolbar>
72-
<img src={logo} style={{width:50}}/>
70+
<img src={logo} alt="description" style={{width:50}}/>
7371
<Typography variant="h6" className={classes.titleNav}>
7472
TxCRCP-ME Analysis
7573
</Typography>
@@ -103,24 +101,15 @@ function App() {
103101
<Slide direction="up" in={page==='CRCP'} mountOnEnter unmountOnExit>
104102
<CRCP
105103
toMenu={()=>setPage('home')}
106-
// print={(d)=>{setReportData(d);setPage('Print')}}
107104
AnalysisPunchouts={AnalysisPunchoutsFunc}
108105
AnalysisSlabThickness={AnalysisSlabThicknessFunc}
109106
/>
110107
</Slide>
111108
<Slide direction="up" in={page === 'TransferFunc'} mountOnEnter unmountOnExit>
112-
<div> {/* Wrap TransferFunc in Box */}
109+
<div>
113110
<TransferFunc />
114111
</div>
115112
</Slide>
116-
{/*<Slide direction="up" in={page==='Print'} mountOnEnter unmountOnExit>*/}
117-
{/* <Report*/}
118-
{/* data={reportData}*/}
119-
{/* toMenu={()=>setPage('home')}*/}
120-
{/* toCRCP={()=>setPage('CRCP')}*/}
121-
{/* AnalysisPunchouts={AnalysisPunchoutsFunc()}*/}
122-
{/* />*/}
123-
{/*</Slide>*/}
124113
</div>
125114
</div>
126115
</ThemeProvider>

src/component/CRCP.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const DialogTitle = withStyles(styles)((props) => {
115115
<MuiDialogTitle disableTypography className={classes.root} {...other}>
116116
{children}
117117
{onClose ? (
118-
<IconButton aria-label="close" size="small" className={classes.closeButton} onClick={onClose} size="small">
118+
<IconButton aria-label="close" size="small" className={classes.closeButton} onClick={onClose}>
119119
<CloseIcon fontSize="small" />
120120
</IconButton>
121121
) : null}
@@ -191,6 +191,7 @@ const Total_design_trafic = <>
191191
<TransformComponent>
192192
<img
193193
src={TrafficOneDirectionPic}
194+
alt="description"
194195
style={{ maxWidth: 500, height: "auto" }}
195196
/></TransformComponent></TransformWrapper>
196197
</>;
@@ -514,7 +515,7 @@ class CRCP extends Component {
514515
if (i !== 1)
515516
rowIndexStress = 7;
516517
for (var j = 0; j < 12; j++) {
517-
if (i == 1 && j == 0)
518+
if (i === 1 && j === 0)
518519
;
519520
//If counterYear = 1 And counterMonth = 1 Then
520521
// 'If First Year than Omit Calculation of First Month, Already Done
@@ -547,7 +548,7 @@ class CRCP extends Component {
547548
// Cells(rowIndex, 12) = Cells(rowIndex - 1, 12).Value + Cells(rowIndex, 11).Value
548549
row2.push(18.985 / (1 + 5 * Math.pow(row2[11], -1.1)));
549550
// Cells(rowIndex, 13) = 18.985 / (1 + 5 * Cells(rowIndex, 12).Value ^ -1.1)
550-
if (rowIndexStress == 13)
551+
if (rowIndexStress === 13)
551552
rowIndexStress = 1;
552553
rows.push(row2);
553554
row1 = row2;
@@ -786,7 +787,7 @@ class CRCP extends Component {
786787
if (this.state.helperEl.el === event.currentTarget && freeze && this.state.helperEl.freeze) // same target
787788
this.handleCloseHelper(event);
788789
else {
789-
if (freeze || this.state.helperEl.el !== event.currentTarget && freeze)
790+
if ((freeze || this.state.helperEl.el) !== (event.currentTarget && freeze))
790791
this.setState({ helperEl: { el: event.currentTarget, content, freeze } });
791792
}
792793
} else {
@@ -934,6 +935,7 @@ class CRCP extends Component {
934935
case "MH":
935936
case "CL":
936937
return 25;
938+
default:
937939
}
938940
}
939941

@@ -1927,7 +1929,7 @@ class CRCP extends Component {
19271929
<CloseIcon fontSize="small" />
19281930
</IconButton> : ""}
19291931
{this.state.helperEl.content.src ?
1930-
<a href={this.state.helperEl.content.href} target={"_blank"}>
1932+
<a href={this.state.helperEl.content.href} target={"_blank"} rel="noopener noreferrer">
19311933
<TransformWrapper
19321934
defaultScale={1}
19331935
defaultPositionX={1}
@@ -1936,6 +1938,7 @@ class CRCP extends Component {
19361938
<TransformComponent>
19371939
<img
19381940
src={this.state.helperEl.content.src}
1941+
alt="description"
19391942
style={{ maxWidth: 600, height: "auto" }}
19401943
/></TransformComponent></TransformWrapper> </a> :
19411944
this.state.helperEl.content.text

src/component/EditableTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function CustomTable ({data,editFields,onChange,formular}){
9393
getVal: (formular?formular[k]:undefined)??(d=>d[k])
9494
})))
9595
}
96-
},[data])
96+
},[data, editFields, formular])
9797
return <TableContainer style={{height:'70vh'}}>
9898
<Table stickyHeader aria-label="sticky table" size="small">
9999
<TableHead>

src/component/tableData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ class Tabledata extends Component {
2929
maxArray.push(0);
3030
}
3131
for (var i = 0; i < rows.length; i++) {
32-
for (var j = 0; j < rows[i].length; j++) {
32+
for (j = 0; j < rows[i].length; j++) {
3333
if (rows[i][j] > maxArray[j])
3434
maxArray[j] = rows[i][j];
3535
if (rows[i][j] < minArray[j])
3636
minArray[j] = rows[i][j];
3737
}
3838
}
3939
this.colorRedBlues = [];
40-
for (var j = 0; j < rows[0].length; j++) {
40+
for (j = 0; j < rows[0].length; j++) {
4141
var colorScale = d3.scaleLinear()
4242
.domain([minArray[j], (minArray[j] + maxArray[j]) / 2, maxArray[j]])
4343
.range(["#55f", "white", "#f55"]);

0 commit comments

Comments
 (0)