

20230622 김성훈 노드Excel 등록, 사용자, 유지보수담당자 등록 유효성 검사 추가
@8c8afca83b8526ce4162f7581387ada95f112fcb
--- client/views/pages/SystemManagement/AccessRecord.vue
+++ client/views/pages/SystemManagement/AccessRecord.vue
... | ... | @@ -3,14 +3,10 @@ |
3 | 3 |
<div class="tab-wrap"> |
4 | 4 |
<ul> |
5 | 5 |
<li> |
6 |
- <router-link to="/UserManagement.page"> |
|
7 |
- <span class="tab">사용자 관리</span> |
|
8 |
- </router-link> |
|
6 |
+ <span class="tab" @click="userSelectListPage">사용자 관리</span> |
|
9 | 7 |
</li> |
10 | 8 |
<li> |
11 |
- <router-link to="/AccessRecord.page"> |
|
12 |
- <span class="tab active">접속기록 조회</span> |
|
13 |
- </router-link> |
|
9 |
+ <span class="tab active" @click="accessLogPage">접속기록 조회</span> |
|
14 | 10 |
</li> |
15 | 11 |
</ul> |
16 | 12 |
</div> |
... | ... | @@ -21,19 +17,17 @@ |
21 | 17 |
<hr class="margin"> |
22 | 18 |
<div class="search-wrap clear-fix"> |
23 | 19 |
<div class="float-right"> |
24 |
- <form action=""> |
|
25 |
- <label>접속일자</label> |
|
26 |
- <input type="date" name="" id="" /> |
|
27 |
- <span>~</span> |
|
28 |
- <input type="date" name="" id="" /> |
|
29 |
- <select name="" id=""> |
|
30 |
- <option value="">검색조건</option> |
|
31 |
- <option value="">ID</option> |
|
32 |
- <option value="">이름</option> |
|
33 |
- </select> |
|
34 |
- <input type="text" /> |
|
35 |
- <button type="button" class="green-btn">검색</button> |
|
36 |
- </form> |
|
20 |
+ <label>접속일자</label> |
|
21 |
+ <input type="date" value-format="yyyymmdd" v-model="userAccessListSearch.startDate"/> |
|
22 |
+ <span>~</span> |
|
23 |
+ <input type="date" value-format="yyyymmdd" v-model="userAccessListSearch.endDate"/> |
|
24 |
+ <select v-model="userAccessListSearch.searchType"> |
|
25 |
+ <option value="">검색조건</option> |
|
26 |
+ <option value="user_id">ID</option> |
|
27 |
+ <option value="user_nm">이름</option> |
|
28 |
+ </select> |
|
29 |
+ <input type="text" placeholder="검색어를 입력 해주세요." v-model="userAccessListSearch.searchText" @keyup.enter="userAccessList"/> |
|
30 |
+ <button type="button" class="green-btn" @click="userAccessList">검색</button> |
|
37 | 31 |
</div> |
38 | 32 |
</div> |
39 | 33 |
<div> |
... | ... | @@ -57,35 +51,22 @@ |
57 | 51 |
</tr> |
58 | 52 |
</thead> |
59 | 53 |
<tbody> |
60 |
- <tr> |
|
61 |
- <td>100</td> |
|
62 |
- <td>id_sample_1</td> |
|
63 |
- <td>name_1</td> |
|
64 |
- <td>2023-04-28 16:55:28</td> |
|
65 |
- <td>192.168.0.11</td> |
|
66 |
- <td></td> |
|
67 |
- </tr> |
|
68 |
- <tr> |
|
69 |
- <td>99</td> |
|
70 |
- <td>id_sample_2</td> |
|
71 |
- <td>name_2</td> |
|
72 |
- <td>2023-04-28 16:55:28</td> |
|
73 |
- <td>192.168.0.11</td> |
|
74 |
- <td></td> |
|
54 |
+ <tr v-for="(item, idx) in userAccessList" :key="idx"> |
|
55 |
+ <td data-title="NO">{{ idx + 1 }}</td> |
|
56 |
+ <td data-title="접속ID">{{ item.user_id }}</td> |
|
57 |
+ <td data-title="접속자이름">{{ item.user_nm }}</td> |
|
58 |
+ <td data-title="접속일시">{{ item.cntn_dt }}</td> |
|
59 |
+ <td data-title="접속IP">{{ item.cntn_ip }}</td> |
|
60 |
+ <td data-title="접속타입">{{ item.cntn_ty }}</td> |
|
75 | 61 |
</tr> |
76 | 62 |
</tbody> |
77 | 63 |
</table> |
78 | 64 |
</div> |
79 | 65 |
<div class="bottom-wrap"> |
80 |
- <div class="pg-wrap"> |
|
81 |
- <a href="#" class="pg-item prev">◀</a> |
|
82 |
- <a href="#" class="pg-item active">1</a> |
|
83 |
- <a href="#" class="pg-item">2</a> |
|
84 |
- <a href="#" class="pg-item">3</a> |
|
85 |
- <a href="#" class="pg-item">4</a> |
|
86 |
- <a href="#" class="pg-item">5</a> |
|
87 |
- <a href="#" class="pg-item next">▶</a> |
|
88 |
- </div> |
|
66 |
+ <PaginationButton |
|
67 |
+ v-model:currentPage="userAccessListSearch.currentPage" |
|
68 |
+ :per-page="userAccessListSearch.perPage" :total-count="userAccessCount" :max-range="5" |
|
69 |
+ :click="userAccessList" /> |
|
89 | 70 |
<div class="btn-wrap"> |
90 | 71 |
<button type="button" class="green-btn">Excel로 저장</button> |
91 | 72 |
</div> |
... | ... | @@ -95,13 +76,61 @@ |
95 | 76 |
</template> |
96 | 77 |
|
97 | 78 |
<script> |
79 |
+import axios from 'axios'; |
|
80 |
+import PaginationButton from '../../component/pagination/PaginationButton.vue'; |
|
81 |
+ |
|
98 | 82 |
export default { |
99 |
- data() { |
|
100 |
- return {}; |
|
83 |
+ data: () => { |
|
84 |
+ return { |
|
85 |
+ userAccessListSearch: { |
|
86 |
+ currentPage: 1, |
|
87 |
+ perPage: 10, |
|
88 |
+ searchType: null, |
|
89 |
+ searchText: null, |
|
90 |
+ startDate: null, |
|
91 |
+ endDate: null |
|
92 |
+ }, |
|
93 |
+ userAccessCount: 0, |
|
94 |
+ userAccessList: [] |
|
95 |
+ }; |
|
101 | 96 |
}, |
102 |
- methods: {}, |
|
97 |
+ methods: { |
|
98 |
+ |
|
99 |
+ //접속기록 목록 조회 |
|
100 |
+ userAccessList: function () { |
|
101 |
+ const vm = this; |
|
102 |
+ axios({ |
|
103 |
+ url: '/user/userAccessLog.json', |
|
104 |
+ method: 'post', |
|
105 |
+ herders: { |
|
106 |
+ 'Content-Type': "application/json; charset=UTF-8", |
|
107 |
+ }, |
|
108 |
+ data: vm.userAccessListSearch |
|
109 |
+ }).then(function(response) { |
|
110 |
+ console.log("userAccessList - response : ", response.data); |
|
111 |
+ vm.userAccessCount = response.data.userAccessCount; |
|
112 |
+ vm.userAccessList = response.data.userAccessList; |
|
113 |
+ }).catch(function(error) { |
|
114 |
+ console.log("userAccessList - error : ", error); |
|
115 |
+ alert("접속기록 목록 조회 오류, 관리자에게 문의해주세요.") |
|
116 |
+ }) |
|
117 |
+ }, |
|
118 |
+ |
|
119 |
+ //사용자 목록 페이지 이동 |
|
120 |
+ userSelectListPage: function () { |
|
121 |
+ this.$router.push({ path: '/UserManagement.page'}); |
|
122 |
+ }, |
|
123 |
+ |
|
124 |
+ //접속기록조회 페이지 이동 |
|
125 |
+ accessLogPage: function () { |
|
126 |
+ this.$router.push({ path: '/AccessRecord.page'}); |
|
127 |
+ }, |
|
128 |
+ }, |
|
103 | 129 |
watch: {}, |
104 | 130 |
computed: {}, |
131 |
+ components: { |
|
132 |
+ 'PaginationButton':PaginationButton, |
|
133 |
+ }, |
|
105 | 134 |
mounted() { |
106 | 135 |
console.log("Main4 mounted"); |
107 | 136 |
}, |
--- client/views/pages/SystemManagement/ChargeManagement.vue
+++ client/views/pages/SystemManagement/ChargeManagement.vue
... | ... | @@ -37,12 +37,12 @@ |
37 | 37 |
</thead> |
38 | 38 |
<tbody> |
39 | 39 |
<tr v-for="(item, idx) in managerList" :key="idx" @click="managerSelectOnePage(item)"> |
40 |
- <td data-title="NO">{{ item['mntnce_mngr_id'] }}</td> |
|
41 |
- <td data-title="이름">{{ item['mngr_nm'] }}</td> |
|
42 |
- <td data-title="전화번호">{{ HyphenMinus(item['mngr_telno']) }}</td> |
|
43 |
- <td data-title="이메일">{{ item['mngr_eml'] }}</td> |
|
44 |
- <td data-title="소속정보">{{ item['mngr_ogdp_info'] }}</td> |
|
45 |
- <td data-title="등록일자">{{ yyyymmdd(item['reg_dt']) }}</td> |
|
40 |
+ <td data-title="NO">{{ item.mntnce_mngr_id }}</td> |
|
41 |
+ <td data-title="이름">{{ item.mngr_nm }}</td> |
|
42 |
+ <td data-title="전화번호">{{ HyphenMinus(item.mngr_telno) }}</td> |
|
43 |
+ <td data-title="이메일">{{ item.mngr_eml }}</td> |
|
44 |
+ <td data-title="소속정보">{{ item.mngr_ogdp_info }}</td> |
|
45 |
+ <td data-title="등록일자">{{ yyyymmdd(item.reg_dt) }}</td> |
|
46 | 46 |
</tr> |
47 | 47 |
</tbody> |
48 | 48 |
</table> |
--- client/views/pages/SystemManagement/ManagerAddForm.vue
+++ client/views/pages/SystemManagement/ManagerAddForm.vue
... | ... | @@ -69,8 +69,8 @@ |
69 | 69 |
methods: { |
70 | 70 |
|
71 | 71 |
//전화번호 입력 시 자동 '-' 삽입 |
72 |
- getPhoneMask: function(val) { |
|
73 |
- var res = COMMON_UTIL.getMask(val) |
|
72 |
+ getPhoneMask: function(telNumber) { |
|
73 |
+ var res = COMMON_UTIL.getMask(telNumber) |
|
74 | 74 |
this.telno = res |
75 | 75 |
//서버 전송 값에는 '-' 를 제외하고 숫자만 저장 |
76 | 76 |
this.manager.mngr_telno = this.telno.replace(/[^0-9]/g, '') |
... | ... | @@ -86,7 +86,7 @@ |
86 | 86 |
if (COMMON_UTIL.checkPhone(this.manager.mngr_telno) === false) this.telno_boolean = false; |
87 | 87 |
}, |
88 | 88 |
|
89 |
- // 등록버튼 클릭 시 유효성 검사 |
|
89 |
+ // 등록버튼 클릭 시 빈칸 검사 |
|
90 | 90 |
managerInsertCheck: function() { |
91 | 91 |
|
92 | 92 |
if (COMMON_UTIL.isEmpty(this.manager.mngr_nm) === false) { |
... | ... | @@ -99,6 +99,11 @@ |
99 | 99 |
return false; |
100 | 100 |
} |
101 | 101 |
|
102 |
+ if (COMMON_UTIL.checkPhone(this.manager.mngr_telno) === false) { |
|
103 |
+ alert('전화번호 형식을 확인해주세요.'); |
|
104 |
+ return false; |
|
105 |
+ } |
|
106 |
+ |
|
102 | 107 |
if (COMMON_UTIL.isEmpty(this.manager.mngr_eml) === false) { |
103 | 108 |
alert('이메일을 입력해주세요.'); |
104 | 109 |
return false; |
--- client/views/pages/SystemManagement/NodeManagement.vue
+++ client/views/pages/SystemManagement/NodeManagement.vue
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 |
<label for="fileBtn" class="btn-2 green-btn"> |
132 | 132 |
파일선택 |
133 | 133 |
</label> |
134 |
- <button type="button" class="gray-btn">등록</button> |
|
134 |
+ <button type="button" class="gray-btn" @click="nodeExcelInsert">등록</button> |
|
135 | 135 |
</td> |
136 | 136 |
</tr> |
137 | 137 |
<tr> |
... | ... | @@ -215,6 +215,42 @@ |
215 | 215 |
}; |
216 | 216 |
}, |
217 | 217 |
methods: { |
218 |
+ |
|
219 |
+ //노드 엑셀 업로드 |
|
220 |
+ nodeExcelInsert: function() { |
|
221 |
+ const vm = this; |
|
222 |
+ var form = new FormData(); |
|
223 |
+ var file = document.getElementById("fileBtn");; |
|
224 |
+ console.log(file.files[0]); |
|
225 |
+ form.append("file", file.files[0]); |
|
226 |
+ axios({ |
|
227 |
+ url: '/node/nodeExcelRead.json', |
|
228 |
+ method: 'post', |
|
229 |
+ hearders: { |
|
230 |
+ 'Content-Type': "multipart/form-data", |
|
231 |
+ }, |
|
232 |
+ data: form |
|
233 |
+ }).then(function (response) { |
|
234 |
+ console.log("nodeExcelInsert - response : ", response.data); |
|
235 |
+ let insert = response.data.insert; |
|
236 |
+ let error = response.data.error; |
|
237 |
+ if (insert > 0 && error > 0) { |
|
238 |
+ alert(insert + "건의 노드 등록완료, " + error + "건은 이미 ID가 존재하는 데이터 입니다.") |
|
239 |
+ vm.nodeSelectList(); |
|
240 |
+ } else if(insert === 0) { |
|
241 |
+ alert("업로드 파일의 모든 데이터(" + error + "건)는 이미 ID가 존재하는 데이터 입니다.") |
|
242 |
+ vm.nodeSelectList(); |
|
243 |
+ } else if(insert > 0 && error === 0) { |
|
244 |
+ alert(insert + "건의 노드 등록완료.") |
|
245 |
+ vm.nodeSelectList(); |
|
246 |
+ } |
|
247 |
+ }).catch(function (error) { |
|
248 |
+ console.log("nodeExcelInsert - error", error); |
|
249 |
+ alert("파일 등록 오류, 관리자에게 문의해주세요.") |
|
250 |
+ }) |
|
251 |
+ }, |
|
252 |
+ |
|
253 |
+ //노드목록 조회 |
|
218 | 254 |
nodeSelectList: function() { |
219 | 255 |
const vm = this; |
220 | 256 |
axios({ |
... | ... | @@ -234,6 +270,7 @@ |
234 | 270 |
}); |
235 | 271 |
}, |
236 | 272 |
|
273 |
+ //노드 등록 |
|
237 | 274 |
nodeInsert: function() { |
238 | 275 |
const vm = this; |
239 | 276 |
axios({ |
... | ... | @@ -268,6 +305,7 @@ |
268 | 305 |
}) |
269 | 306 |
}, |
270 | 307 |
|
308 |
+ //노드 수정 |
|
271 | 309 |
nodeUpdate: function() { |
272 | 310 |
const vm = this; |
273 | 311 |
axios({ |
... | ... | @@ -303,6 +341,7 @@ |
303 | 341 |
}) |
304 | 342 |
}, |
305 | 343 |
|
344 |
+ //노드 삭제 |
|
306 | 345 |
nodeDelete: function() { |
307 | 346 |
const vm = this; |
308 | 347 |
axios({ |
... | ... | @@ -338,15 +377,16 @@ |
338 | 377 |
}) |
339 | 378 |
}, |
340 | 379 |
|
341 |
- nodeSelectOne: function(user) { |
|
380 |
+ //노드 상세 조회 |
|
381 |
+ nodeSelectOne: function(nodeOne) { |
|
342 | 382 |
const vm = this; |
343 | 383 |
|
344 | 384 |
this.disabled = true; |
345 |
- vm.node.node_id = user.node_id; |
|
346 |
- vm.node.node_nm = user.node_nm; |
|
347 |
- vm.node.node_ty = user.node_ty; |
|
348 |
- vm.node.lat = user.lat; |
|
349 |
- vm.node.lot = user.lot; |
|
385 |
+ vm.node.node_id = nodeOne.node_id; |
|
386 |
+ vm.node.node_nm = nodeOne.node_nm; |
|
387 |
+ vm.node.node_ty = nodeOne.node_ty; |
|
388 |
+ vm.node.lat = nodeOne.lat; |
|
389 |
+ vm.node.lot = nodeOne.lot; |
|
350 | 390 |
} |
351 | 391 |
}, |
352 | 392 |
watch: {}, |
--- client/views/pages/SystemManagement/UserAddForm.vue
+++ client/views/pages/SystemManagement/UserAddForm.vue
... | ... | @@ -24,26 +24,26 @@ |
24 | 24 |
<div class="flex m-b"> |
25 | 25 |
<span>비밀번호 : </span> |
26 | 26 |
<input type="password" placeholder="Password" v-model="user.user_pw" @change="passwordSyncCheck()"> |
27 |
- <p>비번 : {{ user.user_pw }}</p> |
|
28 | 27 |
</div> |
29 | 28 |
<div class="flex m-b"> |
30 | 29 |
<span>비밀번호 확인 : </span> |
31 | 30 |
<input type="password" placeholder="Confirm Password" v-model="passwordCheck" @change="passwordSyncCheck()"> |
32 |
- <p>체크 : {{ passwordCheck }}</p> |
|
33 | 31 |
</div> |
34 |
- <div v-if="passwordCheckFlag" style="color:chartreuse">비밀번호 일치</div> |
|
35 |
- <div v-else style="color:red">비밀번호 불일치</div> |
|
32 |
+ <div v-if="passwordCheckFlag === true" style="color:chartreuse">비밀번호 일치</div> |
|
33 |
+ <div v-else-if="passwordCheckFlag === false" style="color:red">비밀번호 불일치</div> |
|
36 | 34 |
<div class="flex m-b"> |
37 | 35 |
<span>이름 : </span> |
38 | 36 |
<input type="text" placeholder="Name" v-model="user.user_nm"> |
39 | 37 |
</div> |
40 | 38 |
<div class="flex m-b"> |
41 | 39 |
<span>전화번호 : </span> |
42 |
- <input type="text" placeholder="Phone Number" v-model="user.user_telno"> |
|
40 |
+ <input type="text" placeholder=" '-' 을 제외하고 입력해주세요." maxlength="13" v-model="telno" @change="phoneCheck" @keyup="getPhoneMask(telno)"> |
|
41 |
+ <p style="color:red" v-if="telno_boolean === false"> 전화번호 9~11자리를 입력해주세요.</p> |
|
43 | 42 |
</div> |
44 | 43 |
<div class="flex m-b"> |
45 | 44 |
<span>이메일 : </span> |
46 |
- <input type="text" placeholder="E-Mail" v-model="user.user_eml"> |
|
45 |
+ <input type="text" placeholder=" 예) qwer@naver.com" v-model="user.user_eml" @change="emailCheck"> |
|
46 |
+ <p style="color:red" v-if="email_boolean === false"> 잘못된 이메일 형식입니다.</p> |
|
47 | 47 |
</div> |
48 | 48 |
<div class="flex m-b"> |
49 | 49 |
<span>관리구역 : </span> |
... | ... | @@ -64,17 +64,17 @@ |
64 | 64 |
<div class="flex m-b"> |
65 | 65 |
<span>권한 : </span> |
66 | 66 |
<label for="radio_1"> |
67 |
- <input type="radio" name="radio" id="radio_1" value="si" v-model="user.user_author"> |
|
68 |
- 시청 관리자 |
|
67 |
+ <input type="radio" name="radio" id="radio_1" value="시청관리자" v-model="user.user_author"> |
|
68 |
+ 시청관리자 |
|
69 | 69 |
</label> |
70 | 70 |
<label for="radio_2"> |
71 |
- <input type="radio" name="radio" id="radio_2" value="ji" v-model="user.user_author"> |
|
72 |
- 지자체 관리자 |
|
71 |
+ <input type="radio" name="radio" id="radio_2" value="지자체관리자" v-model="user.user_author"> |
|
72 |
+ 지자체관리자 |
|
73 | 73 |
</label> |
74 | 74 |
</div> |
75 | 75 |
|
76 | 76 |
<div class="btn-wrap"> |
77 |
- <button type="button" class="green-btn" @click="modal_1 = true">등록</button> |
|
77 |
+ <button type="button" class="green-btn" @click="userInsertCheck">등록</button> |
|
78 | 78 |
<router-link to="/UserManagement.page"> |
79 | 79 |
<span class="btn-2 gray-btn">취소</span> |
80 | 80 |
</router-link> |
... | ... | @@ -83,14 +83,14 @@ |
83 | 83 |
</div> |
84 | 84 |
</div> |
85 | 85 |
|
86 |
- <div class="modal-wrap" v-if="modal_1 == true"> |
|
86 |
+ <div class="modal-wrap" v-if="modal_insert == true"> |
|
87 | 87 |
<div class="modal-bg"> |
88 | 88 |
</div> |
89 | 89 |
<div class="modal"> |
90 | 90 |
<p>사용자를 <span class="txt-point">등록</span>하시겠습니까?</p> |
91 | 91 |
<div class="btn-wrap"> |
92 | 92 |
<button type="button" class="green-btn" @click="userInsert">확인</button> |
93 |
- <button type="button" class="gray-btn" @click="modal_1 = false">취소</button> |
|
93 |
+ <button type="button" class="gray-btn" @click="modal_insert = false">취소</button> |
|
94 | 94 |
</div> |
95 | 95 |
</div> |
96 | 96 |
</div> |
... | ... | @@ -98,6 +98,7 @@ |
98 | 98 |
|
99 | 99 |
<script> |
100 | 100 |
import axios from 'axios'; |
101 |
+import COMMON_UTIL from '../../../resources/js/commonUtil.ts'; |
|
101 | 102 |
|
102 | 103 |
export default { |
103 | 104 |
data: () => { |
... | ... | @@ -112,11 +113,17 @@ |
112 | 113 |
rm: null |
113 | 114 |
}, |
114 | 115 |
passwordCheck: null, |
115 |
- passwordCheckFlag: false, |
|
116 |
- modal_1: false, |
|
116 |
+ passwordCheckFlag: null, |
|
117 |
+ telno_boolean: true, |
|
118 |
+ email_boolean: true, |
|
119 |
+ idChcek_boolean: false, |
|
120 |
+ telno: null, |
|
121 |
+ modal_insert: false |
|
122 |
+ |
|
117 | 123 |
}; |
118 | 124 |
}, |
119 | 125 |
methods: { |
126 |
+ //ID 중복 검사 |
|
120 | 127 |
idChcek: function() { |
121 | 128 |
const vm = this; |
122 | 129 |
axios({ |
... | ... | @@ -130,27 +137,112 @@ |
130 | 137 |
console.log("idCheck - response : ", response.data); |
131 | 138 |
if(response.data != null) { |
132 | 139 |
alert("중복된 ID 입니다."); |
140 |
+ vm.idChcek_boolean = false; |
|
133 | 141 |
return false; |
134 | 142 |
} else { |
135 | 143 |
alert("사용가능한 ID 입니다."); |
144 |
+ vm.idChcek_boolean = true; |
|
136 | 145 |
return true; |
137 | 146 |
} |
138 | 147 |
}).catch( function (error) { |
139 | 148 |
console.log("idCheck - error : ", error); |
140 | 149 |
alert("중복검사 오류, 다시 시도해주세요."); |
150 |
+ vm.idChcek_boolean = false; |
|
141 | 151 |
}); |
142 | 152 |
}, |
143 |
- |
|
153 |
+ |
|
154 |
+ //비밀번호 일치 여부 검사 |
|
144 | 155 |
passwordSyncCheck: function () { |
145 |
- console.log("this.user.user_pw : ", this.user.user_pw); |
|
146 |
- console.log("this.passwordCheck : ", this.passwordCheck); |
|
147 |
- |
|
148 |
- if (this.user.user_pw != this.passwordCheck) this.passwordCheckFlag = false; |
|
149 |
- else this.passwordCheckFlag = true; |
|
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 |
+ } |
|
150 | 165 |
}, |
151 | 166 |
|
152 |
- // |
|
153 |
- userInsert: async function() { |
|
167 |
+ //전화번호 입력 시 자동 '-' 삽입 |
|
168 |
+ getPhoneMask: function(telNumber) { |
|
169 |
+ var res = COMMON_UTIL.getMask(telNumber) |
|
170 |
+ this.telno = res |
|
171 |
+ //서버 전송 값에는 '-' 를 제외하고 숫자만 저장 |
|
172 |
+ this.user.user_telno = this.telno.replace(/[^0-9]/g, '') |
|
173 |
+ }, |
|
174 |
+ |
|
175 |
+ emailCheck: function() { |
|
176 |
+ this.email_boolean = true; |
|
177 |
+ if (COMMON_UTIL.checkEmail(this.user.user_eml) === false) this.email_boolean = false; |
|
178 |
+ }, |
|
179 |
+ |
|
180 |
+ phoneCheck: function() { |
|
181 |
+ this.telno_boolean = true; |
|
182 |
+ if (COMMON_UTIL.checkPhone(this.user.user_telno) === false) this.telno_boolean = false; |
|
183 |
+ }, |
|
184 |
+ |
|
185 |
+ // 등록버튼 클릭 시 빈칸 검사 |
|
186 |
+ userInsertCheck: function() { |
|
187 |
+ if (COMMON_UTIL.isEmpty(this.user.user_id) === false) { |
|
188 |
+ alert('ID를 입력해주세요.'); |
|
189 |
+ return false; |
|
190 |
+ } |
|
191 |
+ |
|
192 |
+ if (this.idChcek_boolean === false) { |
|
193 |
+ alert("ID중복검사를 완료해주세요.") |
|
194 |
+ return false; |
|
195 |
+ } |
|
196 |
+ |
|
197 |
+ if (COMMON_UTIL.isEmpty(this.user.user_pw) === false) { |
|
198 |
+ alert('비밀번호를 입력해주세요.'); |
|
199 |
+ return false; |
|
200 |
+ } |
|
201 |
+ |
|
202 |
+ if (this.passwordCheckFlag === false || this.passwordCheckFlag === null) { |
|
203 |
+ alert('비밀번호가 일치하지 않습니다.'); |
|
204 |
+ return false; |
|
205 |
+ } |
|
206 |
+ |
|
207 |
+ if (COMMON_UTIL.isEmpty(this.user.user_nm) === false) { |
|
208 |
+ alert('이름을 입력해주세요.'); |
|
209 |
+ return false; |
|
210 |
+ } |
|
211 |
+ |
|
212 |
+ if (COMMON_UTIL.isEmpty(this.user.user_telno) === false) { |
|
213 |
+ alert('전화번호를 입력해주세요.'); |
|
214 |
+ return false; |
|
215 |
+ } |
|
216 |
+ |
|
217 |
+ if (COMMON_UTIL.checkPhone(this.user.user_telno) === false) { |
|
218 |
+ alert('전화번호 형식을 확인해주세요.'); |
|
219 |
+ return false; |
|
220 |
+ } |
|
221 |
+ |
|
222 |
+ if (COMMON_UTIL.isEmpty(this.user.user_eml) === false) { |
|
223 |
+ alert('이메일을 입력해주세요.'); |
|
224 |
+ return false; |
|
225 |
+ } |
|
226 |
+ |
|
227 |
+ if (COMMON_UTIL.checkEmail(this.user.user_eml) === false) { |
|
228 |
+ alert('이메일 형식을 확인해주세요.'); |
|
229 |
+ return false; |
|
230 |
+ } |
|
231 |
+ |
|
232 |
+ // if (COMMON_UTIL.isEmpty(this.user.) === false) { |
|
233 |
+ // alert('관리구역을 선택해주세요.'); |
|
234 |
+ // return false; |
|
235 |
+ // } |
|
236 |
+ |
|
237 |
+ if (COMMON_UTIL.isEmpty(this.user.user_author) === false) { |
|
238 |
+ alert('권한을 선택해주세요.'); |
|
239 |
+ return false; |
|
240 |
+ } |
|
241 |
+ this.modal_insert = true |
|
242 |
+ }, |
|
243 |
+ |
|
244 |
+ // 사용자 등록 |
|
245 |
+ userInsert: function() { |
|
154 | 246 |
const vm = this; |
155 | 247 |
axios({ |
156 | 248 |
url: '/user/userInsert.json', |
--- client/views/pages/SystemManagement/UserManagement.vue
+++ client/views/pages/SystemManagement/UserManagement.vue
... | ... | @@ -19,8 +19,8 @@ |
19 | 19 |
<div class="float-left"> |
20 | 20 |
<select v-model="userListSearch.authorFilter" @change="userSelectList"> |
21 | 21 |
<option value="">권한필터</option> |
22 |
- <option value="si">시청관리자</option> |
|
23 |
- <option value="ji">지자체관리자</option> |
|
22 |
+ <option value="시청관리자">시청관리자</option> |
|
23 |
+ <option value="지자체관리자">지자체관리자</option> |
|
24 | 24 |
</select> |
25 | 25 |
</div> |
26 | 26 |
<div class="float-right"> |
... | ... | @@ -57,18 +57,20 @@ |
57 | 57 |
<th>권한</th> |
58 | 58 |
<th>전화번호</th> |
59 | 59 |
<th>관리구역</th> |
60 |
+ <th>등록일자</th> |
|
60 | 61 |
<th>비고</th> |
61 | 62 |
</tr> |
62 | 63 |
</thead> |
63 | 64 |
<tbody> |
64 | 65 |
<tr v-for="(item, idx) in userList" :key="idx" @click="userSelectOnePage(item)"> |
65 | 66 |
<td data-title="NO">{{ idx + 1 }}</td> |
66 |
- <td data-title="ID">{{ item['user_id'] }}</td> |
|
67 |
- <td data-title="이름">{{ item['user_nm'] }}</td> |
|
68 |
- <td data-title="권한">{{ item['user_author'] }}</td> |
|
69 |
- <td data-title="전화번호">{{ item['user_telno'] }}</td> |
|
70 |
- <td data-titel="권리구역">{{ item['dong_korn_nm'] }}</td> |
|
71 |
- <td data-totel="비고">{{ item['rm'] }}</td> |
|
67 |
+ <td data-title="ID">{{ item.user_id }}</td> |
|
68 |
+ <td data-title="이름">{{ item.user_nm }}</td> |
|
69 |
+ <td data-title="권한">{{ item.user_author }}</td> |
|
70 |
+ <td data-title="전화번호">{{ HyphenMinus(item.user_telno) }}</td> |
|
71 |
+ <td data-titel="관리구역">{{ item.dong_korn_nm }}</td> |
|
72 |
+ <td data-titel="등록일자">{{ yyyymmdd(item.reg_dt) }}</td> |
|
73 |
+ <td data-totel="비고">{{ item.rm }}</td> |
|
72 | 74 |
</tr> |
73 | 75 |
</tbody> |
74 | 76 |
</table> |
... | ... | @@ -89,6 +91,7 @@ |
89 | 91 |
<script> |
90 | 92 |
import axios from 'axios'; |
91 | 93 |
import PaginationButton from '../../component/pagination/PaginationButton.vue'; |
94 |
+import COMMON_UTIL from '../../../resources/js/commonUtil.ts'; |
|
92 | 95 |
|
93 | 96 |
export default { |
94 | 97 |
data: () => { |
... | ... | @@ -127,6 +130,16 @@ |
127 | 130 |
}) |
128 | 131 |
}, |
129 | 132 |
|
133 |
+ // 전화번호 '-' 추가 후 출력 |
|
134 |
+ HyphenMinus: function (telno) { |
|
135 |
+ return COMMON_UTIL.HyphenMinus(telno); |
|
136 |
+ }, |
|
137 |
+ |
|
138 |
+ //날짜 시,분,초 자르기 |
|
139 |
+ yyyymmdd: function (date) { |
|
140 |
+ return COMMON_UTIL.yyyymmdd(date); |
|
141 |
+ }, |
|
142 |
+ |
|
130 | 143 |
//사용자 목록 페이지 이동 |
131 | 144 |
userSelectListPage: function () { |
132 | 145 |
this.$router.push({ path: '/UserManagement.page'}); |
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?