Stormen123 2023-08-02
230802 김성훈 횡단보도상세조회 -> 상황,에러정보조회로 이동 시 행정동,노드명 출력
@db0d3c5164e19fa9e73ade5628b0e78510c4f971
client/views/component/dongSelectListSimple.vue
--- client/views/component/dongSelectListSimple.vue
+++ client/views/component/dongSelectListSimple.vue
@@ -2,7 +2,7 @@
     <div class="grid3_7  gap" id="siDoHiddenCk" style="float: left;display: block;block;width: 10rem;">       
         <select name="siDoSelectList" id="siDoSelectList" v-model="address['siDo_dong_cd']"
             @change="siDoGunGuSelectF($event)">
-            <option :value=null disabled> 시/도</option>
+            <option :value=null > 시/도</option>
             <option v-for="(item, key) in siDoList" :key="key" :value="item['dong_cd']">
                 {{ item['dong_nm'] }}
             </option>
@@ -11,7 +11,7 @@
     <div class="grid3_7  gap" id="gunGuHiddenCk" style="float: left;display: block;block;width: 10rem;">       
         <select class="bg-white" name="gunGuSelectList" id="gunGuSelectList" v-model="address['guGun_dong_cd']"
             @change="siDoGunGuSelectF($event)">
-            <option :value=null disabled> 시/군/구 </option>
+            <option :value=null > 시/군/구 </option>
             <option v-for="(item, key) in gunGuList" :key="key" :value="item['dong_cd']">
                 {{ item['dong_nm'] }}
             </option>
@@ -19,8 +19,7 @@
     </div>
     <div class="grid3_7  gap" id="dongHiddenCk" style="float: left;display: block;width: 10rem;">   
         <select name="dongSelectList" id="dongSelectList" v-model="address['dong_dong_cd']" @change="dongSelectF($event)">
-            <option :value=null disabled> 행정동 </option>
-            <option :value=null > 선택안함 </option>
+            <option :value=null > 행정동 </option>
             <option v-for="(item, key) in dongList" :key="key" :value="item['dong_cd']">
                 {{ item['dong_nm'] }}
             </option>
@@ -28,14 +27,14 @@
     </div>
     <div class="grid3_7 gap" id="nodeHiddenCk" style="float: left;display: block;width: 10rem;">   
         <select name="nodeSelectList" id="nodeSelectList" v-model="address['node_id']" @change="nodeSelectF($event)">
-            <option :value=null disabled> 교차로 </option>
+            <option :value=null > 교차로 </option>
             <option v-for="(item, key) in nodeList" :key="key" :value="item['node_id']">
                 {{ item['node_name'] }}
             </option>
         </select>
     </div>
-    <!--
-    <div class="grid3_7 " id="crslk_azHiddenCk" style="float: left;display: block;">
+    
+    <div class="grid3_7 gap " id="crslk_azHiddenCk" style="float: left;display: block;width: 10rem;">
         <select name="crslk_azSelectList" id="crslk_azSelectList" v-model="address['crslk_az']">
             <option :value="0"> 방위각 </option>
             <option :value="10">북</option>
@@ -48,7 +47,7 @@
             <option :value="80">북서</option>
         </select>
     </div>
-    -->
+    
 </template>
   
 <script>
@@ -63,19 +62,21 @@
         crslk_azHiddenCk: Boolean,
         user_sido_cd: null,
         user_sigungu_cd: null,
