

20230626 김성훈 사용자 상세조회,수정,삭제 추가
@6204bb43d2a0c6252d6b79ee586b345cd8df82bc
--- client/views/pages/SystemManagement/UserAddForm.vue
+++ client/views/pages/SystemManagement/UserAddForm.vue
... | ... | @@ -3,10 +3,10 @@ |
3 | 3 |
<div class="tab-wrap"> |
4 | 4 |
<ul> |
5 | 5 |
<li> |
6 |
- <a href="" class="tab active">사용자 관리</a> |
|
6 |
+ <button class="tab active">사용자 관리</button> |
|
7 | 7 |
</li> |
8 | 8 |
<li> |
9 |
- <a href="" class="tab">접속기록 조회</a> |
|
9 |
+ <button @click="accessLogPage()" class="tab">접속기록 조회</button> |
|
10 | 10 |
</li> |
11 | 11 |
</ul> |
12 | 12 |
</div> |
... | ... | @@ -23,21 +23,19 @@ |
23 | 23 |
</div> |
24 | 24 |
<div class="flex m-b"> |
25 | 25 |
<span>비밀번호 : </span> |
26 |
- <input type="password" placeholder="Password" v-model="user.user_pw" @change="passwordSyncCheck()"> |
|
26 |
+ <input type="password" placeholder="Password" v-model="user.user_pw"> |
|
27 | 27 |
</div> |
28 | 28 |
<div class="flex m-b"> |
29 | 29 |
<span>비밀번호 확인 : </span> |
30 |
- <input type="password" placeholder="Confirm Password" v-model="passwordCheck" @change="passwordSyncCheck()"> |
|
30 |
+ <input type="password" placeholder="Confirm Password" v-model="passwordCheck"> |
|
31 | 31 |
</div> |
32 |
- <div v-if="passwordCheckFlag === true" style="color:chartreuse">비밀번호 일치</div> |
|
33 |
- <div v-else-if="passwordCheckFlag === false" style="color:red">비밀번호 불일치</div> |
|
34 | 32 |
<div class="flex m-b"> |
35 | 33 |
<span>이름 : </span> |
36 | 34 |
<input type="text" placeholder="Name" v-model="user.user_nm"> |
37 | 35 |
</div> |
38 | 36 |
<div class="flex m-b"> |
39 | 37 |
<span>전화번호 : </span> |
40 |
- <input type="text" placeholder=" '-' 을 제외하고 입력해주세요." maxlength="13" v-model="telno" @change="phoneCheck" @keyup="getPhoneMask(telno)"> |
|
38 |
+ <input type="text" placeholder=" '-' 을 제외하고 입력해주세요." maxlength="13" v-model="user.user_telno" @change="phoneCheck" @keyup="getPhoneMask(user.user_telno)"> |
|
41 | 39 |
<p style="color:red" v-if="telno_boolean === false"> 전화번호 9~11자리를 입력해주세요.</p> |
42 | 40 |
</div> |
43 | 41 |
<div class="flex m-b"> |
... | ... | @@ -47,7 +45,7 @@ |
47 | 45 |
</div> |
48 | 46 |
<div class="flex m-b"> |
49 | 47 |
<span>관리구역 : </span> |
50 |
- <select name="" id=""> |
|
48 |
+ <select v-model="searchCip_rvnCode"> |
|
51 | 49 |
<option value="">시/도</option> |
52 | 50 |
</select> |
53 | 51 |
<select name="" id=""> |
... | ... | @@ -75,9 +73,7 @@ |
75 | 73 |
|
76 | 74 |
<div class="btn-wrap"> |
77 | 75 |
<button type="button" class="green-btn" @click="userInsertCheck">등록</button> |
78 |
- <router-link to="/UserManagement.page"> |
|
79 |
- <span class="btn-2 gray-btn">취소</span> |
|
80 |
- </router-link> |
|
76 |
+ <span class="btn-2 gray-btn" @click="userSelectListPage()">취소</span> |
|
81 | 77 |
</div> |
82 | 78 |
</div> |
83 | 79 |
</div> |
... | ... | @@ -123,6 +119,7 @@ |
123 | 119 |
}; |
124 | 120 |
}, |
125 | 121 |
methods: { |
122 |
+ |
|
126 | 123 |
//ID 중복 검사 |
127 | 124 |
idChcek: function() { |
128 | 125 |
const vm = this; |
... | ... | @@ -150,36 +147,25 @@ |
150 | 147 |
vm.idChcek_boolean = false; |
151 | 148 |
}); |
152 | 149 |
}, |
153 |
- |
|
154 |
- //비밀번호 일치 여부 검사 |
|
155 |
- passwordSyncCheck: function () { |
|
156 |
- if (this.user.user_pw != this.passwordCheck && this.user.user_pw != "" && this.passwordCheck != "" && |
|
157 |
- this.user.user_pw != null && this.passwordCheck != null) { |
|
158 |
- this.passwordCheckFlag = false; |
|
159 |
- } else if (this.user.user_pw === this.passwordCheck && this.user.user_pw != "" && this.passwordCheck != ""&& |
|
160 |
- this.user.user_pw != null && this.passwordCheck != null) { |
|
161 |
- this.passwordCheckFlag = true; |
|
162 |
- } else if (this.user.user_pw === "" || this.passwordCheck === "") { |
|
163 |
- this.passwordCheckFlag = null; |
|
164 |
- } |
|
165 |
- }, |
|
166 | 150 |
|
167 | 151 |
//전화번호 입력 시 자동 '-' 삽입 |
168 | 152 |
getPhoneMask: function(telNumber) { |
169 | 153 |
var res = COMMON_UTIL.getMask(telNumber) |
170 |
- this.telno = res |
|
171 |
- //서버 전송 값에는 '-' 를 제외하고 숫자만 저장 |
|
172 |
- this.user.user_telno = this.telno.replace(/[^0-9]/g, '') |
|
154 |
+ this.user.user_telno = res |
|
173 | 155 |
}, |
174 | 156 |
|
175 | 157 |
emailCheck: function() { |
176 | 158 |
this.email_boolean = true; |
177 |
- if (COMMON_UTIL.checkEmail(this.user.user_eml) === false) this.email_boolean = false; |
|
159 |
+ |
|
160 |
+ if (COMMON_UTIL.checkEmail(this.user.user_eml) === false) |
|
161 |
+ this.email_boolean = false; |
|
178 | 162 |
}, |
179 | 163 |
|
180 | 164 |
phoneCheck: function() { |
181 | 165 |
this.telno_boolean = true; |
182 |
- if (COMMON_UTIL.checkPhone(this.user.user_telno) === false) this.telno_boolean = false; |
|
166 |
+ |
|
167 |
+ if (COMMON_UTIL.checkPhone(this.user.user_telno) === false) |
|
168 |
+ this.telno_boolean = false; |
|
183 | 169 |
}, |
184 | 170 |
|
185 | 171 |
// 등록버튼 클릭 시 빈칸 검사 |
... | ... | @@ -199,7 +185,7 @@ |
199 | 185 |
return false; |
200 | 186 |
} |
201 | 187 |
|
202 |
- if (this.passwordCheckFlag === false || this.passwordCheckFlag === null) { |
|
188 |
+ if (COMMON_UTIL.checkPassword(this.user.user_pw, this.passwordCheck) === false) { |
|
203 | 189 |
alert('비밀번호가 일치하지 않습니다.'); |
204 | 190 |
return false; |
205 | 191 |
} |
... | ... | @@ -244,6 +230,9 @@ |
244 | 230 |
// 사용자 등록 |
245 | 231 |
userInsert: function() { |
246 | 232 |
const vm = this; |
233 |
+ //서버 전송 값에는 '-' 를 제외하고 숫자만 저장 |
|
234 |
+ vm.user.user_telno = vm.user.user_telno.replace(/[^0-9]/g, ''); |
|
235 |
+ |
|
247 | 236 |
axios({ |
248 | 237 |
url: '/user/userInsert.json', |
249 | 238 |
method: 'post', |
... | ... | @@ -259,17 +248,23 @@ |
259 | 248 |
vm.userSelectListPage(); |
260 | 249 |
} else { |
261 | 250 |
alert("등록 실패, 관리자에게 문의해주세요."); |
262 |
- vm.modal_1 = false; |
|
251 |
+ vm.modal_insert = false; |
|
263 | 252 |
} |
264 | 253 |
}).catch(function (error) { |
265 | 254 |
console.log("userInsert - error : ", error); |
266 | 255 |
alert("사용자 등록 오류, 관리자에게 문의해주세요."); |
267 |
- vm.modal_1 = false; |
|
256 |
+ vm.modal_insert = false; |
|
268 | 257 |
}) |
269 | 258 |
}, |
270 |
- |
|
259 |
+ |
|
260 |
+ //사용자 목록 페이지 이동 |
|
271 | 261 |
userSelectListPage: function () { |
272 |
- this.$router.push({ path : '/UserManagement.page'}); |
|
262 |
+ this.$router.push({ path: '/UserManagement.page'}); |
|
263 |
+ }, |
|
264 |
+ |
|
265 |
+ //접속기록조회 페이지 이동 |
|
266 |
+ accessLogPage: function () { |
|
267 |
+ this.$router.push({ path: '/AccessRecord.page'}); |
|
273 | 268 |
}, |
274 | 269 |
}, |
275 | 270 |
watch: {}, |
--- client/views/pages/SystemManagement/UserManagement.vue
+++ client/views/pages/SystemManagement/UserManagement.vue
... | ... | @@ -3,22 +3,22 @@ |
3 | 3 |
<div class="tab-wrap"> |
4 | 4 |
<ul> |
5 | 5 |
<li> |
6 |
- <button @click="userSelectListPage" class="tab active">사용자 관리</button> |
|
6 |
+ <button class="tab active">사용자 관리</button> |
|
7 | 7 |
</li> |
8 | 8 |
<li> |
9 |
- <button @click="accessLogPage" class="tab">접속기록 조회</button> |
|
9 |
+ <button @click="accessLogPage()" class="tab">접속기록 조회</button> |
|
10 | 10 |
</li> |
11 | 11 |
</ul> |
12 | 12 |
</div> |
13 | 13 |
<div class="board-wrap"> |
14 | 14 |
<div> |
15 |
- <h2 class="page-title">사용자 등록</h2> |
|
15 |
+ <h2 class="page-title">사용자 관리</h2> |
|
16 | 16 |
</div> |
17 | 17 |
<hr class="margin"> |
18 | 18 |
<div class="search-wrap clear-fix"> |
19 | 19 |
<div class="float-left"> |
20 | 20 |
<select v-model="userListSearch.authorFilter" @change="userSelectList"> |
21 |
- <option value="">권한필터</option> |
|
21 |
+ <option value="null">권한필터</option> |
|
22 | 22 |
<option value="시청관리자">시청관리자</option> |
23 | 23 |
<option value="지자체관리자">지자체관리자</option> |
24 | 24 |
</select> |
... | ... | @@ -26,10 +26,10 @@ |
26 | 26 |
<div class="float-right flex gap"> |
27 | 27 |
<label>등록일자</label> |
28 | 28 |
<input type="date" value-format="yyyyMMdd" v-model="userListSearch.startDate"/> |
29 |
- <span>~</span> |
|
29 |
+ <span> ~ </span> |
|
30 | 30 |
<input type="date" value-format="yyyyMMdd" v-model="userListSearch.endDate"/> |
31 | 31 |
<select v-model="userListSearch.searchType"> |
32 |
- <option value="">검색조건</option> |
|
32 |
+ <option value="null">검색조건</option> |
|
33 | 33 |
<option value="user_id">ID</option> |
34 | 34 |
<option value="user_nm">이름</option> |
35 | 35 |
<option value="dong_cd">관리구역</option> |
... | ... | @@ -139,11 +139,6 @@ |
139 | 139 |
//날짜 시,분,초 자르기 |
140 | 140 |
yyyymmdd: function (date) { |
141 | 141 |
return COMMON_UTIL.yyyymmdd(date); |
142 |
- }, |
|
143 |
- |
|
144 |
- //사용자 목록 페이지 이동 |
|
145 |
- userSelectListPage: function () { |
|
146 |
- this.$router.push({ path: '/UserManagement.page'}); |
|
147 | 142 |
}, |
148 | 143 |
|
149 | 144 |
//접속기록조회 페이지 이동 |
--- client/views/pages/SystemManagement/UserModifyForm.vue
+++ client/views/pages/SystemManagement/UserModifyForm.vue
... | ... | @@ -3,10 +3,10 @@ |
3 | 3 |
<div class="tab-wrap"> |
4 | 4 |
<ul> |
5 | 5 |
<li> |
6 |
- <a href="" class="tab active">사용자 관리</a> |
|
6 |
+ <button class="tab active">사용자 관리</button> |
|
7 | 7 |
</li> |
8 | 8 |
<li> |
9 |
- <a href="" class="tab">접속기록 조회</a> |
|
9 |
+ <button @click="accessLogPage()" class="tab">접속기록 조회</button> |
|
10 | 10 |
</li> |
11 | 11 |
</ul> |
12 | 12 |
</div> |
... | ... | @@ -18,25 +18,23 @@ |
18 | 18 |
<div class="form-wrap"> |
19 | 19 |
<div class="flex m-b"> |
20 | 20 |
<span>아이디 : </span> |
21 |
- <span>admin </span> |
|
21 |
+ <span>{{ user.user_id }} </span> |
|
22 | 22 |
</div> |
23 | 23 |
<div class="flex m-b"> |
24 | 24 |
<span>비밀번호 : </span> |
25 |
- <input type="password" placeholder="Password" v-model="user.user_pw" @change="passwordSyncCheck()"> |
|
25 |
+ <input type="password" placeholder="Password" v-model="user.user_pw"> |
|
26 | 26 |
</div> |
27 | 27 |
<div class="flex m-b"> |
28 | 28 |
<span>비밀번호 확인 : </span> |
29 |
- <input type="password" placeholder="Confirm Password" v-model="passwordCheck" @change="passwordSyncCheck()"> |
|
29 |
+ <input type="password" placeholder="Confirm Password" v-model="passwordCheck"> |
|
30 | 30 |
</div> |
31 |
- <div v-if="passwordCheckFlag === true" style="color:chartreuse">비밀번호 일치</div> |
|
32 |
- <div v-else-if="passwordCheckFlag === false" style="color:red">비밀번호 불일치</div> |
|
33 | 31 |
<div class="flex m-b"> |
34 | 32 |
<span>이름 : </span> |
35 | 33 |
<input type="text" placeholder="Name" v-model="user.user_nm"> |
36 | 34 |
</div> |
37 | 35 |
<div class="flex m-b"> |
38 | 36 |
<span>전화번호 : </span> |
39 |
- <input type="text" placeholder=" '-' 을 제외하고 입력해주세요." maxlength="13" v-model="telno" @change="phoneCheck" @keyup="getPhoneMask(telno)"> |
|
37 |
+ <input type="text" placeholder=" '-' 을 제외하고 입력해주세요." maxlength="13" v-model="user.user_telno" @change="phoneCheck" @keyup="getPhoneMask(user.user_telno)"> |
|
40 | 38 |
<p style="color:red" v-if="telno_boolean === false"> 전화번호 9~11자리를 입력해주세요.</p> |
41 | 39 |
</div> |
42 | 40 |
<div class="flex m-b"> |
... | ... | @@ -73,24 +71,38 @@ |
73 | 71 |
</div> |
74 | 72 |
|
75 | 73 |
<div class="btn-wrap"> |
76 |
- <button type="button" class="green-btn" @click="userInsertCheck">수정</button> |
|
77 |
- <button type="button" class="green-btn" @click="DeleteCheck">삭제</button> |
|
78 |
- <router-link to="/UserManagement.page"> |
|
79 |
- <span class="btn-2 gray-btn">취소</span> |
|
80 |
- </router-link> |
|
74 |
+ <button type="button" class="green-btn" @click="userUpdateCheck">수정</button> |
|
75 |
+ <button type="button" class="green-btn" @click="modal_delete = true">삭제</button> |
|
76 |
+ <span class="btn-2 gray-btn" @click="userSelectListPage()">취소</span> |
|
81 | 77 |
</div> |
82 | 78 |
</div> |
83 | 79 |
</div> |
84 | 80 |
</div> |
85 | 81 |
|
86 |
- <div class="modal-wrap" v-if="modal_insert == true"> |
|
82 |
+ <div class="modal-wrap" v-if="modal_update == true"> |
|
87 | 83 |
<div class="modal-bg"> |
88 | 84 |
</div> |
89 | 85 |
<div class="modal"> |
90 |
- <p>사용자를 <span class="txt-point">등록</span>하시겠습니까?</p> |
|
86 |
+ <p>수정하신 정보를 <span class="txt-point">저장</span>하시겠습니까?</p> |
|
91 | 87 |
<div class="btn-wrap"> |
92 |
- <button type="button" class="green-btn" @click="userInsert">확인</button> |
|
93 |
- <button type="button" class="gray-btn" @click="modal_insert = false">취소</button> |
|
88 |
+ <button type="button" class="green-btn" @click="userUpdate">확인</button> |
|
89 |
+ <button type="button" class="gray-btn" @click="modal_update = false">취소</button> |
|
90 |
+ </div> |
|
91 |
+ </div> |
|
92 |
+ </div> |
|
93 |
+ |
|
94 |
+ <div class="modal-wrap" v-if="modal_delete == true"> |
|
95 |
+ <div class="modal-bg"> |
|
96 |
+ </div> |
|
97 |
+ <div class="modal"> |
|
98 |
+ <p> |
|
99 |
+ 해당 기능은 데이터 <span class="txt-point-red">삭제</span>기능입니다.<br> |
|
100 |
+ 데이터 <span class="txt-point-red">삭제</span> 후, 조회에서 해당 데이터를 확인할 수 없습니다.<br> |
|
101 |
+ <span class="txt-point-red">삭제</span>를 원하시면 아래 삭제 버튼을 눌러주세요. |
|
102 |
+ </p> |
|
103 |
+ <div class="btn-wrap"> |
|
104 |
+ <button type="button" class="green-btn" @click="userDelete">삭제</button> |
|
105 |
+ <button type="button" class="gray-btn" @click="modal_delete = false">취소</button> |
|
94 | 106 |
</div> |
95 | 107 |
</div> |
96 | 108 |
</div> |
... | ... | @@ -99,6 +111,7 @@ |
99 | 111 |
<script> |
100 | 112 |
import axios from 'axios'; |
101 | 113 |
import COMMON_UTIL from '../../../resources/js/commonUtil.ts'; |
114 |
+import { useRoute } from 'vue-router'; |
|
102 | 115 |
|
103 | 116 |
export default { |
104 | 117 |
data: () => { |
... | ... | @@ -112,64 +125,48 @@ |
112 | 125 |
user_author: null, |
113 | 126 |
rm: null |
114 | 127 |
}, |
128 |
+ route: useRoute(), |
|
129 |
+ |
|
115 | 130 |
passwordCheck: null, |
116 |
- passwordCheckFlag: null, |
|
131 |
+ |
|
117 | 132 |
telno_boolean: true, |
118 | 133 |
email_boolean: true, |
119 |
- idChcek_boolean: false, |
|
120 |
- telno: null, |
|
121 |
- modal_insert: false |
|
134 |
+ modal_update: false, |
|
135 |
+ modal_delete: false |
|
122 | 136 |
|
123 | 137 |
}; |
124 | 138 |
}, |
125 | 139 |
methods: { |
126 |
- //ID 중복 검사 |
|
127 |
- idChcek: function() { |
|
140 |
+ |
|
141 |
+ //사용자 상세조회 |
|
142 |
+ userSelectOne: function() { |
|
128 | 143 |
const vm = this; |
129 | 144 |
axios({ |
130 | 145 |
url: '/user/userSelectOne.json', |
131 | 146 |
method: 'post', |
132 |
- herders: { |
|
133 |
- 'Content-Type': "application/json; charset=UTF-8", |
|
147 |
+ headers: { |
|
148 |
+ "Content-Type": "application/json; charset=UTF-8" |
|
134 | 149 |
}, |
135 |
- data: vm.user |
|
136 |
- }).then( function (response) { |
|
137 |
- console.log("idCheck - response : ", response.data); |
|
138 |
- if(response.data != null) { |
|
139 |
- alert("중복된 ID 입니다."); |
|
140 |
- vm.idChcek_boolean = false; |
|
141 |
- return false; |
|
142 |
- } else { |
|
143 |
- alert("사용가능한 ID 입니다."); |
|
144 |
- vm.idChcek_boolean = true; |
|
145 |
- return true; |
|
146 |
- } |
|
147 |
- }).catch( function (error) { |
|
148 |
- console.log("idCheck - error : ", error); |
|
149 |
- alert("중복검사 오류, 다시 시도해주세요."); |
|
150 |
- vm.idChcek_boolean = false; |
|
150 |
+ data: vm.route.query |
|
151 |
+ }).then(function (response) { |
|
152 |
+ console.log("userSelectOne - response : ", response.data); |
|
153 |
+ vm.user = response.data; |
|
154 |
+ vm.user.user_telno = vm.HyphenMinus(response.data.user_telno); |
|
155 |
+ }).catch(function(error) { |
|
156 |
+ console.log("userSelectOne - error : ", error) |
|
151 | 157 |
}); |
152 | 158 |
}, |
153 |
- |
|
154 |
- //비밀번호 일치 여부 검사 |
|
155 |
- passwordSyncCheck: function () { |
|
156 |
- if (this.user.user_pw != this.passwordCheck && this.user.user_pw != "" && this.passwordCheck != "" && |
|
157 |
- this.user.user_pw != null && this.passwordCheck != null) { |
|
158 |
- this.passwordCheckFlag = false; |
|
159 |
- } else if (this.user.user_pw === this.passwordCheck && this.user.user_pw != "" && this.passwordCheck != ""&& |
|
160 |
- this.user.user_pw != null && this.passwordCheck != null) { |
|
161 |
- this.passwordCheckFlag = true; |
|
162 |
- } else if (this.user.user_pw === "" || this.passwordCheck === "") { |
|
163 |
- this.passwordCheckFlag = null; |
|
164 |
- } |
|
159 |
+ |
|
160 |
+ // 전화번호 '-' 추가 후 출력 |
|
161 |
+ HyphenMinus: function (telno) { |
|
162 |
+ return COMMON_UTIL.HyphenMinus(telno); |
|
165 | 163 |
}, |
166 | 164 |
|
167 | 165 |
//전화번호 입력 시 자동 '-' 삽입 |
168 | 166 |
getPhoneMask: function(telNumber) { |
169 | 167 |
var res = COMMON_UTIL.getMask(telNumber) |
170 |
- this.telno = res |
|
171 |
- //서버 전송 값에는 '-' 를 제외하고 숫자만 저장 |
|
172 |
- this.user.user_telno = this.telno.replace(/[^0-9]/g, '') |
|
168 |
+ this.user.user_telno = res |
|
169 |
+ // this.user.user_telno = this.user_telno.replace(/[^0-9]/g, '') |
|
173 | 170 |
}, |
174 | 171 |
|
175 | 172 |
emailCheck: function() { |
... | ... | @@ -182,24 +179,15 @@ |
182 | 179 |
if (COMMON_UTIL.checkPhone(this.user.user_telno) === false) this.telno_boolean = false; |
183 | 180 |
}, |
184 | 181 |
|
185 |
- // 등록버튼 클릭 시 빈칸 검사 |
|
186 |
- userInsertCheck: function() { |
|
187 |
- if (COMMON_UTIL.isEmpty(this.user.user_id) === false) { |
|
188 |
- alert('수정하신 정보를 저장하시겠습니까?'); |
|
189 |
- return false; |
|
190 |
- } |
|
191 |
- |
|
192 |
- if (this.idChcek_boolean === false) { |
|
193 |
- alert("ID중복검사를 완료해주세요.") |
|
194 |
- return false; |
|
195 |
- } |
|
196 |
- |
|
182 |
+ // 수정버튼 클릭 시 빈칸 검사 |
|
183 |
+ userUpdateCheck: function() { |
|
184 |
+ |
|
197 | 185 |
if (COMMON_UTIL.isEmpty(this.user.user_pw) === false) { |
198 | 186 |
alert('비밀번호를 입력해주세요.'); |
199 | 187 |
return false; |
200 | 188 |
} |
201 | 189 |
|
202 |
- if (this.passwordCheckFlag === false || this.passwordCheckFlag === null) { |
|
190 |
+ if (COMMON_UTIL.checkPassword(this.user.user_pw, this.passwordCheck) === false) { |
|
203 | 191 |
alert('비밀번호가 일치하지 않습니다.'); |
204 | 192 |
return false; |
205 | 193 |
} |
... | ... | @@ -238,44 +226,80 @@ |
238 | 226 |
alert('권한을 선택해주세요.'); |
239 | 227 |
return false; |
240 | 228 |
} |
241 |
- this.modal_insert = true |
|
229 |
+ this.modal_update = true |
|
242 | 230 |
}, |
243 | 231 |
|
244 |
- // 사용자 삭제 |
|
245 |
- DeleteCheck: function() { |
|
232 |
+ userUpdate: function() { |
|
246 | 233 |
const vm = this; |
234 |
+ //서버 전송 값에는 '-' 를 제외하고 숫자만 저장 |
|
235 |
+ vm.user.user_telno = vm.user.user_telno.replace(/[^0-9]/g, ''); |
|
236 |
+ |
|
247 | 237 |
axios({ |
248 |
- url: '/user/userInsert.json', |
|
238 |
+ url: '/user/userUpdate.json', |
|
249 | 239 |
method: 'post', |
250 |
- herders: { |
|
240 |
+ headers: { |
|
251 | 241 |
'Content-Type': "application/json; charset=UTF-8", |
252 | 242 |
}, |
253 | 243 |
data: vm.user |
254 |
- }).then(function (response) { |
|
255 |
- console.log("userInsert - response : ", response); |
|
244 |
+ }).then(function(response) { |
|
245 |
+ console.log("userUpdate - response : ",response.data); |
|
256 | 246 |
let result = response.data; |
257 |
- if (result > 0) { |
|
258 |
- alert("해당 기능은 데이터 삭제 기능입니다. 데이터 삭제 후, 조회에서 해당 데이터를 확인할 수 없습니다.삭제를 원하시면 아래 삭제 버튼을 눌러 주세요."); |
|
247 |
+ if(result > 0) { |
|
248 |
+ alert("사용자 정보 수정을 완료 하였습니다."); |
|
259 | 249 |
vm.userSelectListPage(); |
260 | 250 |
} else { |
261 |
- alert("등록 실패, 관리자에게 문의해주세요."); |
|
262 |
- vm.modal_1 = false; |
|
251 |
+ alert("수정 실패, 관리자에게 문의해주세요."); |
|
252 |
+ vm.modal_update = false; |
|
263 | 253 |
} |
264 | 254 |
}).catch(function (error) { |
265 |
- console.log("userInsert - error : ", error); |
|
266 |
- alert("해당 기능은 데이터 삭제 기능입니다. 데이터 삭제 후, 조회에서 해당 데이터를 확인할 수 없습니다.삭제를 원하시면 아래 삭제 버튼을 눌러 주세요."); |
|
267 |
- vm.modal_1 = false; |
|
255 |
+ console.log("userUpdate - error : ", error); |
|
256 |
+ alert("사용자정보 수정 오류, 관리자에게 문의해주세요."); |
|
257 |
+ vm.modal_update = false; |
|
268 | 258 |
}) |
269 | 259 |
}, |
270 | 260 |
|
261 |
+ //사용자아이디 사용여부 N |
|
262 |
+ userDelete: function() { |
|
263 |
+ const vm = this; |
|
264 |
+ axios({ |
|
265 |
+ url: '/user/userDelete.json', |
|
266 |
+ method: 'post', |
|
267 |
+ headers: { |
|
268 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
269 |
+ }, |
|
270 |
+ data: vm.user |
|
271 |
+ }).then(function(response) { |
|
272 |
+ console.log("userUpdate - response : ",response.data); |
|
273 |
+ let result = response.data; |
|
274 |
+ if(result > 0) { |
|
275 |
+ alert("사용자 삭제를 완료 하였습니다."); |
|
276 |
+ vm.userSelectListPage(); |
|
277 |
+ } else { |
|
278 |
+ alert("삭제 실패, 관리자에게 문의해주세요."); |
|
279 |
+ vm.modal_delete = false; |
|
280 |
+ } |
|
281 |
+ }).catch(function (error) { |
|
282 |
+ console.log("userUpdate - error : ", error); |
|
283 |
+ alert("사용자 삭제 오류, 관리자에게 문의해주세요."); |
|
284 |
+ vm.modal_delete = false; |
|
285 |
+ }) |
|
286 |
+ }, |
|
287 |
+ |
|
288 |
+ //사용자 목록 페이지 이동 |
|
271 | 289 |
userSelectListPage: function () { |
272 |
- this.$router.push({ path : '/UserManagement.page'}); |
|
290 |
+ this.$router.push({ path: '/UserManagement.page'}); |
|
291 |
+ }, |
|
292 |
+ |
|
293 |
+ //접속기록조회 페이지 이동 |
|
294 |
+ accessLogPage: function () { |
|
295 |
+ this.$router.push({ path: '/AccessRecord.page'}); |
|
273 | 296 |
}, |
274 | 297 |
}, |
275 | 298 |
watch: {}, |
276 | 299 |
computed: {}, |
277 | 300 |
mounted() { |
278 | 301 |
console.log("Main4 mounted"); |
302 |
+ this.userSelectOne(); |
|
279 | 303 |
}, |
280 | 304 |
}; |
281 | 305 |
</script> |
... | ... | @@ -407,4 +431,8 @@ |
407 | 431 |
.txt-point { |
408 | 432 |
color: #13833b; |
409 | 433 |
} |
434 |
+ |
|
435 |
+.txt-point-red { |
|
436 |
+ color: red; |
|
437 |
+} |
|
410 | 438 |
</style>(No newline at end of file) |
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?