Monica视频监控处理程序
xc
2021-04-29 e184f67a2bf120c12775a8b37d0e9c58735036e8
src/main/resources/public/js/jquery.progressTime.js
@@ -162,10 +162,16 @@
        typeof this.options.callback === "function" && this.options.callback(config);
    }
    ProgressTime.prototype.setTime = function (e) {
        var layerX = e && e.originalEvent.layerX;
        var type = e && e.type;
        var layerX= e && e.originalEvent.layerX;
        var type=e && e.type;;
        var tooltipTimestamp;
        if (e&&e.timer){
            let timer = new Date(formatDate(new Date(e.timer), "YYYY/MM/DD HH:00:00"));
            tooltipTimestamp=timer;
        }else {
            tooltipTimestamp = this.currentTimeTemp || this.currentTime.getTime(); // 返回当前的时间的时间戳
        }
        var hoursWidth = $("." + this.id + "-center-t-ul li")[0].getBoundingClientRect().width / 24; // 计算每个小时所占的宽度
        var tooltipTimestamp = this.currentTimeTemp || this.currentTime.getTime(); // 返回当前的时间的时间戳
        var num = Math.floor((tooltipTimestamp - this.startTime.getTime()) / hourTimestamp); // 计算出多少小时
        num = layerX !== undefined ? Math.round(layerX / hoursWidth) : num;
        var progressWidth = num * hoursWidth; // 计算出时间条的长度