Browse Source

机构画像

zhengjinyi 2 years ago
parent
commit
fe288c512a
1 changed files with 36 additions and 11 deletions
  1. 36 11
      src/main/webapp/static/modules/cmClubPortrait/cmClubEacths.js

+ 36 - 11
src/main/webapp/static/modules/cmClubPortrait/cmClubEacths.js

@@ -151,11 +151,7 @@ const  getClubEacthsData = function (type,dateType) {
                             $('#orderEacths').hide();
                             $('#orderEacths').hide();
                             $('.eachts-total').hide();
                             $('.eachts-total').hide();
                         }else{
                         }else{
-                            $('.eachts-total').show();
-                            $('#orderEacths').show();
-                            $('#orderEacthsNone').hide();
-                            getOrderEacths(data.order.orderList);
-                            $('#orderTotalNum').text(`${data.order.orderTotalNum}个`);
+                            setOrderData(type,data)
                         }
                         }
                         break;
                         break;
                     case 1:
                     case 1:
@@ -191,10 +187,33 @@ const  getClubEacthsData = function (type,dateType) {
         }
         }
     });
     });
 }
 }
+// 设置订单数据
+const  setOrderData = function (type,data) {
+    const orderMap = {
+        0:{ // 订单
+            fn:function () {
+                $('.eachts-total').show();
+                $('#orderEacths').show();
+                $('#orderEacthsNone').hide();
+                $('#orderTimeEnd').val(data.order.endTime);
+                $('#orderTimeStart').val(data.order.startTime);
+                $('#orderTotalNum').text(`${data.order.orderTotalNum}个`);
+            },
+            id:'orderEacths',
+            series:{
+                name:'订单总量',
+                color:['#3aa0ff','#36cbcb','#fad337','#4dcb73','#f2637b','#975fe4'],
+                seriesData:data.order.orderList
+            },
+        }
+    }
+    getOrderEacths(orderMap[type].fn,orderMap[type].id,orderMap[type].series);
+}
 // 基于准备好的dom,初始化echarts实例
 // 基于准备好的dom,初始化echarts实例
-const getOrderEacths = function (data) {
+const getOrderEacths = function (handleFn,id,data) {
     // 基于准备好的dom,初始化echarts实例
     // 基于准备好的dom,初始化echarts实例
-    const myChart = echarts.init(document.getElementById('orderEacths'));
+    handleFn();
+    const myChart = echarts.init(document.getElementById(id));
     const option = {
     const option = {
         tooltip: {
         tooltip: {
             trigger: 'item'
             trigger: 'item'
@@ -207,10 +226,10 @@ const getOrderEacths = function (data) {
                 fontSize: 14,
                 fontSize: 14,
             },
             },
         },
         },
-        color:['#3aa0ff','#36cbcb','#fad337','#4dcb73','#f2637b','#975fe4'],
+        color:data.series.color,
         series: [
         series: [
             {
             {
-                name: '订单总量',
+                name: data.series.name,
                 type: 'pie',
                 type: 'pie',
                 radius: '55%',
                 radius: '55%',
                 center: ['25%', '50%'],
                 center: ['25%', '50%'],
@@ -226,7 +245,7 @@ const getOrderEacths = function (data) {
                     show: false,
                     show: false,
                     position: 'center'
                     position: 'center'
                 },
                 },
-                data:data
+                data:data.series.seriesData
             }
             }
         ]
         ]
     };
     };
@@ -241,6 +260,8 @@ const setOtherData = function (type,data) {
             fn:function () {
             fn:function () {
                 $('#keyWordsEacths').show();
                 $('#keyWordsEacths').show();
                 $('#keyWordsEacthsNone').hide();
                 $('#keyWordsEacthsNone').hide();
+                $('#keyWordsTimeEnd').val(data.behavior.endTime);
+                $('#keyWordsTimeStart').val(data.behavior.startTime);
             },
             },
             id:'keyWordsEacths',
             id:'keyWordsEacths',
             series:{
             series:{
@@ -254,6 +275,8 @@ const setOtherData = function (type,data) {
             fn:function () {
             fn:function () {
                 $('#serviceEacths').show();
                 $('#serviceEacths').show();
                 $('#serviceEacthsNone').hide();
                 $('#serviceEacthsNone').hide();
+                $('#serviceTimeEnd').val(data.remarks.endTime);
+                $('#serviceTimeStart').val(data.remarks.startTime);
             },
             },
             id:'serviceEacths',
             id:'serviceEacths',
             series:{
             series:{
@@ -267,6 +290,8 @@ const setOtherData = function (type,data) {
             fn:function () {
             fn:function () {
                 $('#visitEacths').show();
                 $('#visitEacths').show();
                 $('#visitEacthsNone').hide();
                 $('#visitEacthsNone').hide();
+                $('#visitTimeEnd').val(data.pageType.endTime);
+                $('#visitTimeStart').val(data.pageType.startTime);
             },
             },
             id:'visitEacths',
             id:'visitEacths',
             series:{
             series:{
@@ -280,7 +305,7 @@ const setOtherData = function (type,data) {
     getOtherEacths(dataMap[type].fn,dataMap[type].id,dataMap[type].series);
     getOtherEacths(dataMap[type].fn,dataMap[type].id,dataMap[type].series);
 }
 }
 // 其他三个图表
 // 其他三个图表
-const getOtherEacths = function (handleFn,id,data,color) {
+const getOtherEacths = function (handleFn,id,data) {
     // 基于准备好的dom,初始化echarts实例
     // 基于准备好的dom,初始化echarts实例
     handleFn();
     handleFn();
     const myChart = echarts.init(document.getElementById(id));
     const myChart = echarts.init(document.getElementById(id));