var majorId = 0; var time = new Date(); var t = ''; $(function() { window.onload = function() { setInterval(function() { var time = new Date(); // 程序计时的月从0开始取值后+1 var month = time.getMonth() + 1; var minutes = time.getMinutes(); var seconds = time.getSeconds(); var hours = time.getHours(); if (minutes < 10) { minutes = "0" + minutes } else { minutes } if (seconds < 10) { seconds = "0" + seconds } else { seconds } t = time.getFullYear() + "-" + month + "-" + time.getDate() + " " + hours + ":" + minutes + ":" + seconds; var str = '

当前时间:' + t + '

' $('#time').html(str) }, 1000); }; $('#start').on('click', function() { var arr = '

开始时间:' + t + '

' $('#start_time').html(arr) }) $('#end').on('click', function() { var arr = '

结束时间:' + t + '

' $('#end_time').html(arr) }) layui.use(["form", "table", "laypage", "layer", 'upload'], function() { var form = layui.form; var upload = layui.upload; var layer = layui.layer; //元器件id function getdevice_id() { fetchJSON("api/device/listAll?deviceType=2", {}, "get", function(bet) { if (bet.status === 0) { $("#device_id").empty(); $("#device_id").append($("