
--- client/views/pages/ctgry/CategoryManagement.vue
+++ client/views/pages/ctgry/CategoryManagement.vue
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 |
try { |
234 | 234 |
const response = await saveCategory(this.selectedCategory); |
235 | 235 |
if (response.status === 200) { |
236 |
- alert("등록되었습니다.."); |
|
236 |
+ alert("등록되었습니다."); |
|
237 | 237 |
this.searchCategories(); |
238 | 238 |
} |
239 | 239 |
} catch (error) { |
... | ... | @@ -249,7 +249,7 @@ |
249 | 249 |
try { |
250 | 250 |
const response = await updateCategory(this.ctgryId, this.copySelectedCategory); |
251 | 251 |
if (response.status === 200) { |
252 |
- alert("수정되었습니다.."); |
|
252 |
+ alert("수정되었습니다."); |
|
253 | 253 |
this.searchCategories(); |
254 | 254 |
} |
255 | 255 |
} catch (error) { |
... | ... | @@ -262,7 +262,7 @@ |
262 | 262 |
try { |
263 | 263 |
const response = await updateCategory(this.ctgryId, this.copySelectedCategory); |
264 | 264 |
if (response.status === 200) { |
265 |
- alert("수정되었습니다.."); |
|
265 |
+ alert("수정되었습니다."); |
|
266 | 266 |
this.searchCategories(); |
267 | 267 |
} |
268 | 268 |
} catch (error) { |
... | ... | @@ -280,7 +280,7 @@ |
280 | 280 |
toggleUseAt() { |
281 | 281 |
this.selectedCategory.useAt = this.selectedCategory.useAt === 'Y' ? 'N' : 'Y'; |
282 | 282 |
}, |
283 |
- //취소소 |
|
283 |
+ //취소 |
|
284 | 284 |
cancelCategory() { |
285 | 285 |
if (confirm("초기값으로 변경하시겠습니까?")) { |
286 | 286 |
if (this.ctgryId === null || this.ctgryId === "") { |
--- client/views/pages/member/MemberManagement.vue
+++ client/views/pages/member/MemberManagement.vue
... | ... | @@ -61,13 +61,14 @@ |
61 | 61 |
class="button green-line" @click="updateByUseAtUser">복구</div> |
62 | 62 |
<div v-if="copySelectedUser.useAt === 'Y' && isNewInsert && userId != null" class="button red-line" |
63 | 63 |
@click="updateByUseAtUser">회원탈퇴</div> |
64 |
- <div class="button gray-line" @click="restPassword">비밀번호 초기화</div> |
|
65 |
- <div class="button pink-line-bg flex align-center" @click="resetUser"><img :src="check_pink" alt=""> |
|
64 |
+ <div v-if="newInsertCheck" class="button gray-line" @click="restPassword">비밀번호 초기화</div> |
|
65 |
+ <div v-if="newInsertCheck" class="button pink-line-bg flex align-center" @click="resetUser"><img |
|
66 |
+ :src="check_pink" alt=""> |
|
66 | 67 |
<p>신규등록</p> |
67 | 68 |
</div> |
68 | 69 |
<div class="button blue-line-bg flex align-center" @click="insertByUpdateUser"><img |
69 | 70 |
:src="check_blue" alt=""> |
70 |
- <p>등록</p> |
|
71 |
+ {{ newInsertCheck ? "수정" : "등록" }} |
|
71 | 72 |
</div> |
72 | 73 |
<div class="button gray-bg" @click="cancelUser">취소</div> |
73 | 74 |
</div> |
... | ... | @@ -117,7 +118,8 @@ |
117 | 118 |
<label for="use" class="require">사용여부</label> |
118 | 119 |
<div class="switch"> |
119 | 120 |
<input type="checkbox" id="switch" :checked="selectedUser.useAt === 'Y'" |
120 |
- @change="toggleUseAt" :disabled="!isNewInsert || (this.userId !== null || this.userId !== '')" /> |
|
121 |
+ @change="toggleUseAt" |
|
122 |
+ :disabled="!isNewInsert || (this.userId !== null || this.userId !== '')" /> |
|
121 | 123 |
<label for="switch">Toggle</label> |
122 | 124 |
</div> |
123 | 125 |
</dd> |
... | ... | @@ -149,6 +151,7 @@ |
149 | 151 |
check_blue: 'client/resources/images/checkbox_blue.png', |
150 | 152 |
searchicon: 'client/resources/images/icon/search.png', |
151 | 153 |
selectedUsers: [], |
154 |
+ newInsertCheck: false, |
|
152 | 155 |
//사용자 로그인 아이다 |
153 | 156 |
loginId: null, |
154 | 157 |
//사용자 아이디 |
... | ... | @@ -202,23 +205,25 @@ |
202 | 205 |
}, |
203 | 206 |
methods: { |
204 | 207 |
cancelUser() { |
205 |
- if (this.userId === null || this.userId === "") { |
|
206 |
- this.loginId = null; |
|
207 |
- this.password = null; |
|
208 |
- this.passwordCheck = null; |
|
209 |
- this.selectedUser = { |
|
210 |
- userNm: null, |
|
211 |
- useAt: "Y", |
|
212 |
- authorUpdateCheck: false, |
|
213 |
- authorList: [{ authorCode: "ROLE_ADMIN" }] |
|
214 |
- }; |
|
215 |
- } else { |
|
216 |
- this.selectedUser = { |
|
217 |
- userNm: this.copySelectedUser.userNm, |
|
218 |
- useAt: this.copySelectedUser.useAt, |
|
219 |
- authorUpdateCheck: false, |
|
220 |
- authorList: [{ authorCode: this.copySelectedUser.authorList[0].authorCode }] // 배열 형태로 설정 |
|
221 |
- }; |
|
208 |
+ if (confirm("초기값으로 변경하시겠습니까?")) { |
|
209 |
+ if (this.userId === null || this.userId === "") { |
|
210 |
+ this.loginId = null; |
|
211 |
+ this.password = null; |
|
212 |
+ this.passwordCheck = null; |
|
213 |
+ this.selectedUser = { |
|
214 |
+ userNm: null, |
|
215 |
+ useAt: "Y", |
|
216 |
+ authorUpdateCheck: false, |
|
217 |
+ authorList: [{ authorCode: "ROLE_ADMIN" }] |
|
218 |
+ }; |
|
219 |
+ } else { |
|
220 |
+ this.selectedUser = { |
|
221 |
+ userNm: this.copySelectedUser.userNm, |
|
222 |
+ useAt: this.copySelectedUser.useAt, |
|
223 |
+ authorUpdateCheck: false, |
|
224 |
+ authorList: [{ authorCode: this.copySelectedUser.authorList[0].authorCode }] // 배열 형태로 설정 |
|
225 |
+ }; |
|
226 |
+ } |
|
222 | 227 |
} |
223 | 228 |
}, |
224 | 229 |
//등록 함수 |
... | ... | @@ -237,7 +242,7 @@ |
237 | 242 |
try { |
238 | 243 |
const response = await join(this.joinDTO); |
239 | 244 |
if (response.status === 200) { |
240 |
- alert("회원가입되었습니다.."); |
|
245 |
+ alert("회원가입되었습니다."); |
|
241 | 246 |
this.searchUsers(); |
242 | 247 |
|
243 | 248 |
} |
... | ... | @@ -246,47 +251,50 @@ |
246 | 251 |
this.searchUsers(); |
247 | 252 |
} |
248 | 253 |
} |
254 |
+ } else { |
|
255 |
+ // 권한이 변경되었는지 확인 |
|
256 |
+ const isAuthorChanged = this.copySelectedUser.authorList[0].authorCode !== this.selectedUser.authorList[0].authorCode; |
|
257 |
+ if (isAuthorChanged) { |
|
258 |
+ this.selectedUser.authorUpdateCheck = true; // 권한 변경 체크 |
|
259 |
+ if (confirm("회원 수정을 하시겠습니까?")) { |
|
260 |
+ try { |
|
261 |
+ const response = await updateUsers(this.userId, this.selectedUser); |
|
262 |
+ if (response.status === 200) { |
|
263 |
+ alert("수정되었습니다."); |
|
264 |
+ this.searchUsers(); |
|
265 |
+ } |
|
266 |
+ } catch (error) { |
|
267 |
+ alert("수정이 실패하였습니다."); |
|
268 |
+ this.searchUsers(); |
|
269 |
+ } |
|
270 |
+ } |
|
271 |
+ } else { |
|
272 |
+ // 권한이 변경되지 않았다면 기존 수정 로직 실행 |
|
273 |
+ if (confirm("회원 수정을 하시겠습니까?")) { |
|
274 |
+ try { |
|
275 |
+ const response = await updateUsers(this.userId, this.selectedUser); |
|
276 |
+ if (response.status === 200) { |
|
277 |
+ alert("수정되었습니다."); |
|
278 |
+ this.searchUsers(); |
|
279 |
+ } |
|
280 |
+ } catch (error) { |
|
281 |
+ alert("수정이 실패하였습니다."); |
|
282 |
+ this.searchUsers(); |
|
283 |
+ } |
|
284 |
+ } |
|
285 |
+ } |
|
249 | 286 |
} |
250 | 287 |
} else { |
251 |
- // 권한이 변경되었는지 확인 |
|
252 |
- console.log("복사", this.copySelectedUser.authorList[0].authorCode); |
|
253 |
- console.log("본체", this.selectedUser.authorList[0].authorCode); |
|
254 |
- const isAuthorChanged = this.copySelectedUser.authorList[0].authorCode !== this.selectedUser.authorList[0].authorCode; |
|
255 |
- console.log("권한이 같은지 다른지 ", isAuthorChanged); |
|
256 |
- if (isAuthorChanged) { |
|
257 |
- this.selectedUser.authorUpdateCheck = true; // 권한 변경 체크 |
|
258 |
- if (confirm("회원 수정을 하시겠습니까?")) { |
|
259 |
- try { |
|
260 |
- const response = await updateUsers(this.userId, this.selectedUser); |
|
261 |
- if (response.status === 200) { |
|
262 |
- alert("수정되었습니다.."); |
|
263 |
- this.searchUsers(); |
|
264 |
- } |
|
265 |
- } catch (error) { |
|
266 |
- alert("수정이 실패하였습니다."); |
|
267 |
- this.searchUsers(); |
|
268 |
- } |
|
269 |
- } |
|
270 |
- } else { |
|
271 |
- // 권한이 변경되지 않았다면 기존 수정 로직 실행 |
|
272 |
- if (confirm("회원 수정을 하시겠습니까?")) { |
|
273 |
- try { |
|
274 |
- const response = await updateUsers(this.userId, this.selectedUser); |
|
275 |
- if (response.status === 200) { |
|
276 |
- alert("수정되었습니다.."); |
|
277 |
- this.searchUsers(); |
|
278 |
- } |
|
279 |
- } catch (error) { |
|
280 |
- alert("수정이 실패하였습니다."); |
|
281 |
- this.searchUsers(); |
|
282 |
- } |
|
283 |
- } |
|
284 |
- } |
|
288 |
+ alert("필수 항목 값을 입력해주세요"); |
|
285 | 289 |
} |
286 | 290 |
}, |
287 | 291 |
//사용자 벨류데이션 체크 |
288 | 292 |
isValidationUser() { |
289 |
- return this.selectedUser.userNm == null || this.selectedUser.userNm == '' || this.loginId == null || this.loginId == '' || this.password == null || this.password == ''; |
|
293 |
+ if(this.newInsertCheck){ |
|
294 |
+ return this.selectedUser.userNm == null || this.selectedUser.userNm == '' || this.loginId == null || this.loginId == ''; |
|
295 |
+ }else{ |
|
296 |
+ return this.selectedUser.userNm == null || this.selectedUser.userNm == '' || this.loginId == null || this.loginId == '' || this.password == null || this.password == ''; |
|
297 |
+ } |
|
290 | 298 |
}, |
291 | 299 |
validatePassword() { |
292 | 300 |
// 빈 문자열이나 null 체크 |
... | ... | @@ -313,7 +321,8 @@ |
313 | 321 |
}, |
314 | 322 |
// 선택한 사용자 |
315 | 323 |
selectUser(item) { |
316 |
- this.isNewInsert = true; |
|
324 |
+ this.newInsertCheck = true, |
|
325 |
+ this.isNewInsert = true; |
|
317 | 326 |
|
318 | 327 |
this.loginId = item.loginId; |
319 | 328 |
this.userId = item.userId; |
... | ... | @@ -338,9 +347,10 @@ |
338 | 347 |
// 삭제 또는 복구 로직 |
339 | 348 |
async updateByUseAtUser() { |
340 | 349 |
if (this.selectedUser.useAt === 'Y') { |
341 |
- this.selectedUser.useAt = 'N' |
|
342 | 350 |
if (confirm("선택한 사용자를 탈퇴 하시겠습니까?")) { |
343 | 351 |
try { |
352 |
+ this.selectedUser.useAt = 'N' |
|
353 |
+ this.copySelectedCategory = 'N' |
|
344 | 354 |
const response = await updateUsers(this.userId, this.selectedUser); |
345 | 355 |
if (response.status === 200) { |
346 | 356 |
alert("탈퇴되었습니다.."); |
... | ... | @@ -354,9 +364,10 @@ |
354 | 364 |
} |
355 | 365 |
} |
356 | 366 |
} else { |
357 |
- this.selectedUser.useAt = 'Y' |
|
358 | 367 |
if (confirm("선택한 사용자를 복구 하시겠습니까?")) { |
359 | 368 |
try { |
369 |
+ this.selectedUser.useAt = 'Y' |
|
370 |
+ this.copySelectedCategory = 'Y' |
|
360 | 371 |
const response = await updateUsers(this.userId, this.selectedUser); |
361 | 372 |
if (response.status === 200) { |
362 | 373 |
alert("복구되었습니다.."); |
... | ... | @@ -393,6 +404,7 @@ |
393 | 404 |
}, |
394 | 405 |
// 사용자 초기화 |
395 | 406 |
resetUser() { |
407 |
+ this.newInsertCheck = false; |
|
396 | 408 |
this.isNewInsert = false; |
397 | 409 |
|
398 | 410 |
this.loginId = null; |
... | ... | @@ -422,6 +434,7 @@ |
422 | 434 |
}, |
423 | 435 |
mounted() { |
424 | 436 |
this.searchUsers(); // 컴포넌트가 마운트될 때 사용자 목록을 조회 |
437 |
+ this.resetUser(); |
|
425 | 438 |
} |
426 | 439 |
}; |
427 | 440 |
</script> |
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?