박민혁 박민혁 2024-01-25
240125 박민혁 모달창 수정
@4f7bc2a0877db5ae0d587baa2c0f01d25aa038e9
client/views/common/commonPlugin.js
--- client/views/common/commonPlugin.js
+++ client/views/common/commonPlugin.js
@@ -2,6 +2,8 @@
  * 
  * 공통 처리 플러그인
  */
+import Vue from "vue";
+
 export default{    
     install(Vue){ 
 
 
client/views/component/AlertModal.vue (added)
+++ client/views/component/AlertModal.vue
@@ -0,0 +1,110 @@
+<template>
+    <div v-show="isModalOpen" class="modal-wrapper">
+        <div class="modal-container small-modal">
+            <div class="modal-title text-ct">
+                <h2>{{title}}</h2>
+            </div>
+            <div class="modal-content-monthly">
+                <p class="alert-write text-ct"  v-html="message">                   
+                </p>
+            </div>
+            <div class="modal-end flex justify-center">
+                <button class="gray-btn large-btn flex50" id="confirmCancle" @click="closeModal" v-show="confirmAt">취소</button>
+                <button class="blue-btn large-btn flex50" id="confirmOk" @click="closeModal" @keyup.enter="closeModal">확인</button>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+
+export default {
+    props: {
+        title : {
+            type : String,
+            default : '모달 제목'
+        },
+        message : {
+            type : String,
+            default : '경고 메세지를 입력해주세요. <br /> 삭제,수정,추가 등등'
+        },
+    },
+    data() {
+        return {
+            isModalOpen: false,
+            activeTab: 'tab1',
+            modalType: 'tab-modal',
+            title : this.title,
+            message : this.message,
+            confirmAt : false
+        }
+    },
+    methods: {
+        // 탭 변경
+        showTab: function (tabName) {
+            this.activeTab = tabName;
+        },
+
+        // 닫기
+        closeModal: function(){
+            this.isModalOpen = false;
+        },
+
+        // 모달 호출
+        showModal : function(){
+            
+            this.confirmAt = false;
+            this.isModalOpen = true;
+            document.getElementById("confirmOk").focus()
+        },
+
+        // confirm 호출
+        showConfirm : async function(){
+            this.confirmAt = true;
+            this.isModalOpen = true;   
+            document.getElementById("confirmOk").focus()
+            const promise = new Promise((resolve, reject) => {               
+                document.getElementById("confirmCancle").addEventListener("click", async () => {   
+                    resolve('cancle')
+                });
+    
+                document.getElementById("confirmOk").addEventListener("click", async () => {                   
+                    resolve('ok')                 
+                });
+            });
+
+            return promise.then(
+                (id) => {         
+                    if(id == 'cancle'){
+                        return false;  
+                    }else if(id =='ok'){
+                        return true;          
+                    }
+                 
+                }     
+            );
+        },
+
+        setTitle : function(Title){
+            this.title = Title;
+        },
+
+        setMessage : function(message){
+            this.message = message;
+        },
+
+    },
+    watch: {
+
+    },
+    computed: {
+
+    },
+    components: {
+
+    },
+    mounted() {
+        console.log('main mounted');
+    }
+}
+</script>(No newline at end of file)
client/views/index.js
--- client/views/index.js
+++ client/views/index.js
@@ -8,13 +8,11 @@
 import AppRouter from "./pages/AppRouter.js";
 import App from "./pages/App.vue";
 import cmmnPlugin from './common/commonPlugin.js';
-import { quillEditor } from 'vue3-quill';
 
 
 
 const app = createApp(App);
-app.use(cmmnPlugin)
-app.use(quillEditor)
-app.use(AppRouter)
+app.use(cmmnPlugin);
+app.use(AppRouter);
 app.mount("#root");
 
client/views/layout/TopMenu.vue
--- client/views/layout/TopMenu.vue
+++ client/views/layout/TopMenu.vue
@@ -125,7 +125,7 @@
                 // subMenu가 존재하는 경우에만 길이를 반환
                 return menu.subMenu ? menu.subMenu.length : 0;
             }));
