설문관리 중간저장.

thkim
강석 최 2024-03-06 19:37:09 +09:00
parent 8afc775f18
commit 03c93da6cc
2 changed files with 71 additions and 10 deletions

View File

@ -114,7 +114,7 @@ function Survey({}) {
</div>
</div>
<Modal size={modalSize} show={show} onHide={handleClose} keyboard={false}>
<Modal size={modalSize} show={show} onHide={handleClose} keyboard={false} scrollable>
{modalBody}
</Modal>
</div>

View File

@ -1,8 +1,9 @@
import React, {useEffect, useState} from "react";
import Modal from "react-bootstrap/Modal";
import Form from "react-bootstrap/Form";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
import Form from "react-bootstrap/Form";
import Table from "react-bootstrap/Table";
import * as EgovNet from "api/egovFetch";
function QuestionModal({svySeq}){
@ -21,9 +22,11 @@ function QuestionModal({svySeq}){
const temp = [];
resp.result.qtList.forEach(function (qt, index){
temp.push(
<Row>
<Col onClick={()=>selectQt(qt.itemList)}>{qt.qtTitle}</Col>
</Row>
<tr>
<td className={"clickable"} onClick={()=>selectQt(qt.itemList)}>
<Form.Control type={"text"} defaultValue={qt.qtTitle}/>
</td>
</tr>
)
})
setQtTag(temp);
@ -39,14 +42,40 @@ function QuestionModal({svySeq}){
const temp = [];
itemList.forEach(function (item, index){
temp.push(
<Row>
<Col>{item.itemNm}</Col>
</Row>
<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(){
const temp = [...itemTag]
temp.push(
<tr>
<td>
<Form.Control type={"text"}/>
</td>
</tr>
)
setItemTag(temp)
}
function editSurveyQt(e){
}
@ -63,10 +92,42 @@ function QuestionModal({svySeq}){
<Modal.Body>
<Row>
<Col xs={6}>
{qtTag}
<Table>
<thead>
<tr>
<th>질문</th>
</tr>
</thead>
<tbody>
{qtTag}
</tbody>
<tfoot>
<tr>
<td>
<button className={"btn btn_blue_h31"} onClick={addQt}>추가</button>
</td>
</tr>
</tfoot>
</Table>
</Col>
<Col xs={6}>
{itemTag}
<Table>
<thead>
<tr>
<th>보기</th>
</tr>
</thead>
<tbody>
{itemTag}
</tbody>
<tfoot>
<tr>
<td>
<button className={"btn btn_blue_h31"} onClick={addItem}>추가</button>
</td>
</tr>
</tfoot>
</Table>
</Col>
</Row>
</Modal.Body>