-        user_dong_cd: null
+        user_dong_cd: null,
+        user_node_id: null,
+        user_crslk_az: null
     },
     data() {
         return {
             address: {
                 //지역 설정
-                dong_cd: "22030",
+                dong_cd: "22",
                 siDo_dong_cd: "22",
                 guGun_dong_cd: null,
                 dong_dong_cd: null,
                 node_id: null,
                 zoomLevel: null,
-                crslk_az: null,
+                crslk_az: 0,
             },
             siDoList: [],
             gunGuList: [],
@@ -110,34 +111,43 @@
             console.log("guGun_dong_cd oldValue : ", oldValue);
             this.address.dong_cd = newValue;
             //아래에 있는 값은 초기화
-            this.address.dong_dong_cd = null;
-            this.address.node_id = null;
+            
             this.dongList = null;
 
             //zoom 재설정
             this.address.zoomLevel = 14;
 
+            if(newValue != null && oldValue != null) {
+                this.address.dong_dong_cd = null;
+                this.address.node_id = null;      
+            }
             
             if (newValue != null) {
                 this.dongSelectList(newValue);
             } else {
                 this.address.dong_cd = this.address.siDo_dong_cd;
             }
+
         },
         'address.dong_dong_cd': function (newValue, oldValue) {
             console.log("dong_dong_cd newValue : ", newValue);
             console.log("dong_dong_cd oldValue : ", oldValue);
             this.address.dong_cd = newValue;
             //아래에 있는 값은 초기화
-            this.address.node_id = null;
+
+            if(newValue != null && oldValue != null) {
+                this.address.node_id = null;
+                this.address.crslk_az = 0;    
+            }
 
             this.address.zoomLevel = 15;
 
-            if (newValue === null) {
+            if (newValue != null) {
+                this.findNodeUsingDongSelectList(newValue);
+            } else {
                 this.address.dong_cd = this.address.guGun_dong_cd;
             }
 
-            this.findNodeUsingDongSelectList(newValue);
         },
         'address.node_id': function (newValue, oldValue) {
             console.log("node_id newValue : ", newValue);
@@ -148,28 +158,16 @@
                     this.address.node_name = node.node_name;
                 }
             })
+
+            if(newValue != null && oldValue != null) {
+                this.address.crslk_az = 0;    
+            }
             this.address.zoomLevel = 19;
         },
-        'user_sido_cd': function (newValue, oldValue) {
-            console.log("user_sido_cd newValue : ", newValue);
-            console.log("user_sido_cd oldValue : ", oldValue);
-            this.address.siDo_dong_cd = newValue;
-        },
-        'user_sigungu_cd': function (newValue, oldValue) {
-            console.log("user_sigungu_cd newValue : ", newValue);
-            console.log("user_sigungu_cd oldValue : ", oldValue);
-            if (newValue != undefined) {
-                this.address.guGun_dong_cd = newValue;
-            } else {
-                this.address.guGun_dong_cd = null;
-            }
-        },
-        'user_dong_cd': function (newValue, oldValue) {
-            console.log("user_dong_cd newValue : ", newValue);
-            console.log("user_dong_cd oldValue : ", oldValue);
-            if (newValue != undefined) {
-                this.address.dong_dong_cd = newValue;
-            }
+        'address.crslk_az': function (newValue, oldValue) {
+            console.log("crslk_az newValue : ", newValue);
+            console.log("crslk_az oldValue : ", oldValue);
+            this.address.crslk_az = newValue;
         },
     },
     methods: {
@@ -262,7 +260,6 @@
         console.log("dongSelectList mounted : ");
         this.siDoSelectList();
         this.gunGuSelect(this.address.siDo_dong_cd);
-        this.dongSelectList(this.address.guGun_dong_cd);
         this.onEmit();
         if (this.siDoHiddenCk) {
             document.getElementById("siDoHiddenCk").style.display = 'none';
@@ -279,6 +276,22 @@
         if (this.crslk_azHiddenCk) {
             document.getElementById("crslk_azHiddenCk").style.display = 'none';
         }
+
+        if(this.user_sigungu_cd != undefined) {
+            this.address.guGun_dong_cd = this.user_sigungu_cd;
+        }
+
+        if(this.user_dong_cd != undefined) {
+            this.address.dong_dong_cd = this.user_dong_cd;
+        }
+
+        if(this.user_node_id != undefined) {
+            this.address.node_id = this.user_node_id;
+        }
+
+        if(this.user_crslk_az != undefined) {
+            this.address.crslk_az = this.user_crslk_az;
+        }
     },
 };
 
client/views/pages/RealtimeStatus/CrosswalkListSearch.vue
--- client/views/pages/RealtimeStatus/CrosswalkListSearch.vue
+++ client/views/pages/RealtimeStatus/CrosswalkListSearch.vue
@@ -314,8 +314,8 @@
 
             <h3 class="modal_base_title">이벤트 발생정보</h3>
             <button class="btn-2 green-btn s-btn " style=" float: right; margin-left: 10px; margin-bottom:5px;" @click="crosswalkSearchPage(crosswalk.node_id, crosswalk.dong_cd)">위치확인</button>