-            return maxSubItems * 48; // 48px는 각 메뉴 항목의 높이로 가정
+            return maxSubItems * 50; // 48px는 각 메뉴 항목의 높이로 가정
         }
     },
     components: {
client/views/pages/App.vue
--- client/views/pages/App.vue
+++ client/views/pages/App.vue
@@ -1,6 +1,6 @@
 <template>
    <div v-cloak :class="layoutType === 'side' ? 'dashboard-wrap' : 'layout-wrap'">
-      <Header v-show="isLogin" :className="layoutType"  @updateIsLogin="isLogin = $event"/>
+      <Header v-show="isLogin" :className="layoutType" @updateIsLogin="isLogin = $event" />
       <SideMenu v-show="isLogin" v-if="layoutType === 'side'" />
       <TopMenu v-show="isLogin" v-else />
       <div class="main">
@@ -8,6 +8,7 @@
          <router-view @updateIsLogin="isLogin = $event" />
       </div>
    </div>
+   <AlertModal id="cmmnAlert" ref="Alert"></AlertModal>
 </template>
 
 <script>
@@ -15,12 +16,13 @@
 import SideMenu from '../layout/SideMenu.vue';
 import TopMenu from '../layout/TopMenu.vue';
 import PageNavigation from '../component/PageNavigation.vue';
+import AlertModal from '../component/AlertModal.vue';
 const App = {
    data: () => {
       return {
          // side혹은 top 둘중 한개 타입
          layoutType: "top",
-         isLogin:false,
+         isLogin: true,
       }
    },
    methods: {
@@ -31,19 +33,19 @@
       },
    },
    watch: {
-
    },
    computed: {
-
    },
    components: {
       'Header': Header,
       'SideMenu': SideMenu,
       'TopMenu': TopMenu,
       'PageNavigation': PageNavigation,
+      'AlertModal' : AlertModal,
    },
-   mounted: () => {
+   mounted: function() {
       console.log('Vue mounted');
+      this.$setAlertRef(this.$refs.Alert);
    }
 }
 
client/views/pages/dbManagement/DbSchema.vue
--- client/views/pages/dbManagement/DbSchema.vue
+++ client/views/pages/dbManagement/DbSchema.vue
@@ -1,18 +1,4 @@
 <template>
-    <!-- 경고 모달창 -->
-    <div v-show="isAlertModalOpen" class="modal-wrapper">
-        <div class="modal-container alert-modal">
-            <div class="modal-title text-ct">
-                <h2>{{ alertTitle }}</h2>
-            </div>
-            <div class="modal-content-monthly">
-                <p class="alert-write text-ct"> {{ alertMessage }} </p>
-            </div>
-            <div class="modal-end flex justify-center">
-                <button class="blue-btn large-btn flex50" @click="closeAlertModal">확인</button>
-            </div>
-        </div>
-    </div>
     <div class="container">
         <div class="page-titleZone flex justify-between">
             <p class="main-title">진단대상관리 > 진단대상DB관리</p>
@@ -251,10 +237,6 @@
             schemaPerPage: 10,
             schemaTotalCount: 0,
             schemaIndex: 0,
-            // 경고 모달용
-            alertMessage: '',
-            alertTitle: '',
-            isAlertModalOpen: false,
         };
     },
     methods: {
@@ -295,55 +277,45 @@
         handleSchemaClick(index) {
             this.selectedSchema = index;
         },
-        // 경고 - alert 
-        openAlertModal:function(title, message){
-            this.alertTitle = title;
-            this.alertMessage = message;
-            this.isAlertModalOpen=true;
-        },
-        closeAlertModal:function(){
-            this.isAlertModalOpen=false;
-        },
-
         insertDbData: function () {
             const vm = this;
             const inputData = vm.dbInput;
 
             // 유효성 검사
             if (
-                !this.dbInput.dbms_name ||
-                !this.dbInput.dbms_type ||
-                !this.dbInput.dbms_url_port ||
-                !this.dbInput.dbms_drive_nm ||
-                !this.dbInput.dbms_connect_id ||
-                !this.dbInput.dbms_connect_pw ||
-                !this.dbInput.dbms_ag_nm ||
-                !this.dbInput.dbms_system_nm
+                !vm.dbInput.dbms_name ||
+                !vm.dbInput.dbms_type ||
+                !vm.dbInput.dbms_url_port ||
+                !vm.dbInput.dbms_drive_nm ||
+                !vm.dbInput.dbms_connect_id ||
+                !vm.dbInput.dbms_connect_pw ||
+                !vm.dbInput.dbms_ag_nm ||
+                !vm.dbInput.dbms_system_nm
             ) {
-                if (!this.dbInput.dbms_name) {
-                    this.openAlertModal('error', 'DBMS명은 반드시 입력해야 합니다.');
-                    this.$refs.dbms_name.focus();
-                } else if (!this.dbInput.dbms_type) {
-                    this.openAlertModal('error', 'DBMS유형은 반드시 선택해야 합니다.');
-                    this.$refs.dbms_type.focus();
-                } else if (!this.dbInput.dbms_url_port) {
-                    this.openAlertModal('error', '연결 URL은 반드시 입력해야 합니다.');
-                    this.$refs.dbms_url_port.focus();
-                } else if (!this.dbInput.dbms_drive_nm) {
-                    this.openAlertModal('error', '드라이버명은 반드시 입력해야 합니다.');
-                    this.$refs.dbms_drive_nm.focus();
+                if (!vm.dbInput.dbms_name) {
+                    vm.$showAlert('error', 'DBMS명은 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_name.focus();
+                } else if (!vm.dbInput.dbms_type) {
+                    vm.$showAlert('error', 'DBMS유형은 반드시 선택해야 합니다.');
+                    vm.$refs.dbms_type.focus();
+                } else if (!vm.dbInput.dbms_url_port) {
+                    vm.$showAlert('error', '연결 URL은 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_url_port.focus();
+                } else if (!vm.dbInput.dbms_drive_nm) {
+                    vm.$showAlert('error', '드라이버명은 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_drive_nm.focus();
                 } else if (!this.dbInput.dbms_connect_id) {
-                    this.openAlertModal('error', 'DB접속계정ID는 반드시 입력해야 합니다.');
-                    this.$refs.dbms_connect_id.focus();
-                } else if (!this.dbInput.dbms_connect_pw) {
-                    this.openAlertModal('error', 'DB접속계정암호는 반드시 입력해야 합니다.');
-                    this.$refs.dbms_connect_pw.focus();
-                } else if (!this.dbInput.dbms_ag_nm) {
-                    this.openAlertModal('error', '기관명은 반드시 입력해야 합니다.');
-                    this.$refs.dbms_ag_nm.focus();
-                } else if (!this.dbInput.dbms_system_nm) {
-                    this.openAlertModal('error', '정보시스템명은 반드시 입력해야 합니다.');
-                    this.$refs.dbms_system_nm.focus();
+                    vm.$showAlert('error', 'DB접속계정ID는 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_connect_id.focus();
+                } else if (!vm.dbInput.dbms_connect_pw) {
+                    vm.$showAlert('error', 'DB접속계정암호는 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_connect_pw.focus();
+                } else if (!vm.dbInput.dbms_ag_nm) {
+                    vm.$showAlert('error', '기관명은 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_ag_nm.focus();
+                } else if (!vm.dbInput.dbms_system_nm) {
+                    vm.$showAlert('error', '정보시스템명은 반드시 입력해야 합니다.');
+                    vm.$refs.dbms_system_nm.focus();
                 }
 
                 return;
@@ -361,7 +333,7 @@
                 })
                 .catch(function (error) {
                     console.log('insertDbData - error : ', error);
-                    this.openAlertModal('error', 'insertDbData 오류');
+                    vm.$showAlert('error', 'insertDbData 오류');
                 });
         },
         selectDbList: function () {
@@ -381,8 +353,8 @@
                     vm.dbIdx = vm.dbListCount - (vm.dbListSearch.currentPage - 1) * vm.dbListSearch.perPage;
                 })
                 .catch(function (error) {
-                    vm.openAlertModal('error', 'selectDbList - error');
-                    vm.openAlertModal('error', 'selectDbList 오류');
+                    console.log('error', 'selectDbList - error');
+                    vm.$showAlert('error', 'selectDbList 오류');
                 });
         },
 
@@ -390,7 +362,7 @@
             const vm = this;
 
             if (vm.selectedDb == null) {
-                vm.openAlertModal('error', '접속 테스트할 DB를 선택해주세요!');
+                vm.$showAlert('error', '접속 테스트할 DB를 선택해주세요!');
                 return;
             }
 
@@ -405,15 +377,15 @@
                 .then(function (response) {
                     console.log(response.data);
                     if (response.data == 1) {
-                        vm.openAlertModal('response', 'DB 접속이 성공되었습니다!');
+                        vm.$showAlert('response', 'DB 접속이 성공되었습니다!');
                         vm.selectDbList();
                     } else {
-                        vm.openAlertModal('error', '접속이 실패했습니다! DB 정보를 다시 확인해주세요!');
+                        vm.$showAlert('error', '접속이 실패했습니다! DB 정보를 다시 확인해주세요!');
                     }
                 })
                 .catch(function (error) {
                     console.log('selectDbList - error : ', error);
-                    vm.openAlertModal('error', '접속이 실패했습니다! DB 정보를 다시 확인해주세요');
+                    vm.$showAlert('error', '접속이 실패했습니다! DB 정보를 다시 확인해주세요');
                     vm.selectDbList();
                 });
         },
@@ -422,11 +394,11 @@
             const vm = this;
 
             if (vm.selectedDb == null) {
-                vm.openAlertModal('error', '스키마를 수집할 DB를 선택해주세요!');
+                vm.$showAlert('error', '스키마를 수집할 DB를 선택해주세요!');
                 return;
             }
             if (vm.dbList[vm.selectedDb].dbms_connect != 1) {
-                vm.openAlertModal('error', '접속 테스트가 완료된 DB를 선택해주세요!');
+                vm.$showAlert('error', '접속 테스트가 완료된 DB를 선택해주세요!');
                 return;
             }
 
@@ -441,13 +413,13 @@
                 .then(function (response) {
                     console.log(response.data);
                     if (response.data == 1) {
-                        vm.openAlertModal('response', '스키마 수집이 성공되었습니다!');
+                        vm.$showAlert('response', '스키마 수집이 성공되었습니다!');
                         vm.selectDbList();
                     }
                 })
                 .catch(function (error) {
                     console.log('selectDbList - error : ', error);
-                    vm.openAlertModal('error', '스키마 수집이 실패했습니다! DB 정보를 다시 확인해주세요');
+                    vm.$showAlert('error', '스키마 수집이 실패했습니다! DB 정보를 다시 확인해주세요');
                 });
         },
 
@@ -455,7 +427,7 @@
             const vm = this;
 
             if (vm.selectedDb == null) {
-                vm.openAlertModal('error', '삭제할 DB를 선택해주세요!');
+                vm.$showAlert('error', '삭제할 DB를 선택해주세요!');
                 return;
             }
 
@@ -468,7 +440,7 @@
                 data: vm.dbList[vm.selectedDb],
             })
                 .then(function (response) {
-                    vm.openAlertModal('response', 'DB가 삭제되었습니다!');
+                    vm.$showAlert('response', 'DB가 삭제되었습니다!');
                     vm.selectDbList();
                 })
                 .catch(function (error) {
@@ -482,7 +454,7 @@
             const vm = this;
 
             if (vm.selectedDb == null) {
-                vm.openAlertModal('error', '수정할 DB를 선택해주세요!');
+                vm.$showAlert('error', '수정할 DB를 선택해주세요!');
                 return;
             }
 
@@ -495,7 +467,7 @@
                 data: vm.dbList[vm.selectedDb],
             })
                 .then(function (response) {
-                    vm.openAlertModal('response', 'DB가 수정되었습니다!');
+                    vm.$showAlert('response', 'DB가 수정되었습니다!');
                     vm.selectDbList();
                 })
                 .catch(function (error) {
@@ -530,7 +502,7 @@
                 })
                 .catch((err) => {
                     console.log('스키마 정보 수집 에러 : ', err);
-                    vm.openAlertModal('error', '스키마 수집 에러');
+                    vm.$showAlert('error', '스키마 수집 에러');
                 });
         },
 
