Parcourir la source

feat:修改跳转参数

AmandaG il y a 1 an
Parent
commit
b4dab29ded

+ 2 - 2
src/components/DateRange/src/DateRange.vue

@@ -144,7 +144,6 @@ const defaultDate = () => {
         daterangeObj2.ETA = obj
         emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
       }
-
       if (data.etd_start) {
         DateStart.value = [dayjs(data.etd_start), dayjs(data.etd_end)]
         daterangeObj.ETD =
@@ -155,7 +154,7 @@ const defaultDate = () => {
           title: 'ETD',
           data: [DateStart.value[0].format('MM/DD/YYYY'), DateStart.value[1].format('MM/DD/YYYY')]
         }
-        daterangeObj2.ETA = obj
+        daterangeObj2.ETD = obj
         emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
       }
     }
@@ -247,6 +246,7 @@ const DateRangeChange = (val: any) => {
 }
 const emit = defineEmits(['DateRangeSearch', 'clearDaterangeTags', 'defaultDate'])
 const DateRangeSearch = () => {
+  console.log(daterangeObj, daterangeObj2)
   emit('DateRangeSearch', daterangeObj, daterangeObj2)
   Date_visible.value = false
 }

+ 14 - 14
src/views/Dashboard/src/DashboardView.vue

@@ -469,35 +469,35 @@ const ClickParams = (val: any) => {
     if (name == 'Container') {
       if (type == 'ETA') {
         if (startyear.value) {
-          reportList.eta_start = startyear.value + '-' + startmonth.value + '-01'
+          reportList.eta_start = startmonth.value + '/01/' + startyear.value
           reportList.eta_end =
-            endyear.value +
-            '-' +
             endmonth.value +
-            '-' +
-            new Date(endyear.value, endmonth.value, 0).getDate()
+            '/' +
+            new Date(endyear.value, endmonth.value, 0).getDate() +
+            '/' +
+            endyear.value
         }
       } else {
         if (startyear.value) {
-          reportList.etd_start = startyear.value + '-' + startmonth.value + '-01'
+          reportList.etd_start = startmonth.value + '/01/' + startyear.value
           reportList.etd_end =
-            endyear.value +
-            '-' +
             endmonth.value +
-            '-' +
-            new Date(endyear.value, endmonth.value, 0).getDate()
+            '/' +
+            new Date(endyear.value, endmonth.value, 0).getDate() +
+            '/' +
+            endyear.value
         }
       }
     } else {
       if (type == 'ETA') {
         if (startyear.value) {
-          reportList.eta_start = startyear.value + '-' + startmonth.value + startday.value
-          reportList.eta_end = endyear.value + '-' + endmonth.value + '-' + endday.value
+          reportList.eta_start = startmonth.value + '/' + startday.value + '/' + startyear.value
+          reportList.eta_end = endmonth.value + '/' + endday.value + '/' + endyear.value
         }
       } else {
         if (startyear.value) {
-          reportList.etd_start = startyear.value + '-' + startmonth.value + startday.value
-          reportList.etd_end = endyear.value + '-' + endmonth.value + '-' + endday.value
+          reportList.etd_start = startmonth.value + '/' + startday.value + '/' + startyear.value
+          reportList.etd_end = endmonth.value + '/' + endday.value + '/' + endyear.value
         }
       }
     }

+ 9 - 5
src/views/Tracking/src/TrackingView.vue

@@ -143,6 +143,7 @@ const defaultDate = (val: any, value: any, data: any) => {
       filterData.daterangeData.push(str)
     }
   }
+  console.log(sessionStorage.getItem('searchTableQeuryTracking'))
   if (sessionStorage.getItem('searchTableQeuryTracking') == null) {
     if (
       sessionStorage.getItem('clickParams') === null ||
@@ -156,18 +157,20 @@ const defaultDate = (val: any, value: any, data: any) => {
         searchTableQeuryTracking.etd_start = value[key].data[0]
         searchTableQeuryTracking.etd_end = value[key].data[1]
       }
-    } else {
-      for (const key in value) {
-        searchTableQeuryTracking.etd_start = value[key].data[0]
-        searchTableQeuryTracking.etd_end = value[key].data[1]
-      }
     }
+    // else {
+    //   for (const key in value) {
+    //     searchTableQeuryTracking.etd_start = value[key].data[0]
+    //     searchTableQeuryTracking.etd_end = value[key].data[1]
+    //   }
+    // }
   } else {
     searchTableQeuryTracking = data
     if (searchTableQeuryTracking._textSearch) {
       TrackingSearch.value = searchTableQeuryTracking._textSearch
     }
   }
+  console.log(searchTableQeuryTracking)
   const trackingData = JSON.parse(localStorage.getItem('searchData'))
   if (trackingData) {
     // 根据顶部搜索框的搜索结果赋值
@@ -470,6 +473,7 @@ const TagsList = ref<ListItem[]>([])
 const filterTag = ref(['All'])
 const isShowAlertIcon = ref(false)
 const Gettrackingdata = () => {
+  console.log(searchTableQeuryTracking)
   tableLoadingTableData.value = true
   TrackingTable_ref.value.getLoadingData(tableLoadingTableData.value)
   $api