IOA IQ

route the route

目前为 2025-01-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         IOA IQ
// @namespace    https://www.conanluo.com/
// @version      1.2.10
// @description  route the route
// @author       Conan
// @match        https://*.itinerisonline.com/*
// @require      https://code.jquery.com/jquery-2.2.4.min.js
// @ require      https://work.conanluo.com/prts_info.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=itinerisonline.com
// @grant        none
// ==/UserScript==

(function(){

    let drivers={
        29714:{name:"Wilson",route:"12"},
        25937:{name:"Bert",route:"10"},
        30094:{name:"Lok",route:"3"},
        29757:{name:"Zhong",route:"7"},
        24954:{name:"Mauricio",route:"2"},
        27707:{name:"Raymond",route:"9"},
        30263:{name:"Jabari",route:"8"},
        30125:{name:"Jerry",route:"5"},
        25442:{name:"Walter",route:"6"},
        13395:{name:"Ken",route:"1"},
        30269:{name:"Jackie",route:"4"},
        22836:{name:"Joe",route:"MV"},
        
    }

    /****************************
    frame changed. begin
    *****************************/
    //setup top button
    let topBtn=`
    <nav id='topBtnDiv'>
    <button id='hightLightRoute' class='btn btn-success'>hightLightRoute</button>
    <button id='popPmRoute' class='btn btn-danger'>popPmRoute</button>
    <button id='clearDeadPixel' class='btn btn-warning' onclick="$('#timelineCurrentTime').hide();">clearDeadPixel</button>
    <button id='mainPage0' class='btn btn-primary goToPage'>createSchedule</button>
    <button id='mainPage1' class='btn btn-primary mainUse goToPage'>todayRoute1</button>
    <button id='mainPage2' class='btn btn-primary mainUse goToPage'>todayRoute2</button>
    </nav>
    `;
    $("body").prepend(topBtn);

    //set up the listenner for each top button
    //
    $(".goToPage").click(function(){
        let flag=this.id.replace("mainPage","");
        top.location=getMainUrl(getToday(),flag);
        location.reload();
    })

    $("#hightLightRoute").click(function(){
        resetRouteFrame()
    })



    /****************************
    frame changed. begin
    *****************************/
    /*
    resetRoute
    */
    function resetRouteFrame(){
        $(".vehicle-group").each(function(){
            let id=$(this).attr("id");
            let driverID=id.split("@")[0];
            //$(this).perpend(`<span color='orange'>465456</span>`)
            if(driverID)$(this).find("span").first().html(
                `<font style='font-size:20px;color:DarkMagenta'>Route ${drivers[driverID].route}</font>&nbsp;&nbsp;&nbsp;&nbsp;
                 <font color="6495ED" style="font-size:17px;background:lightgrey">${drivers[driverID].name}<br></font>`)
        })
    }


    /**************
    hide unwanted elements
    **************/
    $(".fa-toggle-down").click()

    /**************
    **************/
    setTimeout(function(){
        resetRouteFrame()

        $(".fa-toggle-down").click()
    },1000);

    /****************************
    Functions Begin
    *****************************/
    /**
    *getMainUrl, return the Link back to main-use page -> /affiliate/#/admin/schedule
    */
    function getMainUrl(today,flag){
        let billToId=flag<=1?"490078":"490078,%20294341";
        let returnString=""
        console.log(billToId)
        if(flag>=1) returnString =`/affiliate/#/admin/schedule?serviceDate=${today.year}-${today.month}-${today.day}&division=ca04&billToId=${billToId}&billToCustomQuery=`;
        else if(flag==0) returnString = `/affiliate/#/trip-import?billToId=${billToId}&popOutCode=true`
        return returnString
    }

    function getToday(){
        let today=new Date(),
        mMonth=today.getMonth()+1,
        mDay=today.getDate(),
        mYear=today.getFullYear();

        mMonth = mMonth<10?"0"+mMonth:mMonth;
        mDay = mDay<10?"0"+mDay:mDay;

        return {"year":mYear,"month":mMonth,"day":mDay}
    }
})()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址