--- client/views/pages/join/Join.jsx
+++ client/views/pages/join/Join.jsx
... | ... | @@ -8,28 +8,28 @@ |
8 | 8 |
export default function Join() { |
9 | 9 |
const navigate = useNavigate(); |
10 | 10 |
const location = useLocation(); |
11 |
- const state = useSelector((state) => {return state}); |
|
11 |
+ const state = useSelector((state) => { |
|
12 |
+ return state; |
|
13 |
+ }); |
|
12 | 14 |
|
13 | 15 |
let defaultAuthority = null; |
14 | 16 |
let defaultAgencyId = null; |
15 | 17 |
let defaultGovernmentId = null; |
16 |
- console.log('location.state : ', location.state); |
|
17 |
- console.log('state.loginUser : ', state.loginUser); |
|
18 |
+ console.log("location.state : ", location.state); |
|
19 |
+ console.log("state.loginUser : ", state.loginUser); |
|
18 | 20 |
if (CommonUtil.isEmpty(location.state) == false) { |
19 |
- defaultAuthority = location.state['authority']; |
|
20 |
- defaultAgencyId = location.state['agency_id']; |
|
21 |
- defaultGovernmentId = location.state['government_id']; |
|
21 |
+ defaultAuthority = location.state["authority"]; |
|
22 |
+ defaultAgencyId = location.state["agency_id"]; |
|
23 |
+ defaultGovernmentId = location.state["government_id"]; |
|
22 | 24 |
} else if (CommonUtil.isEmpty(state.loginUser) == false) { |
23 |
- defaultAuthority = state.loginUser['authority']; |
|
24 |
- defaultAgencyId = state.loginUser['agency_id']; |
|
25 |
- defaultGovernmentId = state.loginUser['government_id']; |
|
25 |
+ defaultAuthority = state.loginUser["authority"]; |
|
26 |
+ defaultAgencyId = state.loginUser["agency_id"]; |
|
27 |
+ defaultGovernmentId = state.loginUser["government_id"]; |
|
26 | 28 |
} else { |
27 | 29 |
defaultAuthority = null; |
28 | 30 |
defaultAgencyId = null; |
29 | 31 |
defaultGovernmentId = null; |
30 | 32 |
} |
31 |
- |
|
32 |
- |
|
33 | 33 |
|
34 | 34 |
/**** 기본 조회 데이터 (시작) ****/ |
35 | 35 |
//권한 타입 종류 |
... | ... | @@ -39,49 +39,69 @@ |
39 | 39 |
fetch("/common/systemCode/authoritiesSelect.json", { |
40 | 40 |
method: "POST", |
41 | 41 |
headers: { |
42 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
42 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
43 | 43 |
}, |
44 | 44 |
body: JSON.stringify({}), |
45 |
- }).then((response) => response.json()).then((data) => { |
|
46 |
- console.log("권한 타입 종류 목록 조회 : ", data); |
|
47 |
- setAuthorities(data); |
|
48 |
- }).catch((error) => { |
|
49 |
- console.log('authoritiesSelect() /common/systemCode/authoritiesSelect.json error : ', error); |
|
50 |
- }); |
|
45 |
+ }) |
|
46 |
+ .then((response) => response.json()) |
|
47 |
+ .then((data) => { |
|
48 |
+ console.log("권한 타입 종류 목록 조회 : ", data); |
|
49 |
+ setAuthorities(data); |
|
50 |
+ }) |
|
51 |
+ .catch((error) => { |
|
52 |
+ console.log( |
|
53 |
+ "authoritiesSelect() /common/systemCode/authoritiesSelect.json error : ", |
|
54 |
+ error |
|
55 |
+ ); |
|
56 |
+ }); |
|
51 | 57 |
}; |
52 | 58 |
//기관 계층 구조 목록 |
53 | 59 |
const [orgListOfHierarchy, setOrgListOfHierarchy] = React.useState([]); |
54 | 60 |
//기관(관리, 시행) 계층 구조 목록 조회 |
55 | 61 |
const orgSelectListOfHierarchy = () => { |
56 | 62 |
const param = { |
57 |
- 'government_id': defaultGovernmentId, |
|
58 |
- 'agency_id': defaultAgencyId |
|
63 |
+ government_id: defaultGovernmentId, |
|
64 |
+ agency_id: defaultAgencyId, |
|
59 | 65 |
}; |
60 |
- if (CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_ADMIN') { |
|
61 |
- param['government_id'] = null; |
|
62 |
- param['agency_id'] = null; |
|
66 |
+ if ( |
|
67 |
+ CommonUtil.isEmpty(state.loginUser) == false && |
|
68 |
+ state.loginUser["authority"] == "ROLE_ADMIN" |
|
69 |
+ ) { |
|
70 |
+ param["government_id"] = null; |
|
71 |
+ param["agency_id"] = null; |
|
63 | 72 |
} |
64 | 73 |
fetch("/org/orgSelectListOfHierarchy.json", { |
65 | 74 |
method: "POST", |
66 | 75 |
headers: { |
67 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
76 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
68 | 77 |
}, |
69 | 78 |
body: JSON.stringify(param), |
70 |
- }).then((response) => response.json()).then((data) => { |
|
71 |
- console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
|
72 |
- setOrgListOfHierarchy(data); |
|
73 |
- }).catch((error) => { |
|
74 |
- console.log('orgSelectListOfHierarchy() /org/orgSelectListOfHierarchy.json error : ', error); |
|
75 |
- }); |
|
79 |
+ }) |
|
80 |
+ .then((response) => response.json()) |
|
81 |
+ .then((data) => { |
|
82 |
+ console.log("기관(관리, 시행) 계층 구조 목록 조회 : ", data); |
|
83 |
+ setOrgListOfHierarchy(data); |
|
84 |
+ }) |
|
85 |
+ .catch((error) => { |
|
86 |
+ console.log( |
|
87 |
+ "orgSelectListOfHierarchy() /org/orgSelectListOfHierarchy.json error : ", |
|
88 |
+ error |
|
89 |
+ ); |
|
90 |
+ }); |
|
76 | 91 |
}; |
77 | 92 |
const getAgencyList = () => { |
78 |
- const government = orgListOfHierarchy.find(item => item['government_id'] == user['government_id']); |
|
79 |
- if (CommonUtil.isEmpty(government) || CommonUtil.isEmpty(government['agencyList'])) { |
|
93 |
+ const government = orgListOfHierarchy.find( |
|
94 |
+ (item) => item["government_id"] == user["government_id"] |
|
95 |
+ ); |
|
96 |
+ if ( |
|
97 |
+ CommonUtil.isEmpty(government) || |
|
98 |
+ CommonUtil.isEmpty(government["agencyList"]) |
|
99 |
+ ) { |
|
80 | 100 |
return []; |
81 | 101 |
} else { |
82 |
- return government['agencyList']; |
|
102 |
+ return government["agencyList"]; |
|
83 | 103 |
} |
84 |
- } |
|
104 |
+ }; |
|
85 | 105 |
/**** 기본 조회 데이터 (종료) ****/ |
86 | 106 |
|
87 | 107 |
//아이디 중복 확인 |
... | ... | @@ -89,23 +109,29 @@ |
89 | 109 |
|
90 | 110 |
//등록할 사용자 정보 |
91 | 111 |
const [user, setUser] = React.useState({ |
92 |
- 'user_id': null, |
|
93 |
- 'user_name': null, |
|
94 |
- 'user_password': null, |
|
95 |
- 'user_password_check': null, |
|
96 |
- 'user_phonenumber': null, |
|
97 |
- 'user_birth': null, |
|
98 |
- 'user_gender': null, |
|
99 |
- 'user_address': null, |
|
100 |
- 'user_email': null, |
|
101 |
- 'authority': CommonUtil.isEmpty(defaultAuthority) ? state.loginUser['authority'] : defaultAuthority, |
|
102 |
- 'agency_id': CommonUtil.isEmpty(defaultAgencyId) ? state.loginUser['agency_id'] : defaultAgencyId, |
|
103 |
- 'government_id': CommonUtil.isEmpty(defaultGovernmentId) ? state.loginUser['government_id'] : defaultGovernmentId, |
|
112 |
+ user_id: null, |
|
113 |
+ user_name: null, |
|
114 |
+ user_password: null, |
|
115 |
+ user_password_check: null, |
|
116 |
+ user_phonenumber: null, |
|
117 |
+ user_birth: null, |
|
118 |
+ user_gender: null, |
|
119 |
+ user_address: null, |
|
120 |
+ user_email: null, |
|
121 |
+ authority: CommonUtil.isEmpty(defaultAuthority) |
|
122 |
+ ? state.loginUser["authority"] |
|
123 |
+ : defaultAuthority, |
|
124 |
+ agency_id: CommonUtil.isEmpty(defaultAgencyId) |
|
125 |
+ ? state.loginUser["agency_id"] |
|
126 |
+ : defaultAgencyId, |
|
127 |
+ government_id: CommonUtil.isEmpty(defaultGovernmentId) |
|
128 |
+ ? state.loginUser["government_id"] |
|
129 |
+ : defaultGovernmentId, |
|
104 | 130 |
}); |
105 | 131 |
//각 데이터별로 Dom 정보 담을 Ref 생성 |
106 | 132 |
const userRefInit = JSON.parse(JSON.stringify(user)); |
107 |
- userRefInit['user_gender'] = {}; |
|
108 |
- userRefInit['user_id_check_button'] = null; |
|
133 |
+ userRefInit["user_gender"] = {}; |
|
134 |
+ userRefInit["user_id_check_button"] = null; |
|
109 | 135 |
const userRef = React.useRef(userRefInit); |
110 | 136 |
|
111 | 137 |
//등록할 사용자 정보 변경 |
... | ... | @@ -113,89 +139,106 @@ |
113 | 139 |
let newUser = JSON.parse(JSON.stringify(user)); |
114 | 140 |
newUser[targetKey] = value; |
115 | 141 |
setUser(newUser); |
116 |
- } |
|
142 |
+ console.log("user: ", user); |
|
143 |
+ }; |
|
117 | 144 |
//등록할 사용자의 권한 구분 변경 |
118 | 145 |
const userAuthorityChange = (value) => { |
119 | 146 |
let newUser = JSON.parse(JSON.stringify(user)); |
120 |
- newUser['authority'] = value; |
|
147 |
+ newUser["authority"] = value; |
|
121 | 148 |
// newUser['government_id'] = null; |
122 | 149 |
// newUser['agency_id'] = null; |
123 | 150 |
setUser(newUser); |
124 |
- } |
|
151 |
+ }; |
|
125 | 152 |
//등록할 사용자의 관리기관 변경 |
126 | 153 |
const userGovernmentIdChange = (value) => { |
127 | 154 |
let newUser = JSON.parse(JSON.stringify(user)); |
128 | 155 |
if (CommonUtil.isEmpty(value) == true) { |
129 |
- newUser['government_id'] = null; |
|
156 |
+ newUser["government_id"] = null; |
|
130 | 157 |
} else { |
131 |
- newUser['government_id'] = value; |
|
158 |
+ newUser["government_id"] = value; |
|
132 | 159 |
} |
133 |
- newUser['agency_id'] = null; |
|
160 |
+ newUser["agency_id"] = null; |
|
134 | 161 |
setUser(newUser); |
135 |
- } |
|
162 |
+ }; |
|
136 | 163 |
//등록할 사용자의 시행기관 변경 |
137 | 164 |
const userAgencyIdChange = (value) => { |
138 | 165 |
let newUser = JSON.parse(JSON.stringify(user)); |
139 | 166 |
if (CommonUtil.isEmpty(value) == true) { |
140 |
- newUser['agency_id'] = null; |
|
167 |
+ newUser["agency_id"] = null; |
|
141 | 168 |
} else { |
142 |
- newUser['agency_id'] = value; |
|
169 |
+ newUser["agency_id"] = value; |
|
143 | 170 |
} |
144 | 171 |
setUser(newUser); |
145 |
- } |
|
172 |
+ }; |
|
146 | 173 |
//로그인 아이디 중복 검사 |
147 | 174 |
const userIdCheck = () => { |
148 |
- if (CommonUtil.isEmpty(user['user_id']) == true) { |
|
149 |
- userRef.current['user_id'].focus(); |
|
175 |
+ if (CommonUtil.isEmpty(user["user_id"]) == true) { |
|
176 |
+ userRef.current["user_id"].focus(); |
|
150 | 177 |
alert("아이디를 입력해 주세요."); |
151 | 178 |
return; |
152 | 179 |
} |
153 | 180 |
|
154 |
- fetch("/user/userSelectOne.json", { |
|
181 |
+ console.log("user!! : ", user); |
|
182 |
+ |
|
183 |
+ fetch("/user/userSelectOneCount.json", { |
|
155 | 184 |
method: "POST", |
156 | 185 |
headers: { |
157 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
186 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
158 | 187 |
}, |
159 | 188 |
body: JSON.stringify(user), |
160 |
- }).then((response) => response.json()).then((data) => { |
|
161 |
- console.log("로그인 아이디 중복 검사(아이디를 통한 사용자 조회) : ", data); |
|
162 |
- if (CommonUtil.isEmpty(data) == true) { |
|
163 |
- setIsIdCheck(true); |
|
164 |
- userRef.current['user_password'].focus(); |
|
165 |
- alert("사용가능한 아이디 입니다."); |
|
166 |
- } else { |
|
167 |
- setIsIdCheck(false); |
|
168 |
- userRef.current['user_id'].focus(); |
|
169 |
- alert("이미 존재하는 아이디 입니다."); |
|
170 |
- } |
|
171 |
- }).catch((error) => { |
|
172 |
- console.log('userIdCheck() /user/userSelectOne.json error : ', error); |
|
173 |
- }); |
|
174 |
- } |
|
189 |
+ }) |
|
190 |
+ .then((response) => response.json()) |
|
191 |
+ .then((data) => { |
|
192 |
+ console.log( |
|
193 |
+ "로그인 아이디 중복 검사(아이디를 통한 사용자 조회) : ", |
|
194 |
+ data |
|
195 |
+ ); |
|
196 |
+ if (data == 0) { |
|
197 |
+ setIsIdCheck(true); |
|
198 |
+ userRef.current["user_password"].focus(); |
|
199 |
+ alert("사용가능한 아이디 입니다."); |
|
200 |
+ } else { |
|
201 |
+ setIsIdCheck(false); |
|
202 |
+ userRef.current["user_id"].focus(); |
|
203 |
+ alert("이미 존재하는 아이디 입니다."); |
|
204 |
+ } |
|
205 |
+ }) |
|
206 |
+ .catch((error) => { |
|
207 |
+ console.log( |
|
208 |
+ "userSelectOneCount() /user/userSelectOneCount.json error : ", |
|
209 |
+ error |
|
210 |
+ ); |
|
211 |
+ }); |
|
212 |
+ }; |
|
175 | 213 |
|
176 |
- |
|
177 |
- //사용자 등록 유효성 검사 |
|
178 |
- const userInsertValidation = () => { |
|
179 |
- if ((user['authority'] == 'ROLE_GOVERNMENT' || user['authority'] == 'ROLE_AGENCY') |
|
180 |
- && CommonUtil.isEmpty(user['government_id']) == true) { |
|
181 |
- userRef.current['government_id'].focus(); |
|
214 |
+ //사용자 등록 유효성 검사 |
|
215 |
+ const userInsertValidation = () => { |
|
216 |
+ if ( |
|
217 |
+ (user["authority"] == "ROLE_GOVERNMENT" || |
|
218 |
+ user["authority"] == "ROLE_AGENCY") && |
|
219 |
+ CommonUtil.isEmpty(user["government_id"]) == true |
|
220 |
+ ) { |
|
221 |
+ userRef.current["government_id"].focus(); |
|
182 | 222 |
alert("관리기관을 선택해 주세요."); |
183 | 223 |
return false; |
184 | 224 |
} |
185 | 225 |
|
186 |
- if (user['authority'] == 'ROLE_AGENCY' && CommonUtil.isEmpty(user['agency_id']) == true) { |
|
187 |
- userRef.current['agency_id'].focus(); |
|
226 |
+ if ( |
|
227 |
+ user["authority"] == "ROLE_AGENCY" && |
|
228 |
+ CommonUtil.isEmpty(user["agency_id"]) == true |
|
229 |
+ ) { |
|
230 |
+ userRef.current["agency_id"].focus(); |
|
188 | 231 |
alert("시행기관을 선택해 주세요."); |
189 | 232 |
return false; |
190 | 233 |
} |
191 | 234 |
|
192 |
- if (CommonUtil.isEmpty(user['user_name']) == true) { |
|
193 |
- userRef.current['user_name'].focus(); |
|
235 |
+ if (CommonUtil.isEmpty(user["user_name"]) == true) { |
|
236 |
+ userRef.current["user_name"].focus(); |
|
194 | 237 |
alert("이름을 입력해 주세요."); |
195 | 238 |
return false; |
196 | 239 |
} |
197 |
- if (CommonUtil.isEmpty(user['user_id']) == true) { |
|
198 |
- userRef.current['user_id'].focus(); |
|
240 |
+ if (CommonUtil.isEmpty(user["user_id"]) == true) { |
|
241 |
+ userRef.current["user_id"].focus(); |
|
199 | 242 |
alert("아이디를 입력해 주세요."); |
200 | 243 |
return false; |
201 | 244 |
} |
... | ... | @@ -203,18 +246,18 @@ |
203 | 246 |
alert("아이디 중복확인을 해주세요."); |
204 | 247 |
return false; |
205 | 248 |
} |
206 |
- if (CommonUtil.isEmpty(user['user_password']) == true) { |
|
207 |
- userRef.current['user_password'].focus(); |
|
249 |
+ if (CommonUtil.isEmpty(user["user_password"]) == true) { |
|
250 |
+ userRef.current["user_password"].focus(); |
|
208 | 251 |
alert("비밀번호를 입력해 주세요."); |
209 | 252 |
return false; |
210 | 253 |
} |
211 |
- if (user['user_password'] != user['user_password_check']) { |
|
212 |
- userRef.current['user_password_check'].focus(); |
|
254 |
+ if (user["user_password"] != user["user_password_check"]) { |
|
255 |
+ userRef.current["user_password_check"].focus(); |
|
213 | 256 |
alert("비밀번호가 일치하지 않습니다."); |
214 | 257 |
return false; |
215 | 258 |
} |
216 |
- if (CommonUtil.isEmpty(user['user_phonenumber']) == true) { |
|
217 |
- userRef.current['user_phonenumber'].focus(); |
|
259 |
+ if (CommonUtil.isEmpty(user["user_phonenumber"]) == true) { |
|
260 |
+ userRef.current["user_phonenumber"].focus(); |
|
218 | 261 |
alert("연락처를 입력해 주세요."); |
219 | 262 |
return false; |
220 | 263 |
} |
... | ... | @@ -226,7 +269,7 @@ |
226 | 269 |
} */ |
227 | 270 |
|
228 | 271 |
return true; |
229 |
- } |
|
272 |
+ }; |
|
230 | 273 |
|
231 | 274 |
//사용자 등록 |
232 | 275 |
const userInsert = () => { |
... | ... | @@ -237,21 +280,24 @@ |
237 | 280 |
fetch("/user/userInsert.json", { |
238 | 281 |
method: "POST", |
239 | 282 |
headers: { |
240 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
283 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
241 | 284 |
}, |
242 | 285 |
body: JSON.stringify(user), |
243 |
- }).then((response) => response.json()).then((data) => { |
|
244 |
- console.log("사용자 등록 결과(건수) : ", data); |
|
245 |
- if (data > 0) { |
|
246 |
- alert("계정생성완료"); |
|
247 |
- navigate(-1); |
|
248 |
- } else { |
|
249 |
- alert("계정생성에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
250 |
- } |
|
251 |
- }).catch((error) => { |
|
252 |
- console.log('userInsert() /user/userInsert.json error : ', error); |
|
253 |
- }); |
|
254 |
- } |
|
286 |
+ }) |
|
287 |
+ .then((response) => response.json()) |
|
288 |
+ .then((data) => { |
|
289 |
+ console.log("사용자 등록 결과(건수) : ", data); |
|
290 |
+ if (data > 0) { |
|
291 |
+ alert("계정생성완료"); |
|
292 |
+ navigate(-1); |
|
293 |
+ } else { |
|
294 |
+ alert("계정생성에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
295 |
+ } |
|
296 |
+ }) |
|
297 |
+ .catch((error) => { |
|
298 |
+ console.log("userInsert() /user/userInsert.json error : ", error); |
|
299 |
+ }); |
|
300 |
+ }; |
|
255 | 301 |
|
256 | 302 |
//생활보호사 등록 |
257 | 303 |
const agentInsert = () => { |
... | ... | @@ -262,184 +308,297 @@ |
262 | 308 |
fetch("/user/agentInsert.json", { |
263 | 309 |
method: "POST", |
264 | 310 |
headers: { |
265 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
311 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
266 | 312 |
}, |
267 | 313 |
body: JSON.stringify(user), |
268 |
- }).then((response) => response.json()).then((data) => { |
|
269 |
- console.log("생활보호사 등록 결과(건수) : ", data); |
|
270 |
- if (data > 0) { |
|
271 |
- alert("계정생성완료"); |
|
272 |
- navigate(-1); |
|
273 |
- } else { |
|
274 |
- alert("계정생성에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
275 |
- } |
|
276 |
- }).catch((error) => { |
|
277 |
- console.log('agentInsert() /user/agentInsert.json error : ', error); |
|
278 |
- }); |
|
279 |
- } |
|
280 |
- |
|
314 |
+ }) |
|
315 |
+ .then((response) => response.json()) |
|
316 |
+ .then((data) => { |
|
317 |
+ console.log("생활보호사 등록 결과(건수) : ", data); |
|
318 |
+ if (data > 0) { |
|
319 |
+ alert("계정생성완료"); |
|
320 |
+ navigate(-1); |
|
321 |
+ } else { |
|
322 |
+ alert("계정생성에 실패하였습니다. 관리자에게 문의바랍니다."); |
|
323 |
+ } |
|
324 |
+ }) |
|
325 |
+ .catch((error) => { |
|
326 |
+ console.log("agentInsert() /user/agentInsert.json error : ", error); |
|
327 |
+ }); |
|
328 |
+ }; |
|
329 |
+ |
|
281 | 330 |
//Mounted |
282 | 331 |
React.useEffect(() => { |
283 | 332 |
authoritiesSelect(); |
284 | 333 |
orgSelectListOfHierarchy(); |
285 | 334 |
}, []); |
286 |
- |
|
287 | 335 |
|
288 | 336 |
return ( |
289 |
- <div className="container row flex-center join-login"> |
|
290 |
- <div className="join-group"> |
|
291 |
- <h3>계정생성</h3> |
|
292 |
- <div className="join-inner"> |
|
337 |
+ <div className="container row flex-center join-login"> |
|
338 |
+ <div className="join-group"> |
|
339 |
+ <h3>계정생성</h3> |
|
340 |
+ <div className="join-inner"> |
|
341 |
+ <div> |
|
342 |
+ <div className="flex-start margin-bottom2"> |
|
343 |
+ <label className="flex25"> |
|
344 |
+ <span style={{ color: "red" }}>*</span>사용자구분 |
|
345 |
+ </label> |
|
346 |
+ <select |
|
347 |
+ name="division" |
|
348 |
+ id="section" |
|
349 |
+ disabled={ |
|
350 |
+ CommonUtil.isEmpty(state.loginUser) == false && |
|
351 |
+ state.loginUser["authority"] != "ROLE_ADMIN" && |
|
352 |
+ state.loginUser["authority"] != "ROLE_GOVERNMENT" && |
|
353 |
+ state.loginUser["authority"] != "ROLE_AGENCYADMIN" |
|
354 |
+ } |
|
355 |
+ onChange={(e) => { |
|
356 |
+ userAuthorityChange(e.target.value); |
|
357 |
+ }} |
|
358 |
+ > |
|
359 |
+ {CommonUtil.isEmpty(state.loginUser) == false && |
|
360 |
+ state.loginUser["authority"] == "ROLE_ADMIN" ? ( |
|
361 |
+ <option |
|
362 |
+ value="ROLE_ADMIN" |
|
363 |
+ selected={user["authority"] == "ROLE_ADMIN"} |
|
364 |
+ > |
|
365 |
+ 시스템 관리자 |
|
366 |
+ </option> |
|
367 |
+ ) : null} |
|
368 |
+ {CommonUtil.isEmpty(state.loginUser) == false && |
|
369 |
+ (state.loginUser["authority"] == "ROLE_ADMIN" || |
|
370 |
+ state.loginUser["authority"] == "ROLE_GOVERNMENT") ? ( |
|
371 |
+ <option |
|
372 |
+ value="ROLE_GOVERNMENT" |
|
373 |
+ selected={user["authority"] == "ROLE_GOVERNMENT"} |
|
374 |
+ > |
|
375 |
+ 기관 관리자 |
|
376 |
+ </option> |
|
377 |
+ ) : null} |
|
378 |
+ {CommonUtil.isEmpty(state.loginUser) == false && |
|
379 |
+ (state.loginUser["authority"] == "ROLE_ADMIN" || |
|
380 |
+ state.loginUser["authority"] == "ROLE_GOVERNMENT" || |
|
381 |
+ state.loginUser["authority"] == "ROLE_AGENCYADMIN") ? ( |
|
382 |
+ <option |
|
383 |
+ value="ROLE_AGENCYADMIN" |
|
384 |
+ selected={user["authority"] == "ROLE_AGENCYADMIN"} |
|
385 |
+ > |
|
386 |
+ 센터 관리자 |
|
387 |
+ </option> |
|
388 |
+ ) : null} |
|
389 |
+ <option |
|
390 |
+ value="ROLE_AGENCY" |
|
391 |
+ selected={user["authority"] == "ROLE_AGENCY"} |
|
392 |
+ > |
|
393 |
+ {state.loginUser["title_name"]} |
|
394 |
+ </option> |
|
395 |
+ </select> |
|
396 |
+ </div> |
|
397 |
+ </div> |
|
398 |
+ |
|
399 |
+ {user["authority"] == "ROLE_GOVERNMENT" || |
|
400 |
+ user["authority"] == "ROLE_AGENCYADMIN" || |
|
401 |
+ user["authority"] == "ROLE_AGENCY" ? ( |
|
293 | 402 |
<div> |
294 | 403 |
<div className="flex-start margin-bottom2"> |
295 |
- <label className="flex25"><span style={{color : "red"}}>*</span>사용자구분</label> |
|
296 |
- <select name="division" id="section" |
|
404 |
+ <label className="flex25" htmlFor="name"> |
|
405 |
+ <span style={{ color: "red" }}>*</span>관리기관 |
|
406 |
+ </label> |
|
407 |
+ <select |
|
297 | 408 |
disabled={ |
298 |
- CommonUtil.isEmpty(state.loginUser) == false |
|
299 |
- && state.loginUser['authority'] != 'ROLE_ADMIN' |
|
300 |
- && state.loginUser['authority'] != 'ROLE_GOVERNMENT' |
|
301 |
- && state.loginUser['authority'] != 'ROLE_AGENCYADMIN' |
|
409 |
+ CommonUtil.isEmpty(state.loginUser) == false && |
|
410 |
+ state.loginUser["authority"] != "ROLE_ADMIN" && |
|
411 |
+ state.loginUser["authority"] != "ROLE_GOVERNMENT" |
|
302 | 412 |
} |
303 |
- onChange={(e) => {userAuthorityChange(e.target.value)}}> |
|
304 |
- {CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_ADMIN' ? |
|
305 |
- <option value="ROLE_ADMIN" selected={user['authority'] == "ROLE_ADMIN"}>시스템 관리자</option> |
|
306 |
- : null} |
|
307 |
- {CommonUtil.isEmpty(state.loginUser) == false && (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT') ? |
|
308 |
- <option value="ROLE_GOVERNMENT" selected={user['authority'] == "ROLE_GOVERNMENT"}>기관 관리자</option> |
|
309 |
- : null} |
|
310 |
- {CommonUtil.isEmpty(state.loginUser) == false && (state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' || state.loginUser['authority'] == 'ROLE_AGENCYADMIN') ? |
|
311 |
- <option value="ROLE_AGENCYADMIN" selected={user['authority'] == "ROLE_AGENCYADMIN"}>센터 관리자</option> |
|
312 |
- : null} |
|
313 |
- <option value="ROLE_AGENCY" selected={user['authority'] == "ROLE_AGENCY"}>{state.loginUser['title_name']}</option> |
|
413 |
+ onChange={(e) => { |
|
414 |
+ userGovernmentIdChange(e.target.value); |
|
415 |
+ }} |
|
416 |
+ ref={(el) => (userRef.current["government_id"] = el)} |
|
417 |
+ > |
|
418 |
+ <option value={""} selected={user["government_id"] == null}> |
|
419 |
+ 관리기관선택 |
|
420 |
+ </option> |
|
421 |
+ {orgListOfHierarchy.map((item, idx) => { |
|
422 |
+ return ( |
|
423 |
+ <option |
|
424 |
+ key={idx} |
|
425 |
+ value={item["government_id"]} |
|
426 |
+ selected={ |
|
427 |
+ user["government_id"] == item["government_id"] |
|
428 |
+ } |
|
429 |
+ > |
|
430 |
+ {item["government_name"]} |
|
431 |
+ </option> |
|
432 |
+ ); |
|
433 |
+ })} |
|
314 | 434 |
</select> |
315 | 435 |
</div> |
316 | 436 |
</div> |
437 |
+ ) : null} |
|
317 | 438 |
|
318 |
- {user['authority'] == 'ROLE_GOVERNMENT' || user['authority'] == 'ROLE_AGENCYADMIN' || user['authority'] == 'ROLE_AGENCY' ? |
|
319 |
- <div> |
|
320 |
- <div className="flex-start margin-bottom2"> |
|
321 |
- <label className="flex25" htmlFor="name"><span style={{color : "red"}}>*</span>관리기관</label> |
|
322 |
- <select |
|
323 |
- disabled={ |
|
324 |
- CommonUtil.isEmpty(state.loginUser) == false |
|
325 |
- && state.loginUser['authority'] != 'ROLE_ADMIN' |
|
326 |
- && state.loginUser['authority'] != 'ROLE_GOVERNMENT' |
|
327 |
- } |
|
328 |
- onChange={(e) => {userGovernmentIdChange(e.target.value)}} |
|
329 |
- ref={el => userRef.current['government_id'] = el}> |
|
330 |
- <option value={''} selected={user['government_id'] == null}>관리기관선택</option> |
|
331 |
- {orgListOfHierarchy.map((item, idx) => { return ( |
|
332 |
- <option key={idx} value={item['government_id']} selected={user['government_id'] == item['government_id']}> |
|
333 |
- {item['government_name']} |
|
439 |
+ {user["authority"] == "ROLE_AGENCYADMIN" || |
|
440 |
+ user["authority"] == "ROLE_AGENCY" ? ( |
|
441 |
+ <div> |
|
442 |
+ <div className="flex-start margin-bottom2"> |
|
443 |
+ <label className="flex25" htmlFor="name"> |
|
444 |
+ <span style={{ color: "red" }}>*</span>시행기관 |
|
445 |
+ </label> |
|
446 |
+ <select |
|
447 |
+ disabled={ |
|
448 |
+ CommonUtil.isEmpty(state.loginUser["authority"]) == false && |
|
449 |
+ state.loginUser["authority"] != "ROLE_ADMIN" && |
|
450 |
+ state.loginUser["authority"] != "ROLE_GOVERNMENT" |
|
451 |
+ } |
|
452 |
+ onChange={(e) => { |
|
453 |
+ userAgencyIdChange(e.target.value); |
|
454 |
+ }} |
|
455 |
+ ref={(el) => (userRef.current["agency_id"] = el)} |
|
456 |
+ > |
|
457 |
+ <option value={""} selected={user["agency_id"] == null}> |
|
458 |
+ 시행기관선택 |
|
459 |
+ </option> |
|
460 |
+ {getAgencyList().map((item, idx) => { |
|
461 |
+ return ( |
|
462 |
+ <option |
|
463 |
+ key={idx} |
|
464 |
+ value={item["agency_id"]} |
|
465 |
+ selected={user["agency_id"] == item["agency_id"]} |
|
466 |
+ > |
|
467 |
+ {item["agency_name"]} |
|
334 | 468 |
</option> |
335 |
- )})} |
|
336 |
- </select> |
|
337 |
- </div> |
|
338 |
- </div> |
|
339 |
- : null} |
|
340 |
- |
|
341 |
- { user['authority'] == 'ROLE_AGENCYADMIN' || user['authority'] == 'ROLE_AGENCY' ? |
|
342 |
- <div> |
|
343 |
- <div className="flex-start margin-bottom2"> |
|
344 |
- <label className="flex25" htmlFor="name"><span style={{color : "red"}}>*</span>시행기관</label> |
|
345 |
- <select |
|
346 |
- disabled={ |
|
347 |
- CommonUtil.isEmpty(state.loginUser['authority']) == false |
|
348 |
- && state.loginUser['authority'] != 'ROLE_ADMIN' |
|
349 |
- && state.loginUser['authority'] != 'ROLE_GOVERNMENT' |
|
350 |
- } |
|
351 |
- onChange={(e) => {userAgencyIdChange(e.target.value)}} |
|
352 |
- ref={el => userRef.current['agency_id'] = el}> |
|
353 |
- <option value={''} selected={user['agency_id'] == null}>시행기관선택</option> |
|
354 |
- {getAgencyList().map((item, idx) => { return ( |
|
355 |
- <option key={idx} value={item['agency_id']} selected={user['agency_id'] == item['agency_id']}> |
|
356 |
- {item['agency_name']} |
|
357 |
- </option> |
|
358 |
- )})} |
|
359 |
- </select> |
|
360 |
- </div> |
|
361 |
- </div> |
|
362 |
- : null} |
|
363 |
- |
|
364 |
- <div> |
|
365 |
- <div className="flex-start margin-bottom2"> |
|
366 |
- <label className="flex25" htmlFor="name"><span style={{color : "red"}}>*</span>이름</label> |
|
367 |
- <input type="text" |
|
368 |
- value={user['user_name']} |
|
369 |
- onChange={(e) => {userValueChange('user_name', e.target.value)}} |
|
370 |
- ref={el => userRef.current['user_name'] = el} |
|
371 |
- /> |
|
469 |
+ ); |
|
470 |
+ })} |
|
471 |
+ </select> |
|
372 | 472 |
</div> |
373 | 473 |
</div> |
474 |
+ ) : null} |
|
374 | 475 |
|
375 |
- <div className="id"> |
|
376 |
- <div className="flex-start margin-bottom2"> |
|
377 |
- <label className="flex25" htmlFor="id"><span style={{color : "red"}}>*</span>아이디</label> |
|
378 |
- <input type="text" |
|
379 |
- value={user['user_id']} |
|
380 |
- onChange={(e) => {userValueChange('user_id', e.target.value); setIsIdCheck(false)}} |
|
381 |
- ref={el => userRef.current['user_id'] = el} |
|
382 |
- /> |
|
383 |
- <button className={"red-btn btn-large"} onClick={userIdCheck} |
|
384 |
- ref={el => userRef.current['user_id_check_button'] = el}> |
|
385 |
- 중복확인 |
|
386 |
- </button> |
|
387 |
- </div> |
|
476 |
+ <div> |
|
477 |
+ <div className="flex-start margin-bottom2"> |
|
478 |
+ <label className="flex25" htmlFor="name"> |
|
479 |
+ <span style={{ color: "red" }}>*</span>이름 |
|
480 |
+ </label> |
|
481 |
+ <input |
|
482 |
+ type="text" |
|
483 |
+ value={user["user_name"]} |
|
484 |
+ onChange={(e) => { |
|
485 |
+ userValueChange("user_name", e.target.value); |
|
486 |
+ }} |
|
487 |
+ ref={(el) => (userRef.current["user_name"] = el)} |
|
488 |
+ /> |
|
388 | 489 |
</div> |
490 |
+ </div> |
|
389 | 491 |
|
390 |
- <div> |
|
391 |
- <div className="flex-start margin-bottom2"> |
|
392 |
- <label className="flex25" htmlFor="password"><span style={{color : "red"}}>*</span>비밀번호</label> |
|
393 |
- <input type="password" |
|
394 |
- value={user['user_password']} |
|
395 |
- onChange={(e) => {userValueChange('user_password', e.target.value)}} |
|
396 |
- ref={el => userRef.current['user_password'] = el} |
|
397 |
- /> |
|
398 |
- </div> |
|
492 |
+ <div className="id"> |
|
493 |
+ <div className="flex-start margin-bottom2"> |
|
494 |
+ <label className="flex25" htmlFor="id"> |
|
495 |
+ <span style={{ color: "red" }}>*</span>아이디 |
|
496 |
+ </label> |
|
497 |
+ <input |
|
498 |
+ type="text" |
|
499 |
+ value={user["user_id"]} |
|
500 |
+ onChange={(e) => { |
|
501 |
+ userValueChange("user_id", e.target.value); |
|
502 |
+ setIsIdCheck(false); |
|
503 |
+ }} |
|
504 |
+ ref={(el) => (userRef.current["user_id"] = el)} |
|
505 |
+ /> |
|
506 |
+ <button |
|
507 |
+ className={"red-btn btn-large"} |
|
508 |
+ onClick={userIdCheck} |
|
509 |
+ ref={(el) => (userRef.current["user_id_check_button"] = el)} |
|
510 |
+ > |
|
511 |
+ 중복확인 |
|
512 |
+ </button> |
|
399 | 513 |
</div> |
400 |
- <div> |
|
401 |
- <div className="flex-start margin-bottom2"> |
|
402 |
- <label className="flex25" htmlFor="password_check"><span style={{color : "red"}}>*</span>비밀번호 확인</label> |
|
403 |
- <input type="password" |
|
404 |
- value={user['user_password_check']} |
|
405 |
- onChange={(e) => {userValueChange('user_password_check', e.target.value)}} |
|
406 |
- ref={el => userRef.current['user_password_check'] = el} |
|
407 |
- /> |
|
408 |
- </div> |
|
409 |
- </div> |
|
514 |
+ </div> |
|
410 | 515 |
|
411 |
- <div> |
|
412 |
- <div className="flex margin-bottom2"> |
|
413 |
- <label className="flex25" htmlFor="phone_number"><span style={{color : "red"}}>*</span>전화번호</label> |
|
414 |
- <input type="number" maxLength="11" |
|
415 |
- value={user['user_phonenumber']} |
|
416 |
- onChange={(e) => {userValueChange('user_phonenumber', e.target.value)}} |
|
417 |
- ref={el => userRef.current['user_phonenumber'] = el} |
|
418 |
- /> |
|
419 |
- </div> |
|
516 |
+ <div> |
|
517 |
+ <div className="flex-start margin-bottom2"> |
|
518 |
+ <label className="flex25" htmlFor="password"> |
|
519 |
+ <span style={{ color: "red" }}>*</span>비밀번호 |
|
520 |
+ </label> |
|
521 |
+ <input |
|
522 |
+ type="password" |
|
523 |
+ value={user["user_password"]} |
|
524 |
+ onChange={(e) => { |
|
525 |
+ userValueChange("user_password", e.target.value); |
|
526 |
+ }} |
|
527 |
+ ref={(el) => (userRef.current["user_password"] = el)} |
|
528 |
+ /> |
|
420 | 529 |
</div> |
421 |
- |
|
422 |
- <div> |
|
423 |
- <div className="flex-start margin-bottom2"> |
|
424 |
- <label className="flex25" htmlFor="password_check">이메일</label> |
|
425 |
- <input type="text" |
|
426 |
- value={user['user_email']} |
|
427 |
- onChange={(e) => {userValueChange('user_email', e.target.value)}} |
|
428 |
- ref={el => userRef.current['user_email'] = el} |
|
429 |
- /> |
|
430 |
- </div> |
|
530 |
+ </div> |
|
531 |
+ <div> |
|
532 |
+ <div className="flex-start margin-bottom2"> |
|
533 |
+ <label className="flex25" htmlFor="password_check"> |
|
534 |
+ <span style={{ color: "red" }}>*</span>비밀번호 확인 |
|
535 |
+ </label> |
|
536 |
+ <input |
|
537 |
+ type="password" |
|
538 |
+ value={user["user_password_check"]} |
|
539 |
+ onChange={(e) => { |
|
540 |
+ userValueChange("user_password_check", e.target.value); |
|
541 |
+ }} |
|
542 |
+ ref={(el) => (userRef.current["user_password_check"] = el)} |
|
543 |
+ /> |
|
431 | 544 |
</div> |
545 |
+ </div> |
|
432 | 546 |
|
433 |
- <div className="btn-wrap"> |
|
434 |
- <button className={"gray-btn btn-large"} onClick={() => {navigate(-1)}}>취소</button> |
|
435 |
- {user['authority'] == "ROLE_AGENCYADMIN" || user['authority'] == "ROLE_AGENCY" |
|
436 |
- ? <button className={"red-btn btn-large"} onClick={agentInsert}>등록</button> |
|
437 |
- : <button className={"red-btn btn-large"} onClick={userInsert}>등록</button> |
|
438 |
- } |
|
547 |
+ <div> |
|
548 |
+ <div className="flex margin-bottom2"> |
|
549 |
+ <label className="flex25" htmlFor="phone_number"> |
|
550 |
+ <span style={{ color: "red" }}>*</span>전화번호 |
|
551 |
+ </label> |
|
552 |
+ <input |
|
553 |
+ type="number" |
|
554 |
+ maxLength="11" |
|
555 |
+ value={user["user_phonenumber"]} |
|
556 |
+ onChange={(e) => { |
|
557 |
+ userValueChange("user_phonenumber", e.target.value); |
|
558 |
+ }} |
|
559 |
+ ref={(el) => (userRef.current["user_phonenumber"] = el)} |
|
560 |
+ /> |
|
439 | 561 |
</div> |
562 |
+ </div> |
|
440 | 563 |
|
564 |
+ <div> |
|
565 |
+ <div className="flex-start margin-bottom2"> |
|
566 |
+ <label className="flex25" htmlFor="password_check"> |
|
567 |
+ 이메일 |
|
568 |
+ </label> |
|
569 |
+ <input |
|
570 |
+ type="text" |
|
571 |
+ value={user["user_email"]} |
|
572 |
+ onChange={(e) => { |
|
573 |
+ userValueChange("user_email", e.target.value); |
|
574 |
+ }} |
|
575 |
+ ref={(el) => (userRef.current["user_email"] = el)} |
|
576 |
+ /> |
|
577 |
+ </div> |
|
578 |
+ </div> |
|
579 |
+ |
|
580 |
+ <div className="btn-wrap"> |
|
581 |
+ <button |
|
582 |
+ className={"gray-btn btn-large"} |
|
583 |
+ onClick={() => { |
|
584 |
+ navigate(-1); |
|
585 |
+ }} |
|
586 |
+ > |
|
587 |
+ 취소 |
|
588 |
+ </button> |
|
589 |
+ {user["authority"] == "ROLE_AGENCYADMIN" || |
|
590 |
+ user["authority"] == "ROLE_AGENCY" ? ( |
|
591 |
+ <button className={"red-btn btn-large"} onClick={agentInsert}> |
|
592 |
+ 등록 |
|
593 |
+ </button> |
|
594 |
+ ) : ( |
|
595 |
+ <button className={"red-btn btn-large"} onClick={userInsert}> |
|
596 |
+ 등록 |
|
597 |
+ </button> |
|
598 |
+ )} |
|
441 | 599 |
</div> |
442 | 600 |
</div> |
443 | 601 |
</div> |
602 |
+ </div> |
|
444 | 603 |
); |
445 | 604 |
} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?