Ver Fonte

机构画像

zhengjinyi há 2 anos atrás
pai
commit
c18e868949

+ 65 - 51
src/main/webapp/static/modules/cmClubPortrait/cmClubEacths.js

@@ -143,58 +143,42 @@ const  getClubEacthsData = function (type,dateType) {
         type: "GET",
         data: defaultParams,
         contentType : 'application/json;charset=UTF-8', //contentType很重要
-        success: function (res) {
-            console.log('res',res)
-            if (res.portrait.code === 0) {
-                let data = res.portrait
-                if(type === 0){
-                    if(data.orderPortrait){
-                        let  data = data.orderPortrait;
-                        getOrderEacths(data)
-                    }else{
-                        $('#orderEacthsNone').show();
-                        $('#orderEacths').hide();
-                    }
-                }else{
-                    if(!data.behavior){
-                        $('#keyWordsEacthsNone').show();
-                        $('#keyWordsEacths').hide();
-                    }
-                    if(!data.remarks){
-                        $('#serviceEacthsNone').show();
-                        $('#serviceEacths').hide();
-                    }
-                    if(!data.pageType){
-                        $('#visitEacthsNone').show();
-                        $('#visitEacths').hide();
-                    }
-                    const dataMap = {
-                        1:{
-                            id:'keyWordsEacths',
-                            color:'#e15616',
-                            series:{
-                                yAxisData:data.behavior.name,
-                                seriesData:data.behavior.value
-                            },
-                        },
-                        2:{
-                            id:'serviceEacths',
-                            color:'#36cbcb',
-                            series:{
-                                yAxisData:data.remarks.name,
-                                seriesData:data.remarks.value
-                            },
-                        },
-                        3:{
-                            id:'visitEacths',
-                            color:'#3aa0ff',
-                            series:{
-                                yAxisData:data.remarks.name,
-                                seriesData:data.remarks.value
-                            },
+        success: function (data) {
+            console.log('res',data)
+            if (data.code === 0) {
+                switch (type) {
+                    case 0:
+                        if(!data.orderPortrait){
+                            $('#orderEacthsNone').show();
+                            $('#orderEacths').hide();
+                        }else{
+                            getOrderEacths(data.orderPortrait)
                         }
-                    }
-                    getOtherEacths(dataMap[type].id,dataMap[type].series,dataMap[type].color);
+                        break;
+                    case 1:
+                        if(!data.behavior){
+                            $('#keyWordsEacthsNone').show();
+                            $('#keyWordsEacths').hide();
+                        }else{
+                            setOtherData(type,data)
+                        }
+                        break;
+                    case 2:
+                        if(!data.remarks){
+                            $('#serviceEacthsNone').show();
+                            $('#serviceEacths').hide();
+                        }else{
+                            setOtherData(type,data)
+                        }
+                        break;
+                    case 3:
+                        if(!data.pageType){
+                            $('#visitEacthsNone').show();
+                            $('#visitEacths').hide();
+                        }else{
+                            setOtherData(type,data)
+                        }
+                        break;
                 }
             } else {
                 console.log('机构订单图表数据异常')
@@ -246,6 +230,36 @@ const getOrderEacths = function (data) {
     window.onresize = myChart.resize;//移动适配
 };
 // 其他三个图表
+const setOtherData = function (type,data) {
+    const dataMap = {
+        1:{
+            id:'keyWordsEacths',
+            color:'#e15616',
+            series:{
+                yAxisData:data.behavior.name,
+                seriesData:data.behavior.value
+            },
+        },
+        2:{
+            id:'serviceEacths',
+            color:'#36cbcb',
+            series:{
+                yAxisData:data.remarks.name,
+                seriesData:data.remarks.value
+            },
+        },
+        3:{
+            id:'visitEacths',
+            color:'#3aa0ff',
+            series:{
+                yAxisData:data.pageType.name,
+                seriesData:data.pageType.value
+            },
+        }
+    }
+    getOtherEacths(dataMap[type].id,dataMap[type].series,dataMap[type].color);
+}
+// 其他三个图表
 const getOtherEacths = function (id,data,color) {
     // 基于准备好的dom,初始化echarts实例
     console.log('id',id)

+ 2 - 2
src/main/webapp/static/modules/cmClubPortrait/cmClubPortrait.css

@@ -117,12 +117,12 @@
 .flex-box .box-eachts .eachts-none{
     width: 100%;
     height: 316px;
+    display: none;
 }
 .flex-box .box-eachts .eachts-none p{
-    font-size: 40px;
+    font-size: 30px;
     font-weight: bold;
     text-align: center;
     line-height: 316px;
     color: #333333;
-    display: none;
 }