| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756 | 
//人员大数据统计function user() {    $.get('/api/Project/user',{orgid:orgid},function (data) {        if(data.status == 0){            if(data.data.length > 0){                // 保洁                var cleaning = echarts.init(document.getElementById('cleaning'));                cleaningOption = {                    color: ['#2b5e8e', '#40edfe'],                    title: {                        text: '保洁人员',                        textStyle: {                            color: '#fff',                            fontSize: 14,                        },                        y: 'center',                        x: 'right',                    },                    series: [{                        name: '保洁人员',                        type: 'pie',                        radius: ['70%', '80%'],                        avoidLabelOverlap: false,                        label: {                            normal: {                                show: false,                                position: 'center',                                textStyle: {                                    fontSize: 14,                                    color: '#eac304',                                },                                formatter: '{c}%'                            }                        },                        labelLine: {                            normal: {                                show: false                            }                        },                        data: [                            {                                value: 100 - data.data[2]['percent'],                                color: '#40edfe',                                label: {                                    normal: {                                        show: false                                    }                                }                            },                            {                                value: data.data[2]['percent'],                                color: '#2b5e8e',                                label: {                                    normal: {                                        show: true,                                        position: 'center',                                        textStyle: {                                            fontSize: 14,                                            color: '#eac304',                                        },                                        formatter: '{c}%'                                    }                                }                            }                        ]                    }]                };                cleaning.setOption(cleaningOption);                // 保安                var security = echarts.init(document.getElementById('security'));                securityOption = {                    color: ['#2b5e8e', '#40edfe'],                    title: {                        text: '保安人员',                        textStyle: {                            color: '#fff',                            fontSize: 14,                        },                        y: 'center',                        x: 'right',                    },                    series: [{                        name: '保安人员',                        type: 'pie',                        radius: ['70%', '80%'],                        avoidLabelOverlap: false,                        label: {                            normal: {                                show: true,                                position: 'center',                                textStyle: {                                    fontSize: 14,                                    color: '#eac304',                                },                                formatter: '{c}%'                            }                        },                        labelLine: {                            normal: {                                show: false                            }                        },                        data: [{                            value: 100 - data.data[3]['percent'],                            color: '#40edfe',                            label: {                                normal: {                                    show: false                                }                            }                        }, {                            value: data.data[3]['percent'],                            color: '#2b5e8e',                            label: {                                normal: {                                    show: true,                                    position: 'center',                                    textStyle: {                                        fontSize: 14,                                        color: '#eac304',                                    },                                    formatter: '{c}%'                                }                            }                        },                        ]                    }]                };                security.setOption(securityOption);                // 维修                var repair = echarts.init(document.getElementById('repair'));                repairOption = {                    color: ['#2b5e8e', '#40edfe'],                    title: {                        text: '维修人员',                        textStyle: {                            color: '#fff',                            fontSize: 14,                        },                        y: 'center',                        x: 'right',                    },                    series: [{                        name: '维修人员',                        type: 'pie',                        radius: ['70%', '80%'],                        avoidLabelOverlap: false,                        label: {                            normal: {                                show: true,                                position: 'center',                                textStyle: {                                    fontSize: 14,                                    color: '#eac304',                                },                                formatter: '{c}%'                            }                        },                        labelLine: {                            normal: {                                show: false                            }                        },                        data: [{                            value: 100 - data.data[1]['percent'],                            color: '#40edfe',                            label: {                                normal: {                                    show: false                                }                            }                        }, {                            value: data.data[1]['percent'],                            color: '#2b5e8e',                            label: {                                normal: {                                    show: true,                                    position: 'center',                                    textStyle: {                                        fontSize: 14,                                        color: '#eac304',                                    },                                    formatter: '{c}%'                                }                            }                        },                        ]                    }]                };                repair.setOption(repairOption);                // 运送                var transport = echarts.init(document.getElementById('transport'));                transportOption = {                    color: ['#2b5e8e', '#40edfe'],                    title: {                        text: '运送人员',                        textStyle: {                            color: '#fff',                            fontSize: 14,                        },                        y: 'center',                        x: 'right',                    },                    series: [{                        name: '运送人员',                        type: 'pie',                        radius: ['70%', '80%'],                        avoidLabelOverlap: false,                        label: {                            normal: {                                show: true,                                position: 'center',                                textStyle: {                                    fontSize: 14,                                    color: '#eac304',                                },                                formatter: '{c}%'                            }                        },                        labelLine: {                            normal: {                                show: false                            }                        },                        data: [{                            value: 100 - data.data[0]['percent'],                            color: '#40edfe',                            label: {                                normal: {                                    show: false                                }                            }                        }, {                            value: data.data[0]['percent'],                            color: '#2b5e8e',                            label: {                                normal: {                                    show: true,                                    position: 'center',                                    textStyle: {                                        fontSize: 14,                                        color: '#eac304',                                    },                                    formatter: '{c}%'                                }                            }                        },                        ]                    }]                };                transport.setOption(transportOption);            }        }    });}// 人员统计玫瑰图function personnel() {    $.get('/api/Project/personnel',{orgid:orgid},function (data) {        if(data.status == 0){            if(data.data.length > 0){                var personnel = echarts.init(document.getElementById('personnel'));                personnelOption = {                    color:['#fdd100','#ec5400','#40ebff','#ff4874'],                    tooltip : {                        trigger: 'item',                        formatter: "{a} <br/>{b} : {c} ({d}%)"                    },                    legend: {                        x : 'left',                        y : 'center',                        left: 50,                        textStyle: {                            color: '#fff',                            fontSize: 12,                        },                        orient: 'vertical',                        data:['保洁','保安','维修','运送']                    },                    calculable : true,                    series : [                        {                            name:'人员大数据统计',                            type:'pie',                            radius : [20, 70],                            center : ['60%', '50%'],                            roseType : 'radius',                            data:data.data,                            // data:[                            //     {value:30, name:'保洁'},                            //     {value:25, name:'保安'},                            //     {value:20, name:'维修'},                            //     {value:25, name:'运送'}                            // ],                            label: {                                formatter: '{b}{d}%',                                color: '#fff'                            }                        }                    ]                };                personnel.setOption(personnelOption);            }        }    });}// 工单统计function todo(type) {    $.get('/api/Project/todo',{orgid:orgid, type: type},function (data) {        if(data.status == 0){            if(data.data.list.length > 0){                var ordersChart = echarts.init(document.getElementById("orders"));                ordersOption = null;                ordersOption = {                    color:'#00c6ff',                    tooltip: {},                    dataset: {                        dimensions: ['day', '工单量'],                        source: data.data.list,                    },                    xAxis: {                        type: 'category',                        axisLabel: {                            color:'#fff',                        }                    },                    yAxis: {                        axisLabel: {                            color:'#fff',                        }                    },                    series: [                        {                            type: 'bar',                            barMaxWidth:'30',                            label: {                                normal: {                                    show: true,                                    position: 'top',                                    color: '#fff'                                }                            },                        }                    ]                };                if (ordersOption && typeof ordersOption === "object") {                    ordersChart.setOption(ordersOption, true);                }                $('.todo').removeClass('active');                $('#todo'+type).addClass('active');            }        }    });}//投诉大数据function complaintList() {    $.get('/api/Project/complaint',{orgid:orgid},function (res) {        if(res.status == 0) {            let list = res.data.data;            if (list.length > 0) {                var str = '';                for (var i in list){                    str += '<tr>';                    str += '<td class="table-project-name">' + list[i]['CONTENT'] + '</td>';                    str += '<td>' + list[i]['CREATTE_TIME'].replace(/(\d{4}).(\d{1,2}).(\d{1,2}).+/mg, '$1-$2-$3') + '</td>';                    // str += '<td>' + list[i]['REAL_NAME'].replace(/(?<=.)./g, '*') + '</td>';                    str += '</tr>';                }                $('#complaintList').html(str);            }        }    })}// 投诉图表function complaintChart() {    $.get('/api/Project/complaintChart',{orgid: orgid},function (data) {        if(data.status == 0){            if(data.data.x.length > 0){                var complaint = echarts.init(document.getElementById('complaint'));                complaintOption = null;                complaintOption = {                    color:'#2ca2fc',                    tooltip: {                        trigger: 'axis',                        axisPointer: {                            type: 'shadow'                        }                    },                    grid: {                        top: '3%',                        left: '3%',                        right: '4%',                        bottom: '0',                        // minHeight: 200,                        containLabel: true                    },                    xAxis: {                        type: 'value',                        boundaryGap: [0, 0.01],                        axisLabel: {                            color:'#fff',                        }                    },                    yAxis: {                        type: 'category',                        data: data.data.y,                        axisLabel: {                            color:'#fff',                        }                    },                    series: [                        {                            name: '投诉量',                            type: 'bar',                            barMaxWidth: 30,                            label: {                                normal: {                                    show: true,                                    position: 'right',                                    color: '#fff'                                }                            },                            data: data.data.x                        }                    ]                };                complaint.setOption(complaintOption);            }        }    });}//任务大数据监控function taskList() {    $.get('/api/Project/task',{orgid:orgid},function (res) {        if(res.status == 0) {            let list = res.data.data;            if (list.length > 0) {                var str = '';                for (var i in list){                    str += '<tr>';                    str += '<td class="table-project-name">' + list[i]['TITLE'] + list[i]['NAME'] + '</td>';                    str += '<td>' + list[i]['CREATE_TIME'].replace(/(\d{4}).(\d{1,2}).(\d{1,2}).+/mg, '$1-$2-$3') + '</td>';                    str += '<td>' + list[i]['NAME'] + '</td>';                    str += '</tr>';                }                $('#taskList').html(str);            }        }    })}function taskChart() {    $.get('/api/Project/taskChart',{orgid: orgid},function (data) {        if(data.status == 0){            if(data.data.x.length > 0){                var task = echarts.init(document.getElementById('task'));                taskOption = {                    color: ['#2ca2fc','#fdd100'],                    tooltip: {                        trigger: 'axis',                        axisPointer: {                            type: 'cross',                            crossStyle: {                                color: '#999'                            }                        }                    },                    grid: {                        top: '13%',                        left: '3%',                        right: '4%',                        bottom: '-2%',                        // minHeight: 120,                        containLabel: true                    },                    xAxis: [                        {                            type: 'category',                            data : data.data.x,                            axisPointer: {                                type: 'shadow'                            },                            axisLabel: {                                color:'#fff',                            }                        }                    ],                    yAxis: [                        {                            type: 'value',                            axisLabel: {                                formatter: '{value}',                                color:'#fff',                            },                            axisLine: {                                show: true,                                lineStyle: {                                    color: '#ccc'                                }                            }                        },                        // {                        //     type: 'value',                        //     axisLabel: {                        //         formatter: '{value} %',                        //         color:'#fff',                        //     },                        //     axisLine: {                        //         show: true,                        //         lineStyle: {                        //             color: '#ccc'                        //         }                        //     }                        // }                    ],                    series: [                        {                            name:'任务量',                            type:'bar',                            barWidth: 30,                            data: data.data.y1,                            label: {                                normal: {                                    show: true,                                    position: 'top',                                    color: '#fff'                                }                            },                        },                        // {                        //     name:'概率',                        //     type:'line',                        //     yAxisIndex: 1,                        //     data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2]                        // }                    ]                };                task.setOption(taskOption);            }        }    });}//安保function hiddenDangerChart() {    $.get('/api/Project/hiddenDangerChart',{orgid:orgid},function (data) {        if(data.status == 0){            if(data.data.x.length > 0){                var hiddenDanger = echarts.init(document.getElementById('hidden-danger'));                hiddenDangerOption = {                    color:['#2ca2fc','#ffcb1d'],                    tooltip : {                        trigger: 'axis',                        axisPointer : {                            type : 'shadow'                        }                    },                    grid: {                        top: '10%',                        left: '3%',                        right: '4%',                        bottom: '0',                        containLabel: true                    },                    xAxis:  {                        type: 'category',                        axisLabel:{                            show:true,                            inside:false,                            rotate:0,                            margin: 8,                            color:'#fff',                        },                        data: data.data.x,                    },                    yAxis: {                        type: 'value',                        axisLabel:{                            show:true,                            inside:false,                            rotate:0,                            margin: 8,                            color:'#fff',                        },                        // data: ['0','500','1000','1500','2000']                    },                    series: [                        {                            name: '隐患数量',                            type: 'bar',                            stack: '总量',                            barWidth:'30',                            radius: ['70%', '100%'],                            label: {                                normal: {                                    show: true,                                    position: 'insideRight'                                }                            },                            data: data.data.y1,                        },                        {                            name: '转工单量',                            type: 'bar',                            stack: '总量',                            label: {                                normal: {                                    show: true,                                    position: 'insideRight'                                }                            },                            data: data.data.y2,                        },                    ]                };                hiddenDanger.setOption(hiddenDangerOption);            }        }    });}// 安保表单function hiddenDangerList() {    $.get('/api/Project/hiddenDanger',{orgid:orgid},function (res) {        if(res.status == 0) {            let list = res.data.data;            if (list.length > 0) {                var str = '';                for (var i in list){                    if (list[i]['CURR_ORDER_MODE'] == 9 || list[i]['CURR_ORDER_MODE'] == 11) {                        str += '<tr style="color: #adff2f;">';                    } else {                        str += '<tr>';                    }                    str += '<td class="table-project-name">' + list[i]['TITLE'] + list[i]['NAME'] +'</td>';                    str += '<td>' + list[i]['CREATTE_TIME'].replace(/(\d{4}).(\d{1,2}).(\d{1,2}).+/mg, '$1-$2-$3') + '</td>';                    str += '<td>' + list[i]['REAL_NAME'] + '</td>';                    str += '</tr>';                }                $('#hiddenDangerList').html(str);            }        }    })}// 巡更function patrol() {    $.get('/api/Project/patrol',{orgid:orgid},function (res) {        if(res.status == 0) {            var list = res.data.data;            if (list != '') {                var str = '';                str += '<tr>';                str += '<td>' + list['NAME'] +'地点' + '</td>';                str += '<td>' + list['TITLE'] + '</td>';                str += '</tr>';                str += '<tr>';                str += '<td>' + list['NAME'] +'时间' + '</td>';                str += '<td>' + list['CREATE_TIME'].replace(/(\d{4}).(\d{1,2}).(\d{1,2}).+/mg, '$1-$2-$3') + '</td>';                str += '</tr>';                str += '<tr>';                str += '<td>' + list['NAME'] +'人员' + '</td>';                str += '<td>' + list['USER_NAME'] + '</td>';                str += '</tr>';                $('#patrol').html(str);                $('#patrol-addr').html(list['TITLE']);                $('#patrol-data-monitor').html(list['NAME']+'大数据监控');                $('#patrol-data-title').html('最新'+ list['NAME']+'记录');                var oImg = document.getElementById('patrol-img');                var arr = list['IMAGES'];                var num = 0;                num++;                if (num == arr.length) {                    num = 0;                }                oImg.src = arr[num];            }            setTimeout("patrol()", 15000);        }    })}var timer = 1000*60*30;todo(0);user();personnel();taskList();taskChart();complaintList();complaintChart();hiddenDangerList();hiddenDangerChart();patrol(); //巡更setInterval(function(){    user();    personnel();    taskList();    taskChart();    complaintList();    complaintChart();    hiddenDangerList();    hiddenDangerChart();}, timer);setInterval(function () {    setTimeout(function(){        todo(0);    },5000);    setTimeout(function(){        todo(1);    },10000);    setTimeout(function(){        todo(2);    },15000);},15000);function locationIicon() {    var id = document.getElementById("location-icon");    var photo=$(".location-icon img");    for(var i=0; photo.eq(i).val()==0;i++){        var left = Math.floor( Math.random() * 100 + 200 );        var top = Math.floor( Math.random() * 100 + 100);        photo.eq(i).css({            'position': 'absolute',            'left':left +'px',            'top' :top +'px',        });    }}setInterval(function () {    locationIicon();},5000);
 |