From fbb5c50bbf7d0c0f756bd46179d32b114cbc2f5e Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 6 Mar 2024 16:34:59 +0800 Subject: [PATCH] Init --- .../base/BaseAlarmInfoController.java | 1 - .../controller/system/SysIndexController.java | 4 +-- .../src/main/resources/application.yml | 4 +-- .../static/js/Iot-ui/deviceMonitor.js | 6 ++--- .../resources/static/js/Iot-ui/iotIndex.js | 16 ++++++------ .../static/js/Iot-ui/sensorSummary.js | 4 +-- .../static/js/Iot-ui/sensorTableList.js | 6 ++--- .../src/main/resources/static/ruoyi/login.js | 8 +++--- .../src/main/resources/templates/index.html | 2 +- .../templates/section/substation.html | 14 +++++----- .../templates/section/transformer-detail.html | 26 +++++++++---------- 11 files changed, 46 insertions(+), 45 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java index dc4aed4..0443cbe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmInfoController.java @@ -23,7 +23,6 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; -import sun.management.Sensor; /** * 传感器报警信息Controller 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 b272b98..c36bf48 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 @@ -107,7 +107,7 @@ public class SysIndexController extends BaseController urlResult.add(new ArrayList(){{ menuList.forEach(x->{ if (x.getUrl() != "#"){ - this.add(x.getUrl()); + this.add("/IOT"+x.getUrl()); menuNames.add(x.getMenuName()); } }); @@ -115,7 +115,7 @@ public class SysIndexController extends BaseController menuStrList.add(new MenuStr(menu.getMenuName(),menuNames)); }else{ urlResult.add(new ArrayList(){{ - this.add(menu.getUrl()); + this.add("/IOT"+menu.getUrl()); }}); menuStrList.add(new MenuStr(menu.getMenuName(),new ArrayList())); } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 455ff9a..3515c32 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -19,7 +19,7 @@ server: port: 6066 servlet: # 应用的访问路径 - context-path: / + context-path: /IOT tomcat: # tomcat的URI编码 uri-encoding: UTF-8 @@ -114,7 +114,7 @@ shiro: # 设置Cookie的域名 默认空,即当前访问的域名 domain: # 设置cookie的有效访问路径 - path: / + path: /ruoyi # 设置HttpOnly属性 httpOnly: true # 设置Cookie的过期时间,天为单位 diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js index 9a4796d..23dc21b 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/deviceMonitor.js @@ -4,7 +4,7 @@ const getParameter = async function (dataType) { formData.append("sensorTypeId", dataType); await $.ajax({ type: "post", - url: "/base/sysParamConfig/getParameter", + url: "/IOT/base/sysParamConfig/getParameter", data: formData, contentType: "application/json;charset=utf-8", dataType: "json", @@ -26,7 +26,7 @@ const getParameter = async function (dataType) { const sensorCollectionRefresh = function (monitorUnitId,params) { console.log(params) $.ajax({ - url: "/iot/deviceMonitor/getSensorInfo?monitorunitId=" + monitorUnitId+'&pageNum='+(params?.pageNum||1)+'&pageSize='+(params?.pageSize||10), + url: "/IOT/iot/deviceMonitor/getSensorInfo?monitorunitId=" + monitorUnitId+'&pageNum='+(params?.pageNum||1)+'&pageSize='+(params?.pageSize||10), type: "get", dataType: 'JSON', success: (res) => { @@ -275,7 +275,7 @@ const temperatureTrend = function (sensorId) { title: "趋势分析", width: 1100, iframeContent: { - src: "/record/recordSensorData/getTemperatureTrend?id=" + sensorId, + src: "/IOT/record/recordSensorData/getTemperatureTrend?id=" + sensorId, height: 600 }, showButton: false 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 afe6c39..1146766 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 @@ -1,7 +1,7 @@ //数量统计,传感器数量、监控单元数量 $(() => { $.ajax({ - url: '/iot/index/quantityStatistics', + url: '/IOT/iot/index/quantityStatistics', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -18,7 +18,7 @@ $(() => { $(() => { $.ajax({ - url: '/iot/index/getMonitorUnitCharts', + url: '/IOT/iot/index/getMonitorUnitCharts', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -30,7 +30,7 @@ $(() => { }) $.ajax({ - url: '/iot/index/getMonitorUnitInfo', + url: '/IOT/iot/index/getMonitorUnitInfo', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -46,7 +46,7 @@ $(() => { $(() => { $.ajax({ - url: '/iot/index/getSensorStateCharts', + url: '/IOT/iot/index/getSensorStateCharts', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -58,7 +58,7 @@ $(() => { }) $.ajax({ - url: '/iot/index/getSensorStateInfo', + url: '/IOT/iot/index/getSensorStateInfo', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -74,7 +74,7 @@ $(() => { $(() => { //告警数量统计 $.ajax({ - url: '/iot/index/getAlarmAmount', + url: '/IOT/iot/index/getAlarmAmount', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -88,7 +88,7 @@ $(() => { //告警单元数量统计 $.ajax({ - url: '/iot/index/getAlarmModuleAmount', + url: '/IOT/iot/index/getAlarmModuleAmount', type: 'GET', dataType: 'JSON', success: function (datas) { @@ -100,7 +100,7 @@ $(() => { }) //告警趋势 $.ajax({ - url: '/iot/index/getAlarmTrend', + url: '/IOT/iot/index/getAlarmTrend', type: 'GET', dataType: 'JSON', success: function (datas) { 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 88ccfed..d69eaa6 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 @@ -3,13 +3,13 @@ $(()=>{ document.getElementById("sensorType").contentWindow.document.contentEditable = true; var cssLink = document.createElement("link"); - cssLink.href="../../css/lot-ui/sensorType.css"; + cssLink.href="../../IOT/css/lot-ui/sensorType.css"; cssLink.rel = "stylesheet"; cssLink.type = "text/css"; document.getElementById("sensorType").contentWindow.document.body.appendChild(cssLink); $.ajax({ - url: "/iot/sensorSummary/getSensorType", + url: "/IOT/iot/sensorSummary/getSensorType", type: "get", dataType: 'JSON', success: (res) => { 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 e67f44d..75b29f4 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 @@ -4,7 +4,7 @@ const sensorInfoList = function (sensorTypeId) { formData.append("sensorTypeId", sensorTypeId); $.ajax({ type: "post", - url: "/iot/sensorSummary/getSensorInfo", + url: "/IOT/iot/sensorSummary/getSensorInfo", data: formData, contentType: "application/json;charset=utf-8", dataType: "json", @@ -102,7 +102,7 @@ const getparamsFunction = function (sensorTypeId) { formData.append("sensorTypeId", sensorTypeId); $.ajax({ type: "post", - url: "/base/sysParamConfig/getParameterNotVisibleFlag", + url: "/IOT/base/sysParamConfig/getParameterNotVisibleFlag", data: formData, contentType: "application/json;charset=utf-8", dataType: "json", @@ -173,5 +173,5 @@ const onSearchByCollectTime = function (obj) { } const historyButton = function(id) { - location.href = '/record/recordSensorData/getPage?id='+id; + location.href = '/IOT/record/recordSensorData/getPage?id='+id; } diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/login.js b/ruoyi-admin/src/main/resources/static/ruoyi/login.js index f40f110..fe21b9e 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/login.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/login.js @@ -13,8 +13,9 @@ $.validator.setDefaults({ login(); } }); - +login(); function login() { + console.log("login1...."); $.modal.loading($("#btnSubmit").data("loading")); var username = $.common.trim($("input[name='username']").val()); var password = $.common.trim($("input[name='password']").val()); @@ -24,13 +25,14 @@ function login() { type: "post", url: ctx + "login", data: { - "username": username, - "password": password, + "username": "admin", + "password": "admin123", "validateCode": validateCode, "rememberMe": rememberMe }, success: function(r) { if (r.code == web_status.SUCCESS) { + console.log("login2...."); location.href = ctx + 'index'; } else { $.modal.closeLoading(); diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index 9a42fcb..3b80fba 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -233,7 +233,7 @@ - - + @@ -506,7 +506,7 @@
- +
@@ -537,7 +537,7 @@ $(function () { var search = function () { $.ajax({ - url: "/iot/deviceMonitor/getMonitorUnitTree", // 发送的路径 + url: "/IOT/iot/deviceMonitor/getMonitorUnitTree", // 发送的路径 type: "get", // 发送方式 dataType: 'JSON', // 反序列化 success: (res) => { // 成功获取到后端返回结果的回调函数 @@ -607,7 +607,7 @@ sensorCollectionRefresh(unitId, params); } else { $.ajax({ - url: "/iot/deviceMonitor/getFirstMonitorUnit", + url: "/IOT/iot/deviceMonitor/getFirstMonitorUnit", type: "get", success: (res) => { thisID = res @@ -622,7 +622,7 @@ }) const monitorUnitModule = function (monitorUnitId) { $.ajax({ - url: "/iot/deviceMonitor/getMonitorUnitInfo?monitorunitId=" + monitorUnitId, + url: "/IOT/iot/deviceMonitor/getMonitorUnitInfo?monitorunitId=" + monitorUnitId, type: "get", dataType: 'JSON', success: (res) => {