Skip to content

Commit

Permalink
Merge pull request #94 from Kim-Jaemin420/develop
Browse files Browse the repository at this point in the history
문서 H4-1 수정
  • Loading branch information
Kim-Jaemin420 authored May 18, 2021
2 parents 1501083 + 29d35be commit b80c5da
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
5 changes: 4 additions & 1 deletion src/components/doc/H4-1/H41Bottom.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { useSelector } from 'react-redux';
import styled from 'styled-components';

const BottomBox = styled.div`
Expand All @@ -22,11 +23,13 @@ const BottomBox = styled.div`
`;

const H41Bottom = ({ onChangeTextArea }) => {
const D2 = useSelector(state => state.h2A.D2);

return (
<BottomBox>
<div className='title'>Recommendation ;</div>
<div className='description'>
<textarea onChange={onChangeTextArea}></textarea>
<textarea value={D2} onChange={onChangeTextArea}></textarea>
</div>
</BottomBox>
);
Expand Down
23 changes: 12 additions & 11 deletions src/components/doc/H4-1/H41TableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,39 @@ import { useSelector } from 'react-redux';
import DeleteButton from '../common/DeleteButton';

const H41TableRow = ({ id, onRemove, onChange, units }) => {
const { TestDt } = useSelector(state => state.h2A.D1[id]);
const { CylnType, Volume, WorkPress, SerialNo, TestDt, Perform } = useSelector(state => state.h2A.D1[id]);

const inputArg = ({ target }) => onChange({ target, id });

return (
<tr>
<td>
<input type='text' onChange={inputArg} name="CylnType"/>
<input type='text' value={CylnType} onChange={inputArg} name="CylnType"/>
</td>
<td>
<input type='text' onChange={inputArg} name="Volume"/>
<input type='text' value={Volume} onChange={inputArg} name="Volume"/>
</td>
<td>
<input type='text' onChange={inputArg} name="WorkPress"/>
<input type='text' value={WorkPress} onChange={inputArg} name="WorkPress"/>
</td>
<td>
<input type='text' onChange={inputArg} name="SerialNo"/>
<input type='text' value={SerialNo} onChange={inputArg} name="SerialNo"/>
</td>
<td>
<DatePicker
selected={TestDt}
selected={new Date(TestDt)}
name="TestDt"
dateFormat="MMM.yyyy"
dateFormat="yyyy-MM"
onChange={value => onChange({ id, target: { name: "TestDt", value } })}
showMonthYearPicker
/>
</td>
<td>
<select onChange={inputArg} name="Perform">
<select value={Perform} onChange={inputArg} name="Perform">
<option defaultValue="선택해주세요">선택해주세요</option>
{units.map(unit => (
<option key={unit.CdNm} value={unit.CD}>
{unit.CdNm}
{units.map(({CdNm, CD}) => (
<option key={CdNm} value={CD}>
{CdNm}
</option>
))}
</select>
Expand Down
9 changes: 5 additions & 4 deletions src/components/doc/H4-1/H41Top.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { useSelector } from 'react-redux';
import styled from 'styled-components';
import H41TableRow from './H41TableRow';

Expand Down Expand Up @@ -49,8 +50,8 @@ const ButtonDiv = styled.div`
text-align: center;
`;

const H41Top = ({ onChange, onRemove, onInsert, lists, units }) => {

const H41Top = ({ onChange, onRemove, onInsert, units }) => {
const D1 = useSelector(state => state.h2A.D1);
return (
<>
<TableBox>
Expand All @@ -68,8 +69,8 @@ const H41Top = ({ onChange, onRemove, onInsert, lists, units }) => {
</tr>
</thead>
<tbody>
{lists.map(list => (
<H41TableRow key={list.id} id={list.id} onRemove={onRemove} onChange={onChange} units={units}/>
{Object.entries(D1).map(item => (
<H41TableRow key={item[0]} id={item[0]} onRemove={onRemove} onChange={onChange} units={units} />
))}
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion src/components/doc/H4/H4Top.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ButtonDiv = styled.div`
text-align: center;
`;

const H4Top = ({ onChange, onRemove, onInsert, lists, units }) => {
const H4Top = ({ onChange, onRemove, onInsert, units }) => {
const D1 = useSelector(state => state.h2A.D1);

return (
Expand Down

0 comments on commit b80c5da

Please sign in to comment.