sgj
3 天以前 241d327e57cbfe504aa806c61aa22e6205706098
fzzy-igdss-web/src/main/resources/static/security/quantity.js
@@ -59,9 +59,6 @@
    //渲染记录
    ajaxListRecord();
    //渲染抓拍图
    ajaxSnapImg();
}
/**
@@ -83,7 +80,7 @@
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(data),
        success: function (result) {
            if (result.code != "SUCCESS") {
            if (result.code != "0000") {
                renderSnapImg();
            } else {
                fileRecord = result.data;
@@ -143,7 +140,6 @@
    }
}
/**
 * 请求图表信息
 */
@@ -158,7 +154,7 @@
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(data),
        success: function (result) {
            if (result.code != "SUCCESS") {
            if (result.code != "0000") {
                renderEcharts(null);
            } else {
                renderEcharts(result.data);
@@ -177,11 +173,11 @@
function renderEcharts(chartData) {
    var chart = hisChart;
    if (chartData && chartData.xaxis.length > 0 && chartData.seriesData.length > 0) {
        chart.option.xAxis.data = chartData.xaxis;
        chart.option.xAxis[0].data = chartData.xaxis;
        chart.option.series[0].data = chartData.seriesData;
        chart.chart.setOption(chart.option, true);
    } else {
        chart.option.xAxis.data = names;
        chart.option.xAxis[0].data = names;
        chart.option.series[0].data = data;
        chart.chart.setOption(chart.option, true);
    }
@@ -204,7 +200,7 @@
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(data),
        success: function (result) {
            if (result.code != "SUCCESS") {
            if (result.code != "0000") {
                renderListRecord();
            } else {
                listRecord = result.data;
@@ -223,9 +219,17 @@
 */
function renderListRecord() {
    if (!listRecord) return null;
    if (!listRecord) {
        //渲染抓拍图
        ajaxSnapImg();
        return null;
    }
    if (listRecord.length === 0) return null;
    if (listRecord.length === 0) {
        //渲染抓拍图
        ajaxSnapImg();
        return null;
    }
    var record = listRecord[0];
    if (record) {
@@ -271,6 +275,9 @@
        $("#record_time4").text("----");
        $("#record_content4").text("检测重量为---- KG,实际重量为---- KG,误差小于-%。");
    }
    //渲染抓拍图
    ajaxSnapImg();
}
/**
@@ -317,6 +324,68 @@
    $("#divPlugin2").html(html);
}
/**
 * 启动开始检测
 */
function checkStart() {
    if (!curCamera) {
        shoTips("请先选择设备!");
        return;
    }
    layer.msg("开始执行……");
    var data = {
        'depotId': curCamera.depotId
    };
    $.ajax({
        type: "POST",
        url: "/security/check-single",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(data),
        success: function (result) {
            if (result.code == "ORDER_SUCCESS") {
                shoTips("命令发生成功,请等待终端返回结果……");
            } else {
                shoTips("命令发送失败:" + result.msg);
            }
        },
        error: function () {
            shoTips("检测出现异常,执行失败!");
        }
    });
}
/**
 * 停止检测
 */
function checkStop() {
    if (!curCamera) {
        shoTips("请先选择仓库!");
        return;
    }
    layer.msg("开始执行……");
    var data = {
        'depotId': curCamera.depotId
    };
    $.ajax({
        type: "POST",
        url: "/security/check-stop",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(data),
        success: function (result) {
            if (result.code == "ORDER_SUCCESS") {
                shoTips("命令发生成功……");
            } else {
                shoTips("命令发送失败:" + result.msg);
            }
        },
        error: function () {
            shoTips("检测出现异常,执行失败!");
        }
    });
}
// 初始化ECharts温度走势图
function initEcharts(names, data) {
    // 初始化ECharts温度走势图
@@ -356,7 +425,7 @@
                type: 'value',
                name: '数量 (KG)',
                min: 0,
                max: 3000000,
                // max: 3000000,
                axisLabel: {
                    formatter: '{value} KG'
                }
@@ -389,4 +458,11 @@
    window.addEventListener('resize', function () {
        temperatureChart.resize();
    });
}
function shoTips(msg) {
    layer.msg(msg,
        {time: 3000, shift: 5, offset: "rb"},
        function () {
        });
}