index.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <script type="text/javascript" src="__static__/js/jquery-1.10.2.min.js"></script>
  6. <link rel="stylesheet" href="__static__/css/bootstrap.min.css">
  7. <script type="text/javascript" src="__static__/js/bootstrap.min.js"></script>
  8. <title></title>
  9. </head>
  10. <body>
  11. <div class="mainbox" style="padding: 20px;">
  12. <div class="page-toolbar">
  13. <div class="btn">
  14. <a href="{:url('add')}" class="btn btn-primary"><i class="aicon ai-tianjia"></i>注册设备</a>
  15. </div>
  16. </div>
  17. <form id="pageListForm">
  18. <div class="layui-form">
  19. <table class="table table-bordered table-striped " lay-even="" lay-skin="row">
  20. <thead>
  21. <th>设备号</th>
  22. <th>名称</th>
  23. <th>iot-id</th>
  24. <th>设备类型</th>
  25. <th>厂商名称</th>
  26. <th>设备型号</th>
  27. <th>安全设备</th>
  28. <th>添加时间</th>
  29. <th>功能</th>
  30. <th>操作</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. {volist name="data_list" id="vo"}
  35. <tr>
  36. <td>{$vo['device_id']}</td>
  37. <td class="font12">{$vo['name']}</td>
  38. <td>{$vo['iot_id']}</td>
  39. <td>{$vo['deviceType']}</td>
  40. <td>{$vo['manufacturerName']}</td>
  41. <td>{$vo['model']}</td>
  42. <td>{$vo['isSecure']}</td>
  43. <td>{$vo['addtime']}</td>
  44. <td>
  45. <a href="{:url('manage/add')}?deviceId={$vo['iot_id']}&IMEI={$vo['device_id']}" style="cursor: pointer;">下发命令</a>
  46. <a href="{:url('history')}?id={$vo['device_id']}">历史数据</a>
  47. </td>
  48. <td>
  49. <a onclick="status('{$vo['iot_id']}')" style="cursor: pointer;">状态</a>
  50. <a href="{:url('edit')}?id={$vo['id']}">编辑</a>
  51. <a onclick="del('{$vo['iot_id']}','{$vo['device_id']}')" style="cursor: pointer;">删除</a>
  52. </td>
  53. </tr>
  54. {/volist}
  55. </tbody>
  56. </table>
  57. {$pages}
  58. </div>
  59. </form>
  60. <script>
  61. function del(iot_id,device_id){
  62. var msg = "确定要删除该设备吗";
  63. if (confirm(msg)==true){
  64. window.location.href='{:url("delete")}?auth=xw12345&iot_id='+iot_id+'&device_id='+device_id;
  65. return true;
  66. }else{
  67. return false;
  68. }
  69. }
  70. function status(iot_id){
  71. $.post('{:url("status")}',{iot_id:iot_id},function(res){
  72. var res=JSON.parse(res);
  73. if(res.activated){
  74. alert("已绑定");
  75. }else{
  76. alert("未绑定");
  77. }
  78. });
  79. return false;
  80. }
  81. </script>
  82. </body>
  83. </html>