@@ -624,7 +596,7 @@
             console.log(UpdateSchemaList);
 
             if (UpdateSchemaList.length < 1) {
-                vm.openAlertModal('error', '변경 사항이 없습니다.');
+                vm.$showAlert('error', '변경 사항이 없습니다.');
                 return;
             }
 
@@ -633,7 +605,7 @@
             );
 
             if (targetItem) {
-                vm.openAlertModal('error', '설명을 입력하세요');
+                vm.$showAlert('error', '설명을 입력하세요');
                 // 입력 안 한 칸으로 이동
                 const firstInput = document.querySelector(`.explain_input_${targetItem.schema_id}`);
 
@@ -655,7 +627,7 @@
                 .then((res) => {
                     console.log('스키마 정보 수정 응답 : ', res.data);
                     if (res.data > 0) {
-                        vm.openAlertModal('response', '변경 내용 저장 완료');
+                        vm.$showAlert('response', '변경 내용 저장 완료');
 
                         // 변경 후 초기화
                         vm.updateSchemaList = [];
@@ -670,7 +642,7 @@
                 })
                 .catch((err) => {
                     console.log('스키마 정보 수정 에러 : ', err);
-                    vm.openAlertModal('error', '스키마 수정 에러');
+                    vm.$showAlert('error', '스키마 수정 에러');
                 });
         },
         // 페이지네이션 클릭 이벤트
client/views/pages/login/Login.vue
--- client/views/pages/login/Login.vue
+++ client/views/pages/login/Login.vue
@@ -14,7 +14,7 @@
                             <div class="inputUnderline"></div>
                         </div>
                         <div class="inputContainer">
-                            <input required="" class="customInput" type="text" v-model="userLogin.user_password" @keyup.enter="handleEnterKey">
+                            <input required="" class="customInput" type="password" v-model="userLogin.user_password" @keyup.enter="handleEnterKey">
                             <label class="inputLabel">PASSWORD</label>
                             <div class="inputUnderline"></div>
                         </div>
@@ -75,7 +75,6 @@
                 .then(function (response) {
                     console.log("login - response", response.data);
                     if (response.data > 0) {
-                        alert("로그인 성공하였습니다.");
                         vm.$emit("updateIsLogin", true);
                         vm.$router.go();
                         vm.$router.push({ path: '/main.page', query: {} });
client/views/pages/rule/DomainRuleList.vue
--- client/views/pages/rule/DomainRuleList.vue
+++ client/views/pages/rule/DomainRuleList.vue
@@ -1,21 +1,7 @@
 <template>
-    <!-- 경고 모달창 -->
-    <div v-show="isAlertModalOpen" class="modal-wrapper">
-        <div class="modal-container alert-modal">
-            <div class="modal-title text-ct">
-                <h2>{{ alertTitle }}</h2>
-            </div>
-            <div class="modal-content-monthly">
-                <p class="alert-write text-ct"> {{ alertMessage }} </p>
-            </div>
-            <div class="modal-end flex justify-center">
-                <button class="blue-btn large-btn flex50" @click="closeAlertModal">확인</button>
-            </div>
-        </div>
-    </div>
     <!-- 검색 모달창 -->
     <div v-show="isModalOpen" class="modal-wrapper">
-        <div class="modal-container">
+        <div class="modal-container" style="height:60%">
             <div class="modal-title">
                 <div class="flex justify-between align-center">
                     <h2>진단 규칙 검색</h2>
@@ -368,10 +354,6 @@
             schemaNameList: [],
             selectSchema: '',
 
-            // 경고 모달용
-            alertMessage: '',
-            alertTitle: '',
-            isAlertModalOpen: false,
         };
     },
     methods: {
@@ -463,10 +445,11 @@
                         val_rule_id: this.domainList[i].val_rule_id,
                         column_id: this.domainList[i].column_id
                     }
-                    this.updateDomainRule()
+                    this.updateDomainRule();
+
                 }
             }
