Răsfoiți Sursa

财务2.8 问题解决

hbchen 1 an în urmă
părinte
comite
ffdd6edb4b

+ 1 - 1
src/components/echart/baseOptions.js

@@ -50,7 +50,7 @@ export const baseOptions=()=>{
       axisLabel:{
         color:'#999',
         formatter:(value)=>{
-          return Math.round(value*10)/100000
+          return Math.round(value*100)/1000000
         }
       }
     }]

+ 1 - 0
src/components/echart/index.vue

@@ -57,6 +57,7 @@
 
   const chartDraw=(option)=>{
     // nextTick(()=>{
+      barChart.clear()
       barChart.setOption(option)
     // })
   }

+ 10 - 3
src/views/financialStatistics/businessIncome.vue

@@ -21,6 +21,7 @@
   })
   // 加载状态
   const loading=reactive({
+    search:false,
     list:true,
     export:false
   })
@@ -71,7 +72,11 @@
     chartOptions.value.yAxis[1]={
       alignTicks:true,
       axisLabel:{
-        color:'#999'
+        color:'#999',
+        formatter:(value)=>{
+          // 防止失真
+          return Math.round(value*10000)/10000
+        }
       },
       splitLine:{
         lineStyle:{
@@ -102,8 +107,9 @@
       }
     ]
   }
-
   const getList=()=>{
+    // 月度/季度/月度累计 数据返回速度较慢 给个加载框,防止先请求的数据后到
+    if([0,1,4].includes(searchParams.list_param)) loading.search=true
     getIncomeChartData(searchParams).then(res=>{
       // console.log(res);
       let dates = res.data.Date || []
@@ -111,6 +117,7 @@
       chartOptions.value.series[1].data=dates.map((item,index)=> [item,res.data.Yoy[index]])
     }).finally(()=>{
       loading.list=false
+      loading.search=false
     })
   }
 
@@ -133,7 +140,7 @@
       <div class="business-income-top">
         <div class="business-income-search-zone">
           <el-radio-group v-model="searchParams.list_param" size="large" @change="getList"
-          style="margin: 0 30px 8px 0;">
+          style="margin: 0 30px 8px 0;" v-loading="loading.search">
             <el-radio-button v-for="item in dimensionArray" :key="item.tag" class="dimension-radio"
             :label="item.tag" >{{ item.label }}</el-radio-button>
           </el-radio-group>