Compare commits
No commits in common. "eef87b6e81a4d589d8cb57fb136610f69a419644" and "ffea20482073df2b490d1e0c1dcd3ae411cb107f" have entirely different histories.
eef87b6e81
...
ffea204820
|
|
@ -11,13 +11,13 @@ function CheckBox({name, grpCd, selectedValue}){
|
|||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if(checkBox&&selectedValue){
|
||||
if(selectedValue){
|
||||
const itemCdAry = selectedValue.split(',');
|
||||
itemCdAry.forEach(function(itemCd){
|
||||
document.querySelector(`#chkBox_${itemCd}`).checked = true;
|
||||
})
|
||||
}
|
||||
}, [checkBox]);
|
||||
}, [selectedValue]);
|
||||
|
||||
function getCodeItemList() {
|
||||
EgovNet.requestFetch(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ function SelectOption({name, grpCd, selectedValue}){
|
|||
useEffect(() => {
|
||||
getCodeItemList()
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setValue(selectedValue)
|
||||
}, [selectedValue]);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ function List({}) {
|
|||
});
|
||||
|
||||
const [listTag, setListTag] = useState([]);
|
||||
const [userSeOption, setUserSeOption] = useState([]);
|
||||
|
||||
const [paginationInfo, setPaginationInfo] = useState({});
|
||||
|
||||
|
|
@ -39,24 +40,32 @@ function List({}) {
|
|||
(resp) => {
|
||||
setPaginationInfo(resp.result.paginationInfo);
|
||||
let mutListTag = [];
|
||||
let userSeTag = [];
|
||||
|
||||
setListTag([]);
|
||||
setUserSeOption([]);
|
||||
// 리스트 항목 구성
|
||||
resp.result.userList.forEach(function (item, index) {
|
||||
mutListTag.push(
|
||||
<div className={"list_item"} key={"userListDiv_"+index}>
|
||||
<div><a href={"#"} onClick={()=>{userInfoModal(item)}}>{item.userId}</a></div>
|
||||
<div>{item.userSe}</div>
|
||||
<div><a href={"#"} onClick={()=>{userInfoModal(item.userSeq)}}>{item.userId}</a></div>
|
||||
<div>{item.userNm}</div>
|
||||
<div>{item.email}</div>
|
||||
<div>{item.phoneNum}</div>
|
||||
<div>{item.statusValue}</div>
|
||||
<div>{item.status}</div>
|
||||
<div><button className={"btn btn_red_h31 px-1"} onClick={()=>{removeUserInfo(item.userSeq)}}>삭제</button></div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
if(!mutListTag.length) mutListTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); // 게시판 목록 초기값
|
||||
|
||||
resp.result.userSeOption.forEach(function (item, index){
|
||||
userSeTag.push(<option value={item.itemCd}>{item.itemNm}</option>)
|
||||
})
|
||||
|
||||
setListTag(mutListTag);
|
||||
setUserSeOption(userSeTag);
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
|
|
@ -76,9 +85,9 @@ function List({}) {
|
|||
setSearchCondition({...searchCondition, pageIndex: passedPage})
|
||||
});
|
||||
|
||||
function userInfoModal(userInfo){
|
||||
function userInfoModal(userSeq){
|
||||
handleShow()
|
||||
setModalBody(<UserInfoModal savedInfo={userInfo} reloadFunction={retrieveList}></UserInfoModal>)
|
||||
setModalBody(<UserInfoModal userSeq={userSeq} reloadFunction={retrieveList}></UserInfoModal>)
|
||||
}
|
||||
|
||||
const removeUserInfo = useCallback((seq)=>{
|
||||
|
|
@ -128,6 +137,16 @@ function List({}) {
|
|||
{/* <!-- 검색조건 --> */}
|
||||
<div className="condition">
|
||||
<ul>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
|
||||
<select id="sel1" title="구분" defaultValue={searchCondition.userSe}
|
||||
onChange={(e) => {setSearchCondition({...searchCondition, userSe: e.target.value})}}>
|
||||
<option value="">전체</option>
|
||||
{userSeOption}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel1" title="조건" defaultValue={searchCondition.searchCondition}
|
||||
|
|
@ -151,6 +170,7 @@ function List({}) {
|
|||
|
||||
<div className="board_list userList">
|
||||
<div className="head">
|
||||
<span>구분</span>
|
||||
<span>아이디</span>
|
||||
<span>이름</span>
|
||||
<span>이메일</span>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,38 @@ import SelectOption from "components/commonCode/SelectOption";
|
|||
import CheckBox from "components/commonCode/CheckBox";
|
||||
import CODE from "../../../constants/code";
|
||||
|
||||
function UserInfoModal({savedInfo, reloadFunction}){
|
||||
|
||||
function UserInfoModal({userSeq, reloadFunction}){
|
||||
|
||||
const [userInfo, setUserInfo] = useState({ userSeq: '', userId: '', password: '', passwordChk: '', userNm: '', email: '', phoneNum: '', userSe:'', userRole:'', status:''});
|
||||
|
||||
function getModalContent(){
|
||||
EgovNet.requestFetch(
|
||||
'/admin/users/info?userSeq='+userSeq,
|
||||
{
|
||||
method: "GET"
|
||||
},
|
||||
(resp) => {
|
||||
const respInfo = resp.result.userInfo;
|
||||
const info = {
|
||||
userSeq: respInfo.userSeq,
|
||||
userId: respInfo.userId,
|
||||
userNm: respInfo.userNm,
|
||||
email: respInfo.email,
|
||||
phoneNum: respInfo.phoneNum,
|
||||
password: "",
|
||||
passwordChk: "",
|
||||
userSe: respInfo.userSe,
|
||||
userRole: respInfo.userRole,
|
||||
status: respInfo.status
|
||||
}
|
||||
setUserInfo(info);
|
||||
},
|
||||
(resp) => {
|
||||
console.log("err response : ", resp);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function userInfoChange(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
@ -23,6 +53,7 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
userNm: form.userNm.value,
|
||||
email: form.email.value,
|
||||
phoneNum: form.phoneNum.value,
|
||||
userSe: form.userSe.value,
|
||||
userRole: '',
|
||||
status: form.status.value,
|
||||
}
|
||||
|
|
@ -57,22 +88,26 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getModalContent();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>
|
||||
{savedInfo?.userNm} 상세정보
|
||||
{userInfo.userNm} 상세정보
|
||||
</Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
<Form onSubmit={(e) =>{userInfoChange(e)}} noValidate>
|
||||
<input type={"hidden"} name={"userSeq"} defaultValue={savedInfo?.userSeq} />
|
||||
<input type={"hidden"} name={"userSeq"} defaultValue={userInfo.userSeq} />
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
<Form.Label column sm={3}>
|
||||
아이디
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="text" name="userId" placeholder="아이디" required defaultValue={savedInfo?.userId} readOnly/>
|
||||
<Form.Control type="text" name="userId" placeholder="아이디" required defaultValue={userInfo?.userId} readOnly/>
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -96,7 +131,7 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
이름
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="text" name="userNm" placeholder="이름" required defaultValue={savedInfo?.userNm} />
|
||||
<Form.Control type="text" name="userNm" placeholder="이름" required defaultValue={userInfo?.userNm} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -104,7 +139,7 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
이메일
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="email" name="email" placeholder="email" required defaultValue={savedInfo?.email} />
|
||||
<Form.Control type="email" name="email" placeholder="email" required defaultValue={userInfo?.email} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -112,7 +147,15 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
연락처
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<Form.Control type="text" name="phoneNum" placeholder="연락처" required defaultValue={savedInfo?.phoneNum} />
|
||||
<Form.Control type="text" name="phoneNum" placeholder="연락처" required defaultValue={userInfo?.phoneNum} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
<Form.Label column sm={3}>
|
||||
사용자 유형
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<SelectOption name={"userSe"} grpCd={"ACC_TYPE"} selectedValue={userInfo?.userSe} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -120,7 +163,7 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
사용자 권한
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<CheckBox name={"userRole"} grpCd={"ROLE"} selectedValue={savedInfo?.userRole} />
|
||||
<CheckBox name={"userRole"} grpCd={"ROLE"} selectedValue={userInfo?.userRole} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Form.Group as={Row} className="mb-3">
|
||||
|
|
@ -128,7 +171,7 @@ function UserInfoModal({savedInfo, reloadFunction}){
|
|||
상태
|
||||
</Form.Label>
|
||||
<Col sm={9}>
|
||||
<SelectOption name={"status"} grpCd={"ACC_STUS"} selectedValue={savedInfo?.status} />
|
||||
<SelectOption name={"status"} grpCd={"ACC_STUS"} selectedValue={userInfo?.status} />
|
||||
</Col>
|
||||
</Form.Group>
|
||||
<Row className="mb-3">
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public class AdminUsersService extends EgovAbstractServiceImpl {
|
|||
}
|
||||
savedInfo.setEmail(info.getEmail());
|
||||
savedInfo.setPhoneNum(info.getPhoneNum());
|
||||
savedInfo.setUserSe(info.getUserSe());
|
||||
savedInfo.setUserRole(info.getUserRole());
|
||||
savedInfo.setStatus(info.getStatus());
|
||||
savedInfo.setLastChgId(updateUser);
|
||||
|
|
|
|||
|
|
@ -70,8 +70,6 @@ public class UserInfo extends BoardParams implements UserDetails{
|
|||
|
||||
@Transient
|
||||
private String passwordChk;
|
||||
@Transient
|
||||
private String statusValue;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@
|
|||
a.user_nm,
|
||||
a.phone_num,
|
||||
a.user_role,
|
||||
a.status,
|
||||
c.item_nm as status_value
|
||||
c.item_nm as status
|
||||
from user_info a
|
||||
inner join tc_code_item b on a.user_se = b.item_cd
|
||||
inner join tc_code_item c on a.status = c.item_cd
|
||||
|
|
|
|||
Loading…
Reference in New Issue