147 lines
4.6 KiB
Plaintext
147 lines
4.6 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
|
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
|
<!DOCTYPE html>
|
|
<!-- <html lang="zh-CN"> -->
|
|
<!-- BEGIN HEAD -->
|
|
|
|
<head>
|
|
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
|
<!-- 引用页头及CSS页-->
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|
<script type="text/javascript">
|
|
var websocket = new WebSocket('ws://' + window.location.host + ext.contextPath + '/chat/userName=大屏');
|
|
var switchWindow = null;//大屏Switch的window
|
|
var planId;
|
|
var editFun = function (id) {
|
|
planId = id;
|
|
sendSocket();
|
|
};
|
|
|
|
function sendSocket() {
|
|
//清除交互
|
|
var clearInterationJsonStr = "[{'type':'clearInteraction'}]";
|
|
websocket.send(clearInterationJsonStr);
|
|
var jsonstr = "[{'type':'plan','id':'" + planId + "'}]";
|
|
websocket.send(jsonstr);
|
|
}
|
|
|
|
var initTreeView = function () {
|
|
$.post(ext.contextPath + '/plan//getPlansJsonActive.do', { ng: '' }, function (data) {
|
|
//console.info(data)
|
|
$('#tree').treeview({
|
|
data: data,
|
|
levels: 3
|
|
});
|
|
$('#tree').on('nodeSelected', function (event, data) {
|
|
editFun(data.id);
|
|
//var node=$('#tree').treeview('getSelected');
|
|
});
|
|
TreeView.ExpandAll();
|
|
}, 'json');
|
|
$("#planBox").html("");
|
|
};
|
|
|
|
function doCollapse() {
|
|
if (document.getElementById("planBox").className == "col-md-9") {
|
|
doHide();
|
|
} else {
|
|
doShow();
|
|
}
|
|
};
|
|
|
|
//隐藏折叠框
|
|
function doHide() {
|
|
document.getElementById("collapseIcon").className = "fa fa-arrow-right";//改变图标箭头
|
|
$('#treeCollapse').collapse('toggle');//1
|
|
setTimeout(function () {
|
|
document.getElementById("planBox").className = "col-md-12";//2
|
|
}, 400);
|
|
};
|
|
|
|
//显示折叠框
|
|
function doShow() {
|
|
document.getElementById("collapseIcon").className = "fa fa-arrow-left";//改变图标箭头
|
|
document.getElementById("planBox").className = "col-md-9";//1
|
|
setTimeout(function () {
|
|
$('#treeCollapse').collapse('toggle');//2
|
|
}, 400);
|
|
};
|
|
|
|
$(function () {
|
|
$('#treeCollapse').collapse('show');//显示折叠框
|
|
initTreeView();
|
|
// 浏览器上的websocket对象,用来和服务端通信.
|
|
if ('WebSocket' in window) {
|
|
// 创建websocket对象
|
|
var userName = "控制";
|
|
websocket = new WebSocket('ws://' + window.location.host + ext.contextPath + '/chat?userName=' + userName);
|
|
registerEvent();
|
|
} else {
|
|
alert('当前浏览器不支持websocket')
|
|
}
|
|
function registerEvent() {
|
|
websocket.onopen = function (event) {
|
|
|
|
}
|
|
websocket.onmessage = function (event) {
|
|
|
|
};
|
|
websocket.onclose = function (event) {
|
|
websocket.close();
|
|
};
|
|
//连接发生错误的回调方法
|
|
websocket.onerror = function () {
|
|
$("#Putin").attr('disabled', 'disabled');
|
|
websocket.close();
|
|
};
|
|
}
|
|
$(window).unload(function () {
|
|
console.log("websocket关闭");
|
|
websocket.close();
|
|
});
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
|
<div class="wrapper">
|
|
<div class="content-wrapper">
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
<h1 id="head_title"></h1>
|
|
<ol class="breadcrumb">
|
|
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
|
</ol>
|
|
</section>
|
|
<!-- Main content -->
|
|
<section class="content container-fluid">
|
|
<div id="mainAlertdiv"></div>
|
|
<div id="subDiv"></div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div id="treeCollapse" class="collapse">
|
|
<div class="box box-primary">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title">方案列表</h3>
|
|
</div>
|
|
<div class="box-body no-padding">
|
|
<div id="tree" style="height:550px;overflow:auto; "></div>
|
|
</div>
|
|
<!-- /.box-body -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- /.content -->
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |