|
|
@ -439,7 +439,6 @@
|
|
|
|
placeholder="请输入传感器名称">
|
|
|
|
placeholder="请输入传感器名称">
|
|
|
|
|
|
|
|
|
|
|
|
<button class="btn btn-primary search-btn">搜索</button>
|
|
|
|
<button class="btn btn-primary search-btn">搜索</button>
|
|
|
|
<!-- <button type="reset" class="btn btn-outline-primary reset-btn">重置</button>-->
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</nav>
|
|
|
|
</nav>
|
|
|
|
<div id="sensor-card-group">
|
|
|
|
<div id="sensor-card-group">
|
|
|
@ -449,13 +448,11 @@
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
|
|
var search = function () {
|
|
|
|
var search = function () {
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url: "/iot/deviceMonitor/getMonitorUnitTree", // 发送的路径
|
|
|
|
url: "/iot/deviceMonitor/getMonitorUnitTree", // 发送的路径
|
|
|
|
type: "get", // 发送方式
|
|
|
|
type: "get", // 发送方式
|
|
|
|
dataType: 'JSON', // 反序列化
|
|
|
|
dataType: 'JSON', // 反序列化
|
|
|
|
//data:{v1,v2}, // 发送的数据
|
|
|
|
|
|
|
|
success: (res) => { // 成功获取到后端返回结果的回调函数
|
|
|
|
success: (res) => { // 成功获取到后端返回结果的回调函数
|
|
|
|
initSelectableTree(res);
|
|
|
|
initSelectableTree(res);
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
@ -472,8 +469,10 @@
|
|
|
|
multiSelect: $('#chk-select-multi').is(':checked'),
|
|
|
|
multiSelect: $('#chk-select-multi').is(':checked'),
|
|
|
|
onNodeSelected: function (event, node) {
|
|
|
|
onNodeSelected: function (event, node) {
|
|
|
|
$('#selectable-output').prepend('<p>' + node.text + ' was selected</p>');
|
|
|
|
$('#selectable-output').prepend('<p>' + node.text + ' was selected</p>');
|
|
|
|
|
|
|
|
if(node.nodeId > 0){
|
|
|
|
monitorUnitModule(node.href);
|
|
|
|
monitorUnitModule(node.href);
|
|
|
|
sensorCollectionRefresh(node.href);
|
|
|
|
sensorCollectionRefresh(node.href);
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onNodeUnselected: function (event, node) {
|
|
|
|
onNodeUnselected: function (event, node) {
|
|
|
|
$('#selectable-output').prepend('<p>' + node.text + ' was unselected</p>');
|
|
|
|
$('#selectable-output').prepend('<p>' + node.text + ' was unselected</p>');
|
|
|
@ -484,7 +483,6 @@
|
|
|
|
var $selectableTree = initSelectableTree(search());
|
|
|
|
var $selectableTree = initSelectableTree(search());
|
|
|
|
|
|
|
|
|
|
|
|
var findSelectableNodes = function () {
|
|
|
|
var findSelectableNodes = function () {
|
|
|
|
|
|
|
|
|
|
|
|
return $selectableTree.treeview('search', [$('#input-select-node').val(), {
|
|
|
|
return $selectableTree.treeview('search', [$('#input-select-node').val(), {
|
|
|
|
ignoreCase: false,
|
|
|
|
ignoreCase: false,
|
|
|
|
exactMatch: false,
|
|
|
|
exactMatch: false,
|
|
|
@ -501,8 +499,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(() => {
|
|
|
|
$(() => {
|
|
|
|
monitorUnitModule("BYQ")
|
|
|
|
let unitId = getParams("id");
|
|
|
|
sensorCollectionRefresh("BYQ");
|
|
|
|
if( unitId != null) {
|
|
|
|
|
|
|
|
monitorUnitModule(unitId)
|
|
|
|
|
|
|
|
sensorCollectionRefresh(unitId);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
url: "/iot/deviceMonitor/getFirstMonitorUnit",
|
|
|
|
|
|
|
|
type: "get",
|
|
|
|
|
|
|
|
success: (res) => {
|
|
|
|
|
|
|
|
monitorUnitModule(res)
|
|
|
|
|
|
|
|
sensorCollectionRefresh(res);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error: () => {
|
|
|
|
|
|
|
|
console.log("失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const monitorUnitModule = function (monitorUnitId) {
|
|
|
|
const monitorUnitModule = function (monitorUnitId) {
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
@ -515,7 +528,7 @@
|
|
|
|
$("#transformer-model").append(e);
|
|
|
|
$("#transformer-model").append(e);
|
|
|
|
|
|
|
|
|
|
|
|
$('#sensor-text').html("");
|
|
|
|
$('#sensor-text').html("");
|
|
|
|
let html = '<p>设备编号:<span>' + res[0].monitorunitId + '</span></p>\n' +
|
|
|
|
let html = '<p>设备编号:<span>' + res[0].monitorunitName + '</span></p>\n' +
|
|
|
|
' <p>设备型号:<span>' + res[0].monitorunitName + '</span></p>\n' +
|
|
|
|
' <p>设备型号:<span>' + res[0].monitorunitName + '</span></p>\n' +
|
|
|
|
' <p>启用时间:<span>' + formatter(res[0].createTime, "yyyy-MM-dd") + '</span></p>\n' +
|
|
|
|
' <p>启用时间:<span>' + formatter(res[0].createTime, "yyyy-MM-dd") + '</span></p>\n' +
|
|
|
|
' <p>所属变电站:<span>' + res[0].substationName + '</span></p>';
|
|
|
|
' <p>所属变电站:<span>' + res[0].substationName + '</span></p>';
|
|
|
@ -529,6 +542,15 @@
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
function getParams(key) {
|
|
|
|
|
|
|
|
var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
|
|
|
|
|
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
|
|
|
|
|
if (r != null) {
|
|
|
|
|
|
|
|
return unescape(r[2]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function formatter(thistime, fmt) {
|
|
|
|
function formatter(thistime, fmt) {
|
|
|
|
let $this = new Date(thistime)
|
|
|
|
let $this = new Date(thistime)
|
|
|
|
let o = {
|
|
|
|
let o = {
|
|
|
|