44323
2023-10-13 a7900eee85457c085a97427b4932537dcdd6a343
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/storeIncome.html
@@ -40,6 +40,8 @@
</style>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <input id="objectId" value="${objectId}" hidden>
        <input id="objectType" value="${objectType}" hidden>
        <div class="form-horizontal">
            <div class="row">
                <br class="col-sm-10">
@@ -188,7 +190,7 @@
                                    <h2>运营数据</h2>
                                    </br>
                                    </br>
                                    <span>运营时长:0小时</span>
                                    <span id = "allHours">运营时长:0小时</span>
                                    </br>
                                    </br>
                                    <div style="height: 25px;box-sizing: border-box;background:#f3f3f4;line-height: 25px;border:1px solid;margin-bottom: 20px;width: 500px">
@@ -272,6 +274,8 @@
    function search(){
        ptStu()
        ptCourse()
        if(cutType==1){
            srtj()
            tuifei()
@@ -284,7 +288,9 @@
            ptActivity()
        }
        if(cutType==3){
            ptStu()
            jxtj()
        }
    }
    function income(){
@@ -387,7 +393,11 @@
        });
        ajax.set("type",1);
        ajax.set("storeId",$("#cCode").val());
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("storeId", $("#cCode").val())
        }
        ajax.start();
        // 营收
        var income  = echarts.init(document.getElementById('income'));
@@ -544,7 +554,11 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.set("time",beginTime);
        ajax.start();
@@ -665,7 +679,11 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.start();
    }
@@ -782,7 +800,12 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.start();
    }
@@ -863,7 +886,11 @@
            };
        });
        ajax3.set("id",id)
        if($("#objectType").val()==3){
            ajax3.set("id",$("#objectId").val())
        }else {
            ajax3.set("id", id)
        }
        ajax3.start();
        myChart1.on('legendselectchanged', obj => {
@@ -883,7 +910,101 @@
        myChart1.setOption(option1);
    }
    function ptStu() {
        var myChart6 = echarts.init(document.getElementById('teach'));
        myChart6.on('legendselectchanged', obj => {
            var options = myChart6.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
            }
            myChart6.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/stuStores", function(data){
            console.log(data)
            $("#allUser").text(data.allUser)
            option6  = {
                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.count,data.count1,data.count2,data.count3]
                    },
                    {
                        name: '日度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.dayData
                    }
                ]
            };
        });
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", $("#cCode").val())
        }
        ajax2.start()
        myChart6.setOption(option6);
    }
    function ptUser() {
        var myChart2 = echarts.init(document.getElementById('user'));
@@ -1051,12 +1172,107 @@
                ]
            };
        });
        ajax2.set("id",id)
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", id)
        }
        ajax2.start()
        myChart2.setOption(option2);
        myChart3.setOption(option3);
    }
    function ptCourse() {
        var myChart7 = echarts.init(document.getElementById('courseData'));
        myChart7.on('legendselectchanged', obj => {
            var options = myChart7.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
            }
            myChart7.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/courseStore", function(data){
            console.log(data)
            $("#allCourse").text("现有课时总量:"+data.allCourse+"小时")
            option7  = {
                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
                    }
                ]
            };
        });
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", $("#cCode").val())
        }
        ajax2.start()
        myChart7.setOption(option7);
    }
    function ptActivity() {
        var myChart4 = echarts.init(document.getElementById('activity'));
        var myChart5 = echarts.init(document.getElementById('prepare'));
@@ -1088,9 +1304,7 @@
            return;
        }
        var ajax2 = new $ax(Feng.ctxPath + "/data/actStore", function(data){
            $("#allHour").text(data.allHour)
            $("#allHours").text(data.allHour)
            option4 = {
                tooltip: {
                    trigger: 'axis'
@@ -1190,7 +1404,12 @@
                ]
            };
        });
        ajax2.set("id",id)
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", id)
        }
        ajax2.start()
        myChart4.setOption(option4);
        myChart5.setOption(option5);
@@ -1665,6 +1884,16 @@
    myChart.setOption(option);
    });
    $(function(){
        if($("#objectType").val()==3){
            ptCourse()
            ptActivity()
            ptUser()
            ptStu()
            tuifei()
            yytj()
            srtj()
        }
        var chartDom = document.getElementById('cookieCourse');
        var myChart = echarts.init(chartDom);
        var option;