-            <button class="btn-2 green-btn s-btn " style=" float: right; margin-left: 10px; margin-bottom:5px;" @click="situationSearchPage(crosswalk.node_id, crosswalk.crslk_az, crosswalk.dong_cd)">상황발생 상세보기</button>
-            <button class="btn-2 green-btn s-btn " style=" float: right; margin-left: 10px; margin-bottom:5px;" @click="errorSearchPage(crosswalk.node_id, crosswalk.crslk_az, crosswalk.dong_cd)">장애발생 상세보기</button>          
+            <button class="btn-2 green-btn s-btn " style=" float: right; margin-left: 10px; margin-bottom:5px;" @click="situationSearchPage(crosswalk.node_id, crosswalk.crslk_az, crosswalk.sigungu_cd, crosswalk.dong_cd)">상황발생 상세보기</button>
+            <button class="btn-2 green-btn s-btn " style=" float: right; margin-left: 10px; margin-bottom:5px;" @click="errorSearchPage(crosswalk.node_id, crosswalk.crslk_az, crosswalk.sigungu_cd, crosswalk.dong_cd)">장애발생 상세보기</button>          
             <div class="de_Search">
               <table class="troubleTable mrg_b_0" >              
                   <tbody>
@@ -387,6 +387,7 @@
       crosswalk: {
         crslk_az: null,
         node_id: null,
+        sigungu_cd: null,
         dong_cd: null,
         crslk_nm: null,
         instl_ymd: null,
@@ -488,12 +489,12 @@
       this.address = value;
     },
 
-    situationSearchPage: function(node_id, crslk_az, dong_cd) {
-      this.$router.push({ path: '/SituationSearch.page', query: { 'node_id': node_id, 'crslk_az': crslk_az, 'dong_cd': dong_cd}})
+    situationSearchPage: function(node_id, crslk_az, sigungu_cd, dong_cd) {
+      this.$router.push({ path: '/SituationSearch.page', query: { 'node_id': node_id, 'crslk_az': crslk_az, 'sigungu_cd': sigungu_cd,'dong_cd': dong_cd}})
     },
 
-    errorSearchPage: function(node_id, crslk_az, dong_cd) {
-      this.$router.push({ path: '/ErrorSearch.page', query: { 'node_id': node_id, 'crslk_az': crslk_az, 'dong_cd': dong_cd}})
+    errorSearchPage: function(node_id, crslk_az, sigungu_cd, dong_cd) {
+      this.$router.push({ path: '/ErrorSearch.page', query: { 'node_id': node_id, 'crslk_az': crslk_az, 'sigungu_cd': sigungu_cd, 'dong_cd': dong_cd}})
     },
     
     crosswalkSearchPage: function(node_id, dong_cd) {
@@ -506,6 +507,10 @@
     PaginationButton: PaginationButton,
     dongSelectList: dongSelectList,
   },
+  created() {
+    this.crosswalkListSearch.endDate = COMMON_UTIL.today();
+    this.crosswalkListSearch.startDate = COMMON_UTIL.oneMonthAgo();
+  },
   mounted() {
     console.log("CrosswalkListSearch mounted");
     this.crosswalkSelectList();
client/views/pages/RealtimeStatus/ErrorSearch.vue
--- client/views/pages/RealtimeStatus/ErrorSearch.vue
+++ client/views/pages/RealtimeStatus/ErrorSearch.vue
@@ -17,8 +17,9 @@
               </td>              
               <th>행정구역</th>
               <td colspan="3">       
-                <dongSelectList @setDongCd="setDongCd" 
-                                :user_dong_cd="errorListSearch.dong_cd"
+                <dongSelectList @setDongCd="setDongCd"
+                                :user_sigungu_cd="errorListSearch.sigungu_cd"
+                                :user_dong_cd="errorListSearch.dong_dong_cd"
                                 :user_node_id="errorListSearch.node_id"
                                 :user_crslk_az="errorListSearch.crslk_az"></dongSelectList>         
               </td>             
@@ -269,7 +270,9 @@
         errorType: null,
         equipmentType: null,
         recoveryType: null,
+        sigungu_cd:null,
         dong_cd: null,
+        dong_dong_cd: null,
         node_id: null,
         crslk_az: null
       },
@@ -358,7 +361,8 @@
     },
   },
   watch: {
-    'address.dong_dong_cd': function (newValue) {
+
+    'address.dong_cd': function (newValue) {
       this.errorListSearch.dong_cd = newValue;
     },
 
@@ -376,13 +380,23 @@
     dongSelectList: dongSelectList,
   },
   created(){
-    this.errorListSearch.dong_cd = this.$route.query.dong_cd;
-    this.errorListSearch.node_id = this.$route.query.node_id;
-    this.errorListSearch.crslk_az = this.$route.query.crslk_az;
+    if(this.$route.query.sigungu_cd != null) {
+      console.log("ErrorSearch created")
+      this.errorListSearch.sigungu_cd = this.$route.query.sigungu_cd;
+      this.errorListSearch.dong_dong_cd = this.$route.query.dong_cd;
+      this.errorListSearch.node_id = this.$route.query.node_id;
+      this.errorListSearch.crslk_az = this.$route.query.crslk_az;
+      this.errorListSearch.startDate = COMMON_UTIL.today();
+      this.errorListSearch.endDate = COMMON_UTIL.today();
+    } else {
+      this.errorListSearch.endDate = COMMON_UTIL.today();
+      this.errorListSearch.startDate = COMMON_UTIL.oneMonthAgo();
+    }
   },
   mounted() {
     console.log("ErrorSearch mounted");
     this.errorSelectList();
+    
   },
 };
 </script>
