| | |
| | | |
| | | //渲染记录 |
| | | ajaxListRecord(); |
| | | |
| | | //渲染抓拍图 |
| | | ajaxSnapImg(); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 请求图表信息 |
| | | */ |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | */ |
| | | 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) { |
| | |
| | | $("#record_time4").text("----"); |
| | | $("#record_content4").text("检测重量为---- KG,实际重量为---- KG,误差小于-%。"); |
| | | } |
| | | |
| | | //渲染抓拍图 |
| | | ajaxSnapImg(); |
| | | } |
| | | |
| | | /** |
| | |
| | | $("#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温度走势图 |
| | |
| | | type: 'value', |
| | | name: '数量 (KG)', |
| | | min: 0, |
| | | max: 3000000, |
| | | // max: 3000000, |
| | | axisLabel: { |
| | | formatter: '{value} KG' |
| | | } |
| | |
| | | window.addEventListener('resize', function () { |
| | | temperatureChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function shoTips(msg) { |
| | | layer.msg(msg, |
| | | {time: 3000, shift: 5, offset: "rb"}, |
| | | function () { |
| | | }); |
| | | } |