new Vue({
    el: '#all',
    data: function() {
        return {
            Big: {
                Man: 0,
                WoMan: 0
            },
            Middle: {
                Man: 0,
                WoMan: 0
            },
            Small: {
                Man: 0,
                WoMan: 0
            },
            token: "",
            url: window.tils.adminUrl + "/api",
            url1: "http://localhost:50011/api"
        }
    },

    mounted: function() {
        //班级运行情况
        this.token = sessionStorage.getItem("token"); //与API交互
        this.getData();
        this.changeWindow();
        this.navTo()
    },
    methods: {
        // 请求数据
        // request({
        //     type,
        //     url,
        //     data = {},
        //     headers = {
        //         'content-type': 'application/json',
        //         'Authorization': "Bearer " + this.token,
        //     }
        // }) {
        //     return new Promise(resolve => {
        //         $.ajax({
        //             type,
        //             url,
        //             data,
        //             headers,
        //             success(data) {
        //                 resolve(data);
        //             }
        //         });
        //     });
        // },
        changeWindow: function() {
            window.onresize = function() {
                setTimeout(function() {
                    window.location.reload();
                }, 200)
            }
        },
        navTo: function () {
            document.getElementById("html5").href = '/WebApp/EverydayData/wisdomMedic.html?EquipmentID=' + window.guid
            document.getElementById("html1").href = '/WebApp/EverydayData/everdayData.html?EquipmentID=' + window.guid
            document.getElementById("html2").href = '/WebApp/EverydayData/kindergartenThings.html?EquipmentID=' + window.guid
            document.getElementById("html3").href = '/WebApp/EverydayData/careEducation.html?EquipmentID=' + window.guid
            document.getElementById("html4").href = '/WebApp/EverydayData/homeInteraction.html?EquipmentID=' + window.guid
        },
        getData: function() {
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getsexratiostatistics", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            // console.log(data)
                            that.Small.Man = data.data.Small.Man
                            that.Small.WoMan = data.data.Small.WoMan
                            that.Middle.Man = data.data.Middle.Man
                            that.Middle.WoMan = data.data.Middle.WoMan
                            that.Big.Man = data.data.Big.Man
                            that.Big.WoMan = data.data.Big.WoMan
                        }

                    }
                );
            });
            that.charts1();
            that.charts2();
            that.charts3();
            that.charts4();
            that.charts5();
            that.charts6();
            that.charts7();
            that.charts8();
        },
        charts1: function() {
            let chartDom = document.getElementById('echarts2');
            let myChart = echarts.init(chartDom);
            let option;
            var dataAxis = ['托班', '小班', '中班', '大班'];
            var data1 = [0, 120, 250, 220];
            var data2 = [0, 140, 200, 300];
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getclasssizestatistics", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            data1 = data.data.Man
                            data2 = data.data.WoMan
                        }
                        option = {
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: {
                                    type: 'shadow'
                                },
                                formatter: function(params) {
                                    if (params[1]) {
                                        return params[0].name + "：" + "</br>" + params[1].seriesName + "：" + params[1].value + "人" + "</br>" + params[0].seriesName + "：" + params[0].value + "人"
                                    } else if (params[0]) {
                                        return params[0].name + "：" + "</br>" + params[0].seriesName + "：" + params[0].value + "人"
                                    }
                                },
                            },
                            legend: {
                                data: ['男', '女'],
                                orient: 'vertical',
                                x: 'right', //可设定图例在左、右、居中
                                y: 'center', //可设定图例在上、下、居中
                                padding: [0, 0, 0, 45], //可设定图例[距上方距离，距右方距离，距下方距离，距左方距离]
                                textStyle: {
                                    fontSize: 14, //字体大小
                                    color: '#ffffff' //字体颜色
                                }
                            },
                            xAxis: {
                                data: dataAxis,
                                axisLabel: {
                                    // inside: true,
                                    textStyle: {
                                        color: '#fff'
                                    }
                                },
                                axisTick: {
                                    show: false
                                },
                                axisLine: {
                                    show: false
                                },
                                z: 10
                            },
                            yAxis: {
                                type: 'value',
                                axisLine: {
                                    show: false
                                },
                                axisTick: {
                                    show: false
                                },
                                axisLabel: {
                                    formatter: "{value}人",
                                    color: '#fff'
                                },
                                splitLine: {
                                    lineStyle: {
                                        color: ['#081868'],
                                    }
                                },
                                splitNumber: 5,
                            },
                            series: [{
                                    name: "男",
                                    type: 'bar',
                                    showBackground: true,
                                    stack: '总量',
                                    barWidth: 30,
                                    // barMinHeight: 30,
                                    itemStyle: {
                                        normal: {
                                            color: new echarts.graphic.LinearGradient(
                                                0, 1, 0, 0, [
                                                    { offset: 0, color: '#0336FF' },
                                                    // { offset: 0.5, color: '#1dadee' },
                                                    { offset: 1, color: '#01B4FF' }
                                                ]
                                            ),
                                        },

                                    },
                                    emphasis: {
                                        itemStyle: {
                                            color: new echarts.graphic.LinearGradient(
                                                0, 1, 0, 0, [
                                                    { offset: 0, color: '#0336FF' },
                                                    // { offset: 0.5, color: '#1dadee' },
                                                    { offset: 1, color: '#01B4FF' }
                                                ]
                                            ),
                                        }
                                    },
                                    data: data1
                                },
                                {
                                    name: "女",
                                    type: 'bar',
                                    showBackground: true,
                                    stack: '总量',
                                    barWidth: 30,
                                    // barMinHeight: 30,
                                    itemStyle: {
                                        normal: {
                                            color: new echarts.graphic.LinearGradient(
                                                0, 1, 0, 0, [
                                                    { offset: 0, color: '#EF6E18' },
                                                    // { offset: 0.5, color: '#1dadee' },
                                                    { offset: 1, color: '#EF6E18' }
                                                ]
                                            ),
                                        },

                                    },
                                    emphasis: {
                                        itemStyle: {
                                            color: new echarts.graphic.LinearGradient(
                                                0, 1, 0, 0, [
                                                    { offset: 0, color: '#EF6E18' },
                                                    // { offset: 0.5, color: '#1dadee' },
                                                    { offset: 1, color: '#EF6E18' }
                                                ]
                                            ),
                                        }
                                    },
                                    data: data2
                                }
                            ]
                        };

                        option && myChart.setOption(option);
                    }
                );
            });
        },
        charts2: function() {
            let chartDom = document.getElementById('echarts3');
            let myChart = echarts.init(chartDom);
            let option;
            let tixindata = [
                { value: 0, name: '托班' },
                { value: 260, name: '小班' },
                { value: 450, name: '中班' },
                { value: 520, name: '大班' },
            ]
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getclasssizestatistics", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            tixindata[0].value = data.data.Toban
                            tixindata[1].value = data.data.Small
                            tixindata[2].value = data.data.Middle
                            tixindata[3].value = data.data.Big
                        }
                        option = {
                            tooltip: {
                                trigger: 'item',
                                formatter: function(params) {
                                    return params.data.name.split(" ")[0] + "：" + params.value + "人";
                                },
                            },
                            // title: {
                            //     text: '性别分布',
                            //     left:'1%',
                            //     top:"20%",
                            //     textStyle:{
                            //         //文字颜色
                            //         color:'#FFFFFF',
                            //         //字体风格,'normal','italic','oblique'
                            //         fontStyle:'normal',
                            //         //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
                            //         fontWeight:'bold',
                            //         //字体系列
                            //         fontFamily:'sans-serif',
                            //         //字体大小
                            // 　　　　 fontSize:18
                            //     }
                            // },
                            series: [{
                                type: 'pie',
                                radius: '42%',
                                center: ['50%', '50%'],
                                selectedMode: 'single',
                                data: tixindata,
                                minAngle: 5,
                                itemStyle: {
                                    normal: {
                                        color: function(params) {
                                            var colorList = ["#00CCFF", "#EF6E18", "#006fdd", "#74f3fd", "#1368bd", "#267afe", "#0067cd"]
                                            return colorList[params.dataIndex % colorList.length];
                                        },
                                        labelLine: {
                                            length: 20,
                                            length1: 10
                                        },
                                        label: {
                                            formatter: function(val) {
                                                var str = val.name + "-" + val.percent + "%"
                                                str = str.split("-").join("\n")
                                                    // var str = val.percent + "%"
                                                return str
                                            },
                                            rich: {
                                                value: {
                                                    width: 14,
                                                    align: 'left',
                                                }
                                            },
                                            textStyle: { color: '#FFFFFF', fontSize: "14" },

                                        },
                                    },
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                                        textColor: '#000'
                                    }
                                },
                                emphasis: {
                                    itemStyle: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });


        },
        charts3: function() {
            var chartDom = document.getElementById('echarts1');
            var myChart = echarts.init(chartDom);
            var option;
            var data1 = []
            var data2 = []
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getteacherstaffstatistics", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            data1 = data.data.Man
                            data2 = data.data.WoMan
                        }
                        option = {
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                                },
                                formatter: function(params) {
                                    if (params[1]) {
                                        return params[0].name + "：" + "</br>" + params[0].seriesName + "：" + params[0].value + "</br>" + params[1].seriesName + "：" + params[1].value
                                    } else if (params[0]) {
                                        return params[0].name + "：" + "</br>" + params[0].seriesName + "：" + params[0].value
                                    }
                                },
                            },
                            title: {
                                text: '人数',
                                left: '1%',
                                top: "5%",
                                textStyle: {
                                    //文字颜色
                                    color: '#FFFFFF',
                                    //字体风格,'normal','italic','oblique'
                                    fontStyle: 'normal',
                                    //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
                                    fontWeight: 'bold',
                                    //字体系列
                                    fontFamily: 'sans-serif',
                                    //字体大小
                                    　　　　fontSize: 18
                                }
                            },
                            legend: {
                                data: ['男性', '女性'],
                                orient: 'vertical',
                                x: 'right', //可设定图例在左、右、居中
                                y: 'center', //可设定图例在上、下、居中
                                padding: [0, 0, 0, 45], //可设定图例[距上方距离，距右方距离，距下方距离，距左方距离]
                                textStyle: {
                                    fontSize: 14, //字体大小
                                    color: '#ffffff' //字体颜色
                                }
                            },
                            grid: {
                                left: '3%',
                                right: '4%',
                                bottom: '10%',
                                containLabel: true
                            },
                            xAxis: [{
                                type: 'category',
                                data: ['专任教师', '兼代课', '保健医生', '保育员', '园长'],
                                axisTick: {
                                    alignWithLabel: true
                                },
                                axisLabel: {
                                    // inside: true,
                                    textStyle: {
                                        color: '#fff'
                                    }
                                },
                            }],
                            yAxis: [{
                                type: 'value',
                                axisLine: {
                                    show: false
                                },
                                axisTick: {
                                    show: false
                                },
                                axisLabel: {
                                    formatter: "{value}人",
                                    color: '#fff'
                                },
                                splitLine: {
                                    lineStyle: {
                                        color: ['#081868'],
                                    }
                                },
                            }],
                            series: [{
                                    name: '男性',
                                    type: "bar",
                                    barWidth: 20,
                                    barGap: "0%",
                                    itemStyle: {
                                        normal: {
                                            color: '#52C5FF',
                                               //柱状颜色
                                        }
                                    },
                                    data: data1
                                },
                                {
                                    name: '女性',
                                    type: "bar",
                                    barWidth: 20,
                                    barGap: "0%",
                                    itemStyle: {
                                        normal: {
                                            color: '#F45E23',
                                               //柱状颜色
                                        }
                                    },
                                    data: data2
                                }
                            ]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });


        },
        charts4: function() {
            var chartDom = document.getElementById('echarts4');
            var myChart = echarts.init(chartDom);
            var option;
            let dataStudent = [3, 4, 1, 1, 2, 3];
            let dataTeacher = [16, 73, 30, 5, 6, 5];
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getteachingstaffacademicanalysis", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            dataStudent = data.data.Administration ? data.data.Administration : [];
                            dataTeacher = data.data.Teacher ? data.data.Teacher : [];
                        }
                        option = {
                            color: ['#02dcfd', "#f96e00", "#0178e9", "rgb(255, 230, 88)", "#ff01ff", "#f9ad12"],
                            tooltip: {
                                trigger: 'axis'
                            },
                            legend: {
                                data: ["行政人员", '专任教师'],
                                y: "bottom",
                                textStyle: {
                                    color: '#5380b4'
                                }
                            },
                            grid: {
                                left: '1%',
                                right: '1%',
                                bottom: '10%',
                                containLabel: true
                            },
                            xAxis: {
                                type: 'category',
                                // boundaryGap:false,
                                axisLabel: {
                                    textStyle: {
                                        color: '#fff'
                                    },
                                },
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        color: ['#151d3d']
                                    }
                                },
                                data: ["高中", "大专", "本科", "硕士", "博士", "其他"]
                            },
                            yAxis: {
                                show: true,
                                type: 'value',
                                axisLabel: {
                                    formatter: "{value}人",
                                    color: '#fff'
                                },
                                splitLine: {
                                    lineStyle: {
                                        color: ['#151d3d']
                                    }
                                },
                            },
                            series: [{
                                    name: '行政人员',
                                    smooth: true,
                                    type: 'line',
                                    symbolSize: 1,
                                    data: dataStudent,
                                },
                                {
                                    name: '专任教师',
                                    smooth: true,
                                    type: 'line',
                                    symbolSize: 1,
                                    data: dataTeacher,
                                }
                            ]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });

        },
        charts5: function() {
            var chartDom = document.getElementById('echarts5');
            var myChart = echarts.init(chartDom);
            var option;
            var dataMan = [13, 10, 5, 7, 4, 6, 3, 2, 0]
            var dataWoman = [17, 25, 13, 20, 12, 19, 7, 6, 0]
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getteachingstaffagegroupanalysis", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            dataMan = data.data.Man
                            dataWoman = data.data.WoMan
                        }
                        option = {
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                                },
                                formatter: function(params) {
                                    if (params[1]) {
                                        return params[0].name + "：" + "</br>" + params[0].seriesName + "：" + params[0].value + "</br>" + params[1].seriesName + "：" + params[1].value
                                    } else if (params[0]) {
                                        return params[0].name + "：" + "</br>" + params[0].seriesName + "：" + params[0].value
                                    }
                                },
                            },
                            legend: {
                                data: ['男', '女'],
                                orient: 'vertical',
                                x: 'right', //可设定图例在左、右、居中
                                y: 'bottom', //可设定图例在上、下、居中
                                padding: [0, 0, 20, 45], //可设定图例[距上方距离，距右方距离，距下方距离，距左方距离]
                                textStyle: {
                                    fontSize: 14, //字体大小
                                    color: '#ffffff' //字体颜色
                                }
                            },
                            grid: {
                                left: '3%',
                                right: '12%',
                                bottom: '5%',
                                containLabel: true
                            },
                            xAxis: [{
                                type: 'category',
                                data: ['24以下', '25-29', '30-34', '35-39', '40-44', "45-49", '50-54', '55-59', '60以上'],
                                axisTick: {
                                    alignWithLabel: true
                                },
                                axisLabel: {
                                    // inside: true,
                                    textStyle: {
                                        color: '#fff'
                                    },
                                    interval: 0,
                                    rotate: 40
                                },
                            }],
                            yAxis: [{
                                type: 'value',
                                axisLine: {
                                    show: false,

                                },
                                axisTick: {
                                    show: false
                                },
                                axisLabel: {
                                    formatter: "{value}人",
                                    color: '#fff',
                                },
                                splitLine: {
                                    lineStyle: {
                                        color: ['#081868'],
                                    }
                                },

                            }],
                            series: [{
                                    name: '男',
                                    type: "bar",
                                    barWidth: 15,
                                    barGap: "0%",
                                    itemStyle: {
                                        normal: {
                                            color: '#52C5FF',
                                               //柱状颜色
                                        }
                                    },
                                    data: dataMan
                                },
                                {
                                    name: '女',
                                    type: "bar",
                                    barWidth: 15,
                                    barGap: "0%",
                                    itemStyle: {
                                        normal: {
                                            color: '#F45E23',
                                               //柱状颜色
                                        }
                                    },
                                    data: dataWoman
                                }
                            ]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });

        },
        charts6: function() {
            var chartDom = document.getElementById('echarts6');
            var myChart = echarts.init(chartDom);
            var option;
            let tixindata = [
                { value: 50, name: '男' },
                { value: 119, name: '女' },
            ]
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getteachingstaffagegroupanalysis", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            tixindata[0].value = data.data.ManNumber
                            tixindata[1].value = data.data.WoManNumber
                        }
                        option = {
                            tooltip: {
                                trigger: 'item',
                                formatter: function(params) {
                                    return params.data.name.split(" ")[0] + "：" + params.value + "人";
                                },
                            },
                            series: [{
                                type: 'pie',
                                radius: '42%',
                                center: ['40%', '40%'],
                                selectedMode: 'single',
                                data: tixindata,
                                minAngle: 5,
                                itemStyle: {
                                    normal: {
                                        color: function(params) {
                                            var colorList = ["#00CCFF", "#EF6E18", "#006fdd", "#74f3fd", "#1368bd", "#267afe", "#0067cd"]
                                            return colorList[params.dataIndex % colorList.length];
                                        },
                                        labelLine: {
                                            length: 8,
                                            length1: 5
                                        },
                                        label: {
                                            formatter: function(val) {
                                                // var str = val.name + "-" + val.percent + "%"
                                                // str = str.split("-").join("\n")
                                                var str = val.percent + "%"
                                                return str
                                            },
                                            rich: {
                                                value: {
                                                    width: 14,
                                                    align: 'left',
                                                }
                                            },
                                            textStyle: { color: '#FFFFFF', fontSize: "14" },

                                        },
                                    },
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                                        textColor: '#000'
                                    }
                                },
                                emphasis: {
                                    itemStyle: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });


        },
        charts7: function() {
            var chartDom = document.getElementById('echarts7');
            var myChart = echarts.init(chartDom);
            var option;
            let todayData = [200, 1000, 300, 12300]
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getschoolbuildinginfostatistics", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            todayData = data.data.Area
                        }
                        option = {
                            tooltip: {
                                trigger: 'axis',
                                //axisPointer: {
                                //    type: 'shadow'
                                //},
                                formatter: function(params) {
                                    return params[0].name + "：" + params[0].value + "m&sup2;";
                                },
                            },
                            legend: {
                                data: ['面积'],
                                orient: 'vertical',
                                x: 'right', //可设定图例在左、右、居中
                                y: 'top', //可设定图例在上、下、居中
                                padding: [45, 0, 0, 0], //可设定图例[距上方距离，距右方距离，距下方距离，距左方距离]
                                textStyle: {
                                    fontSize: 14, //字体大小
                                    color: '#ffffff' //字体颜色
                                }
                            },
                            grid: {
                                left: '4%',
                                right: '14%',
                                bottom: '3%',
                                containLabel: true
                            },
                            xAxis: {
                                show: false,
                            },
                            yAxis: {
                                type: 'category',
                                data: ['其他用房', '行政办公', '生活用房', '教学及辅助'],
                                axisLabel: {
                                    color: '#03d1f3'
                                },
                                splitLine: {
                                    lineStyle: {
                                        color: ['rgba(0,0,0,1)']
                                    }
                                },
                            },
                            series: [{
                                name: '面积',
                                type: 'bar',
                                barWidth: 15,
                                data: todayData,
                                //顶部数字展示pzr
                                itemStyle: {
                                    emphasis: {
                                        label: {
                                            show: true,
                                            position: "right",
                                            color: "#fff"
                                        }
                                    },
                                    normal: {
                                        color: ["#278cff"],
                                        label: {
                                            show: true,
                                            position: "right",
                                            color: "#fff"
                                        }
                                    }
                                },
                            }]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });

        },
        charts8: function() {
            var chartDom = document.getElementById('echarts8');
            var myChart = echarts.init(chartDom);
            var option;
            var dataAxis = ['活动室', '随眠室', '保健室', '图书室', '室外活动区域'];
            var data1 = [37, 30, 27, 5, 17];
            let that = this
            layui.config({
                base: "/webconfig/layuiJs/"
            }).use(['jquery', 'form', 'laydate', 'utils', 'basic', 'layui_list'], function() {
                AjaxGet(
                    that.url + "/admin/bigdata/getschoolbuildinginfostatistics", {
                        EquipmentID: window.guid
                    },
                    function(res) {
                        // console.log(res, 132)
                        var data = res
                        if (data.data) {
                            data1 = data.data.Room
                        }
                        option = {
                            tooltip: {
                                trigger: 'axis',
                                axisPointer: {
                                    type: 'shadow'
                                },
                                formatter: function(params) {
                                    return params[0].name + "：" + params[0].value
                                },
                            },
                            grid: {
                                left: '0%',
                                right: '0%',
                                bottom: '10%',
                                containLabel: true
                            },
                            legend: {
                                data: ['数量'],
                                orient: 'vertical',
                                x: 'right', //可设定图例在左、右、居中
                                y: 'top', //可设定图例在上、下、居中
                                padding: [30, 20, 0, 0], //可设定图例[距上方距离，距右方距离，距下方距离，距左方距离]
                                textStyle: {
                                    fontSize: 14, //字体大小
                                    color: '#ffffff' //字体颜色
                                }
                            },
                            xAxis: {
                                data: dataAxis,
                                axisLabel: {
                                    // inside: true,
                                    textStyle: {
                                        color: '#fff'
                                    }
                                },
                                axisTick: {
                                    show: true
                                },
                                axisLine: {
                                    show: true
                                },
                            },
                            yAxis: {
                                type: 'value',
                                splitNumber: 5,
                                axisLine: {
                                    show: false
                                },
                                axisTick: {
                                    show: false
                                },
                                axisLabel: {
                                    formatter: "{value}",
                                    color: '#fff'
                                },
                                splitLine: {
                                    lineStyle: {
                                        color: ['#081868'],
                                    }
                                },

                            },
                            series: [{
                                name: "数量",
                                type: 'bar',
                                showBackground: true,
                                stack: '总量',
                                barWidth: 30,
                                barMinHeight: 30,
                                color: ["#fb9232"],
                                data: data1
                            }]
                        };
                        option && myChart.setOption(option);
                    }
                );
            });
        }
    }
})