| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179 | <!DOCTYPE html><html><head>    <meta charset="UTF-8" />    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no" />    <title>生产数据</title>    <link rel="stylesheet" type="text/css" href="../../css/api.css" />    <!--<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>-->    <link rel="stylesheet" type="text/css" href="../../css/popoPicker.css" />    <link rel="stylesheet" href="../../css/apiToast.css" />    <link rel="stylesheet" type="text/css" href="../../css/style.css" />    <link rel="stylesheet" href="../../css/projeck.css" />    <style>        body,        html {            background: #f3f3f3;        }        .api_layout {            /*border-top: 1px solid #37b0e9;*/            padding: 13px 10px;            -webkit-box-sizing: border-box;            -moz-box-sizing: border-box;            box-sizing: border-box;        }        .ventilate li .icon {            width: 40px;            height: 40px;            background: url('../../icon/fengshan.png') no-repeat;            background-size: cover;            position: absolute;            top: 0;            bottom: 5px;            left: 0;            right: 0;            margin: auto;        }        .ventilate li:nth-child(2) .icon {            width: 40px;            height: 40px;            background: url('../../icon/kj_ico.png') no-repeat;            background-size: cover;            position: absolute;            top: 0;            bottom: 5px;            left: 0;            right: 0;            margin: auto;        }        .ventilate li:nth-child(3) .icon {            width: 40px;            height: 40px;            background: url('../../icon/704_ico.png') no-repeat;            background-size: cover;            position: absolute;            top: 0;            bottom: 5px;            left: 0;            right: 0;            margin: auto;        }        .ventilate li:nth-child(4) .icon {            width: 40px;            height: 40px;            background: url('../../image/rubberTyredCar.png') no-repeat;            background-size: cover;            position: absolute;            top: 0;            bottom: 5px;            left: 0;            right: 0;            margin: auto;        }        .navs_item {            padding: 0;        }        .nav-btns li {            width: 25%;        }        .nav-btns .icon_p {            margin: auto;        }        .navs_item li:first-child:after {            height: 0;        }        .navs_item li:last-child:after {            height: 0;        }    </style></head><body>    <div class="api_layout">        <!-- 公告 -->        <div class="Notice1 borderRa">            <p class="Stitle">公告:</p>            <p class="Scontent Stitle"></p>        </div>        <!-- 导航 -->        <div class="navs Notice borderRa">            <ul class="navs_item nav-btns flex-start">                <li onclick="videoMonitor()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>视频监控</span>                </li>                <li onclick="personalLocationJu()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>人员定位</span>                </li>                <li onclick="securityMonitor()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>安全监测</span>                </li>                <li onclick="effectControl()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>生产统计</span>                </li>            </ul>            <ul class="navs_item nav-btns flex-start ventilate" style="padding-top: 15px;">                <li onclick="ventilate()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>风机监控</span>                </li>                <li onclick="Sewage()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>矿井水处理</span>                </li>                <li onclick="Face()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>704工作面</span>                </li>                <li onclick="rubberTyredCar()">                    <div class="icon_p">                        <i class="icon"></i>                    </div>                    <span>胶轮车监控</span>                </li>            </ul>        </div>        <!-- 报警 -->        <div class="Notice navs borderRa police beforS hide">            <p class="Stitle centertT" style="padding-bottom: 5px;">安全监测报警</p>            <ul class="navs_item flex-space">                <li>                    <span>二级报警</span>                    <div class="circular alarmNum1" onclick="securityMonitor()">                        0个                    </div>                </li>                <li>                    <span>三级报警</span>                    <div class="circular alarmNum2" onclick="securityMonitor()">                        0个                    </div>                </li>                <li>                    <span>四级报警</span>                    <div class="circular alarmNum3" onclick="securityMonitor()">                        0个                    </div>                </li>            </ul>        </div>        <!-- 瓦斯报警异常 -->        <div class="Notice borderRa beforS hide">            <p class="Stitle centertT">瓦斯异常情况</p>            <ul class="items flex-space centertT">                <li class="item" onclick="securityMonitor()">                    <span>报警</span>                    <p class="num Gasalarm">0个</p>                    <i class="imgIco"></i>                </li>                <li class="item" onclick="securityMonitor()">                    <span>断电</span>                    <p class="num duanDian">0个</p>                    <i class="imgIco"></i>                </li>                <li class="item" onclick="securityMonitor()">                    <span>故障</span>                    <p class="num guZhang">0个</p>                    <i class="imgIco"></i>                </li>            </ul>        </div>        <!-- 产量  进尺 -->        <div class="Notice borderRa beforS hide">            <p class="Stitle centertT">产量 进尺</p>            <div class="Chart flex-space">                <div style="width: 50%;" class="canvasParent centertT">                    <canvas id="yield" style="width: 100%; height: 140px;"></canvas>                    <span class="canvasTitle">今日产量</span>                </div>                <div class="centertT" style="width: 50%;">                    <canvas id="Footage" style="width: 100%; height: 140px;"></canvas>                    <span class="canvasTitle">今日掘进进尺</span>                </div>            </div>        </div>        <!-- 皮带秤 产量 -->        <div class="Notice borderRa beforS hide">            <p class="Stitle centertT">皮带秤小时产量</p>            <div class="" style="width: 100%;">                <canvas id="Belt" style="width: 100%; margin-top: 10px; height: 210px;"></canvas>            </div>        </div>        <!-- 销量 能耗 -->        <div class="Notice borderRa beforS hide">            <p class="Stitle centertT">销量 能耗</p>            <div class="Chart flex-space">                <div style="width: 50%;" class="canvasParent centertT">                    <canvas id="sales" style="width: 100%; height: 140px;"></canvas>                    <span class="canvasTitle">销量</span>                </div>                <div class="centertT" style="width: 50%;">                    <canvas id="energy" style="width: 100%; height: 140px;"></canvas>                    <span class="canvasTitle">能耗</span>                </div>            </div>        </div>        <!-- 隐患整治 三违 -->        <div class="Notice borderRa beforS hide">            <p class="Stitle centertT">隐患整治 三违</p>            <div class="Chart flex-space">                <div style="width: 50%;" class="canvasParent centertT">                    <canvas id="danger" style="width: 100%; height: 140px;"></canvas>                    <span class="canvasTitle">隐患整治</span>                </div>                <div class="centertT" style="width: 50%;">                    <canvas id="violation" style="width: 100%; height: 140px;"></canvas>                    <span class="canvasTitle">三违</span>                </div>            </div>        </div>        <!-- 一周产量 -->        <div class="Notice borderRa hide">            <!--<p class="Stitle flex-space">-->            <!--<span> 一周产量趋势</span>-->            <!--<!– <span style="font-size:14px" class="currentNum">当前下井人数:</span> –>-->            <!--</p>-->            <div class="Chart">                <div class="flex-start">                    <div class="relative Sharebox screen">                        <input id="button-value" class="js-picker" value="周产量趋势" />                        <i class="lower"></i>                    </div>                    <div class="selectTime hide">                        <input class="button-value startYear" value="" />                    </div>                    <div class="selectTime1 hide">                        <input class="button-value startTime" value="" />                    </div>                </div>                <div class="" style="width: 100%;">                    <canvas id="weekYield" style="width: 100%; margin-top: 10px; height: 210px;"></canvas>                </div>            </div>        </div>        <!-- 一周下井趋势 -->        <div class="Notice borderRa hide afterS">            <p class="Stitle flex-space">                <span> 一周下井趋势</span>                <span style="font-size: 14px;" class="currentNum"></span>            </p>            <div class="Chart">                <div class="" style="width: 100%;">                    <canvas id="downWell" style="width: 100%; margin-top: 10px; height: 210px;"></canvas>                </div>            </div>            <p class="centertT seachDetatle" onclick="personalLocationJu()">                查看详情            </p>        </div>    </div>    <script src="../../script/api.js"></script>    <script src="../../script/popoPicker.js"></script>    <script src="../../script/f2.js"></script>    <script src="../../script/config.js"></script>    <script>        var headers;        var apiToast = new apiToast();        apiready = function() {            var info = $api.getStorage('data'),                user = JSON.parse(info).data.user;            token = JSON.parse(info).data.access_token;            headers = {                Authorization: 'Bearer ' + token,            };            openSharebox(); //选择器            //公告            noticeFun();            // 图表权限            chartsJurisdiction();            // 监听切换tab标签,刷新页面            api.addEventListener({                    name: 'refreshProduction',                },                function(ret, err) {                    //公告                    noticeFun();                    // 图表权限                    chartsJurisdiction();                }            );        };        // 下拉刷新        function setCustomRefreshHeader() {            api.setRefreshHeaderInfo({                    bgColor: '#f2f2f2',                    textColor: '#000',                    textDown: '下拉刷新...',                    textUp: '松开刷新...',                },                function(ret, err) {                    //公告                    noticeFun();                    // 图表权限                    chartsJurisdiction();                }            );        }        // 打开视频权限        function videoMonitor() {            $http.fnReuestDataNologing(zaoquanUrlRouter.regionApi, headers, 'get', {show: 'must'}, function(ret, err) {                if (ret.code === 0) {                    apiToast.hide();                    $event.openWin(                        'videoMonitor',                        '../videoZaoquan/videoMonitor',                        '',                        ''                    );                } else if (ret.code === 1) {                    api.alert({                        title: '提示',                        msg: '该用户没有此权限',                    });                }            });        }        // 安全监测权限        function securityMonitor() {            $http                .requestData(zaoquanUrlRouter.securityJurisdiction, 'post', {show: 'must'})                .then((ret) => {                    if (ret.code === 0) {                        $event.openWin(                            'securityMonitor',                            '../productionDataZaoquan/securityMonitor',                            '',                            ''                        );                    } else if (ret.code === 1) {                        api.alert({                            title: '提示',                            msg: '该用户没有此权限',                        });                    }                })                .catch((err) => {});        }        // 人员定位权限        function personalLocationJu() {            $http                .requestData(zaoquanUrlRouter.personalLocation, 'post', {show: 'must'})                .then((ret) => {                    if (ret.code === 0) {                        $event.openWin(                            'persnoalLocation',                            '../productionDataZaoquan/persnoalLocation',                            '',                            ''                        );                    } else if (ret.code === 1) {                        api.alert({                            title: '提示',                            msg: '该用户没有此权限',                        });                    }                })                .catch((err) => {});        }        // 效能管控        function effectControl() {            $http                .requestData(zaoquanUrlRouter.efficacyShow, 'post', {show: 'must'})                .then((ret) => {                    if (ret.code === 0) {                        $event.openWin(                            'efficiencyWin',                            '../productionDataZaoquan/efficiencyWin',                            '',                            ''                        );                    } else if (ret.code === 1) {                        api.alert({                            title: '提示',                            msg: '该用户没有此权限',                        });                    }                })                .catch((err) => {});        }        // 风机监控        function ventilate() {            $event.openWin(                'ventilate_win',                '../productionDataZaoquan/ventilate_win',                '',                ''            );        }        // 矿井水处理        function Sewage() {            $event.openTabLayout(                'sewage',                '../productionDataZaoquan/sewage',                '矿井水处理',                ''            );        }        // 704工作面        function Face() {            $http                .requestData(zaoquanUrlRouter.working220704, 'post', {show: 'must'})                .then((ret) => {                    if (ret.code === 0) {                        $event.openTabLayout(                            'Face',                            '../704Zaoquan/704',                            '枣泉煤矿智能开采工作面',                            ''                        );                    } else if (ret.code === 1) {                        api.alert({                            title: '提示',                            msg: '该用户没有此权限',                        });                    }                })                .catch((err) => {});        }        // 胶轮车权限        function rubberTyredCar() {            $http                .requestData(zaoquanUrlRouter.transparentShow, 'post', {show: 'must'})                .then((ret) => {                    if (ret.code === 0) {                        $event.openTabLayout(                            'rubberTyredCar',                            '../productionDataZaoquan/rubberTyredCar',                            '胶轮车',                            ''                        );                    } else if (ret.code === 1) {                        api.alert({                            title: '提示',                            msg: '该用户没有此权限',                        });                    }                })                .catch((err) => {                  console.log(JSON.stringify(err));                });        }        // 生产图表权限        function chartsJurisdiction() {            $api.val($api.dom('#button-value'), '周产量趋势');            $api.addCls($api.dom('.selectTime1'), 'hide');            $api.addCls($api.dom('.selectTime'), 'hide');            $http.fnReuestDataNologing(                zaoquanUrlRouter.chartsJurisdiction,                headers,                'post',                {show: 'must'},                function(ret, err) {                    if (ret && ret.code === 0) {                        // 今日产量                        yieldFootage();                        footage();                        //一周的产量                        weekYield(false, 210);                        // 一周下井趋势                        downWellFun();                        // 报警                        getAlarmData();                        //瓦斯异常                        getGas();                        // 皮带称                        getBeltData();                        // 下拉刷新                        setCustomRefreshHeader();                        var Notice = $api.domAll('.Notice');                        for (var i = 0; i < Notice.length; i++) {                            $api.removeCls(Notice[i], 'hide');                        }                    } else if (ret && ret.code === 1) {                        api.alert({                            title: '提示',                            msg: '该用户没有此权限',                        });                    }                }            );        }        // 产量  进尺        function yieldFootage() {            $http                .requestData(zaoquanUrlRouter.getBanNowDayTotal, 'get', '')                .then((ret) => {                    if (ret && ret.status === 20000 && ret.data.length > 0) {                        api.refreshHeaderLoadDone();                        var data = [{                            x: '1',                            y: 75,                        }, ];                        var chart = new F2.Chart({                            id: 'yield',                            pixelRatio: window.devicePixelRatio,                        });                        chart.source(data, {                            y: {                                max: 100,                                min: 0,                            },                        });                        chart.axis(false);                        chart.tooltip(false);                        chart.coord('polar', {                            transposed: true,                            innerRadius: 0.92,                            radius: 0.99,                        });                        chart.guide().arc({                            start: [0, 0],                            end: [1, 99.98],                            top: false,                            style: {                                lineWidth: 8,                                stroke: '#ccc',                            },                        });                        chart.guide().text({                            position: ['50%', '50%'],                            content: Math.floor(ret.data[0].DayTotal / 1) + '吨',                            style: {                                fontSize: 16,                                fill: '#3d3c42',                            },                        });                        chart                            .interval()                            .position('x*y')                            .size(8)                            .animate({                                appear: {                                    duration: 1200,                                    easing: 'cubicIn',                                },                            })                            .color('#6C6F74');                        chart.render();                    }                })                .catch((err) => {});        }        function footage() {            $http.fnReuestDataNologing(                zaoquanUrlRouter.getSchedule,                'post',                '',                function(ret, err) {                    if (ret.code === 0 && ret) {                        // 进尺                        var data = [{                            x: '1',                            y: ret.data['tunnel'].reality,                        }, ];                        var chart = new F2.Chart({                            id: 'Footage',                            pixelRatio: window.devicePixelRatio,                        });                        chart.source(data, {                            y: {                                max: ret.data['tunnel'].plan,                                min: 0,                            },                        });                        chart.axis(false);                        chart.tooltip(false);                        chart.coord('polar', {                            transposed: true,                            innerRadius: 0.92,                            radius: 0.99,                        });                        chart.guide().arc({                            start: [0, 0],                            end: [1, ret.data['tunnel'].plan - 0.1],                            top: false,                            style: {                                lineWidth: 8,                                stroke: '#ccc',                            },                        });                        chart.guide().text({                            position: ['50%', '50%'],                            content: ret.data['tunnel'].today + '米',                            style: {                                fontSize: 16,                                fill: '#3d3c42',                            },                        });                        chart                            .interval()                            .position('x*y')                            .size(8)                            .animate({                                appear: {                                    duration: 1200,                                    easing: 'cubicIn',                                },                            })                            .color('#14D2B8');                        chart.render();                        // 销量                        var data1 = [{                            x: '1',                            y: ret.data['sales'].reality,                        }, ];                        var chartSales = new F2.Chart({                            id: 'sales',                            pixelRatio: window.devicePixelRatio,                        });                        chartSales.source(data1, {                            y: {                                max: ret.data['sales'].plan,                                min: 0,                            },                        });                        chartSales.axis(false);                        chartSales.tooltip(false);                        chartSales.coord('polar', {                            transposed: true,                            innerRadius: 0.92,                            radius: 0.99,                        });                        chartSales.guide().arc({                            start: [0, 0],                            end: [1, ret.data['sales'].plan - 0.1],                            top: false,                            style: {                                lineWidth: 8,                                stroke: '#ccc',                            },                        });                        chartSales.guide().text({                            position: ['50%', '50%'],                            content: ret.data['sales'].today + '吨',                            style: {                                fontSize: 16,                                fill: '#3d3c42',                            },                        });                        chartSales                            .interval()                            .position('x*y')                            .size(8)                            .animate({                                appear: {                                    duration: 1200,                                    easing: 'cubicIn',                                },                            })                            .color('#14D2B8');                        chartSales.render();                        // 能耗                        var data2 = [{                            x: '1',                            y: ret.data['energy'].reality,                        }, ];                        var chartEnergy = new F2.Chart({                            id: 'energy',                            pixelRatio: window.devicePixelRatio,                        });                        chartEnergy.source(data2, {                            y: {                                max: ret.data['energy'].plan,                                min: 0,                            },                        });                        chartEnergy.axis(false);                        chartEnergy.tooltip(false);                        chartEnergy.coord('polar', {                            transposed: true,                            innerRadius: 0.92,                            radius: 0.99,                        });                        chartEnergy.guide().arc({                            start: [0, 0],                            end: [1, ret.data['energy'].plan - 0.1],                            top: false,                            style: {                                lineWidth: 8,                                stroke: '#ccc',                            },                        });                        chartEnergy.guide().text({                            position: ['50%', '50%'],                            content: ret.data['energy'].today + '千瓦',                            style: {                                fontSize: 16,                                fill: '#3d3c42',                            },                        });                        chartEnergy                            .interval()                            .position('x*y')                            .size(8)                            .animate({                                appear: {                                    duration: 1200,                                    easing: 'cubicIn',                                },                            })                            .color('#FF8B8C');                        chartEnergy.render();                        // 隐患整治                        var data3 = [{                            x: '1',                            y: ret.data['danger'].reality,                        }, ];                        var chartDanger = new F2.Chart({                            id: 'danger',                            pixelRatio: window.devicePixelRatio,                        });                        chartDanger.source(data3, {                            y: {                                max: ret.data['danger'].plan,                                min: 0,                            },                        });                        chartDanger.axis(false);                        chartDanger.tooltip(false);                        chartDanger.coord('polar', {                            transposed: true,                            innerRadius: 0.92,                            radius: 0.99,                        });                        chartDanger.guide().arc({                            start: [0, 0],                            end: [1, ret.data['danger'].plan - 0.1],                            top: false,                            style: {                                lineWidth: 8,                                stroke: '#ccc',                            },                        });                        chartDanger.guide().text({                            position: ['50%', '50%'],                            content: ret.data['danger'].today + '个',                            style: {                                fontSize: 16,                                fill: '#3d3c42',                            },                        });                        chartDanger                            .interval()                            .position('x*y')                            .size(8)                            .animate({                                appear: {                                    duration: 1200,                                    easing: 'cubicIn',                                },                            })                            .color('#14D2B8');                        chartDanger.render();                        //三违                        var data4 = [{                            x: '1',                            y: ret.data['violation'].reality,                        }, ];                        var chartViolation = new F2.Chart({                            id: 'violation',                            pixelRatio: window.devicePixelRatio,                        });                        chartViolation.source(data4, {                            y: {                                max: ret.data['violation'].plan,                                min: 0,                            },                        });                        chartViolation.axis(false);                        chartViolation.tooltip(false);                        chartViolation.coord('polar', {                            transposed: true,                            innerRadius: 0.92,                            radius: 0.99,                        });                        chartViolation.guide().arc({                            start: [0, 0],                            end: [1, ret.data['violation'].plan - 0.1],                            top: false,                            style: {                                lineWidth: 8,                                stroke: '#ccc',                            },                        });                        chartViolation.guide().text({                            position: ['50%', '50%'],                            content: ret.data['violation'].today + '个',                            style: {                                fontSize: 16,                                fill: '#3d3c42',                            },                        });                        chartViolation                            .interval()                            .position('x*y')                            .size(8)                            .animate({                                appear: {                                    duration: 1200,                                    easing: 'cubicIn',                                },                            })                            .color('#FF8B8C');                        chartViolation.render();                    }                }            );        }        // 一周下井趋势        function downWellFun() {            $http                .requestData(zaoquanUrlRouter.downWellTotal, 'post', '')                .then((ret) => {                    if (ret && ret.code === 0) {                        api.refreshHeaderLoadDone();                        var data = ret.data;                        var chart = new F2.Chart({                            id: 'downWell',                            pixelRatio: window.devicePixelRatio,                        });                        chart.source(data, {                            pepole_num: {                                tickCount: 5,                            },                        });                        chart.tooltip({                            custom: false, // 自定义 tooltip 内容框                        });                        chart                            .interval()                            .position('dater*pepole_num')                            .color('classes')                            .adjust('stack');                        chart.render();                    }                })                .catch((err) => {});            //  当前人数            $http                .requestData(zaoquanUrlRouter.currentPersonalNum, 'post', '')                .then((ret) => {                    if (ret && ret.code === 0 && ret.data.length > 0) {                        $api.html(                            $api.dom('.currentNum'),                            '当前下井人数:' + ret.data[0].pepole_num + '人'                        );                    }                })                .catch((err) => {});        }        //一周的产量        function weekYield(transposed, height, type, startTime, endTime) {            if (type != '年产量趋势') {                var data = {                    dateTime: startTime,                    endTime: endTime,                };                $http                    .requestData(zaoquanUrlRouter.getBanDayList, 'get', data)                    .then((ret) => {                        if (ret && ret.status === 20000) {                            api.refreshHeaderLoadDone();                            var data = ret.data;                            var chart = new F2.Chart({                                id: 'weekYield',                                height: height,                                pixelRatio: window.devicePixelRatio,                            });                            chart.source(data, {                                banTotal2: {                                    tickCount: 5,                                },                            });                            chart.coord({                                transposed: transposed,                            });                            chart.tooltip({                                custom: false, // 自定义 tooltip 内容框                            });                            chart                                .interval()                                .position('curDT*total')                                .color('devName')                                .adjust('stack');                            chart.render();                        }                    })                    .catch((err) => {});            } else {                $http                    .requestData(zaoquanUrlRouter.getMonthSumByYear, 'get', {                        year: startTime,                    })                    .then((ret) => {                        if (ret && ret.status === 20000) {                            api.refreshHeaderLoadDone();                            var data = ret.data;                            var chart = new F2.Chart({                                id: 'weekYield',                                height: height,                                pixelRatio: window.devicePixelRatio,                            });                            chart.source(data, {                                banTotal2: {                                    tickCount: 5,                                },                            });                            chart.coord({                                transposed: transposed,                            });                            chart.axis('total', {                                line: null,                                grid: F2.Global._defaultAxis.grid,                                label: function label(text, index, total) {                                    var textCfg = {                                        text: text / 10000 + '万吨',                                    };                                    if (index === 0) {                                        textCfg.textAlign = 'right';                                    } else if (index === total - 1) {                                        textCfg.textAlign = 'right';                                    } else {                                        textCfg.textAlign = 'right';                                    }                                    return textCfg;                                },                            });                            chart                                .interval()                                .position('month*total')                                .color('devName')                                .adjust('stack');                            chart.render();                        }                    });            }        }        //  公告        function noticeFun() {            $http                .requestData(zaoquanUrlRouter.getBulletin, 'post', '')                .then((ret) => {                    if (ret && ret.code === 0) {                        api.refreshHeaderLoadDone();                        $api.html(                            $api.dom('.Scontent'),                            ret.data.content == '' ? '暂无公告' : ret.data.content                        );                    }                });        }        // 报警        function getAlarmData() {            $http                .requestData(zaoquanUrlRouter.getAlarmData, 'post', '')                .then((ret) => {                    if (ret && ret.code === 0) {                        $api.html($api.dom('.alarmNum1'), ret.data.level2 + '个');                        $api.html($api.dom('.alarmNum2'), ret.data.level3 + '个');                        $api.html($api.dom('.alarmNum3'), ret.data.level4 + '个');                    }                })                .catch((err) => {});        }        // 瓦斯异常情况        function getGas() {            $http                .requestData(zaoquanUrlRouter.getGasData, 'post', '')                .then((ret) => {                    if (ret && ret.code === 0) {                        $api.html($api.dom('.Gasalarm'), ret.data[0].count + '个');                        $api.html($api.dom('.duanDian'), ret.data[1].count + '个');                        $api.html($api.dom('.guZhang'), ret.data[2].count + '个');                    }                })                .catch((err) => {});        }        // 选择时间        function openSharebox() {            var myDate = new Date();            var tYear = myDate.getFullYear();            var tmonth = myDate.getMonth() + 1;            $api.val($api.dom('.startYear'), tYear + '年');            $api.val(                $api.dom('.startTime'),                tYear + '-' + (tmonth < 10 ? 0 + '' + tmonth : tmonth)            );            new popoPicker('.js-picker', {                container: '.screen',                wheels: [{                    infinite: false,                    //selected: 3,                    data: [{                        value: 0,                        display: '周产量趋势'                    }, {                        value: 1,                        display: '月产量趋势'                    }, {                        value: 2,                        display: '年产量趋势'                    }, ],                }, ],                background: 'light',                save: function(data) {                    switch (data.result[0].display) {                        case '周产量趋势':                            $api.addCls($api.dom('.selectTime1'), 'hide');                            $api.addCls($api.dom('.selectTime'), 'hide');                            weekYield(false, 210);                            break;                        case '月产量趋势':                            $api.removeCls($api.dom('.selectTime1'), 'hide');                            $api.addCls($api.dom('.selectTime'), 'hide');                            weekYield(                                true,                                700,                                '',                                tYear +                                '-' +                                (tmonth < 10 ? 0 + '' + tmonth + '-' + 0 + '' + 1 : tmonth),                                tYear +                                '-' +                                (tmonth < 10 ? 0 + '' + tmonth + '-' + 31 : tmonth),                                ''                            );                            break;                        case '年产量趋势':                            $api.addCls($api.dom('.selectTime1'), 'hide');                            $api.removeCls($api.dom('.selectTime'), 'hide');                            weekYield(false, 300, data.result[0].display, tYear);                            break;                        default:                    }                },            });            new popoDate('.startTime', {                container: '.selectTime1',                background: 'light',                save: function(data) {                    weekYield(true, 700, '', data + '-' + 0 + '' + 1, data + '-' + 31);                },            });            new popoYear('.startYear', {                container: '.selectTime',                background: 'light',                save: function(data) {                    $api.val($api.dom('.startYear'), data + '年');                    weekYield(false, 300, '年产量趋势', data);                },            });        }        // 皮带称数据        function getBeltData() {            $http                .requestData(zaoquanUrlRouter.getDayHourTotal, 'get', '')                .then((ret) => {                    if (ret.status === 20000) {                        var data = ret.data;                        var chart = new F2.Chart({                            id: 'Belt',                            pixelRatio: window.devicePixelRatio,                        });                        chart.source(data, {                            time: {                                type: 'timeCat',                                mask: 'hh:mm',                                tickCount: 5,                                range: [0, 1],                            },                        });                        chart.tooltip({                            showCrosshairs: true,                            showItemMarker: false,                            onShow: function onShow(ev) {                                var items = ev.items;                                items[0].name = null;                                items[0].value = items[0].value + '吨';                            },                        });                        chart.axis('day', {                            label: function label(text, index, total) {                                var textCfg = {};                                if (index === 0) {                                    textCfg.textAlign = 'left';                                } else if (index === total - 1) {                                    textCfg.textAlign = 'right';                                }                                return textCfg;                            },                        });                        if (ret.data.length != 0) {                            chart.legend({                                custom: true,                                itemWidth: null,                                nameStyle: {                                    textAlign: 'middle',                                    fontSize: '14',                                    textBaseline: 'middle',                                },                                items: [{                                    name: '皮带秤',                                    marker: {                                        symbol: 'circle',                                        radius: 5,                                        fill: ret.data[ret.data.length - 1].runState === 'Stop' ?                                            '#E74C3C' :                                            '#2ECC71',                                    },                                }, ],                            });                        }                        chart.line().position('time*total').shape('smooth');                        chart.point().position('time*total').shape('smooth').style({                            stroke: '#fff',                            lineWidth: 1,                        });                        chart.render();                    }                })                .catch((err) => {});        }    </script></body></html>
 |