Compare commits
No commits in common. "0d338b97b19cc1d2c296139ba5528f260edb7a4d" and "4c5567f6ae114a5ab2f47aafd2cb7d57433f5026" have entirely different histories.
0d338b97b1
...
4c5567f6ae
|
|
@ -8,8 +8,8 @@ import * as EgovNet from "api/egovFetch";
|
||||||
|
|
||||||
function QuestionModal({svySeq}){
|
function QuestionModal({svySeq}){
|
||||||
|
|
||||||
const [qtList, setQtList] = useState([]);
|
const [qtTag, setQtTag] = useState([]);
|
||||||
const [selectedQt, setSelectedQt] = useState(null);
|
const [itemTag, setItemTag] = useState([]);
|
||||||
|
|
||||||
function getSurveyQt(){
|
function getSurveyQt(){
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
|
|
@ -18,7 +18,19 @@ function QuestionModal({svySeq}){
|
||||||
method: "GET"
|
method: "GET"
|
||||||
},
|
},
|
||||||
(resp) => {
|
(resp) => {
|
||||||
setQtList(resp.result.qtList)
|
|
||||||
|
const temp = [];
|
||||||
|
resp.result.qtList.forEach(function (qt, index){
|
||||||
|
temp.push(
|
||||||
|
<tr>
|
||||||
|
<td className={"clickable"} onClick={()=>selectQt(qt.itemList)}>
|
||||||
|
<Form.Control type={"text"} defaultValue={qt.qtTitle}/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
setQtTag(temp);
|
||||||
|
|
||||||
},
|
},
|
||||||
function (resp) {
|
function (resp) {
|
||||||
console.log("err response : ", resp);
|
console.log("err response : ", resp);
|
||||||
|
|
@ -26,12 +38,42 @@ function QuestionModal({svySeq}){
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addQt(){
|
function selectQt(itemList){
|
||||||
|
const temp = [];
|
||||||
|
itemList.forEach(function (item, index){
|
||||||
|
temp.push(
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Form.Control type={"text"} defaultValue={item.itemNm}/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
setItemTag(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addQt(){
|
||||||
|
const temp = [...qtTag]
|
||||||
|
temp.push(
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Form.Control type={"text"}/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
setQtTag(temp)
|
||||||
}
|
}
|
||||||
|
|
||||||
function addItem(){
|
function addItem(){
|
||||||
|
const temp = [...itemTag]
|
||||||
|
temp.push(
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Form.Control type={"text"}/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
setItemTag(temp)
|
||||||
}
|
}
|
||||||
|
|
||||||
function editSurveyQt(e){
|
function editSurveyQt(e){
|
||||||
|
|
@ -49,7 +91,7 @@ function QuestionModal({svySeq}){
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={6}>
|
||||||
<Table>
|
<Table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -57,15 +99,7 @@ function QuestionModal({svySeq}){
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{qtList.map(qt=>{
|
{qtTag}
|
||||||
return (
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Form.Control type={"text"} defaultValue={qt.qtTitle} onClick={()=>{setSelectedQt(qt)}}/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -76,32 +110,7 @@ function QuestionModal({svySeq}){
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</Table>
|
</Table>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={7}>
|
<Col xs={6}>
|
||||||
<Form.Group as={Row} className="mb-3">
|
|
||||||
<Form.Label column sm={3}>
|
|
||||||
질문유형
|
|
||||||
</Form.Label>
|
|
||||||
<Col sm={9} key={`inline-radio`} className={'my-auto'}>
|
|
||||||
<Form.Check inline label="체크박스" name="qtType" type={'radio'} value={1} checked={selectedQt?.qtType === 1} onClick={()=>{setSelectedQt({...selectedQt, qtType:1})}}/>
|
|
||||||
<Form.Check inline label="라디오버튼" name="qtType" type={'radio'} value={2} checked={selectedQt?.qtType === 2} onClick={()=>{setSelectedQt({...selectedQt, qtType:2})}}/>
|
|
||||||
<Form.Check inline label="직접입력" name="qtType" type={'radio'} value={3} checked={selectedQt?.qtType === 3} onClick={()=>{setSelectedQt({...selectedQt, qtType:3})}}/>
|
|
||||||
<Form.Check inline label="이용자만족도" name="qtType" type={'radio'} value={4} checked={selectedQt?.qtType === 4} onClick={()=>{setSelectedQt({...selectedQt, qtType:4})}}/>
|
|
||||||
</Col>
|
|
||||||
</Form.Group>
|
|
||||||
<Form.Group as={Row} className={`mb-3 ${selectedQt?.qtType!==1?'d-none':''}`}>
|
|
||||||
<Form.Label column sm={3}>
|
|
||||||
최대 선택 개수
|
|
||||||
</Form.Label>
|
|
||||||
<Col sm={3}>
|
|
||||||
<Form.Control type="text" name="maxNo" defaultValue={selectedQt?.maxNo}/>
|
|
||||||
</Col>
|
|
||||||
<Form.Label column sm={'auto'}>
|
|
||||||
기타 여부
|
|
||||||
</Form.Label>
|
|
||||||
<Col sm={3} className={'my-auto'}>
|
|
||||||
<Form.Check type="checkbox" name="mandatoryYn" checked={selectedQt?.mandatoryYn==='Y'}/>
|
|
||||||
</Col>
|
|
||||||
</Form.Group>
|
|
||||||
<Table>
|
<Table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -109,15 +118,7 @@ function QuestionModal({svySeq}){
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{selectedQt?.itemList.map(item=>{
|
{itemTag}
|
||||||
return (
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<Form.Control type={"text"} defaultValue={item.itemNm}/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue