
+++ client/resources/api/cntxtPth.js
... | ... | @@ -0,0 +1,21 @@ |
1 | +import apiClient from "./index"; | |
2 | + | |
3 | +export const findAll = search => { | |
4 | + return apiClient.post(`/admin/cntxtPth/findAll.json`, search); | |
5 | +} | |
6 | + | |
7 | +export const findByCntxtPth = cntxtPth => { | |
8 | + return apiClient.post(`/admin/cntxtPth/findByCntxtPth.json`, cntxtPth); | |
9 | +} | |
10 | + | |
11 | +export const save = cntxtPth => { | |
12 | + return apiClient.post(`/admin/cntxtPth/saveProc.json`, cntxtPth); | |
13 | +} | |
14 | + | |
15 | +export const update = cntxtPth => { | |
16 | + return apiClient.post(`/admin/cntxtPth/updateProc.json`, cntxtPth); | |
17 | +} | |
18 | + | |
19 | +export const del = cntxtPth => { | |
20 | + return apiClient.post(`/admin/cntxtPth/deleteProc.json`, cntxtPth); | |
21 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ client/views/pages/adm/system/contextPath/ContextPathSelectList.vue
... | ... | @@ -0,0 +1,171 @@ |
1 | +<template> | |
2 | + <div class="content-zone"> | |
3 | + <div class="content"> | |
4 | + <div class="scroll"> | |
5 | + <div class="title-zone"> | |
6 | + <div class="page-title"> | |
7 | + <p>컨텍스트 패스 관리</p> | |
8 | + </div> | |
9 | + <PagiNavigationBar /> | |
10 | + </div> | |
11 | + <div class="search-bar "> | |
12 | + <input | |
13 | + type="text" | |
14 | + class="form-control sm" | |
15 | + placeholder="경로를 입력하세요." | |
16 | + v-model="search.searchText" | |
17 | + @keyup.enter="findAll" | |
18 | + /> | |
19 | + | |
20 | + <button class="btn sm ico-sch" @click="findAll"> | |
21 | + 검색 | |
22 | + </button> | |
23 | + </div> | |
24 | + <div class="tbl-wrap"> | |
25 | + <ListTable | |
26 | + :className="'data cursor'" | |
27 | + :colgroup="colgroup" | |
28 | + :thead="thead" | |
29 | + :tbody="tbody" | |
30 | + @listClick="fnView" | |
31 | + > | |
32 | + <template v-slot:button="{ row, idx }"> | |
33 | + <button | |
34 | + class="btn-ico md ico-del" | |
35 | + @click.stop="fnDel(row, idx)" | |
36 | + v-if="pageAuth.delAuthrt == 'Y'" | |
37 | + > | |
38 | + </button> | |
39 | + </template> | |
40 | + </ListTable> | |
41 | + </div> | |
42 | + </div> | |
43 | + </div> | |
44 | + </div> | |
45 | + <div class="btn-wrap list"> | |
46 | + <div></div> | |
47 | + <PaginationButton :className="'pagination'" | |
48 | + v-model:currentPage="search.currentPage" | |
49 | + :pagination="search" | |
50 | + :click="findAll" | |
51 | + /> | |
52 | + <button | |
53 | + class="btn sm primary" | |
54 | + @click="fnAdd" | |
55 | + v-if="pageAuth.regAuthrt == 'Y'" | |
56 | + > | |
57 | + 등록 | |
58 | + </button> | |
59 | + </div> | |
60 | +</template> | |
61 | + | |
62 | +<script> | |
63 | +import ListTable from "../../../../component/table/ListTable.vue"; | |
64 | +import PaginationButton from "../../../../component/pagination/PaginationButton.vue"; | |
65 | +import { findAll, del } from "../../../../../resources/api/cntxtPth"; | |
66 | +import queryParams from "../../../../../resources/js/queryParams"; | |
67 | +import { toRaw } from "vue"; | |
68 | +import { defaultSearchParams } from "../../../../../resources/js/defaultSearchParams"; | |
69 | + | |
70 | +export default { | |
71 | + mixins: [queryParams], | |
72 | + components: { | |
73 | + ListTable: ListTable, | |
74 | + PaginationButton: PaginationButton, | |
75 | + }, | |
76 | + data() { | |
77 | + return { | |
78 | + // 페이지 컨텍스트 패스 객체 | |
79 | + pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, | |
80 | + | |
81 | + colgroup: ["4%", "20", "25%", "13%", "13%", "5%"], | |
82 | + thead: ["NO", "경로", "사용여부", "등록자", "등록일", "삭제"], | |
83 | + tbody: [], | |
84 | + search: { ...defaultSearchParams }, | |
85 | + list: [], // 컨텍스트 패스 목록 | |
86 | + listCnt: 0, | |
87 | + }; | |
88 | + }, | |
89 | + created() { | |
90 | + this.resotreQueryParams("queryParams"); | |
91 | + this.findAll(); | |
92 | + }, | |
93 | + methods: { | |
94 | + // 목록 조회 | |
95 | + async findAll() { | |
96 | + this.saveQueryParams("queryParams", this.search); // 검색조건 저장 | |
97 | + try { | |
98 | + const res = await findAll(toRaw(this.search)); | |
99 | + this.list = res.data.data.list; | |
100 | + this.listCnt = res.data.data.pagination.totalRecordCount; | |
101 | + this.search = res.data.data.pagination; | |
102 | + this.makeTbody(); | |
103 | + console.log("this.list : ", this.list); | |
104 | + } catch (error) { | |
105 | + // console.log("error : ", error); | |
106 | + } | |
107 | + }, | |
108 | + // 상세 조회 | |
109 | + fnView(idx) { | |
110 | + this.saveQueryParams("queryParams", this.search); // 검색조건 저장 | |
111 | + this.$router.push({ | |
112 | + name: "admContextPathSelectListOne", | |
113 | + query: { | |
114 | + pageId: this.list[idx]["cntxtPthId"], | |
115 | + }, | |
116 | + }); | |
117 | + }, | |
118 | + // 등록 페이지 이동 | |
119 | + fnAdd() { | |
120 | + this.$router.push({ | |
121 | + name: "admContextPathInsert", | |
122 | + }); | |
123 | + }, | |
124 | + // 삭제 | |
125 | + async fnDel(row, idx) { | |
126 | + if (this.list[idx].sysPvsnYn == 0) { | |
127 | + alert("시스템에서 제공하는 정보는 삭제할수 없습니다."); | |
128 | + return; | |
129 | + } | |
130 | + if (!confirm("삭제하시겠습니까?")) { | |
131 | + return; | |
132 | + } | |
133 | + try { | |
134 | + const res = await del(this.list[idx]); | |
135 | + alert(res.data.message); | |
136 | + if (res.status == 200) { | |
137 | + this.findAll(); | |
138 | + } | |
139 | + } catch (error) { | |
140 | + alert("에러가 발생했습니다.\n시스템관리자에게 문의하세요."); | |
141 | + } | |
142 | + }, | |
143 | + // tbody 생성 | |
144 | + makeTbody() { | |
145 | + this.tbody = []; // 초기화 | |
146 | + this.tbody = this.list.map((cntxtPth, index) => { | |
147 | + let id = | |
148 | + this.listCnt - | |
149 | + index - | |
150 | + (this.search.currentPage - 1) * this.search.recordSize; // 번호 | |
151 | + let path = cntxtPth.path; // 경로 | |
152 | + let useYn = cntxtPth.useYn; // 사용여부 | |
153 | + let writer; // 작성자 | |
154 | + let writeDt; // 작성일 | |
155 | + // 수정 이력 확인 후 수정된 경우가 없다면 최초 작성자로 등록 | |
156 | + if (cntxtPth.mdfr == null || cntxtPth.mdfr === "") { | |
157 | + writer = cntxtPth.rgtrNm; | |
158 | + writeDt = cntxtPth.regDt; | |
159 | + } else { | |
160 | + writer = cntxtPth.mdfrNm; | |
161 | + writeDt = cntxtPth.mdfcnDt; | |
162 | + } | |
163 | + return { id, path, useYn, writer, writeDt }; | |
164 | + }); | |
165 | + }, | |
166 | + }, | |
167 | + watch: {}, | |
168 | + computed: {}, | |
169 | + mounted() {}, | |
170 | +}; | |
171 | +</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?