#
luxiaotao1123
2020-11-17 b621bb1034544a8c3c90257c96e4a1460747aa6d
src/main/webapp/views/monitor/monitor.html
@@ -367,9 +367,13 @@
    };
    var data = [];
//    折线图
    let lineCharts = echarts.init(document.getElementById('line-charts'));
    lineChartOption = {
    /***********************************************************************************/
    /************************************* 折线图 ***************************************/
    /***********************************************************************************/
    var lineCharts = echarts.init(document.getElementById('line-charts'));
    var lineChartOption = {
        // animation: false,
        grid: {
            top: '0%',
@@ -434,11 +438,39 @@
        }]
    };
    lineCharts.setOption(lineChartOption);
    // 访问量报表加载
    function initlinChart() {
        var reportView = lineChartOption;
        var xAxisDate = [];
        var seriesDate=[];
        $.ajax({
            url: baseUrl+"/monitor/pakin/rep",
            method: 'GET',
            success: function (res) {
                if (res.code === 200){
                    var json = res.data;
                    for (var i = 0; i < json.length; i++) {
                        xAxisDate[i]=json[i].node;
                        seriesDate[i]=json[i].val;
                    }
                    reportView.xAxis.data=xAxisDate;
                    reportView.series[0].data=seriesDate;
                    lineCharts.setOption(reportView)
                } else if (res.code === 403){
                    top.location.href = "/";
                } else {
                    layer.msg(res.msg);
                }
            }
        });
    }
//    饼图
    let pieCharts = echarts.init(document.getElementById('pie-charts'));
    pieChartOption = {
    /***********************************************************************************/
    /************************************* 饼图 *****************************************/
    /***********************************************************************************/
    var pieCharts = echarts.init(document.getElementById('pie-charts'));
    var pieChartOption = {
        // animation: false,
        grid: {
            top: '0%',
@@ -454,7 +486,7 @@
        legend: {
            orient: 'vertical',
            left: 10,
            data: ['1', '2', '3']
            data: ['在库库位', '空库位', '使用库位', '禁用库位']
        },
        series: [
            {
@@ -477,9 +509,10 @@
                    show: false
                },
                data: [
                    {value: 335, name: '1'},
                    {value: 310, name: '2'},
                    {value: 234, name: '3'},
                    {value: 1, name: '在库库位'},
                    {value: 1, name: '空库位'},
                    {value: 1, name: '使用库位'},
                    {value: 1, name: '禁用库位'},
                ],
                itemStyle: {
                    emphasis: {
@@ -500,7 +533,24 @@
            }
        ]
    };
    pieCharts.setOption(pieChartOption);
    // pieCharts.setOption(pieChartOption)
    // 饼图加载
    function initPieChart() {
        $.ajax({
            url: baseUrl+"/monitor/loc/rep",
            method: 'GET',
            success: function (res) {
                if (res.code === 200){
                    pieChartOption.series[0].data = res.data;
                    pieCharts.setOption(pieChartOption)
                } else if (res.code === 403){
                    top.location.href = "/";
                } else {
                    layer.msg(res.msg);
                }
            }
        });
    }
</script>
</html>