공지사항 신규 개발

This commit is contained in:
kimjhjjang
2022-11-01 13:23:58 +09:00
parent c916d16a46
commit d1d62c76c8
57 changed files with 3721 additions and 319 deletions

View File

@@ -37,7 +37,7 @@ export default {
'pageRange', // next or pre 이동할 페이지 단위
],
components: {
VRuntimeTemplate
VRuntimeTemplate,
},
data() {
return {
@@ -59,12 +59,11 @@ export default {
headerData: '',
bodyData: '',
pagingData: '',
nextPageRange: 1
nextPageRange: 1,
};
},
created() {
this.cleanData();
this.cleanData();
if (this.initialRequest == true) {
this.readData();
}
@@ -74,7 +73,7 @@ export default {
this.currentIndex = 1;
this.curPerPage = this.pagePerRows;
this.readData();
}
},
},
methods: {
getData() {
@@ -132,14 +131,14 @@ export default {
var vm = this;
httpClient
//.get(this.url, { params: this.getParams, headers: { 'Show-Layer': 'Yes' }})
.post(this.url, this.getParams, {headers: { 'Show-Layer': 'Yes' }})
.then(response => {
.post(this.url, this.getParams, { headers: { 'Show-Layer': 'Yes' } })
.then((response) => {
let resp = response.data;
//if (resp != null && resp.result == true) {
if (resp != null && resp.retCode == '0000') {
let data = resp.data;
//let conts = data.contents;
let conts = data.list;
let conts = data.list;
vm.bodyList = conts;
bodyStr = vm.makeBodyView();
@@ -151,19 +150,19 @@ export default {
vm.totalCount = data.pagination.totalCount;
pageStr = vm.makePagingView();
}*/
if (vm.pagination == true) {
if (vm.pagination == true) {
vm.currentIndex = data.paging.page == 0 ? 1 : data.paging.page;
vm.totalCount = data.paging.totalCnt;
pageStr = vm.makePagingView();
if(typeof this.pageRange != 'undefined'){
if (typeof this.pageRange != 'undefined') {
vm.nextPageRange = this.pageRange;
}
}
// 조회결과 없음.
}else if(resp != null && resp.retCode == '1004'){
// 조회결과 없음.
} else if (resp != null && resp.retCode == '1004') {
let data = resp.data;
//let conts = data.contents;
let conts = data.list;
let conts = data.list;
vm.bodyList = conts;
bodyStr = vm.makeBodyView();
@@ -171,7 +170,8 @@ export default {
}
vm.setTableView(colStr, headerStr, bodyStr, pageStr);
}).catch(response => {
})
.catch((response) => {
bodyStr = vm.makeBodyView();
if (vm.pagination == true) {
vm.currentIndex = 1;
@@ -541,12 +541,12 @@ export default {
str = '';
}
return str;
},
},
makePagingView() {
let pData = '<div class="pagination">';
let totalPage = Math.ceil(this.totalCount / this.curPerPage);
let totalPage = Math.ceil(this.totalCount / this.curPerPage);
if (totalPage < 1) {
totalPage = 1;
}
@@ -556,7 +556,7 @@ export default {
if (last > totalPage) {
last = totalPage;
}
let first = last - (this.pageCount - 1);
if (first < 1) {
first = 1;
@@ -567,32 +567,31 @@ export default {
prev = 1;
}
// let next = last + 1;
// let next = last + 1;
let next = parseInt(this.currentIndex) + this.nextPageRange;
if (next > totalPage) {
next = totalPage;
}
pData += '<div class="arrow-btn">'
pData += '<div class="arrow-btn">';
pData += '<button href="javascript:void(0);" @click="movePage(1)" class="btn-first"></button>';
pData += '<button href="javascript:void(0);" @click="movePage(' + prev + ')" class="btn-prev"></button>';
pData += '</div>'
pData += '<ul>'
pData += '</div>';
pData += '<ul>';
for (var i = first; i <= last; i++) {
let actCls = '';
if (i == this.currentIndex) {
let actCls = '';
if (i == this.currentIndex) {
actCls = 'class="active"';
}
pData += '<li ' + actCls + '><a href="javascript:void(0);" @click="movePage(' + i + ')" >' + i + '</a></li>';
}
pData += '</ul>'
pData += '<div class="arrow-btn">'
pData += '</ul>';
pData += '<div class="arrow-btn">';
pData += '<button @click="movePage(' + next + ')" class="btn-next"></button>';
pData +=
'<button @click="movePage(' + totalPage + ')" class="btn-last"></button>';
pData += '</div>'
pData += '<button @click="movePage(' + totalPage + ')" class="btn-last"></button>';
pData += '</div>';
pData += '</div>';
return pData;
},
@@ -683,8 +682,8 @@ export default {
_currentPage: this.currentIndex,
_options: {
itemsPerPage: this.curPerPage,
sort: this.getParams['sort']
}
sort: this.getParams['sort'],
},
};
return rslt;
@@ -695,10 +694,9 @@ export default {
if (myChild != null) {
myChild.style.top = rect.y + 20 + 'px';
}
}
}
},
},
};
</script>
<style>
</style>
<style></style>