Эх сурвалжийг харах

Merge branch 'dev_g' of United_Software/k_online_ui into dev

Jack Zhou 1 жил өмнө
parent
commit
6a0688b497

+ 13 - 11
src/components/MoreFilters/src/MoreFilters.vue

@@ -7,17 +7,19 @@ import { ref, onMounted, onBeforeMount, computed } from 'vue'
 import SelectTable from '@/components/SelectTable/src/SelectTable.vue'
 
 onMounted(() => {
-  const reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
-  const data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
-  if (reportlist._city_name != '') {
-    if (data.title.includes('Origin')) {
-      InputForm.value.palces.Origin.push(reportlist._city_name)
-      MoreFiltersObj.Origin = reportlist._city_name
-      MoreFiltersObj2.Origin = InputForm.value.palces.Origin
-    } else {
-      InputForm.value.palces.Destination.push(reportlist._city_name)
-      MoreFiltersObj.Destination = reportlist._city_name
-      MoreFiltersObj2.Destination = InputForm.value.palces.Origin
+  if (sessionStorage.getItem('reportList') != null && sessionStorage.getItem('reportList') != '') {
+    const reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
+    const data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
+    if (reportlist._city_name != '') {
+      if (data.title.includes('Origin')) {
+        InputForm.value.palces.Origin.push(reportlist._city_name)
+        MoreFiltersObj.Origin = reportlist._city_name
+        MoreFiltersObj2.Origin = InputForm.value.palces.Origin
+      } else {
+        InputForm.value.palces.Destination.push(reportlist._city_name)
+        MoreFiltersObj.Destination = reportlist._city_name
+        MoreFiltersObj2.Destination = InputForm.value.palces.Origin
+      }
     }
   }
   emitter.on('clearTag', (tag: any) => {