ソースを参照

跳转图表详情的时候,需要把日期等参数带过来

cxmo 1 年間 前
コミット
d26554943d
2 ファイル変更14 行追加7 行削除
  1. 7 6
      src/views/chartETA/ChartDetail.vue
  2. 7 1
      src/views/chartETA/List.vue

+ 7 - 6
src/views/chartETA/ChartDetail.vue

@@ -81,6 +81,7 @@ async function getChartDetail(e){
 }
 onMounted(() => {
     currentLang.value = localStorage.getItem('chartETALange')==='EN'?'en':'zh'
+    initChartState(route.query)
     getChartDetail('init')
 })
 
@@ -454,18 +455,18 @@ async function handleSwitchChart(type){
         item=index===chartSortListData.value.length-1?chartSortListData.value[0]:chartSortListData.value[index+1]
     }
     //切换前重置chartState
-    initChartState()
+    initChartState(item)
     routeQueryData.id=item.ChartInfoId
     routeQueryData.chartType=item.ChartType
     routeQueryData.chartClassifyId=item.ChartClassifyId
     getChartDetail('init')
 }
-function initChartState(){
+function initChartState(data){
     chartState.showTimePop=false
-    chartState.startTime=''
-    chartState.endTime='',
-    chartState.yearVal='',
-    chartState.calendarType='公历'
+    chartState.startTime=sameOptionType.includes(Number(data.chartType))?data.StartDate:data.SeasonStartDate
+    chartState.endTime=sameOptionType.includes(Number(data.chartType))?data.EndDate:data.SeasonEndDate
+    chartState.yearVal=data.DateType
+    chartState.calendarType=data.Calendar
 }
 
 

+ 7 - 1
src/views/chartETA/List.vue

@@ -32,7 +32,13 @@ const goChartDetail = (item)=>{
             id:item.ChartInfoId,
             chartType:item.ChartType,
             chartClassifyId:listState.cid,
-            IsShowMe:listState.IsShowMe
+            IsShowMe:listState.IsShowMe,
+            DateType:item.DateType,
+            StartDate:(item.DateType===5||item.DateType===6)?item.StartDate:'',
+            EndDate:(item.DateType===5||item.DateType===6)?item.EndDate:'',
+            Calendar:item.Calendar?item.Calendar:'公历',
+            SeasonStartDate:item.SeasonStartDate,
+            SeasonEndDate:item.SeasonEndDate,
         }
     })
 }