-            this.openAlertModal("확인", "선택한 컬럼에 맞춰 규칙이 저장되었습니다");
+            this.$showAlert("확인", "선택한 컬럼에 맞춰 규칙이 저장되었습니다");
             this.checkedDomain = [];
         },
         // 진단 규칙 update
@@ -485,7 +468,7 @@
                 })
                 .catch(function (error) {
                     console.log('updateDomainRule - error : ', error);
-                    this.openAlertModal("error", "updateDomainRule 오류");
+                    this.$showAlert("error", "updateDomainRule 오류");
                 });
         },
         // 도메인 진단 규칙 select
@@ -508,7 +491,7 @@
                 })
                 .catch(function (error) {
                     console.log('selectDomainRule - error : ', error);
-                    this.openAlertModal("error", "selectDomainRule 오류");
+                    this.$showAlert("error", "selectDomainRule 오류");
                 });
         },
         // 진단 규칙 select
@@ -528,7 +511,7 @@
                 })
                 .catch(function (error) {
                     console.log("selectValRule - error : ", error);
-                    this.openAlertModal("error", "selectValRule 오류");
+                    this.$showAlert("error", "selectValRule 오류");
                 });
         },
         // 검증 유형 select
@@ -547,7 +530,7 @@
                 })
                 .catch(function (error) {
                     console.log("selectDqiType - error : ", error);
-                    this.openAlertModal("error", "selectDqiType 오류");
+                    this.$showAlert("error", "selectDqiType 오류");
                 });
         },
         // 코드 select
@@ -565,7 +548,7 @@
                 })
                 .catch(function (error) {
                     console.log('getOptionValue - error', error);
-                    this.openAlertModal("error", "selectCodeList 오류");
+                    this.$showAlert("error", "selectCodeList 오류");
                 });
         },
 
@@ -584,7 +567,7 @@
                     vm.dbNameList = res.data;
                 })
                 .catch((err) => {
-                    this.openAlertModal("error", "selectDbName 오류");
+                    this.$showAlert("error", "selectDbName 오류");
                 });
         },
 
@@ -604,19 +587,10 @@
                     vm.schemaNameList = res.data;
                 })
                 .catch((err) => {
-                    this.openAlertModal("error", "selectSchemaName 오류");
+                    this.$showAlert("error", "selectSchemaName 오류");
                 });
         },
 
-        // 경고 - alert 
-        openAlertModal:function(title, message){
-            this.alertTitle = title;
-            this.alertMessage = message;
-            this.isAlertModalOpen=true;
-        },
-        closeAlertModal:function(){
-            this.isAlertModalOpen=false;
-        }
     },
 
     watch: {
Add a comment
List