var normal = '
' var abnormal = '' var offline = ' 离线' var online = ' 在线' function getCims() { $.ajax({ url: "/Cim/GetCims", method: "GET", headers: { "Content-Type": "application/json" }, async: true, data: { isShowError: $("#isShowError").prop("checked") }, success: function (result) { if (result.code === 0) { $("#cims").html(""); for (var i = 0; i < result.data.length; i++) { var html = "" + result.data[i].topic + "
"; $("#changeShift").append(html); } } } }); } $("#isShowError").change(function () { getCims(); }); function Init() { getCims(); getChangeShifts(); } Init(); setInterval(Init, 10000); function modal_issued_show() { $("#modal_issued").modal("show"); } var zTreeObj; var setting = { check: { enable: true } }; $.ajax({ url: "/ProductionLine/GetProductionLineMachineTree", type: "GET", async: true, success: function (zNodes) { zTreeObj = $.fn.zTree.init($("#productionLineTree"), setting, zNodes); } }); function setEap() { var nodes = zTreeObj.getCheckedNodes(true); if (nodes.length === 0) { alert("请勾选设备!"); return; } var ids = new Array(); for (var i = 0; i < nodes.length; i++) { if (nodes[i].level === 1) { ids.push(nodes[i].id); } } if (ids.length === 0) { alert("请勾选设备!"); return; } var ip = $("#eapIp").val(); var port = $("#eapPort").val(); if (ip === "" || port === "") { alert("请填写 IP/Port!"); return; } $.ajax({ url: "/Cim/SetEAP", type: "POST", async: true, data: { "ids": ids.toString(), "ip": ip, "port": port }, success: function (rev) { alert(rev.message); } }); } function setEapIp() { var nodes = zTreeObj.getCheckedNodes(true); if (nodes.length === 0) { alert("请勾选设备!"); return; } var ids = new Array(); for (var i = 0; i < nodes.length; i++) { if (nodes[i].level === 1) { ids.push(nodes[i].id); } } if (ids.length === 0) { alert("请勾选设备!"); return; } var ip = $("#eapIp1").val(); if (ip === "") { alert("请填写 IP!"); return; } $.ajax({ url: "/Cim/SetEapIp", type: "POST", async: true, data: { "ids": ids.toString(), "ip": ip }, success: function (rev) { alert(rev.message); } }); } function setUpdateApp() { var nodes = zTreeObj.getCheckedNodes(true); if (nodes.length === 0) { alert("请勾选设备!"); return; } var ids = new Array(); for (var i = 0; i < nodes.length; i++) { if (nodes[i].level === 1) { ids.push(nodes[i].id); } } if (ids.length === 0) { alert("请勾选设备!"); return; } $.ajax({ url: "/Cim/UpdateApp", type: "POST", async: true, data: { "ids": ids.toString() }, success: function (rev) { alert(rev.message); } }); }