공지사항 신규 개발

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>

View File

@@ -1,20 +1,32 @@
<template>
<nav>
<ul v-if="menuList.length > 0" class="main_menu">
<li v-for="child in menuList" :key="child.menuNo" :class="child.classNm">
<div class="menu_btn" ></div>
<a href="javascript:void(0);" class="menu_target" @click="actionMenu" :data-menu-no="child.menuNo">{{child.menuNm}}</a>
<nav>
<ul v-if="menuList.length > 0" class="main_menu">
<li v-for="child in menuList" :key="child.menuNo" :class="child.classNm">
<div class="menu_btn"></div>
<a href="javascript:void(0);" class="menu_target" @click="actionMenu" :data-menu-no="child.menuNo">{{
child.menuNm
}}</a>
<div class="sub_menu_wrap">
<ul class="sub_menu" v-if="child.children.length > 0">
<li v-for="child2 in child.children" :key="child2.menuNo">
<router-link :to="`${child2.menuUrl}`">{{child2.menuNm}}</router-link>
</li>
</ul>
</div>
</li>
</ul>
</nav>
<div class="sub_menu_wrap">
<ul class="sub_menu" v-if="child.children.length > 0">
<li v-for="child2 in child.children" :key="child2.menuNo">
<router-link :to="`${child2.menuUrl}`">{{ child2.menuNm }}</router-link>
</li>
</ul>
</div>
</li>
<li>
<a href="javascript:void(0);" class="menu_target" @click="actionMenu">홈페이지 관리</a>
<div class="sub_menu_wrap">
<ul class="sub_menu">
<li>
<router-link to="/homeMgt/notice">공지사항</router-link>
</li>
</ul>
</div>
</li>
</ul>
</nav>
</template>
<script>
//import "../assets/js/script.js";
@@ -24,32 +36,29 @@ import { mapGetters } from 'vuex';
export default {
name: 'Nav',
props: {
},
props: {},
data() {
return {
isLogin : false,
isAuthChk : false,
isLogin: false,
isAuthChk: false,
isErrPage: false,
navActive: false,
menuList: [],
tempList: [],
nowPath:'',
}
nowPath: '',
};
},
created() {
this.isLogin = !!tokenSvc.getToken();
let curPage = location.pathname;
if (this.isLogin && curPage != "/login") {
this.$store.commit("login/isLogin", true);
if (this.isLogin && curPage != '/login') {
this.$store.commit('login/isLogin', true);
this.setMenuData();
} else {
this.$store.commit("login/isLogin", false);
this.$store.commit('login/isLogin', false);
this.isLogin = false;
}
},
mounted() {
//this.menuhighlight();
@@ -62,7 +71,7 @@ export default {
},
watch: {
getLogin(data) {
if (data != null && data != '' && data == true) {
if (data != null && data != '' && data == true) {
this.isLogin = true;
this.setMenuData();
} else {
@@ -76,99 +85,111 @@ export default {
} else {
this.isErrPage = false;
}
},
},
},
methods: {
setMenuData() {
api.menus().then(response => {
const rootMenu = response.data.data;
if (rootMenu != null && rootMenu.children != null && rootMenu.children.length > 0) {
api
.menus()
.then((response) => {
const rootMenu = response.data.data;
if (rootMenu != null && rootMenu.children != null && rootMenu.children.length > 0) {
this.tempList = rootMenu.children;
var nowUrl = this.$route.fullPath;
for(var i=0; i<this.tempList.length; i++){
var menuNo = this.tempList[i].menuNo;
var classNm = '';
switch(menuNo){
case 1001 : classNm = 'customer';
if(nowUrl.indexOf('custMgt') > -1){
classNm += ' is-current';
}
break;
case 1002 : classNm = 'attract';
if(nowUrl.indexOf('attractMgt') > -1){
classNm += ' is-current';
}
break;
case 1003 : classNm = 'service';
if(nowUrl.indexOf('servMgt') > -1){
classNm += ' is-current';
}
break;
case 1004 : classNm = 'calculate';
if(nowUrl.indexOf('calculate') > -1){
classNm += ' is-current';
}
break;
case 1005 : classNm = 'channel';
if(nowUrl.indexOf('channelMgt') > -1){
classNm += ' is-current';
}
break;
case 1006 : classNm = 'key';
if(nowUrl.indexOf('sendNumMgt') > -1){
classNm += ' is-current';
}
break;
case 1007 : classNm = 'moniter';
if(nowUrl.indexOf('mntrng') > -1){
classNm += ' is-current';
}
break;
case 1008 : classNm = 'risk';
if(nowUrl.indexOf('riskMgt') > -1){
classNm += ' is-current';
}
break;
case 1009 : classNm = 'stats';
if(nowUrl.indexOf('stats') > -1){
classNm += ' is-current';
}
break;
case 1010 : classNm = 'system';
if(nowUrl.indexOf('sysMgt') > -1){
classNm += ' is-current';
}
break;
default : classNm = 'customer';
classNm += ' is-current';
}
for (var i = 0; i < this.tempList.length; i++) {
var menuNo = this.tempList[i].menuNo;
var classNm = '';
switch (menuNo) {
case 1001:
classNm = 'customer';
if (nowUrl.indexOf('custMgt') > -1) {
classNm += ' is-current';
}
break;
case 1002:
classNm = 'attract';
if (nowUrl.indexOf('attractMgt') > -1) {
classNm += ' is-current';
}
break;
case 1003:
classNm = 'service';
if (nowUrl.indexOf('servMgt') > -1) {
classNm += ' is-current';
}
break;
case 1004:
classNm = 'calculate';
if (nowUrl.indexOf('calculate') > -1) {
classNm += ' is-current';
}
break;
case 1005:
classNm = 'channel';
if (nowUrl.indexOf('channelMgt') > -1) {
classNm += ' is-current';
}
break;
case 1006:
classNm = 'key';
if (nowUrl.indexOf('sendNumMgt') > -1) {
classNm += ' is-current';
}
break;
case 1007:
classNm = 'moniter';
if (nowUrl.indexOf('mntrng') > -1) {
classNm += ' is-current';
}
break;
case 1008:
classNm = 'risk';
if (nowUrl.indexOf('riskMgt') > -1) {
classNm += ' is-current';
}
break;
case 1009:
classNm = 'stats';
if (nowUrl.indexOf('stats') > -1) {
classNm += ' is-current';
}
break;
case 1010:
classNm = 'system';
if (nowUrl.indexOf('sysMgt') > -1) {
classNm += ' is-current';
}
break;
default:
classNm = 'customer';
classNm += ' is-current';
}
this.tempList[i].classNm = classNm;
}
this.tempList[i].classNm = classNm;
}
this.menuList = rootMenu.children;
} else {
window.top.location.href = '/';
} else {
window.top.location.href = '/';
this.menuList = null;
}
})
.catch((rsponse) => {
this.menuList = null;
}
}).catch(rsponse => {
this.menuList = null;
})
});
},
clickMenu(link){
var location = this.$route.fullPath;
if(link != location){
this.$router.push({
path: link
clickMenu(link) {
var location = this.$route.fullPath;
if (link != location) {
this.$router.push({
path: link,
});
}
},
reload(){
reload() {
var location = this.$route.fullPath;
if (location == "/" || location == "") {
if (location == '/' || location == '') {
// nothing
} else {
this.$router.replace('/');
@@ -176,25 +197,24 @@ export default {
}
},
actionMenu(e){
actionMenu(e) {
const menuList = document.querySelectorAll('.main_menu .is-current');
if(e.target.classList.contains('menu_target') || e.target.classList.contains('menu_btn')){
if (e.target.classList.contains('menu_target') || e.target.classList.contains('menu_btn')) {
const menuListCheck = e.target.parentNode;
if(menuListCheck.classList.contains('is-current')){
menuListCheck.classList.remove('is-current');
if (menuListCheck.classList.contains('is-current')) {
menuListCheck.classList.remove('is-current');
for(const menu of menuList){
menu.classList.remove('is-current');
}
for (const menu of menuList) {
menu.classList.remove('is-current');
}
} else {
for(const other of menuList){
other.classList.remove('is-current');
}
menuListCheck.classList.add('is-current');
for (const other of menuList) {
other.classList.remove('is-current');
}
menuListCheck.classList.add('is-current');
}
}
},
}
}
</script>
},
};
</script>