client/views/pages/RealtimeStatus/SituationSearch.vue
--- client/views/pages/RealtimeStatus/SituationSearch.vue
+++ client/views/pages/RealtimeStatus/SituationSearch.vue
@@ -20,8 +20,9 @@
               </td>  
               <th>행정구역</th>
               <td colspan="3" class="flex gap">       
-                 <dongSelectList @setDongCd="setDongCd" 
-                                :user_dong_cd="eventListSearch.dong_cd"
+                 <dongSelectList @setDongCd="setDongCd"
+                                :user_sigungu_cd="eventListSearch.sigungu_cd" 
+                                :user_dong_cd="eventListSearch.dong_dong_cd"
                                 :user_node_id="eventListSearch.node_id"
                                 :user_crslk_az="eventListSearch.crslk_az"></dongSelectList>         
               </td>          
@@ -298,7 +299,9 @@
         startDate: null,
         endDate: null,
         eventType: null,
+        sigungu_cd:null,
         dong_cd: null,
+        dong_dong_cd: null,
         node_id: null,
         crslk_az: null
       },
@@ -352,7 +355,7 @@
   methods: {
     eventSelectList: function() {
       const vm = this;
-      
+
       axios({
       url: "/statusControl/eventSelectList.json",
       method: "post",
@@ -410,7 +413,8 @@
     },
   },
   watch: {
-    'address.dong_dong_cd': function (newValue) {
+    
+    'address.dong_cd': function (newValue) {
       this.eventListSearch.dong_cd = newValue;
     },
 
@@ -428,12 +432,21 @@
     dongSelectList: dongSelectList
   },
   created(){
-    this.eventListSearch.dong_cd = this.$route.query.dong_cd;
-    this.eventListSearch.node_id = this.$route.query.node_id;
-    this.eventListSearch.crslk_az = this.$route.query.crslk_az;
+    if(this.$route.query.sigungu_cd != null) {
+      console.log("SituationSearch created");
+      this.eventListSearch.sigungu_cd = this.$route.query.sigungu_cd;
+      this.eventListSearch.dong_dong_cd = this.$route.query.dong_cd;
+      this.eventListSearch.node_id = this.$route.query.node_id;
+      this.eventListSearch.crslk_az = this.$route.query.crslk_az;
+      this.eventListSearch.startDate = COMMON_UTIL.today();
+      this.eventListSearch.endDate = COMMON_UTIL.today();
+    } else {
+      this.eventListSearch.endDate = COMMON_UTIL.today();
+      this.eventListSearch.startDate = COMMON_UTIL.oneMonthAgo();
+    }
   },
   mounted() {
-    console.log("Main4 mounted");
+    console.log("SituationSearch mounted");
     this.eventSelectList();
   },
 };
Add a comment
List