瀏覽代碼

图保存bug

jwyu 3 年之前
父節點
當前提交
00fcf029f7
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. 8 8
      src/views/hzyb/chart/Detail.vue

+ 8 - 8
src/views/hzyb/chart/Detail.vue

@@ -85,7 +85,7 @@ const handleConfirmDate=(e)=>{
         startDate.value=start
         endDate.value=end
         dateType.value=5
-        getChartInfo('time')
+        getChartInfo()
         showDate.value=false
     }else{
         Toast('结束时间不能小于开始时间')
@@ -131,7 +131,7 @@ let calendarType=ref('公历')//季节图 公历/农历
 // 公历/农历切换
 const calendarTypeChange=(val)=>{
     calendarType.value=val
-    getChartInfo()
+    getChartInfo('init')
 }
 
 
@@ -145,7 +145,7 @@ let chartData=ref({
 })// 图表配置数据
 let resData=ref(null)//接口详情数据
 let loading=ref(false)
-// 如果type:time则是修改时间重新获取数据 此时不重置时间
+// 如果type:init 则是初始化获取数据 
 const getChartInfo=async (type)=>{
     // resData.value=null
     loading.value=true
@@ -166,14 +166,14 @@ const getChartInfo=async (type)=>{
         
         // 设置highchart配置 ChartType: 1曲线图 2季节图:季节图中公历和农历数据结构不同
         if(res.data.ChartInfo.ChartType===1){
-            if(type!='time'){
+            if(type=='init'){
                 dateType.value=res.data.ChartInfo.DateType||3 
                 startDate.value=res.data.ChartInfo.StartDate||''
                 endDate.value=res.data.ChartInfo.EndDate||''
             }
             setSplineOpt(res.data.EdbInfoList)
         }else{
-            if(type!='time'){
+            if(type=='init'){
                 dateType.value=res.data.ChartInfo.DateType||3 
                 startDate.value=res.data.ChartInfo.SeasonStartDate||''
                 endDate.value=res.data.ChartInfo.SeasonEndDate||''
@@ -183,7 +183,7 @@ const getChartInfo=async (type)=>{
         }
     }
 }
-getChartInfo()
+getChartInfo('init')
 
 // 路由改变 解决从搜索页返回数据不刷新问题
 onBeforeRouteUpdate((nval)=>{
@@ -193,7 +193,7 @@ onBeforeRouteUpdate((nval)=>{
     startDate.value=''
     endDate.value=''
     // router.go(0)
-    getChartInfo()
+    getChartInfo('init')
 })
 
 // 上下线设置
@@ -824,7 +824,7 @@ const handleRefreshChart=async ()=>{
         setTimeout(() => {
             Toast.success(res.msg)
         }, 200);
-        getChartInfo()
+        getChartInfo('init')
     }
 }
 </script>