
--- client/views/pages/ctgry/CategoryManagement.vue
+++ client/views/pages/ctgry/CategoryManagement.vue
... | ... | @@ -29,6 +29,9 @@ |
29 | 29 |
</tr> |
30 | 30 |
</thead> |
31 | 31 |
<tbody> |
32 |
+ <tr v-if="selectedCategories.length === 0"> |
|
33 |
+ <td colspan="3" style="text-align: center;">등록된 카테고리리가 없습니다.</td> |
|
34 |
+ </tr> |
|
32 | 35 |
<tr v-for="item in selectedCategories" :key="item.ctgryId" |
33 | 36 |
:class="{ 'delete-member': item.useAt === 'N' }" @click="selectCategory(item)"> |
34 | 37 |
<!-- Category 칼럼 --> |
... | ... | @@ -45,13 +48,13 @@ |
45 | 48 |
class="button green-line" @click="updateByUseAtCategory">복구</div> |
46 | 49 |
<div v-if="copySelectedCategory.useAt === 'Y' && isNewInsert && ctgryId != null" |
47 | 50 |
class="button red-line" @click="updateByUseAtCategory">삭제</div> |
48 |
- <div class="button pink-line-bg flex align-center" @click="resetCategory"><img :src="check_pink" |
|
49 |
- alt=""> |
|
51 |
+ <div v-if="newInsertCheck" class="button pink-line-bg flex align-center" @click="resetCategory"><img |
|
52 |
+ :src="check_pink" alt=""> |
|
50 | 53 |
<p>신규등록</p> |
51 | 54 |
</div> |
52 | 55 |
<div class="button blue-line-bg flex align-center" @click="insertByUpdateCategory"><img |
53 | 56 |
:src="check_blue" alt=""> |
54 |
- <p>등록</p> |
|
57 |
+ {{ newInsertCheck ? "수정" : "등록" }} |
|
55 | 58 |
</div> |
56 | 59 |
<div class="button gray-bg" @click="cancelCategory">취소</div> |
57 | 60 |
</div> |
... | ... | @@ -67,7 +70,8 @@ |
67 | 70 |
<label for="use" class="require">사용여부</label> |
68 | 71 |
<div class="switch"> |
69 | 72 |
<input type="checkbox" id="switch" :checked="selectedCategory.useAt === 'Y'" |
70 |
- @change="toggleUseAt" :disabled="!isNewInsert"/> |
|
73 |
+ @change="toggleUseAt" |
|
74 |
+ :disabled="!isNewInsert || (this.ctgryId !== null || this.ctgryId !== '')" /> |
|
71 | 75 |
<label for="switch">Toggle</label> |
72 | 76 |
</div> |
73 | 77 |
|
... | ... | @@ -107,12 +111,13 @@ |
107 | 111 |
check_pink: 'client/resources/images/checkbox_pink.png', |
108 | 112 |
check_blue: 'client/resources/images/checkbox_blue.png', |
109 | 113 |
searchicon: 'client/resources/images/icon/search.png', |
114 |
+ newInsertCheck: false, |
|
110 | 115 |
selectedCategories: [], |
111 | 116 |
ctgryId: null, |
112 | 117 |
// 선택된 카테고리 정보를 저장할 객체 |
113 | 118 |
selectedCategory: { |
114 | 119 |
ctgryNm: null, |
115 |
- useAt: null, |
|
120 |
+ useAt: "Y", |
|
116 | 121 |
dc: null |
117 | 122 |
}, |
118 | 123 |
// 선택된 카테고리 정보를 저장할 객체 copy |
... | ... | @@ -120,7 +125,7 @@ |
120 | 125 |
oldCtgryNm: null, |
121 | 126 |
ctgryId: null, |
122 | 127 |
ctgryNm: null, |
123 |
- useAt: null, |
|
128 |
+ useAt: "Y", |
|
124 | 129 |
dc: null |
125 | 130 |
}, |
126 | 131 |
searchReqDTO: { |
... | ... | @@ -149,13 +154,14 @@ |
149 | 154 |
}, |
150 | 155 |
// 클릭한 카테고리의 정보를 오른쪽에 표시 |
151 | 156 |
selectCategory(item) { |
152 |
- this.isNewInsert = true; |
|
157 |
+ this.newInsertCheck = true, |
|
158 |
+ this.isNewInsert = true; |
|
153 | 159 |
this.ctgryId = item.ctgryId, |
154 |
- this.selectedCategory = { |
|
155 |
- ctgryNm: item.ctgryNm, |
|
156 |
- useAt: item.useAt, |
|
157 |
- dc: item.dc |
|
158 |
- }; |
|
160 |
+ this.selectedCategory = { |
|
161 |
+ ctgryNm: item.ctgryNm, |
|
162 |
+ useAt: item.useAt, |
|
163 |
+ dc: item.dc |
|
164 |
+ }; |
|
159 | 165 |
this.copySelectedCategory = { |
160 | 166 |
oldCtgryNm: item.ctgryNm, |
161 | 167 |
ctgryId: item.ctgryId, |
... | ... | @@ -169,9 +175,10 @@ |
169 | 175 |
// 삭제 또는 복구 로직 |
170 | 176 |
async updateByUseAtCategory() { |
171 | 177 |
if (this.selectedCategory.useAt === 'Y') { |
172 |
- this.selectedCategory.useAt = 'N' |
|
173 | 178 |
if (confirm("선택한 카테고리를 삭제 하시겠습니까?")) { |
174 | 179 |
try { |
180 |
+ this.selectedCategory.useAt = 'N' |
|
181 |
+ this.copySelectedCategory.useAt ='N' |
|
175 | 182 |
const response = await updateCategory(this.ctgryId, this.selectedCategory); |
176 | 183 |
if (response.status === 200) { |
177 | 184 |
alert("삭제되었습니다.."); |
... | ... | @@ -184,9 +191,10 @@ |
184 | 191 |
} |
185 | 192 |
} |
186 | 193 |
} else { |
187 |
- this.selectedCategory.useAt = 'Y' |
|
188 | 194 |
if (confirm("선택한 카테고리를 복구 하시겠습니까?")) { |
189 | 195 |
try { |
196 |
+ this.selectedCategory.useAt = 'Y' |
|
197 |
+ this.copySelectedCategory.useAt ='Y' |
|
190 | 198 |
const response = await updateCategory(this.ctgryId, this.selectedCategory); |
191 | 199 |
if (response.status === 200) { |
192 | 200 |
alert("복구되었습니다.."); |
... | ... | @@ -202,7 +210,8 @@ |
202 | 210 |
}, |
203 | 211 |
// 신규 등록 |
204 | 212 |
resetCategory() { |
205 |
- this.isNewInsert = false |
|
213 |
+ this.newInsertCheck = false; |
|
214 |
+ this.isNewInsert = false; |
|
206 | 215 |
this.ctgryId = null; |
207 | 216 |
this.selectedCategory = { |
208 | 217 |
ctgryNm: null, |
... | ... | @@ -273,22 +282,31 @@ |
273 | 282 |
}, |
274 | 283 |
//취소소 |
275 | 284 |
cancelCategory() { |
276 |
- this.ctgryId = this.copySelectedCategory.ctgryId, |
|
277 |
- this.selectedCategory = { |
|
278 |
- ctgryNm: this.copySelectedCategory.ctgryNm, |
|
279 |
- useAt: this.copySelectedCategory.useAt, |
|
280 |
- dc: this.copySelectedCategory.dc, |
|
281 |
- }; |
|
285 |
+ if (confirm("초기값으로 변경하시겠습니까?")) { |
|
286 |
+ if (this.ctgryId === null || this.ctgryId === "") { |
|
287 |
+ this.selectedCategory = { |
|
288 |
+ ctgryNm: null, |
|
289 |
+ useAt: "Y", |
|
290 |
+ dc: null, |
|
291 |
+ }; |
|
292 |
+ } else { |
|
293 |
+ this.selectedCategory = { |
|
294 |
+ ctgryNm: this.copySelectedCategory.ctgryNm, |
|
295 |
+ useAt: this.copySelectedCategory.useAt, |
|
296 |
+ dc: this.copySelectedCategory.dc, |
|
297 |
+ }; |
|
298 |
+ } |
|
299 |
+ } |
|
282 | 300 |
}, |
283 | 301 |
//카테고리 벨류데이션 체크 |
284 | 302 |
isValidationCategory() { |
285 | 303 |
return this.selectedCategory.ctgryNm == null || this.selectedCategory.ctgryNm == ''; |
286 | 304 |
}, |
287 | 305 |
//수정 함수 |
288 |
- updateCategory(){ |
|
306 |
+ updateCategory() { |
|
289 | 307 |
this.copySelectedCategory.ctgryNm = this.selectedCategory.ctgryNm; |
290 | 308 |
this.copySelectedCategory.useAt = this.selectedCategory.useAt; |
291 |
- this.copySelectedCategory.dc = this.selectedCategory.dc; |
|
309 |
+ this.copySelectedCategory.dc = this.selectedCategory.dc; |
|
292 | 310 |
} |
293 | 311 |
|
294 | 312 |
}, |
--- client/views/pages/member/MemberManagement.vue
+++ client/views/pages/member/MemberManagement.vue
... | ... | @@ -31,20 +31,26 @@ |
31 | 31 |
</button> |
32 | 32 |
</div> |
33 | 33 |
</div> |
34 |
- <table class="mb-10"> |
|
34 |
+ <table class="mb-10" style="width: 100%;"> |
|
35 | 35 |
<thead> |
36 | 36 |
<tr> |
37 |
- <th>아이디</th> |
|
38 |
- <th>이름</th> |
|
39 |
- <th>권한</th> |
|
37 |
+ <th style="width: 30%">아이디</th> |
|
38 |
+ <th style="width: 40%">이름</th> |
|
39 |
+ <th style="width: 30%">권한</th> |
|
40 | 40 |
</tr> |
41 | 41 |
</thead> |
42 | 42 |
<tbody> |
43 |
+ <tr v-if="selectedUsers.length === 0"> |
|
44 |
+ <td colspan="3" style="text-align: center;">등록된 사용자가 없습니다.</td> |
|
45 |
+ </tr> |
|
43 | 46 |
<tr v-for="(item, index) in selectedUsers" :key="index" |
44 | 47 |
:class="{ 'delete-member': item.useAt === 'N' }" @click="selectUser(item)"> |
45 | 48 |
<td>{{ item.loginId }}</td> |
46 | 49 |
<td>{{ item.userNm }}</td> |
47 |
- <td>{{ item.authorList[0].authorNm }}</td> |
|
50 |
+ <td> |
|
51 |
+ <span v-if="item.authorList.length > 0">{{ item.authorList[0].authorNm }}</span> |
|
52 |
+ <span v-else>없음</span> |
|
53 |
+ </td> |
|
48 | 54 |
</tr> |
49 | 55 |
</tbody> |
50 | 56 |
</table> |
... | ... | @@ -63,7 +69,7 @@ |
63 | 69 |
:src="check_blue" alt=""> |
64 | 70 |
<p>등록</p> |
65 | 71 |
</div> |
66 |
- <div class="button gray-bg">취소</div> |
|
72 |
+ <div class="button gray-bg" @click="cancelUser">취소</div> |
|
67 | 73 |
</div> |
68 | 74 |
<form action="" class="insert-form mb-50"> |
69 | 75 |
<dl> |
... | ... | @@ -111,7 +117,7 @@ |
111 | 117 |
<label for="use" class="require">사용여부</label> |
112 | 118 |
<div class="switch"> |
113 | 119 |
<input type="checkbox" id="switch" :checked="selectedUser.useAt === 'Y'" |
114 |
- @change="toggleUseAt" :disabled="!isNewInsert" /> |
|
120 |
+ @change="toggleUseAt" :disabled="!isNewInsert || (this.userId !== null || this.userId !== '')" /> |
|
115 | 121 |
<label for="switch">Toggle</label> |
116 | 122 |
</div> |
117 | 123 |
</dd> |
... | ... | @@ -195,6 +201,26 @@ |
195 | 201 |
}; |
196 | 202 |
}, |
197 | 203 |
methods: { |
204 |
+ 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 |
+ }; |
|
222 |
+ } |
|
223 |
+ }, |
|
198 | 224 |
//등록 함수 |
199 | 225 |
updateUser() { |
200 | 226 |
this.joinDTO.loginId = this.loginId; |
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?