From 266fbc08e028cab1f276eeedc682f73215965833 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期一, 09 十月 2023 18:02:13 +0800
Subject: [PATCH] update

---
 cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html |  196 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 137 insertions(+), 59 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html
index e07d1f4..d7c2800 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html
@@ -124,10 +124,10 @@
                                 <div class="col-sm-10" style="width: 1500px" >
                                     </br>
                                     </br>
-                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>本年退费额度:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                    <span>本月退费额度:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                    <span>本周退费额度:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                    <span>本日退费额度:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="yearRefund">本年退费额度:<span id="back1"></span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                    <span id="monthRefund">本月退费额度:<span id="back2"></span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                    <span id="weekRefund">本周退费额度:<span id="back3"></span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                    <span id="todayRefund">本日退费额度:<span id="back4"></span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                     </br>
                                     </br>
                                     <div id="refund" style="width: 1280px;height:500px;"></div>
@@ -295,6 +295,7 @@
 
         if(cutType==1){
             srtj()
+            tuifei()
         }
 
         if(cutType==2){
@@ -318,15 +319,17 @@
         getContent(1);
         getContent1(1);
         getContent2(1);
+
         // 基于准备好的dom,初始化echarts实例
         var myChart  = echarts.init(document.getElementById('income'));
-        var myChart1 = echarts.init(document.getElementById('refund'));
+
         var myChart2 = echarts.init(document.getElementById('user'));
         var myChart3 = echarts.init(document.getElementById('vip'));
         var myChart4 = echarts.init(document.getElementById('activity'));
         var myChart5 = echarts.init(document.getElementById('prepare'));
         var myChart6 = echarts.init(document.getElementById('teach'));
         var myChart7 = echarts.init(document.getElementById('courseData'));
+        tuifei()
         option  = {
             tooltip: {
                 trigger: 'axis'
@@ -374,59 +377,6 @@
                 },
                 {
                     name: '日度营收',
-                    type: 'line',
-                    stack: 'Total',
-                    data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160]
-                }
-            ]
-        };
-        option1 = {
-            tooltip: {
-                trigger: 'axis'
-            },
-            legend: {
-                data: ['年度退费', '月度退费', '周度退费', '日度退费']
-            },
-            grid: {
-                left: '3%',
-                right: '4%',
-                bottom: '3%',
-                containLabel: true
-            },
-            toolbox: {
-                feature: {
-                    saveAsImage: {}
-                }
-            },
-            xAxis: {
-                type: 'category',
-                boundaryGap: false,
-                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
-            },
-            yAxis: {
-                type: 'value'
-            },
-            series: [
-                {
-                    name: '年度退费',
-                    type: 'line',
-                    stack: 'Total',
-                    data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330]
-                },
-                {
-                    name: '月度退费',
-                    type: 'line',
-                    stack: 'Total',
-                    data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160]
-                },
-                {
-                    name: '周度退费',
-                    type: 'line',
-                    stack: 'Total',
-                    data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188]
-                },
-                {
-                    name: '日度退费',
                     type: 'line',
                     stack: 'Total',
                     data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160]
@@ -730,7 +680,6 @@
         };
         // 使用刚指定的配置项和数据显示图表。
         myChart.setOption(option);
-        myChart1.setOption(option1);
         myChart2.setOption(option2);
         myChart3.setOption(option3);
         myChart4.setOption(option4);
@@ -762,6 +711,7 @@
 
         if(type==1){
             srtj()
+            tuifei()
         }
 
 
@@ -1152,6 +1102,105 @@
         ajax.start();
     }
     
+    
+    
+    function tuifei() {
+        var myChart1 = echarts.init(document.getElementById('refund'));
+        let id  = $("#cCode").val()
+        console.log(id)
+        if(id==''){
+            Feng.info("请先选择运营商");
+            return;
+        }
+        var ajax3 = new $ax(Feng.ctxPath + "/data/backYys", function(data){
+            $("#back1").text(data.thisYear);
+            $("#back2").text(data.thisMonth);
+            $("#back3").text(data.thisWeek);
+            $("#back4").text(data.thisDay);
+            option1 = {
+                tooltip: {
+                    trigger: 'axis'
+                },
+                legend: {
+
+                    data: ['年度退费', '月度退费','周度退费','日度退费'],
+                    icon: 'stack',
+                    selectedMode: 'single', // 单选
+                    selected: {
+                        年度会员数: true,
+                        月度会员数: false,
+                        周度会员数: false,
+                        日度会员数: false
+                    }
+                },
+                grid: {
+                    left: '3%',
+                    right: '4%',
+                    bottom: '3%',
+                    containLabel: true
+                },
+                toolbox: {
+                    feature: {
+                        saveAsImage: {}
+                    }
+                },
+                xAxis: {
+                    type: 'category',
+                    boundaryGap: false,
+                    data: yearX
+                },
+                yAxis: {
+                    type: 'value'
+                },
+                series: [
+                    {
+                        name: '年度退费',
+                        type: 'line',
+                        stack: 'Total',
+                        data: data.yearData
+                    },
+                    {
+                        name: '月度退费',
+                        type: 'line',
+                        stack: 'Total',
+                        data: data.monthData
+                    },
+                    {
+                        name: '周度退费',
+                        type: 'line',
+                        stack: 'Total',
+                        data: data.weekData
+                    },
+                    {
+                        name: '日度退费',
+                        type: 'line',
+                        stack: 'Total',
+                        data: data.dayData
+                    }
+                ]
+
+            };
+        });
+        ajax3.set("id",id)
+        ajax3.start();
+
+        myChart1.on('legendselectchanged', obj => {
+            var options = myChart1.getOption()
+            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
+            if (obj.name == '年度退费') {
+                options.xAxis[0].data = yearX
+            } else if (obj.name == '月度退费') {
+                options.xAxis[0].data = monthX
+            } else if (obj.name == '周度退费') {
+                options.xAxis[0].data =  ["1周","2周","3周","4周"]
+            } else if (obj.name == '日度退费') {
+                options.xAxis[0].data = dataX
+            }
+            myChart1.setOption(options, true)
+        })
+        myChart1.setOption(option1);
+    }
+    
     function getContent1(type){
         //设置点击字体颜色效果
         for(var i=1;i<3;i++){
@@ -1186,6 +1235,35 @@
     }
 </script>
 <script>
+    var ans = [];
+    var weekX = ["1周","2周","3周","4周"];
+    var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"];
+    var yearX = [];
+    var timeX = [];
+    var dataX = [];
+    // 创建一个日期对象
+    var currentDate = new Date();
+    // 获取当前日期的号数
+    let currentDay = currentDate.getDate();
+    // 循环添加号数到数组
+    for (let i = 0; i < 7; i++) {
+        dataX.push(currentDay - 6+i);
+    }
+    // 获取当前月份
+    var currentMonth = currentDate.getMonth();
+    // 获取当前年份
+    var currentYear = currentDate.getFullYear();
+    // 计算指定年份和月份的天数
+    function getDaysInMonth(year, month) {
+        // month 参数范围是 0-11,所以需要加 1
+        return new Date(year, month + 1, 0).getDate();
+    }
+    // 获取当前月份的天数
+    var daysInMonth = getDaysInMonth(currentYear, currentMonth);
+    // 将天数按字符串格式添加到 timeX 数组中
+    for (var i = 1; i <= daysInMonth; i++) {
+        timeX.push(String(i));
+    }
     $(function(){
         var chartDom = document.getElementById('cookieTicket');
         var myChart = echarts.init(chartDom);

--
Gitblit v1.7.1