diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/IndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/IndexController.java index fc564e3..c7609c5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/IndexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/IndexController.java @@ -129,7 +129,7 @@ public class IndexController { public String getAlarmAmount(){ return "{\n" + " \"yAxis\": [\"设备高温\", \"设备振动\", \"烟雾火情\", \"环境大风\", \"测试一\", \"测试二\", \"测试三\", \"测试四\", \"测试五\", \"测试六\"],\n" - + " \"data\": [60, 132, 89, 100,15,23,22,60, 132, 89]\n" + + " \"data\": [60, 132, 89, 10,15,23,22,60, 132, 89]\n" + "}"; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java index 5812d6a..fd5cc08 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/iot/SensorSummaryController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.iot; +import com.alibaba.fastjson.JSONArray; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.controller.BaseController; @@ -10,9 +11,13 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; /** * 传感器汇总 @@ -34,343 +39,25 @@ public class SensorSummaryController extends BaseController { @GetMapping("/getSensorInfo") @ResponseBody public String getSensorInfo(){ - return "[{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "},{\n" + - "\t\"id\": 1,\n" + - "\t\"name\": 1521171180000,\n" + - "\t\"price\": \"fa fa-video-camera\",\n" + - "\t\"column1\": 2,\n" + - "\t\"column2\": \"监控界面\",\n" + - "\t\"column3\": \"M\",\n" + - "\t\"column4\": \"2\"\n" + - "}]"; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List sensorTableModelList = new ArrayList<>(); + for (int i =1;i<24;i++){ + sensorTableModel sensor = new sensorTableModel(); + sensor.setId(i); + sensor.setEdgeId(UUID.randomUUID().toString().substring(0,8)); + sensor.setSensorId(UUID.randomUUID().toString().substring(0,8)); + //生成随机数,带两位小数 + double a=Math.random()*10; + DecimalFormat df = new DecimalFormat( "0.00" ); + String str=df.format( a ); + sensor.setSensorData(new BigDecimal(str)); + sensor.setRssi(new BigDecimal(str)); + sensor.setCollectTime(simpleDateFormat.format(new Date())); + sensor.setMonitorLocation(i+"#监控点"); + sensorTableModelList.add(sensor); + } + + return JSONArray.toJSONString(sensorTableModelList); } @@ -378,145 +65,83 @@ public class SensorSummaryController extends BaseController { class sensorTableModel { - /** 用户ID */ - private int userId; + private int id; - /** 用户编号 */ - @Excel(name = "用户编号", cellType = Excel.ColumnType.NUMERIC) - private String userCode; + private String edgeId; - /** 用户姓名 */ - @Excel(name = "用户姓名") - private String userName; + private String sensorId; - /** 用户性别 */ - private String userSex; + private BigDecimal sensorData; - /** 用户手机 */ - @Excel(name = "用户手机") - private String userPhone; + private BigDecimal rssi; - /** 用户邮箱 */ - @Excel(name = "用户邮箱") - private String userEmail; + private BigDecimal voltage; - /** 用户余额 */ - @Excel(name = "用户余额", cellType = Excel.ColumnType.NUMERIC) - private double userBalance; + private String collectTime; - /** 用户状态(0正常 1停用) */ - private String status; + private String monitorLocation; - /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - - public sensorTableModel() - { - - } - - public sensorTableModel(int userId, String userCode, String userName, String userSex, String userPhone, - String userEmail, double userBalance, String status) - { - this.userId = userId; - this.userCode = userCode; - this.userName = userName; - this.userSex = userSex; - this.userPhone = userPhone; - this.userEmail = userEmail; - this.userBalance = userBalance; - this.status = status; - this.createTime = DateUtils.getNowDate(); - } - - public int getUserId() - { - return userId; - } - - public void setUserId(int userId) - { - this.userId = userId; - } - - public String getUserCode() - { - return userCode; + public int getId() { + return id; } - public void setUserCode(String userCode) - { - this.userCode = userCode; + public void setId(int id) { + this.id = id; } - public String getUserName() - { - return userName; + public String getEdgeId() { + return edgeId; } - public void setUserName(String userName) - { - this.userName = userName; + public void setEdgeId(String edgeId) { + this.edgeId = edgeId; } - public String getUserSex() - { - return userSex; + public String getSensorId() { + return sensorId; } - public void setUserSex(String userSex) - { - this.userSex = userSex; + public void setSensorId(String sensorId) { + this.sensorId = sensorId; } - public String getUserPhone() - { - return userPhone; + public BigDecimal getSensorData() { + return sensorData; } - public void setUserPhone(String userPhone) - { - this.userPhone = userPhone; + public void setSensorData(BigDecimal sensorData) { + this.sensorData = sensorData; } - public String getUserEmail() - { - return userEmail; + public BigDecimal getRssi() { + return rssi; } - public void setUserEmail(String userEmail) - { - this.userEmail = userEmail; + public void setRssi(BigDecimal rssi) { + this.rssi = rssi; } - public double getUserBalance() - { - return userBalance; + public BigDecimal getVoltage() { + return voltage; } - public void setUserBalance(double userBalance) - { - this.userBalance = userBalance; + public void setVoltage(BigDecimal voltage) { + this.voltage = voltage; } - public String getStatus() - { - return status; + public String getCollectTime() { + return collectTime; } - public void setStatus(String status) - { - this.status = status; + public void setCollectTime(String collectTime) { + this.collectTime = collectTime; } - public Date getCreateTime() - { - return createTime; + public String getMonitorLocation() { + return monitorLocation; } - public void setCreateTime(Date createTime) - { - this.createTime = createTime; + public void setMonitorLocation(String monitorLocation) { + this.monitorLocation = monitorLocation; } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java index 6767417..b272b98 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java @@ -95,9 +95,7 @@ public class SysIndexController extends BaseController public JsonRootBean menuInfo(){ List menus = menuService.selectVisualMenusByUser(getSysUser()); - List firstMenu = menus.stream().filter(x->x.getParentId()==1112).collect(Collectors.toList()); - JsonRootBean jsonResult = new JsonRootBean(); List> urlResult = new ArrayList<>(); List menuStrList = new ArrayList<>(); @@ -122,50 +120,8 @@ public class SysIndexController extends BaseController menuStrList.add(new MenuStr(menu.getMenuName(),new ArrayList())); } } - - /*urlResult.add(new ArrayList(){{ - this.add("/iot/index"); - }}); - urlResult.add(new ArrayList(){{ - this.add("/sections/substation"); - this.add("/sections/substation"); - this.add("/sections/substation"); - this.add("/sections/substation"); - this.add("/sections/substation"); - this.add("/sections/substation"); - }}); - urlResult.add(new ArrayList(){{ - this.add("/sections/transformer-detail"); - this.add("/sections/transformer-detail"); - this.add("/sections/transformer-detail"); - this.add("/sections/transformer-detail"); - this.add("/sections/transformer-detail"); - this.add("/sections/transformer-detail"); - }}); - urlResult.add(new ArrayList(){{ - this.add("/iot/sensorSummary"); - }}); - menuStrList.add(new MenuStr("监控主页",new ArrayList())); - menuStrList.add(new MenuStr("智慧场景",new ArrayList(){{ - this.add("变压器监控单元"); - this.add("隔离开关监控单元"); - this.add("电流互感器监控单元"); - this.add("电压互感器监控单元"); - this.add("电容电抗器监控单元"); - this.add("避雷器监控单元"); - }})); - menuStrList.add(new MenuStr("设备监测",new ArrayList(){{ - this.add("变压器设备"); - this.add("隔离开关设备"); - this.add("电流互感器设备"); - this.add("电压互感器设备"); - this.add("电容电抗器设备"); - this.add("避雷器设备"); - }})); - menuStrList.add(new MenuStr("传感器汇总",new ArrayList()));*/ jsonResult.setUrl(urlResult); jsonResult.setMenuStr(menuStrList); - System.out.println("测试:"+JSONArray.toJSONString(jsonResult)); return jsonResult; } diff --git a/ruoyi-admin/src/main/resources/static/css/lot-ui/Iot-sensorSummaryStyle.css b/ruoyi-admin/src/main/resources/static/css/lot-ui/Iot-sensorSummaryStyle.css index e3493d4..391179e 100644 --- a/ruoyi-admin/src/main/resources/static/css/lot-ui/Iot-sensorSummaryStyle.css +++ b/ruoyi-admin/src/main/resources/static/css/lot-ui/Iot-sensorSummaryStyle.css @@ -33,6 +33,10 @@ span{ border: 0px solid #7FFFD4; width: 80.3%; left: 18.5%; + + overflow-x: hidden; + overflow-y: auto; + position: absolute; } .searchBox { @@ -70,7 +74,7 @@ span{ .sensorDataTable { height: 88%; - top: 9%; + top: 10%; color: #ddd; } @@ -83,6 +87,14 @@ span{ border: 1px solid #03A6BE; } +.table-bordered>thead>tr>th, .table-bordered>thead>tr>th { + border: 1px solid #03A6BE; +} + +.table>caption+thead>tr:first-child>td, .table>caption+thead>tr:first-child>th, .table>colgroup+thead>tr:first-child>td, .table>colgroup+thead>tr:first-child>th, .table>thead:first-child>tr:first-child>td, .table>thead:first-child>tr:first-child>th { + border: 1px solid #03A6BE; +} + .float-left{ border: 0px solid #ddd; bottom: 3%; @@ -98,4 +110,8 @@ span{ position: fixed; margin-top: 30px; right:1%; +} + +.fixed-table-pagination{ + padding-top: 20px; } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/css/lot-ui/zTree.css b/ruoyi-admin/src/main/resources/static/css/lot-ui/zTree.css new file mode 100644 index 0000000..3adb7d1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/static/css/lot-ui/zTree.css @@ -0,0 +1,90 @@ +/*------------------------------------- +zTree Style + +version: 3.5.19 +author: Hunter.z +email: hunter.z@263.net +website: http://code.google.com/p/jquerytree/ + +-------------------------------------*/ + +/* +.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} +.ztree {margin:0; padding:5px; color:#333} +.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} +.ztree li ul{ margin:0; padding:0 0 0 18px} +.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} + +.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; + text-decoration:none; vertical-align:top; display: inline-block} +.ztree li a:hover {text-decoration:underline} +.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} +.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} +.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; + opacity:0.8; filter:alpha(opacity=80)} +.ztree li a.tmpTargetNode_prev {} +.ztree li a.tmpTargetNode_next {} +.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; + font-size:12px; border:1px #7EC4CC solid; *border:0px} +.ztree li span {line-height:16px; margin-right:2px} +.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; + border:0 none; cursor: pointer;outline:none; + background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; + background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} + +.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} +.ztree li span.button.chk.checkbox_false_full {background-position:0 0} +.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} +.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} +.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} +.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} +.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} +.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} +.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} +.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} +.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} +.ztree li span.button.chk.radio_false_full {background-position:-28px 0} +.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} +.ztree li span.button.chk.radio_false_part {background-position:-28px -28px} +.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} +.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} +.ztree li span.button.chk.radio_true_full {background-position:-42px 0} +.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} +.ztree li span.button.chk.radio_true_part {background-position:-42px -28px} +.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} +.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} + +.ztree li span.button.switch {width:18px; height:18px} +.ztree li span.button.root_open{background-position:-92px -54px} +.ztree li span.button.root_close{background-position:-74px -54px} +.ztree li span.button.roots_open{background-position:-92px 0} +.ztree li span.button.roots_close{background-position:-74px 0} +.ztree li span.button.center_open{background-position:-92px -18px} +.ztree li span.button.center_close{background-position:-74px -18px} +.ztree li span.button.bottom_open{background-position:-92px -36px} +.ztree li span.button.bottom_close{background-position:-74px -36px} +.ztree li span.button.noline_open{background-position:-92px -72px} +.ztree li span.button.noline_close{background-position:-74px -72px} +.ztree li span.button.root_docu{ background:none;} +.ztree li span.button.roots_docu{background-position:-56px 0} +.ztree li span.button.center_docu{background-position:-56px -18px} +.ztree li span.button.bottom_docu{background-position:-56px -36px} +.ztree li span.button.noline_docu{ background:none;} + +.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} +.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} +.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} +.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} +.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} + +.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} + +ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} + +span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; + background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; + background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} + +ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} +.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} +*/ diff --git a/ruoyi-admin/src/main/resources/static/img/transformer-detail.png b/ruoyi-admin/src/main/resources/static/img/transformer-detail.png index 1209041..0008297 100644 Binary files a/ruoyi-admin/src/main/resources/static/img/transformer-detail.png and b/ruoyi-admin/src/main/resources/static/img/transformer-detail.png differ diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/iotIndex.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/iotIndex.js index 665c052..adf181a 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/iotIndex.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/iotIndex.js @@ -181,6 +181,7 @@ function barChats(datas, id) { }, show: true, }, + boundaryGap: ['5%', '5%'], }, yAxis: [{ type: 'category', @@ -204,6 +205,7 @@ function barChats(datas, id) { color: '#fff', } }, + boundaryGap: ['5%', '5%'], data: datas.yAxis } diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorSummary.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorSummary.js index 3b78966..aa1afe8 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorSummary.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorSummary.js @@ -42,58 +42,8 @@ $(()=>{ div.setAttribute("class","sensorTypeItem"); document.getElementById("sensorType").contentWindow.document.body.appendChild(div); } - - //table - // document.getElementById("sensorDataTable").contentWindow.document.designMode = "on"; - // document.getElementById("sensorDataTable").contentWindow.document.contentEditable = true; - // - // var jqueryScrip = document.createElement("script"); - // jqueryScrip.src = "../js/jquery.min.js"; - // //jqueryScrip.type = "text/javascript"; - // document.getElementById("sensorDataTable").contentWindow.document.body.appendChild(jqueryScrip); - // - // var bootstrapTableLink = document.createElement("link"); - // bootstrapTableLink.href="../../css/lot-ui/bootstrap-table.css"; - // bootstrapTableLink.rel = "stylesheet"; - // bootstrapTableLink.type = "text/css"; - // document.getElementById("sensorDataTable").contentWindow.document.body.appendChild(bootstrapTableLink); - // - // var tableCssLink = document.createElement("link"); - // tableCssLink.href="../../css/lot-ui/bootstrap.min.css"; - // tableCssLink.rel = "stylesheet"; - // tableCssLink.type = "text/css"; - // document.getElementById("sensorDataTable").contentWindow.document.body.appendChild(tableCssLink); - // - // var bootstrapTableScript = document.createElement("script"); - // bootstrapTableScript.src = "../js/Iot-ui/bootstrap-table.js"; - // bootstrapTableScript.type = "text/javascript"; - // document.getElementById("sensorDataTable").contentWindow.document.body.appendChild(bootstrapTableScript); - // - // var tableScrip = document.createElement("script"); - // tableScrip.src = "../js/Iot-ui/sensorTableList.js"; - // tableScrip.type = "text/javascript"; - // document.getElementById("sensorDataTable").contentWindow.document.body.appendChild(tableScrip); - // - // var tableInfo = document.getElementById("sensorType").contentWindow.document.createElement("table"); - // tableInfo.id = "table"; - // document.getElementById("sensorDataTable").contentWindow.document.body.appendChild(tableInfo); }) function btnBaby1_onclick(){ - alert(this.id) -} - -window.onload = function() { - - - // sensorDataTable - // document.getElementById("sensorDataTable").contentWindow.document.designMode = "on"; - // document.getElementById("sensorDataTable").contentWindow.document.contentEditable = true; - - // css/bootstrap-table.css -} - -function ifrmLoaded() { - // code here - + alert("切换传感器") } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js index 08d6cb7..5a47fea 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js @@ -9,33 +9,71 @@ $(()=>{ showRefresh: false, columns: [{ field: 'id', - title: '测试列一', + title: '序号', align: 'center', }, { - field: 'name', - title: '测试列二', + field: 'edgeId', + title: '边设备ID', align: 'center', }, { - field: 'price', - title: '测试列三', + field: 'sensorId', + title: '传感器ID', align: 'center', }, { - field: 'column1', - title: '测试列四', + field: 'sensorData', + title: '传感器数据', align: 'center', }, { - field: 'column2', - title: '测试列五', + field: 'rssi', + title: 'RSSI', align: 'center', }, { - field: 'column3', - title: '测试列六', + field: 'voltage', + title: '电压', align: 'center', }, { - field: 'column4', - title: '测试列七', + field: 'collectTime', + title: '时间', + align: 'center', + }, { + field: 'monitorLocation', + title: '监测位置', align: 'center', }] }); }) + +const onSearchByMonitorLocation = function (obj) { + setTimeout(function(){ + var storeId = document.getElementById('table'); + var rowsLength = storeId.rows.length; + var key = obj.value; + var searchCol = 7; + for(var i=1;i传感器汇总 - + + + @@ -17,17 +21,17 @@ -