mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 03:28:39 +09:00
로그인 및 메인 화면 수정 변경
This commit is contained in:
188
frontend/src/modules/sysMgt/components/commonModal.vue
Normal file
188
frontend/src/modules/sysMgt/components/commonModal.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<!-- <div class="wrap bg-wrap"> -->
|
||||
<div>
|
||||
|
||||
<div class="dimmed alertModal" @click="alertModalCancel();"></div>
|
||||
<div class="popup-wrap alertModal">
|
||||
<!-- 로그인실패: 확인 -->
|
||||
<div class="popup alertModal">
|
||||
<div class="pop-head">
|
||||
<h3 class="pop-tit">{{title}}</h3>
|
||||
</div>
|
||||
<div class="pop-cont">
|
||||
<p>{{ msg1 }}</p>
|
||||
<p v-if="msg2 !== ''">{{ msg2 }}</p>
|
||||
<p v-if="msg3 !== ''">{{ msg3 }}</p>
|
||||
<p v-if="msg4 !== ''">{{ msg4 }}</p>
|
||||
</div>
|
||||
<div class="popup-btn1">
|
||||
<button class="btn-pcolor" @click="alertModalClose();">확인</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dimmed confirm" @click="confirmModalCancel();"></div>
|
||||
<div class="popup-wrap confirm">
|
||||
<!-- 수정 확인 -->
|
||||
<div class="popup confirm">
|
||||
<div class="pop-head">
|
||||
<h3 class="pop-tit">{{title}}</h3>
|
||||
</div>
|
||||
<div class="pop-cont">
|
||||
<p>{{ msg1 }}</p>
|
||||
<p v-if="msg2 !== ''">{{ msg2 }}</p>
|
||||
<p v-if="msg3 !== ''">{{ msg3 }}</p>
|
||||
<p v-if="msg4 !== ''">{{ msg4 }}</p>
|
||||
</div>
|
||||
<div class="popup-btn2">
|
||||
<button class="btn-pcolor" @click="confirmModalClose();">확인</button>
|
||||
<button class="btn-default" @click="confirmModalCancel();">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dimmed confirm2" @click="confirmModalCancel2();"></div>
|
||||
<div class="popup-wrap confirm2">
|
||||
<!-- 수정 확인 -->
|
||||
<div class="popup confirm2">
|
||||
<div class="pop-head">
|
||||
<h3 class="popup-tit">{{title}}</h3>
|
||||
</div>
|
||||
<div class="pop-cont">
|
||||
<p>{{ msg1 }}</p>
|
||||
<p v-if="msg2 !== ''">{{ msg2 }}</p>
|
||||
<p v-if="msg3 !== ''">{{ msg3 }}</p>
|
||||
<p v-if="msg4 !== ''">{{ msg4 }}</p>
|
||||
</div>
|
||||
<div class="popup-btn2">
|
||||
<button class="btn-pcolor" @click="confirmModalClose2();">확인</button>
|
||||
<button class="btn-default" @click="confirmModalCancel2();">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "confirm",
|
||||
data(){
|
||||
return{
|
||||
row:{},
|
||||
title:'',
|
||||
msg1: '',
|
||||
msg2: '',
|
||||
msg3: '',
|
||||
msg4: '',
|
||||
targetFocus: '',
|
||||
}
|
||||
},
|
||||
methods :{
|
||||
alertModalOpen(props){
|
||||
console.log('>>>>>>>>>> alertModalOpen');
|
||||
console.log(props.msg1);
|
||||
this.title = props.title;
|
||||
this.msg1 = props.msg1;
|
||||
this.msg2 = props.msg2;
|
||||
this.msg3 = props.msg3;
|
||||
this.msg4 = props.msg4;
|
||||
|
||||
var dimmed = document.getElementsByClassName('alertModal');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'block';
|
||||
}
|
||||
|
||||
},
|
||||
alertModalClose(){
|
||||
var dimmed = document.getElementsByClassName('alertModal');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
this.$parent.checkFocus();
|
||||
},
|
||||
alertModalCancel(){
|
||||
var dimmed = document.getElementsByClassName('alertModal');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
this.$parent.checkFocus();
|
||||
},
|
||||
// 모달 오픈
|
||||
confirmModalOpen(props){
|
||||
var dimmed = document.getElementsByClassName('confirm');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'block';
|
||||
}
|
||||
|
||||
this.title = props.title;
|
||||
this.msg1 = props.msg1;
|
||||
this.msg2 = props.msg2;
|
||||
this.msg3 = props.msg3;
|
||||
this.msg4 = props.msg4;
|
||||
},
|
||||
confirmModalOpen2(props){
|
||||
var dimmed = document.getElementsByClassName('confirm2');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'block';
|
||||
}
|
||||
|
||||
this.title = props.title;
|
||||
this.msg1 = props.msg1;
|
||||
this.msg2 = props.msg2;
|
||||
this.msg3 = props.msg3;
|
||||
this.msg4 = props.msg4;
|
||||
},
|
||||
// 모달 끄기(ok)
|
||||
confirmModalClose(){
|
||||
var dimmed = document.getElementsByClassName('confirm');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
|
||||
this.row.result = true;
|
||||
// 부모 함수 호출.
|
||||
this.$parent.confirmCalbackFnc(this.row);
|
||||
},
|
||||
// 모달 끄기(ok)
|
||||
confirmModalClose2(){
|
||||
var dimmed = document.getElementsByClassName('confirm2');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
|
||||
this.row.result = true;
|
||||
// 부모 함수 호출.
|
||||
this.$parent.confirmCalbackFnc(this.row);
|
||||
},
|
||||
// 모달 끄기(취소)
|
||||
confirmModalCancel(){
|
||||
var dimmed = document.getElementsByClassName('confirm');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
|
||||
this.row.result = false;
|
||||
// 부모 함수 호출.
|
||||
this.$parent.confirmCalbackFnc(this.row);
|
||||
},
|
||||
// 모달 끄기(취소)
|
||||
confirmModalCancel2(){
|
||||
var dimmed = document.getElementsByClassName('confirm2');
|
||||
for(var i = 0; i < dimmed.length; i++){
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
|
||||
this.row.result = false;
|
||||
// 부모 함수 호출.
|
||||
this.$parent.confirmCalbackFnc(this.row);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<style>
|
||||
.popup-btn-wrap {width: 500px; margin: auto; padding: 100px 0;}
|
||||
.popup-btn-wrap button {width: 100%; margin-bottom: 10px; height: 50px; border-radius: 5px; box-shadow: none; border: 1px solid #000; }
|
||||
.popup-btn-wrap button:hover {background: #000; color: #fff;}
|
||||
</style> -->
|
||||
@@ -71,8 +71,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
<td class="check">
|
||||
<p>서비스관리</p>
|
||||
@@ -188,8 +186,9 @@
|
||||
<div class="pop-btn2">
|
||||
<button class="btn-default" type="button" @click="authAddCancel()">취소</button>
|
||||
<button class="btn-pcolor" type="button" @click="authAddSave()">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -197,6 +196,8 @@
|
||||
|
||||
import sysMgtApi from "../service/sysMgtApi.js";
|
||||
import { utils_mixin, chkPattern2 } from '../service/mixins';
|
||||
//import commonModal from "@/components/modal/commonModal";
|
||||
import commonModal from "../components/commonModal";
|
||||
|
||||
export default {
|
||||
name: 'authAdd',
|
||||
@@ -215,6 +216,7 @@ export default {
|
||||
};
|
||||
},
|
||||
components: {
|
||||
commonModal,
|
||||
},
|
||||
created(){
|
||||
//this.setCodeData();
|
||||
@@ -230,29 +232,44 @@ export default {
|
||||
|
||||
// 필수 등록정보 체크
|
||||
if(this.isNull(this.authNm)){
|
||||
alert("권한명을 입력해 주세요");
|
||||
this.$refs._authNm.focus();
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한명을 입력해 주세요.';
|
||||
this.row.focusTaget = '1';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.isNull(this.authCd)){
|
||||
alert('권한 코드를 입력해주세요.');
|
||||
this.$refs._authCd.focus();
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한 코드를 입력해 주세요.';
|
||||
this.row.focusTaget = '2';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.authCd.length > 5){
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한코드는 영문과 숫자포함 최대4자리까지 입력해주세요.';
|
||||
this.row.focusTaget = '2';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.isNull(this.stat)){
|
||||
alert('상태를 체크해주세요.');
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '상태를 체크해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.checkedAuthMenu.length == 0){
|
||||
alert('메뉴 권한 체크를 해주세요.');
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '메뉴 권한 체크를 해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
|
||||
},
|
||||
authAddCancel() {
|
||||
@@ -260,8 +277,17 @@ export default {
|
||||
this.$router.push({ name: 'authList'});
|
||||
|
||||
},
|
||||
async authAddSave(){
|
||||
if(this.doValidate() && window.confirm('저장 하시겠습니까?')){
|
||||
authAddSave(){
|
||||
if(this.doValidate()){
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한 등록 저장하시겠습니까?';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.confirmModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
async authInsert(){
|
||||
|
||||
var reqAuthMenuArr = this.checkedAuthMenu;
|
||||
var listArr = [];
|
||||
var dataMap = {};
|
||||
@@ -275,6 +301,7 @@ export default {
|
||||
listArr.push(dataMap);
|
||||
}
|
||||
|
||||
|
||||
this.row.authCd = this.authCd;
|
||||
this.row.authNm = this.authNm;
|
||||
this.row.authDesc = this.authDesc;
|
||||
@@ -287,22 +314,50 @@ export default {
|
||||
let response = await sysMgtApi.insertAuth(this.row);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == "0000") {
|
||||
alert('저장 하였습니다.');
|
||||
//alert('저장 하였습니다.');
|
||||
// 권한리스트 페이지 이동
|
||||
this.$router.push({ name: 'authList'});
|
||||
|
||||
} else if(result.retCode == "4017"){
|
||||
alert("권한코드가 이미 존재합니다.");
|
||||
this.$refs._authCd.focus();
|
||||
//alert("권한코드가 이미 존재합니다.");
|
||||
//this.$refs._authCd.focus();
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한코드가 이미 존재합니다.';
|
||||
this.row.focusTaget = '2';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
|
||||
} else {
|
||||
alert("실패 하였습니다.");
|
||||
//alert("실패 하였습니다.");
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch(err) {
|
||||
alert("실패 하였습니다.");
|
||||
//alert("실패 하였습니다.");
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
checkFocus(){
|
||||
if(this.row.focusTaget === '1'){
|
||||
this.$refs._authNm.focus();
|
||||
} else if(this.row.focusTaget === '2'){
|
||||
this.$refs._authCd.focus();
|
||||
}
|
||||
},
|
||||
confirmCalbackFnc(props){
|
||||
if(props.result){
|
||||
this.authInsert();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 체크박스 전체선택 기능
|
||||
|
||||
@@ -188,6 +188,7 @@
|
||||
<button class="btn-pcolor" type="button" @click="authModifySave()">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -195,6 +196,7 @@
|
||||
|
||||
import sysMgtApi from "../service/sysMgtApi.js";
|
||||
import { utils_mixin, chkPattern2 } from '../service/mixins';
|
||||
import commonModal from "../components/commonModal";
|
||||
|
||||
export default {
|
||||
name: 'authModify',
|
||||
@@ -219,6 +221,7 @@ export default {
|
||||
}
|
||||
},
|
||||
components: {
|
||||
commonModal,
|
||||
},
|
||||
created(){
|
||||
//this.setCodeData();
|
||||
@@ -235,24 +238,40 @@ export default {
|
||||
|
||||
// 필수 등록정보 체크
|
||||
if(this.isNull(this.authNm)){
|
||||
alert("권한명을 입력해 주세요");
|
||||
this.$refs._authNm.focus();
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한명을 입력해 주세요.';
|
||||
this.row.focusTaget = '1';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.isNull(this.authCd)){
|
||||
alert('권한 코드를 입력해주세요.');
|
||||
this.$refs._authCd.focus();
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한 코드를 입력해 주세요.';
|
||||
this.row.focusTaget = '2';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.authCd.length > 5){
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한코드는 영문과 숫자포함 최대4자리까지 입력해주세요.';
|
||||
this.row.focusTaget = '2';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.isNull(this.stat)){
|
||||
alert('상태를 체크해주세요.');
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '상태를 체크해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.checkedAuthMenu.length == 0){
|
||||
alert('메뉴 권한 체크를 해주세요.');
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '메뉴 권한 체크를 해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -294,15 +313,34 @@ export default {
|
||||
}
|
||||
|
||||
} else {
|
||||
alert("실패 하였습니다.");
|
||||
//alert("실패 하였습니다.");
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
} catch(err) {
|
||||
alert("처리 실패 하였습니다.");
|
||||
//alert("처리 실패 하였습니다.");
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
async authModifySave(){
|
||||
if(this.doValidate() && window.confirm('저장 하시겠습니까?')){
|
||||
authModifySave(){
|
||||
if(this.doValidate()){
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '권한 수정 저장하시겠습니까?';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.confirmModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
async authUpdate(){
|
||||
|
||||
var reqAuthMenuArr = this.checkedAuthMenu;
|
||||
var listArr = [];
|
||||
var dataMap = {};
|
||||
@@ -328,18 +366,40 @@ export default {
|
||||
let response = await sysMgtApi.updateAuth(this.row);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == "0000") {
|
||||
alert('저장 하였습니다.');
|
||||
//alert('저장 하였습니다.');
|
||||
// 권한리스트 페이지 이동
|
||||
this.$router.push({ name: 'authList'});
|
||||
} else {
|
||||
alert("실패 하였습니다.");
|
||||
//alert("실패 하였습니다.");
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch(err) {
|
||||
alert("실패 하였습니다.");
|
||||
//alert("실패 하였습니다.");
|
||||
this.row.title = '시스템관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.row.focusTaget = '0';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
checkFocus(){
|
||||
if(this.row.focusTaget === '1'){
|
||||
this.$refs._authNm.focus();
|
||||
} else if(this.row.focusTaget === '2'){
|
||||
this.$refs._authCd.focus();
|
||||
}
|
||||
},
|
||||
confirmCalbackFnc(props){
|
||||
if(props.result){
|
||||
this.authUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 체크박스 전체선택 기능
|
||||
|
||||
Reference in New Issue
Block a user