魏志佳 4 năm trước cách đây
mục cha
commit
49513c417f
2 tập tin đã thay đổi với 49 bổ sung40 xóa
  1. 1 1
      src/utils/request.js
  2. 48 39
      src/views/modules/stockWatch/accountPage.vue

+ 1 - 1
src/utils/request.js

@@ -16,7 +16,7 @@ else if (process.env.NODE_ENV == 'debug') {
 else if (process.env.NODE_ENV == 'production') { 
   
   // axios.defaults.baseURL = 'http://192.168.1.251/jeecg-boot';
-  axios.defaults.baseURL = 'http://139.186.151.174:8804/jeecg-boot';     
+  axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
   // axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';
 }
 const service = axios.create({

+ 48 - 39
src/views/modules/stockWatch/accountPage.vue

@@ -779,7 +779,8 @@ const columns=[
                     this.getSceneData();
                     this.getGenderData()
                     this.getMaterialData()
-                    this.getColumnsByAccountId()
+                    this.getColumnsByAccountId();
+                    this.echartIndex='charge'
                 }
             }
         },
@@ -1452,8 +1453,8 @@ const columns=[
                     option=  this.getLineOption(data);                   
                     
                 }else if( type=='pie'){
-                    option= this.getPieOption()
-                   option.series[0].data=data
+                    option= this.getPieOption(data);
+                    
                 }
                 return option
             },
@@ -1525,7 +1526,7 @@ const columns=[
             },
 
 
-            getPieOption(){
+            getPieOption(data){
                 const colorList = ['#58D5FF', '#73ACFF', '#FDD56A', '#FDB36A', '#FD866A','#9E87FF']
                 let option = {
                     
@@ -1538,7 +1539,7 @@ const columns=[
                         // left: '3%',
                         // top:'center',
                         // icon:'circle'
-                         orient: 'horizontal',
+                        orient: 'horizontal',
                         left: '3%',
                         top:'top',
                         icon:'circle'
@@ -1554,39 +1555,42 @@ const columns=[
                         show:false
                     },
                     series: [
-                        {
-                            name:'',
-                            type: 'pie',
-                            radius: ['40%', '70%'],
-                            labelLine:{
-                                length:5,
-                                length2:5
-                            },
-                            label:{
-                                show: false,
-                                position:'center'
-                            },
-                            emphasis: {
-                                label: {
-                                    show: true,
-                                    fontSize: '18',
-                                    fontWeight: 'bold'
-                                }
-                            },
-                            labelLine: {
-                                show: true
-                            },
-                            itemStyle: {
-                                borderRadius: 5,
-                                color: (params) => {
-                                    return colorList[params.dataIndex]
-                                }
-                            },
-                            data: []
-                        }
+                        
                     ]
                 }
-
+                option.series=[];
+                option.series.push(
+                    {
+                        name:'',
+                        type: 'pie',
+                        radius: ['40%', '70%'],
+                        labelLine:{
+                            length:5,
+                            length2:5
+                        },
+                        label:{
+                            show: false,
+                            position:'center'
+                        },
+                        emphasis: {
+                            label: {
+                                show: true,
+                                fontSize: '18',
+                                fontWeight: 'bold'
+                            }
+                        },
+                        labelLine: {
+                            show: true
+                        },
+                        itemStyle: {
+                            borderRadius: 5,
+                            color: (params) => {
+                                return colorList[params.dataIndex]
+                            }
+                        },
+                        data: data
+                    }
+                )
                 return option
             },
 
@@ -1599,7 +1603,7 @@ const columns=[
                     // myChart.showLoading({
                     //     text: "图表数据正在努力加载..."
                     // });
-                    
+                    myChart.clear()
                     myChart.setOption(optionName)
                     window.addEventListener('resize', function() {
                     myChart.resize()
@@ -1909,7 +1913,8 @@ const columns=[
                         // },0)
                         
                     }else{
-                       this.accountIndexEchartSpinning=false
+                       this.accountIndexEchartSpinning=false;
+                       this.initEchart('accountIndexEchart',this.initAccountIndexEchart(indexName,[]))
                     }
                 })
             },
@@ -1943,6 +1948,8 @@ const columns=[
                         //     this.initEchart('ageEchart',this.initAdpositionChart(type,data))
                         // })
                         
+                    }else{
+                        this.initEchart('ageEchart',{})
                     }
                     
                 })
@@ -2000,6 +2007,8 @@ const columns=[
                             this.initEchart('genderEchart',this.initAdpositionChart(type,this.handlerLineData(res)))
                         }
                         
+                    }else{
+                        this.initEchart('genderEchart',{})
                     }
                     
                     
@@ -2034,7 +2043,7 @@ const columns=[
                         }
                     }else{
                         this.$message.error(res.message)
-
+                        this.initEchart('adPositionEchart',{})
                     }