From a924795a43a2bd682cbe21bf885a08027ae06e24 Mon Sep 17 00:00:00 2001 From: wenjy Date: Sat, 26 Mar 2022 17:51:58 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E8=AE=BE=E5=A4=87=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=A1=B5=E9=9D=A2=E7=9B=91=E6=8E=A7=E5=8D=95=E5=85=83?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/base/deviceParam/add.html | 42 ++++++- .../base/deviceParam/deviceParam.html | 106 +++++++++++++++++- .../templates/base/deviceParam/edit.html | 33 +++++- .../templates/section/transformer-detail.html | 2 +- .../ruoyi/system/domain/BaseDeviceParam.java | 10 ++ .../mapper/system/BaseDeviceParamMapper.xml | 37 ++++-- 6 files changed, 212 insertions(+), 18 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/base/deviceParam/add.html b/ruoyi-admin/src/main/resources/templates/base/deviceParam/add.html index 0779535..be5f94c 100644 --- a/ruoyi-admin/src/main/resources/templates/base/deviceParam/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/deviceParam/add.html @@ -6,10 +6,14 @@
-
- + +
+
- +
+ + +
@@ -46,6 +50,38 @@ $.operate.save(prefix + "/add", $('#form-deviceParam-add').serialize()); } } + + /* 选择监控单元树 */ + function selectMonitorTree() { + var deptId = $.common.isEmpty($("#treeId").val()) ? "" : $("#treeId").val(); + var url = ctx + "base/monitorUnitInfo/selectMonitorUnitInfoTree/" + deptId; + var options = { + title: '选择部门', + width: "380", + url: url, + callBack: doSubmit + }; + $.modal.openOptions(options); + } + + function doSubmit(index, layero){ + var tree = layero.find("iframe")[0].contentWindow.$._tree; + var body = $.modal.getChildFrame(index); + $("#treeId").val(body.find('#treeId').val()); + $("#treeName").val(body.find('#treeName').val()); + $.modal.close(index); + } + + $(()=>{ + var cp_keynum = "alarmModule_MonitorUnit"; + var str = localStorage.getItem(cp_keynum); + var num = JSON.parse(str); + if(num != null) { + $("#treeId").val(num.cp_num_value.substring(0, num.cp_num_value.indexOf('/'))); + + $("#treeName").val(num.cp_num_value.substring(num.cp_num_value.indexOf('/')+1,num.cp_num_value.length )); + } + }) \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/deviceParam/deviceParam.html b/ruoyi-admin/src/main/resources/templates/base/deviceParam/deviceParam.html index b11d525..be6e3b7 100644 --- a/ruoyi-admin/src/main/resources/templates/base/deviceParam/deviceParam.html +++ b/ruoyi-admin/src/main/resources/templates/base/deviceParam/deviceParam.html @@ -2,8 +2,33 @@ + + - +
+
+
+
+ 监控单元 +
+
+ + + + +
+
+
+
+
+
+
+ +
@@ -57,14 +82,41 @@
+
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/base/deviceParam/edit.html b/ruoyi-admin/src/main/resources/templates/base/deviceParam/edit.html index 1dbf843..9c632fc 100644 --- a/ruoyi-admin/src/main/resources/templates/base/deviceParam/edit.html +++ b/ruoyi-admin/src/main/resources/templates/base/deviceParam/edit.html @@ -7,11 +7,21 @@
-
+ + +
+ +
+
+ + +
+
@@ -47,6 +57,27 @@ $.operate.save(prefix + "/edit", $('#form-deviceParam-edit').serialize()); } } + + /* 选择监控单元树 */ + function selectMonitorTree() { + var deptId = $.common.isEmpty($("#treeId").val()) ? "" : $("#treeId").val(); + var url = ctx + "base/monitorUnitInfo/selectMonitorUnitInfoTree/" + deptId; + var options = { + title: '选择部门', + width: "380", + url: url, + callBack: doSubmit + }; + $.modal.openOptions(options); + } + + function doSubmit(index, layero){ + var tree = layero.find("iframe")[0].contentWindow.$._tree; + var body = $.modal.getChildFrame(index); + $("#treeId").val(body.find('#treeId').val()); + $("#treeName").val(body.find('#treeName').val()); + $.modal.close(index); + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html index 4bca9a6..96d9c72 100644 --- a/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html +++ b/ruoyi-admin/src/main/resources/templates/section/transformer-detail.html @@ -578,7 +578,7 @@ $.cookie('userID', '0000'); var wsImpl = window.WebSocket || window.MozWebSocket; console.log("connecting to server .."); - window.ws = new wsImpl('ws://121.36.58.109:7181'); + window.ws = new wsImpl('ws://127.0.0.1:7181'); ws.onmessage = function (evt) { let result = $.parseJSON(evt.data); console.log(result); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseDeviceParam.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseDeviceParam.java index ad43893..a370cbf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseDeviceParam.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseDeviceParam.java @@ -42,6 +42,8 @@ public class BaseDeviceParam extends BaseEntity @Excel(name = "是否启用") private Long enableFlag; + private String monitorunitName; + public void setObjId(Long ObjId) { this.ObjId = ObjId; @@ -88,6 +90,14 @@ public class BaseDeviceParam extends BaseEntity return enableFlag; } + public String getMonitorunitName() { + return monitorunitName; + } + + public void setMonitorunitName(String monitorunitName) { + this.monitorunitName = monitorunitName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/resources/mapper/system/BaseDeviceParamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BaseDeviceParamMapper.xml index 4cd1471..78a99a1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BaseDeviceParamMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BaseDeviceParamMapper.xml @@ -5,8 +5,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + @@ -17,21 +18,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select ObjId, Device_Id, Param_Title, Param_Value, Enable_Flag, Create_By, Create_Time, Update_By, Update_Time from base_device_param + select t1.ObjId, + t1.Device_Id, + t2.MonitorUnit_Name, + t1.Param_Title, + t1.Param_Value, + t1.Enable_Flag, + t1.Create_By, + t1.Create_Time, + t1.Update_By, + t1.Update_Time + from base_device_param t1 + left join base_monitorunit_info t2 on t1.Device_Id = t2.MonitorUnit_Id