1380 lines
67 KiB
Plaintext
1380 lines
67 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" %>
|
|||
|
|
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/toastr/toastr.min.css"/>
|
|||
|
|
<style type="text/css">
|
|||
|
|
#toast-container > .toast-success {
|
|||
|
|
background-image: url(data:image/png;base64,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) !important;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-menu ul li:hover {
|
|||
|
|
color: #000000
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.right .direct-chat-text:after, .right .direct-chat-text:before {
|
|||
|
|
right: auto;
|
|||
|
|
left: 100%;
|
|||
|
|
border-right-color: transparent;
|
|||
|
|
border-left-color: #9EEA6A;
|
|||
|
|
}
|
|||
|
|
#qrcode{
|
|||
|
|
width: 160px;
|
|||
|
|
height: 170px;
|
|||
|
|
padding: 5px;
|
|||
|
|
margin: auto;
|
|||
|
|
}
|
|||
|
|
/*.dropdown-submenu {
|
|||
|
|
position: relative;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-submenu>.dropdown-menu {
|
|||
|
|
top: 0;
|
|||
|
|
left: 100%;
|
|||
|
|
margin-top: -6px;
|
|||
|
|
margin-left: -1px;
|
|||
|
|
-webkit-border-radius: 0 6px 6px 6px;
|
|||
|
|
-moz-border-radius: 0 6px 6px;
|
|||
|
|
border-radius: 0 6px 6px 6px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-submenu:hover>.dropdown-menu {
|
|||
|
|
display: block;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-submenu>a:after {
|
|||
|
|
display: block;
|
|||
|
|
content: " ";
|
|||
|
|
float: right;
|
|||
|
|
width: 0;
|
|||
|
|
height: 0;
|
|||
|
|
border-color: transparent;
|
|||
|
|
border-style: solid;
|
|||
|
|
border-width: 5px 0 5px 5px;
|
|||
|
|
border-left-color: #ccc;
|
|||
|
|
margin-top: 5px;
|
|||
|
|
margin-right: -10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-submenu:hover>a:after {
|
|||
|
|
border-left-color: #fff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-submenu.pull-left {
|
|||
|
|
float: none;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.dropdown-submenu.pull-left>.dropdown-menu {
|
|||
|
|
left: -100%;
|
|||
|
|
margin-left: 10px;
|
|||
|
|
-webkit-border-radius: 6px 0 6px 6px;
|
|||
|
|
-moz-border-radius: 6px 0 6px 6px;
|
|||
|
|
border-radius: 6px 0 6px 6px;
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
.dropdown-menu {
|
|||
|
|
width: 200px;
|
|||
|
|
/*left: -90px !important;*/
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/toastr/toastr.min.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<!-- Ionicons -->
|
|||
|
|
|
|||
|
|
<!-- 语音识别 -->
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/Recorder-master/recorder.mp3.min.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var logout = function () {
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要退出系统?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function (willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + "/Login/logout.do", function () {
|
|||
|
|
delCookie("j_password");
|
|||
|
|
delCookie('savePassword');
|
|||
|
|
location.replace(ext.contextPath);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
//修改密码
|
|||
|
|
var changePassword = function () {
|
|||
|
|
$.post(ext.contextPath + '/user/showChangePasswordPage.do', {}, function (data) {
|
|||
|
|
$("#subPasswordDiv").html(data);
|
|||
|
|
openModal('subPasswordModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
//查看个人信息
|
|||
|
|
var viewPersonalInformation = function () {
|
|||
|
|
$.post(ext.contextPath + '/user/viewPersonalInformation.do', {id: '${cu.id}'}, function (data) {
|
|||
|
|
$("#subPasswordDiv").html(data);
|
|||
|
|
openModal('subPasswordModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
//为body添加模态框的div
|
|||
|
|
$(function () {
|
|||
|
|
|
|||
|
|
var topWidth = $('#top').outerWidth();
|
|||
|
|
var topRightWidth = $('#topRight').outerWidth();
|
|||
|
|
var titleWidth = topWidth - 195;//115
|
|||
|
|
//$("#logo-title").css('width', titleWidth);
|
|||
|
|
//获取配置的logo和文字
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ext.contextPath + '/base/basicComponents/getBasicComponentsForCode.do',
|
|||
|
|
data: {
|
|||
|
|
code: 'logo',//配置位置
|
|||
|
|
},
|
|||
|
|
async: true,
|
|||
|
|
globle: false,
|
|||
|
|
error: function () {
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
success: function (data) {
|
|||
|
|
var array = JSON.parse(data);
|
|||
|
|
if (array != null && array != undefined && array.length > 0) {
|
|||
|
|
for (var i = 0; i < array.length; i++) {
|
|||
|
|
var top = null;
|
|||
|
|
if ($('#' + array[i].id).length > 0) {
|
|||
|
|
top = $('#' + array[i].id);
|
|||
|
|
if (array[i].type != null) {
|
|||
|
|
if (array[i].type == 'in_file') {
|
|||
|
|
if (array[i].abspath != null && array[i].abspath != '') {
|
|||
|
|
var path = array[i].abspath;
|
|||
|
|
var img = '<img src="' + path + '" alt=""/>';
|
|||
|
|
top.html(img);
|
|||
|
|
} else {
|
|||
|
|
top.html(array[i].text);
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
if (array[i].type == 'out_file') {
|
|||
|
|
if (array[i].abspath != null && array[i].abspath != '') {
|
|||
|
|
var path = ext.contextPath + "/showImg?src=" + encodeURIComponent(array[i].abspath);
|
|||
|
|
var img = '<img src="' + path + '" alt=""/>';
|
|||
|
|
top.html(img);
|
|||
|
|
} else {
|
|||
|
|
top.html(array[i].text);
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
if (array[i].type == 'text') {
|
|||
|
|
top.html(array[i].text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
top.html(array[i].text);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$(document.body).append(
|
|||
|
|
'<div id="subPasswordDiv"></div>' +
|
|||
|
|
'<div id="bonusPointDiv"></div>' +
|
|||
|
|
'<div id="themeDiv"></div>' +
|
|||
|
|
'<div id="fileinputHeadPortraitDiv"></div>'
|
|||
|
|
);
|
|||
|
|
toastr.options.closeButton = true;
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//读取cookies
|
|||
|
|
function getCookie(name) {
|
|||
|
|
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
|||
|
|
if (arr = document.cookie.match(reg)) return unescape(arr[2]);
|
|||
|
|
else return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//删除cookies
|
|||
|
|
function delCookie(name) {
|
|||
|
|
var exp = new Date();
|
|||
|
|
exp.setTime(exp.getTime() - 1);
|
|||
|
|
var cval = getCookie(name);
|
|||
|
|
if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var websocket = null;
|
|||
|
|
var restartDialog;
|
|||
|
|
//判断当前浏览器是否支持WebSocket
|
|||
|
|
if ('WebSocket' in window) {
|
|||
|
|
websocket = new ReconnectingWebSocket(ext.basePath.replace("http", "ws") + "/msgWebSocket/${cu.id}");
|
|||
|
|
} else {
|
|||
|
|
alert('当前浏览器 Not support websocket')
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//连接发生错误的回调方法
|
|||
|
|
websocket.onerror = function () {
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//连接成功建立的回调方法
|
|||
|
|
websocket.onopen = function () {
|
|||
|
|
console.info('消息滚动websocker开启');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//接收到消息的回调方法
|
|||
|
|
websocket.onmessage = function (event) {
|
|||
|
|
//var result= JSON.parse(event.data);
|
|||
|
|
querynewmsg();
|
|||
|
|
queryTaskNum();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//连接关闭的回调方法
|
|||
|
|
websocket.onclose = function () {
|
|||
|
|
console.info('消息滚动websocker关闭_top');
|
|||
|
|
/* if(restartDialog==null){
|
|||
|
|
restartDialog=swal({
|
|||
|
|
title:'提醒',
|
|||
|
|
text: '连接已断开,请刷新页面重试。',
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-info",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function(willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
location.replace(ext.contextPath);
|
|||
|
|
}
|
|||
|
|
});;
|
|||
|
|
} */
|
|||
|
|
closeWebSocket();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
|
|||
|
|
window.onbeforeunload = function () {
|
|||
|
|
closeWebSocket();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//关闭WebSocket连接
|
|||
|
|
function closeWebSocket() {
|
|||
|
|
websocket.close();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var post = "";
|
|||
|
|
var unReadMsgNum = 0;
|
|||
|
|
|
|||
|
|
function querynewmsg(isOnLoad) {
|
|||
|
|
$.post(ext.contextPath + "/msg/getUnreadMsgs4main.do", function (data) {
|
|||
|
|
var total = data.total;
|
|||
|
|
var rows = data.rows;
|
|||
|
|
//console.info(data)
|
|||
|
|
if (unReadMsgNum < total) {
|
|||
|
|
unReadMsgNum = total;
|
|||
|
|
}
|
|||
|
|
showView(data.rows, isOnLoad);
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function msgshow(id, a) {
|
|||
|
|
swal({
|
|||
|
|
title: '消息',
|
|||
|
|
text: a,
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-info",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$.post(ext.contextPath + '/msg/updateMsgRecvStatus.do', {ids: id}, function (data) {
|
|||
|
|
document.body.dataset.msgreaded = 'true';
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function contingencyPlanShow(id, a) {
|
|||
|
|
swal({
|
|||
|
|
title: '应急预案',
|
|||
|
|
text: '应急预案措施内容...',
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-info",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$.post(ext.contextPath + '/msg/updateMsgRecvStatus.do', {ids: id}, function (data) {
|
|||
|
|
document.body.dataset.msgreaded = 'true';
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var msgplayer = true;
|
|||
|
|
|
|||
|
|
function showView(rows, isOnLoad) {
|
|||
|
|
if (!isOnLoad) {
|
|||
|
|
if (document.body.dataset.msgreaded !== 'true') {
|
|||
|
|
if (rows[0].typeid === "ALARM") {
|
|||
|
|
toastr.error('<span onclick="contingencyPlanShow(\'' + rows[0].id + '\',\'' + rows[0].content + '\')">' + rows[0].content + '</span>', '异常报警');
|
|||
|
|
} else if (rows[0].typeid === "PROFESSOR") {
|
|||
|
|
toastr.success('<span onclick="goToLocation(\'work/KPIPro/showlist.do\')">' + rows[0].content + '</span>', '专家建议');
|
|||
|
|
} else if (rows[0].typeid === "INFO") {
|
|||
|
|
toastr.info(rows[0].content, '新公告');
|
|||
|
|
} else {
|
|||
|
|
toastr.warning(rows[0].content, '新消息');
|
|||
|
|
}
|
|||
|
|
//消息声音
|
|||
|
|
console.log(msgplayer);
|
|||
|
|
if (msgplayer) {
|
|||
|
|
msgplayer = false;
|
|||
|
|
var player = document.getElementById("msgMedia");
|
|||
|
|
player.src = "<%=request.getContextPath()%>/node_modules/media/messaging.wav";
|
|||
|
|
player.loop = false;
|
|||
|
|
player.addEventListener('ended', function () {
|
|||
|
|
msgplayer = true;
|
|||
|
|
}, false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (rows.length > 0) {
|
|||
|
|
$('#span_unread').html(rows.length);
|
|||
|
|
} else {
|
|||
|
|
$('#span_unread').html('');
|
|||
|
|
}
|
|||
|
|
$('#li_unread').html('您有' + rows.length + '条未读消息');
|
|||
|
|
$('#msglist').empty();
|
|||
|
|
document.body.dataset.msgreaded = 'false';
|
|||
|
|
//只显示最近10条
|
|||
|
|
for (var i = 0; i < rows.length && i < 10; i++) {
|
|||
|
|
var caption = "XXX";
|
|||
|
|
if (rows[i].susername != null) {
|
|||
|
|
caption = rows[i].susername.caption
|
|||
|
|
}
|
|||
|
|
var content = rows[i].content;
|
|||
|
|
if (content != null && content.length > 27) {
|
|||
|
|
content = content.substring(0, 26) + "......";
|
|||
|
|
}
|
|||
|
|
var clickActionFunc = '"msgshow(\'' + rows[i].id + '\',\'' + rows[i].content + '\')"';
|
|||
|
|
if (rows[i].typeid === "ALARM") {
|
|||
|
|
clickActionFunc = '"contingencyPlanShow(\'' + rows[0].id + '\',\'' + rows[0].content + '\')"';
|
|||
|
|
} else if (rows[i].typeid === "PROFESSOR") {
|
|||
|
|
clickActionFunc = '"goToLocation(\'work/KPIPro/showlist.do\')"';
|
|||
|
|
} else if (rows[i].typeid === "INFO") {
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
var item = '<li><a onclick=' + clickActionFunc + ' style="padding:7px;"><div class="pull-left" "><img src="' + ext.contextPath + '/plugins/AdminLTE/img/msg.png" style="padding:7px;" alt="User Image"></div>' +
|
|||
|
|
'<h4>' + caption +
|
|||
|
|
'<small><i class="fa fa-clock-o"></i>' + rows[i].insdt.substring(10, 16) + '</small>' +
|
|||
|
|
'</h4>' +
|
|||
|
|
'<p style="width:50px;" title="' + rows[i].content + '">' + content + '</p>' +
|
|||
|
|
'</a></li>';
|
|||
|
|
$('#msglist').append(item);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// function goToMsgListView(){
|
|||
|
|
// $.post(ext.contextPath +"/user/getMenuRelation.do",{location:'msg/showMsgrecv.do'},function(data){
|
|||
|
|
// //console.info(data)
|
|||
|
|
//if(data.length>2){
|
|||
|
|
//doforward('msg/showMsgrecv.do',data[2].id,data[1].id,data[0].id)
|
|||
|
|
//}
|
|||
|
|
// },'json');
|
|||
|
|
//
|
|||
|
|
// }
|
|||
|
|
function goToMsgListView() {
|
|||
|
|
addTab('UnreadTaskList', '未读消息', 'msg/showMsgrecv.do');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function goToTaskList() {
|
|||
|
|
// $.post(ext.contextPath +"/user/getMenuRelation.do",{location:'activiti/workflow/taskList.do'},function(data){
|
|||
|
|
// if(data.length>2){
|
|||
|
|
// doforward('activiti/workflow/taskList.do',data[2].id,data[1].id,data[0].id)
|
|||
|
|
// }
|
|||
|
|
// },'json');
|
|||
|
|
|
|||
|
|
addTab('taskList', '待办事项', 'activiti/workflow/taskList.do');
|
|||
|
|
/* var url = ext.contextPath +"/activiti/workflow/taskList.do";
|
|||
|
|
|
|||
|
|
nthTabs.addTab({
|
|||
|
|
id:'tabId_taskList',
|
|||
|
|
title:'待办事项',
|
|||
|
|
url: url,
|
|||
|
|
active: true,
|
|||
|
|
allowClose: true,
|
|||
|
|
location: true,
|
|||
|
|
fadeIn: true
|
|||
|
|
}); */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function goToDoneTaskList() {
|
|||
|
|
addTab('donetaskList', '已办事项', 'activiti/workflow/donetaskList.do');
|
|||
|
|
/* var url = ext.contextPath +"/activiti/workflow/donetaskList.do";
|
|||
|
|
|
|||
|
|
nthTabs.addTab({
|
|||
|
|
id:'tabId_donetaskList',
|
|||
|
|
title:'已办事项',
|
|||
|
|
url: url,
|
|||
|
|
active: true,
|
|||
|
|
allowClose: true,
|
|||
|
|
location: true,
|
|||
|
|
fadeIn: true
|
|||
|
|
}); */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function queryTaskNum() {
|
|||
|
|
//获取所有当前待办任务数量
|
|||
|
|
$.post(ext.contextPath + "/maintenance/getTaskListAmount.do", function (data) {
|
|||
|
|
if (data.total > 0) {
|
|||
|
|
$('#taskNum').html(data.total)
|
|||
|
|
} else {
|
|||
|
|
$('#taskNum').html();
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function changeTheme() {
|
|||
|
|
$.post(ext.contextPath + '/user/showChangeTheme.do', {}, function (data) {
|
|||
|
|
$("#themeDiv").html(data);
|
|||
|
|
openModal('subThemeModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
querynewmsg(true);
|
|||
|
|
queryTaskNum();
|
|||
|
|
setInterval(function() {
|
|||
|
|
queryTaskNum();
|
|||
|
|
},60000);
|
|||
|
|
// $("#companytree").slimScroll({
|
|||
|
|
// height:'500'
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
//防止点击树的+号收起下拉框
|
|||
|
|
// $("#top_company_tree").on("click", function (e) {
|
|||
|
|
// event.stopPropagation();
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
//点击空白隐藏树
|
|||
|
|
$(document).click(function (e) {
|
|||
|
|
var divTree = $('#top_company_tree'); // 设置目标区域
|
|||
|
|
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
|||
|
|
divTree.hide();
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function goToLocation(url) {
|
|||
|
|
$.post(ext.contextPath + "/user/getMenuRelation.do", {location: url}, function (data) {
|
|||
|
|
console.info(data)
|
|||
|
|
if (data.length > 2) {
|
|||
|
|
doforward(url, data[2].id, data[1].id, data[0].id)
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/*function doChoice(name){
|
|||
|
|
$("#viewName").text(name);
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
function companyCheck(id, st, pid) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
|
|||
|
|
// var checkList=$("#companytree"+st);
|
|||
|
|
$("#companytree" + st + " div").each(function () {
|
|||
|
|
var clickid = $(this).attr("id");
|
|||
|
|
if (clickid == id) {
|
|||
|
|
$("#" + clickid + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
} else {
|
|||
|
|
$("#" + clickid + "").css('box-shadow', "");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (st < Number(companyOpenNum)) {
|
|||
|
|
if ($('#companytree' + (Number(st) + 1)).attr("pid") == id) {
|
|||
|
|
for (var i = st; i < Number(companyOpenNum); i++) {
|
|||
|
|
$('#companytree' + (Number(i) + 1)).remove();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#companyP").css('width', 220 * Number(st) + "px");
|
|||
|
|
if (Number(st) > 2) {
|
|||
|
|
$("#companyP").css('left', "-" + 220 * (Number(st) - 2) + "px");
|
|||
|
|
} else {
|
|||
|
|
$("#companyP").css('left', "0px");
|
|||
|
|
}
|
|||
|
|
companyOpenNum = st;
|
|||
|
|
} else {
|
|||
|
|
for (var i = st; i < Number(companyOpenNum); i++) {
|
|||
|
|
$('#companytree' + (Number(i) + 1)).remove();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/user/getUnitTreeForTop.do', {pid: id}, function (data) {
|
|||
|
|
// console.log(data);
|
|||
|
|
if (data != '') {
|
|||
|
|
companyOpenNum = Number(st) + 1;
|
|||
|
|
var cnum = Number(st) + 1;
|
|||
|
|
if (cnum > 2) {
|
|||
|
|
$("#companyP").css('left', "-" + 220 * (cnum - 2) + "px");
|
|||
|
|
}
|
|||
|
|
$("#companyP").css('width', 220 * cnum + "px");
|
|||
|
|
|
|||
|
|
$("#companytree").append("<div id='companytree" + cnum + "' st='" + cnum + "' pid='" + id + "' style='float:left;width:220px;height:100%;overflow-y:auto;background:rgba(250,250,250,0.75);border:1px solid #eee;'></div>");
|
|||
|
|
var html = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
var indata = data[i];
|
|||
|
|
html += "<div onmouseover='bizTreeMIn(\"" + indata.id + "\");' onmouseout='bizTreeMOut(\"" + indata.id + "\");' onclick='changgeCompany(\"" + indata.id + "\",\"" + indata.showtext + "\",\"" + st + "\");' id='" + indata.id + "' style='float:left;width:100%;height:32px;line-height:32px;margin-top:10px;cursor: pointer;position:relative;'>";
|
|||
|
|
html += "<span class='" + indata.icon + "' style='width:35px;padding-left:30px;'></span><span style='width:120px;padding-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:absolute;' title=" + indata.text + ">" + indata.text + "</span>";
|
|||
|
|
if (indata.next == 'true') {
|
|||
|
|
html += "<span onclick='companyCheck(\"" + indata.id + "\",\"" + cnum + "\",\"" + id + "\");' class='btn btn-default btn-sm fa fa-angle-double-right pull-right' style='width:35px;margin-top:3px;margin-right:5px;cursor: pointer;'></span>";
|
|||
|
|
}
|
|||
|
|
html += "</div>";
|
|||
|
|
}
|
|||
|
|
$('#companytree' + cnum).html(html);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
$.post(ext.contextPath + '/user/getUnitTreeForTop.do', {pid: id}, function (data) {
|
|||
|
|
// console.log(data);
|
|||
|
|
if (data != '') {
|
|||
|
|
companyOpenNum = Number(companyOpenNum) + 1;
|
|||
|
|
var cnum = companyOpenNum;
|
|||
|
|
if (cnum > 2) {
|
|||
|
|
$("#companyP").css('left', "-" + 220 * (cnum - 2) + "px");
|
|||
|
|
}
|
|||
|
|
$("#companyP").css('width', 220 * cnum + "px");
|
|||
|
|
|
|||
|
|
$("#companytree").append("<div id='companytree" + cnum + "' st='" + cnum + "' pid='" + id + "' style='float:left;width:220px;height:100%;overflow-y:auto;background:rgba(250,250,250,0.75);border:1px solid #eee;'></div>");
|
|||
|
|
var html = "";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
var indata = data[i];
|
|||
|
|
html += "<div onmouseover='bizTreeMIn(\"" + indata.id + "\");' onmouseout='bizTreeMOut(\"" + indata.id + "\");' onclick='changgeCompany(\"" + indata.id + "\",\"" + indata.showtext + "\",\"" + st + "\");' id='" + indata.id + "' style='float:left;width:100%;height:32px;line-height:32px;margin-top:10px;cursor: pointer;position:relative;'>";
|
|||
|
|
html += "<span class='" + indata.icon + "' style='width:35px;padding-left:30px;'></span><span style='width:120px;padding-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:absolute;' title=" + indata.text + ">" + indata.text + "</span>";
|
|||
|
|
if (indata.next == 'true') {
|
|||
|
|
html += "<span onclick='companyCheck(\"" + indata.id + "\",\"" + cnum + "\",\"" + id + "\");' class='btn btn-default btn-sm fa fa-angle-double-right pull-right' style='width:35px;margin-top:3px;margin-right:5px;cursor: pointer;'></span>";
|
|||
|
|
}
|
|||
|
|
html += "</div>";
|
|||
|
|
}
|
|||
|
|
$('#companytree' + cnum).html(html);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/user/getUnitTreeForTop.do', function (data) {
|
|||
|
|
// console.log(data);
|
|||
|
|
if (data != '') {
|
|||
|
|
var html = "<div id=\"companytree1\" st=\"1\" pid=\"-1\" style=\"float:left;width:220px;height:100%;overflow-y:auto;background:rgba(250,250,250,0.75);border:1px solid #eee;\">";
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
var indata = data[i];
|
|||
|
|
html += "<div onmouseover='bizTreeMIn(\"" + indata.id + "\");' onmouseout='bizTreeMOut(\"" + indata.id + "\");' onclick='changgeCompany(\"" + indata.id + "\",\"" + indata.showtext + "\",\"1\");' id='" + indata.id + "' style='float:left;width:100%;height:32px;line-height:32px;margin-top:10px;cursor: pointer;position:relative;'>";
|
|||
|
|
html += "<span class='" + indata.icon + "' style='width:35px;padding-left:30px;'></span><span style='width:120px;padding-left:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:absolute;' title=" + indata.text + ">" + indata.text + "</span>";
|
|||
|
|
if (indata.next == 'true') {
|
|||
|
|
html += "<span onclick='companyCheck(\"" + indata.id + "\",\"1\",\"-1\");' class='btn btn-default btn-sm fa fa-angle-double-right pull-right' style='width:35px;margin-top:3px;margin-right:5px;cursor: pointer;'></span>";
|
|||
|
|
}
|
|||
|
|
html += "</div>";
|
|||
|
|
}
|
|||
|
|
html += "</div>";
|
|||
|
|
$("#companytree").html(html);
|
|||
|
|
|
|||
|
|
companyCheck(data[0].id, 1, -1);
|
|||
|
|
$("#" + data[0].id + "").css('background-color', "#428BCA");
|
|||
|
|
$("#" + data[0].id + "").css('color', "#ffffff");
|
|||
|
|
$("#" + data[0].id + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
function doChoice() {
|
|||
|
|
$('#top_company_tree').show();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function bizTreeMIn(id) {
|
|||
|
|
var style = $("#" + id + "").css("box-shadow");
|
|||
|
|
if (style == 'rgb(210, 205, 205) 0px 3px 5px 2px') {
|
|||
|
|
console.log(style);
|
|||
|
|
$("#" + id + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
} else {
|
|||
|
|
$("#" + id + "").css('box-shadow', "#d2cdcd 0px 2px 5px 2px");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function bizTreeMOut(id) {
|
|||
|
|
var style = $("#" + id + "").css("box-shadow");
|
|||
|
|
if (style == 'rgb(210, 205, 205) 0px 3px 5px 2px') {
|
|||
|
|
$("#" + id + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
} else {
|
|||
|
|
$("#" + id + "").css('box-shadow', "");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var companyOpenNum = '1';
|
|||
|
|
var lastClickBizid = "-1";
|
|||
|
|
|
|||
|
|
function changgeCompany(bizid, bizname, st) {
|
|||
|
|
st = Number(st) + 1;
|
|||
|
|
$('#companyName').html(bizname);
|
|||
|
|
$('#top_company_tree').hide();
|
|||
|
|
$('#unitId').val(bizid);
|
|||
|
|
|
|||
|
|
//2021.11.25 JY 增加了自定义首页配置
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'post',
|
|||
|
|
url: ext.contextPath + '/base/basicHomePage/getJsonByUserId.do',
|
|||
|
|
data: {
|
|||
|
|
unitId: bizid,
|
|||
|
|
},
|
|||
|
|
dataType: 'json',
|
|||
|
|
async: true,
|
|||
|
|
globle: false,
|
|||
|
|
success: function (pageData) {
|
|||
|
|
// console.log(pageData)
|
|||
|
|
let unrolePeople = "";
|
|||
|
|
if (pageData.data != '' && pageData.data.length > 0) {
|
|||
|
|
let nowUser = pageData.userId;
|
|||
|
|
unrolePeople = pageData.data[0].unrolepeople;
|
|||
|
|
let mainUrl = pageData.data[0].url;
|
|||
|
|
|
|||
|
|
if (unrolePeople != '' && unrolePeople.indexOf(nowUser) != -1) {//无权限查看
|
|||
|
|
mainUrl = "base/basicHomePage/showNoRole.do"
|
|||
|
|
} else {
|
|||
|
|
if (mainUrl.substring(0, 1) == '/') {
|
|||
|
|
mainUrl = mainUrl.substring(1, mainUrl.length);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
// 刷新选项卡
|
|||
|
|
nthTabs.refTab('tabId_home', mainUrl);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//防止厂名过长导致抬头文字换行
|
|||
|
|
var topWidth = $('#top').outerWidth();
|
|||
|
|
var topRightWidth = $('#topRight').outerWidth();
|
|||
|
|
var titleWidth = topWidth - topRightWidth - 50;
|
|||
|
|
//$("#logo-title").css('width', titleWidth);
|
|||
|
|
//所有tab增加Company发生变更状态,变化为true,不变化为false
|
|||
|
|
var tabList = nthTabs.getTabList();
|
|||
|
|
for (var i = 0; i < tabList.length; i++) {
|
|||
|
|
$(tabList[i].id).find("iframe").attr("data-changeCompany", true);
|
|||
|
|
}
|
|||
|
|
//刷新当前活动状态tab
|
|||
|
|
var tabActiveId = nthTabs.getActiveId();
|
|||
|
|
var url = $("#" + tabActiveId).find("iframe").attr("src");
|
|||
|
|
$("#" + tabActiveId).find("iframe").attr('src', url);
|
|||
|
|
$("#" + tabActiveId).find("iframe").attr('data-changeCompany', false);
|
|||
|
|
|
|||
|
|
//全部tab刷新
|
|||
|
|
/* var tabList = nthTabs.getTabList();
|
|||
|
|
for (var i = 0; i < tabList.length; i++) {
|
|||
|
|
var url = $(tabList[i].id).find("iframe").attr("src");
|
|||
|
|
$(tabList[i].id).find("iframe").attr('src', url);
|
|||
|
|
} */
|
|||
|
|
|
|||
|
|
for (var i = st; i < Number(companyOpenNum); i++) {
|
|||
|
|
$('#companytree' + (Number(i) + 1)).remove();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#companyP").css('width', 220 * Number(st) + "px");
|
|||
|
|
if (Number(st) > 2) {
|
|||
|
|
$("#companyP").css('left', "-" + 220 * (Number(st) - 2) + "px");
|
|||
|
|
} else {
|
|||
|
|
$("#companyP").css('left', "0px");
|
|||
|
|
}
|
|||
|
|
companyOpenNum = st;
|
|||
|
|
|
|||
|
|
$("#companytree" + st + " div").each(function () {
|
|||
|
|
var clickid = $(this).attr("id");
|
|||
|
|
if (clickid == bizid) {
|
|||
|
|
$("#" + clickid + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
} else {
|
|||
|
|
$("#" + clickid + "").css('box-shadow', "");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (lastClickBizid != '-1') {
|
|||
|
|
$.post(ext.contextPath + '/user/getAllParentBizId.do', {bizid: lastClickBizid}, function (data) {
|
|||
|
|
var datas = data.substring(0, data.length - 1).split(",");
|
|||
|
|
for (var i = 0; i < datas.length; i++) {
|
|||
|
|
$("#" + datas[i] + "").css('background-color', "#fafafa");
|
|||
|
|
$("#" + datas[i] + "").css('color', "#000000");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/user/getAllParentBizId.do', {bizid: bizid}, function (data) {
|
|||
|
|
var datas = data.substring(0, data.length - 1).split(",");
|
|||
|
|
for (var i = 0; i < datas.length; i++) {
|
|||
|
|
$("#" + datas[i] + "").css('background-color', "#428BCA");
|
|||
|
|
$("#" + datas[i] + "").css('color', "#ffffff");
|
|||
|
|
$("#" + datas[i] + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
$.post(ext.contextPath + '/user/getAllParentBizId.do', {bizid: bizid}, function (data) {
|
|||
|
|
var datas = data.substring(0, data.length - 1).split(",");
|
|||
|
|
for (var i = 0; i < datas.length; i++) {
|
|||
|
|
$("#" + datas[i] + "").css('background-color', "#428BCA");
|
|||
|
|
$("#" + datas[i] + "").css('color', "#ffffff");
|
|||
|
|
$("#" + datas[i] + "").css('box-shadow', "#d2cdcd 0px 3px 5px 2px");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
lastClickBizid = bizid;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//右上角点击回到主页
|
|||
|
|
function goToMainTab() {
|
|||
|
|
nthTabs.toggleTab('tabId_home');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var initialInfo = function () {
|
|||
|
|
initialMainPageType('mainpage_container', bizId, '${cu.id}');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function showQrCode() {
|
|||
|
|
$("#qrcode").html("");
|
|||
|
|
$.post(ext.contextPath + '/app/doScanApk.do', {type: ""}, function (result) {
|
|||
|
|
if (result == null && result == '') {
|
|||
|
|
$("#qrcode").html("暂无安装包!");
|
|||
|
|
} else {
|
|||
|
|
var filename = result.res;
|
|||
|
|
$("#qrcode").qrcode({
|
|||
|
|
render: "canvas",
|
|||
|
|
width: 150, //设置宽度
|
|||
|
|
height: 150, //设置高度
|
|||
|
|
typeNumber: -1, //计算模式
|
|||
|
|
background: "#ffffff",//背景颜色
|
|||
|
|
foreground: "#000000", //前景颜色
|
|||
|
|
text: filename
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}, "json");
|
|||
|
|
/* $('#qrcode').qrcode({
|
|||
|
|
render: "canvas",//canvas
|
|||
|
|
width: 150,
|
|||
|
|
height: 150,
|
|||
|
|
//text: "http://www.baidu.com"
|
|||
|
|
text: "http://127.0.0.1:8080/SIPAIIS_WMS/app/downLoadAPP.do?&path=D:\\Tomcat 7.0\\webapps\\SIPAIIS_WMS_APK&ng=''"
|
|||
|
|
|
|||
|
|
}); */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function showSpeechRecognition() {
|
|||
|
|
let st = $('#speechRecognitiondrop').css('display');
|
|||
|
|
if (st === 'none') {
|
|||
|
|
$('#speechRecognitiondrop').css('display', 'block');
|
|||
|
|
} else {
|
|||
|
|
$('#speechRecognitiondrop').css('display', 'none');
|
|||
|
|
}
|
|||
|
|
// document.getElementById('speechRecognitiondrop').style.display = 'block';
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var rec;
|
|||
|
|
|
|||
|
|
function speechRecognitionDown() {
|
|||
|
|
rec = Recorder({type: "mp3", sampleRate: 16000, bitRate: 16, numChannels: 1});//使用默认配置,mp3格式
|
|||
|
|
//打开麦克风授权获得相关资源
|
|||
|
|
rec.open(function () {
|
|||
|
|
//开始录音
|
|||
|
|
rec.start();
|
|||
|
|
}, function (msg, isUserNotAllow) {
|
|||
|
|
//用户拒绝了权限或浏览器不支持
|
|||
|
|
alert((isUserNotAllow ? "用户拒绝了权限," : "") + "无法录音:" + msg);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function speechRecognitionUp() {
|
|||
|
|
var waitDiv = "<div id='speechRecognitionContentWait' style='text-align:center;'>语音上传中,请稍等!</div>";
|
|||
|
|
$('#speechRecognitionContent').append(waitDiv);
|
|||
|
|
let robj = document.getElementById("speechRecognitionContent");
|
|||
|
|
robj.scrollTop = robj.scrollHeight;
|
|||
|
|
|
|||
|
|
rec.stop(function (blob, duration) {
|
|||
|
|
var api = ext.contextPath + "/data/baiDuAipSpeech/save.do";
|
|||
|
|
var reader = new FileReader();
|
|||
|
|
let to_speak = window.speechSynthesis;
|
|||
|
|
reader.onloadend = function () {
|
|||
|
|
$.ajax({
|
|||
|
|
url: api, //上传接口地址
|
|||
|
|
type: "POST",
|
|||
|
|
data: {
|
|||
|
|
type: blob.type, //告诉后端,这个录音是什么格式的,可能前后端都固定的mp3可以不用写
|
|||
|
|
upfile_b64: (/.+;\s*base64\s*,\s*(.+)$/i.exec(reader.result) || [])[1] //录音文件内容,后端进行base64解码成二进制
|
|||
|
|
},
|
|||
|
|
success: function (data) {
|
|||
|
|
console.log(data);
|
|||
|
|
$('#speechRecognitionContentWait').html("语音识别中,请稍等!");
|
|||
|
|
|
|||
|
|
data = eval('(' + data + ')');
|
|||
|
|
let result = data.result[0];
|
|||
|
|
// console.log(result);
|
|||
|
|
|
|||
|
|
let rightContent = "";
|
|||
|
|
rightContent += "<div class='direct-chat-msg right'>";
|
|||
|
|
rightContent += "<div class='direct-chat-info clearfix'><span class='direct-chat-timestamp pull-left'>" + getNowTime() + "</span></div>";
|
|||
|
|
rightContent += "<i style='float: right;'>";
|
|||
|
|
rightContent += "<svg t='1637637402247' class='icon' viewBox='0 0 1024 1024' width='40' height='40'>";
|
|||
|
|
rightContent += "<path d='M586.945923 513.581008c55.067176-27.962865 92.91211-85.125773 92.91211-150.998039 0-93.338828-75.937506-169.276335-169.277358-169.276335s-169.275311 75.937506-169.275311 169.276335c0 65.872267 37.844933 123.034151 92.911086 150.998039-95.652524 32.016181-164.778904 122.45496-164.778904 228.743728 0 11.31572 9.17394 20.491707 20.491707 20.491707s20.491707-9.174963 20.491707-20.491707c0-110.36869 89.791026-200.160739 200.160739-200.160739S710.741413 631.956046 710.741413 742.324736c0 11.31572 9.17394 20.491707 20.491707 20.491707s20.491707-9.174963 20.491707-20.491707C751.723803 636.035968 682.598446 545.598212 586.945923 513.581008zM382.287753 362.582969c0-70.742181 57.552787-128.293945 128.292921-128.293945 70.742181 0 128.293945 57.552787 128.293945 128.293945 0 70.741157-57.552787 128.292921-128.293945 128.292921C439.84054 490.876913 382.287753 433.324126 382.287753 362.582969z' p-id='2444' fill='#8a8a8a'></path>";
|
|||
|
|
rightContent += "<path d='M827.871087 196.127889C743.498468 111.757317 631.320573 65.290005 512 65.290005S280.500509 111.756293 196.128913 196.127889C111.756293 280.501532 65.291029 392.678404 65.291029 511.998977s46.465265 231.499491 130.837884 315.872111 196.550515 130.837884 315.871087 130.837884 231.498468-46.465265 315.871087-130.837884S958.708971 631.319549 958.708971 511.998977 912.243707 280.500509 827.871087 196.127889zM512 917.726581c-223.718271 0-405.726581-182.007287-405.726581-405.727605 0-223.718271 182.00831-405.726581 405.726581-405.726581s405.726581 182.007287 405.726581 405.726581C917.726581 735.719294 735.718271 917.726581 512 917.726581z' p-id='2445' fill='#8a8a8a'></path>";
|
|||
|
|
rightContent += "</svg>";
|
|||
|
|
rightContent += "</i>";
|
|||
|
|
rightContent += "<div class='direct-chat-text' style='background: #9EEA6A;'>" + result + "</div>";
|
|||
|
|
rightContent += "</div>";
|
|||
|
|
$('#speechRecognitionContent').append(rightContent);
|
|||
|
|
let robj = document.getElementById("speechRecognitionContent");
|
|||
|
|
robj.scrollTop = robj.scrollHeight;
|
|||
|
|
|
|||
|
|
$.ajax({
|
|||
|
|
url: ext.contextPath + '/work/speechRecognition/getJson.do', //上传接口地址
|
|||
|
|
type: "POST",
|
|||
|
|
data: {
|
|||
|
|
text: result,
|
|||
|
|
unitId: $('#unitId').val()
|
|||
|
|
},
|
|||
|
|
dataType: 'json',
|
|||
|
|
success: function (speechRecognition) {
|
|||
|
|
$('#speechRecognitionContentWait').remove();
|
|||
|
|
// console.log(speechRecognition);
|
|||
|
|
if (speechRecognition.length > 0) {
|
|||
|
|
let nowS = speechRecognition[0];
|
|||
|
|
if (nowS.systype == 'bim') {//三维使用
|
|||
|
|
$.post(ext.contextPath + '/data/baiDuAipSpeech/sendBimByWebsocket.do', {
|
|||
|
|
type: nowS.type,
|
|||
|
|
code: nowS.code
|
|||
|
|
}, function (data) {
|
|||
|
|
console.log(data);
|
|||
|
|
let leftContent = getSpeechRecognitionLeft(nowS.respondvoice);
|
|||
|
|
$('#speechRecognitionContent').append(leftContent);
|
|||
|
|
//to_speak = new SpeechSynthesisUtterance(nowS.respondvoice);
|
|||
|
|
//window.speechSynthesis.speak(to_speak);
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/cmd/cmdController/handle4Speech.do', {
|
|||
|
|
value: nowS.respondvoice
|
|||
|
|
}, function (data) {
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (nowS.method != null && nowS.method != '') {
|
|||
|
|
eval(nowS.method);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
} else if (nowS.systype == 'speak') {//语音讲话
|
|||
|
|
let leftContent = getSpeechRecognitionLeft(nowS.respondvoice);
|
|||
|
|
$('#speechRecognitionContent').append(leftContent);
|
|||
|
|
//to_speak = new SpeechSynthesisUtterance(nowS.respondvoice);
|
|||
|
|
//window.speechSynthesis.speak(to_speak);
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/cmd/cmdController/handle4Speech.do', {
|
|||
|
|
value: nowS.respondvoice
|
|||
|
|
}, function (data) {
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (nowS.method != null && nowS.method != '') {
|
|||
|
|
eval(nowS.method);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
let lobj = document.getElementById("speechRecognitionContent");
|
|||
|
|
lobj.scrollTop = lobj.scrollHeight;
|
|||
|
|
} else {
|
|||
|
|
let leftContent = getSpeechRecognitionLeft("请再说一遍!");
|
|||
|
|
$('#speechRecognitionContent').append(leftContent);
|
|||
|
|
to_speak = new SpeechSynthesisUtterance("请再说一遍!");
|
|||
|
|
window.speechSynthesis.speak(to_speak);
|
|||
|
|
|
|||
|
|
let lobj = document.getElementById("speechRecognitionContent");
|
|||
|
|
lobj.scrollTop = lobj.scrollHeight;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
rec.close();
|
|||
|
|
},
|
|||
|
|
error: function (s) {
|
|||
|
|
console.error("上传失败", s);
|
|||
|
|
rec.close();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
reader.readAsDataURL(blob);
|
|||
|
|
|
|||
|
|
}, function (msg) {
|
|||
|
|
alert("录音失败:" + msg);
|
|||
|
|
rec.close();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function delSpeechRecognition() {
|
|||
|
|
let content = "<div style='width: 100%;text-align: center;'>请按住录音键说话!</div>";
|
|||
|
|
$('#speechRecognitionContent').html(content);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getSpeechRecognitionLeft(result) {
|
|||
|
|
let leftContent = "";
|
|||
|
|
leftContent += "<div class='direct-chat-msg'>";
|
|||
|
|
leftContent += "<div class='direct-chat-info clearfix'><span class='direct-chat-timestamp pull-right'>" + getNowTime() + "</span></div>";
|
|||
|
|
leftContent += "<i style='float: left;'>";
|
|||
|
|
leftContent += "<svg t='1637638254028' class='icon' viewBox='0 0 1024 1024' width='40' height='40'>";
|
|||
|
|
leftContent += "<path d='M981.333333 618.666667h-106.666666v-21.333334a298.666667 298.666667 0 0 0-118.186667-244.053333l103.893333-162.986667a64 64 0 1 0-36.053333-23.04l-103.04 162.133334A416.213333 416.213333 0 0 0 512 277.333333a416.213333 416.213333 0 0 0-209.28 52.053334l-103.04-162.133334a64 64 0 1 0-36.053333 23.04l103.893333 162.986667A298.666667 298.666667 0 0 0 149.333333 597.333333v21.333334H42.666667v256h106.666666v85.333333h725.333334v-85.333333h106.666666zM85.333333 832v-170.666667h64v170.666667z m746.666667 85.333333H192V597.333333c0-192 160.64-277.333333 320-277.333333s320 85.333333 320 277.333333v320z m106.666667-85.333333h-64v-170.666667h64z' p-id='7909' fill='#8a8a8a'></path>";
|
|||
|
|
leftContent += "<path d='M405.333333 661.333333m-42.666666 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z' p-id='7910' fill='#8a8a8a'></path>";
|
|||
|
|
leftContent += "<path d='M618.666667 661.333333m-42.666667 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z' p-id='7911' fill='#8a8a8a'></path>";
|
|||
|
|
leftContent += "<path d='M661.333333 533.333333H362.666667a128 128 0 0 0 0 256h298.666666a128 128 0 0 0 0-256z m0 213.333334H362.666667a85.333333 85.333333 0 0 1 0-170.666667h298.666666a85.333333 85.333333 0 0 1 0 170.666667z' p-id='7912' fill='#8a8a8a'></path>";
|
|||
|
|
leftContent += "</svg>";
|
|||
|
|
leftContent += "</i>";
|
|||
|
|
leftContent += "<div class='direct-chat-text'>" + result + "</div>";
|
|||
|
|
leftContent += "</div>";
|
|||
|
|
return leftContent;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function topSpeechRecognitionSpeak(id) {
|
|||
|
|
$.ajax({
|
|||
|
|
url: ext.contextPath + '/work/speechRecognition/getJson.do', //上传接口地址
|
|||
|
|
type: "POST",
|
|||
|
|
data: {
|
|||
|
|
id: id,
|
|||
|
|
},
|
|||
|
|
dataType: 'json',
|
|||
|
|
success: function (speechRecognition) {
|
|||
|
|
if (speechRecognition.length > 0) {
|
|||
|
|
let nowS = speechRecognition[0];
|
|||
|
|
speakText(nowS.respondvoice);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$(document).click(function (e) {
|
|||
|
|
var divTree = $('#speechRecognitiondrop'); // 设置目标区域
|
|||
|
|
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
|||
|
|
divTree.hide()
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
var lastkeyCode = -1;
|
|||
|
|
$(document).keydown(function (event) {
|
|||
|
|
if (event.keyCode == 32) {
|
|||
|
|
if (event.keyCode == lastkeyCode) {
|
|||
|
|
// console.log('重复')
|
|||
|
|
} else {
|
|||
|
|
let st = $('#speechRecognitiondrop').css('display');
|
|||
|
|
if (st === 'none') {
|
|||
|
|
$('#speechRecognitiondrop').css('display', 'block');
|
|||
|
|
}
|
|||
|
|
speechRecognitionDown();
|
|||
|
|
// console.log('按下')
|
|||
|
|
}
|
|||
|
|
lastkeyCode = event.keyCode;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(document).keyup(function (event) {
|
|||
|
|
if (event.keyCode == 32) {
|
|||
|
|
// console.log('松开')
|
|||
|
|
lastkeyCode = -1;
|
|||
|
|
speechRecognitionUp();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
getPersonalAlarmNum();
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function showAlarmList() {
|
|||
|
|
addTab('alarmList', '报警信息', 'alarm/proAlarm/showlist.do');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getPersonalAlarmNum() {
|
|||
|
|
$.post(ext.contextPath + '/alarm/proAlarm/getPersonalAlarmNum.do', function (data) {
|
|||
|
|
let top_alarm_num = Number(data);
|
|||
|
|
if (top_alarm_num > 0) {
|
|||
|
|
$('#top_alarm_path').css("fill", "#d81e06");
|
|||
|
|
personalAlarmNum_time = setInterval(function () {
|
|||
|
|
$('#top_alarm_div').animate({opacity: '0'}, 1000);
|
|||
|
|
$('#top_alarm_div').animate({opacity: '1'}, 1000);
|
|||
|
|
}, 2000)
|
|||
|
|
if (top_alarm_num > 99) {
|
|||
|
|
$('#top_alarm_Num').text("99+");
|
|||
|
|
$('#top_alarm_Num').css("right", "-12px");
|
|||
|
|
} else {
|
|||
|
|
if (top_alarm_num < 10) {
|
|||
|
|
$('#top_alarm_Num').css("right", "2px");
|
|||
|
|
} else {
|
|||
|
|
$('#top_alarm_Num').css("right", "-5px");
|
|||
|
|
}
|
|||
|
|
$('#top_alarm_Num').text(top_alarm_num);
|
|||
|
|
}//消息声音
|
|||
|
|
if (msgplayer) {
|
|||
|
|
msgplayer = false;
|
|||
|
|
var player = document.getElementById("msgMedia");
|
|||
|
|
player.src = "<%=request.getContextPath()%>/node_modules/media/messaging.wav";
|
|||
|
|
player.loop = false;
|
|||
|
|
player.addEventListener('ended', function () {
|
|||
|
|
msgplayer = true;
|
|||
|
|
}, false);
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
$('#top_alarm_path').css("fill", "#00FF66");
|
|||
|
|
// $('#top_alarm_Num').css("right", "2px");
|
|||
|
|
$('#top_alarm_Num').text("");
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/*$(function() {
|
|||
|
|
var topWidth=$('#top').outerWidth();
|
|||
|
|
var topRightWidth=$('#topRight').outerWidth();
|
|||
|
|
var titleWidth=topWidth-topRightWidth-50;
|
|||
|
|
$("#topTitle").css('width',titleWidth);
|
|||
|
|
$("#topTitle").text("智慧水务云平台");
|
|||
|
|
});*/
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<header class="main-header">
|
|||
|
|
<input id="unitId" type="hidden" value="${unitId}"/>
|
|||
|
|
<audio id="msgMedia" autoplay="autoplay" class="hidden"></audio>
|
|||
|
|
<!-- Logo -->
|
|||
|
|
<a onclick="goToMainTab();" style="cursor:pointer " class="logo">
|
|||
|
|
<!-- mini logo for sidebar mini 50x50 pixels -->
|
|||
|
|
<span class="logo-mini"><b id="logo-mini">平台</b></span>
|
|||
|
|
<!-- logo for regular state and mobile devices -->
|
|||
|
|
<span class="logo-lg"><b id="logo-lg"><%-- ${cu._pname} --%></b></span>
|
|||
|
|
</a>
|
|||
|
|
<!-- Navbar Right Menu -->
|
|||
|
|
<div id="logo-top-title" class="pull-left hidden-xs hidden-sm"
|
|||
|
|
style="line-height:50px;text-align: center;color: #ffffff;font-size: 1.2vw;font-weight: bold;letter-spacing:8px;position: absolute;
|
|||
|
|
width: 40%;
|
|||
|
|
z-index: 1001;
|
|||
|
|
left: 30%;">
|
|||
|
|
</div>
|
|||
|
|
<!-- Header Navbar: style can be found in header.less -->
|
|||
|
|
<!-- Header Navbar -->
|
|||
|
|
<nav id="top" class="navbar navbar-static-top" role="navigation">
|
|||
|
|
<!-- Sidebar toggle button-->
|
|||
|
|
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
|||
|
|
<span class="sr-only">Toggle navigation</span>
|
|||
|
|
</a>
|
|||
|
|
<div id="topRight" class="navbar-custom-menu pull-right" style="position:absolute;right:0;top:0;">
|
|||
|
|
<ul class="nav navbar-nav">
|
|||
|
|
|
|||
|
|
<!-- 二维码 -->
|
|||
|
|
<!-- <li class="dropdown ">
|
|||
|
|
Menu Toggle Button
|
|||
|
|
<a onclick="showQrCode()" href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-qrcode"></i>APP二维码</a>
|
|||
|
|
<ul class="dropdown-menu" data-stopPropagation="true" style="width:150px;heigth:150px;" >
|
|||
|
|
<li>
|
|||
|
|
<div id="qrcode"></div>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</li> -->
|
|||
|
|
|
|||
|
|
<li class="dropdown">
|
|||
|
|
<!-- <a id="viewName" href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|||
|
|
珠海水务集团 <span class="caret"></span>
|
|||
|
|
</a>
|
|||
|
|
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="min-width:100%;">
|
|||
|
|
<li class="dropdown-submenu" >
|
|||
|
|
<a tabindex="-1" href="#" onclick="doChoice('珠海水务集团');">珠海水务集团</a>
|
|||
|
|
<ul class="dropdown-menu">
|
|||
|
|
<li><a tabindex="-1" href="#" onclick="doChoice('珠海一车间');">珠海一车间</a></li>
|
|||
|
|
<li><a tabindex="-1" href="#" onclick="doChoice('珠海二车间');">珠海二车间</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
</ul> -->
|
|||
|
|
<a id="companyName" href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="doChoice();">
|
|||
|
|
${cu._pname}
|
|||
|
|
</a>
|
|||
|
|
<ul id="top_company_tree" class="dropdown-menu" data-stopPropagation="true"
|
|||
|
|
style="padding:0px;background:rgba(250,250,250,0.75);">
|
|||
|
|
<li class="header" id="companyP"
|
|||
|
|
style="width:220px;height:220px;background:rgba(250,250,250,0.75);position: absolute;top:0px;left:0px;box-shadow:#d2cdcd 0px 3px 5px 0px;">
|
|||
|
|
<!-- <input type="hidden" id="companyOpenNum" value="1"> -->
|
|||
|
|
<div id="companytree" style="float:left;width:100%;height:100%;overflow:hidden;"></div>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<!-- Messages: style can be found in dropdown.less-->
|
|||
|
|
<!-- <li class="dropdown">
|
|||
|
|
<a onclick="goToMainTab();" style="cursor:pointer " title="首页">
|
|||
|
|
<i class="fa fa-desktop fa-fw"></i>
|
|||
|
|
</a>
|
|||
|
|
</li> -->
|
|||
|
|
|
|||
|
|
<li class="dropdown alarm-menu" onclick="showAlarmList();">
|
|||
|
|
<a onclick="" style="cursor:pointer;height: 50px;" title="报警消息">
|
|||
|
|
<div id="top_alarm_div" style="width: 100%;height: 100%;">
|
|||
|
|
<svg id="top_alarm_svg" t="1638000485128" class="icon" viewBox="0 0 1024 1024" width="18"
|
|||
|
|
height="18"
|
|||
|
|
style="z-index: 90;">
|
|||
|
|
<path id="top_alarm_path"
|
|||
|
|
d="M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233z m72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563z m-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9c-3.1-3.1-8.2-3.1-11.3 0l-39.6 39.6c-3.1 3.1-3.1 8.2 0 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0z m669.6-79.2l-39.6-39.6c-3.1-3.1-8.2-3.1-11.3 0l-67.9 67.9c-3.1 3.1-3.1 8.2 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"
|
|||
|
|
p-id="2583" fill="transparent"></path>
|
|||
|
|
<%-- <rect fill="transparent" width="100%" height="100%">--%>
|
|||
|
|
<%-- <animate id="top_alarm_animate"--%>
|
|||
|
|
<%-- attributeName="fill"--%>
|
|||
|
|
<%-- values="transparent;transparent"--%>
|
|||
|
|
<%-- begin="0s"--%>
|
|||
|
|
<%-- dur="1s"--%>
|
|||
|
|
<%-- calcMode="discrete"--%>
|
|||
|
|
<%-- repeatCount="indefinite"--%>
|
|||
|
|
<%-- />--%>
|
|||
|
|
<%-- </rect>--%>
|
|||
|
|
</svg>
|
|||
|
|
</div>
|
|||
|
|
<span class="label label-danger" id="top_alarm_Num" style="z-index: 80;right: 2px;"></span>
|
|||
|
|
</a>
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li class="dropdown tasks-menu">
|
|||
|
|
<a onclick="goToTaskList();" style="cursor:pointer " title="待办事项">
|
|||
|
|
<i class="fa fa-flag-o fa-fw"></i>
|
|||
|
|
<span class="label label-danger" id="taskNum"></span>
|
|||
|
|
</a>
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<!-- <li class="dropdown messages-menu">
|
|||
|
|
<a onclick="goToMsgListView();" style="cursor:pointer;">
|
|||
|
|
<i class="fa fa-envelope-o fa-fw"></i>
|
|||
|
|
<span class="label label-success" id="span_unread"></span>
|
|||
|
|
</a>
|
|||
|
|
</li> -->
|
|||
|
|
|
|||
|
|
<li class="dropdown messages-menu">
|
|||
|
|
<!-- Menu toggle button -->
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="消息">
|
|||
|
|
<i class="fa fa-envelope-o fa-fw"></i>
|
|||
|
|
<span class="label label-success" id="span_unread"></span>
|
|||
|
|
</a>
|
|||
|
|
<ul class="dropdown-menu">
|
|||
|
|
<li class="header" id="li_unread"></li>
|
|||
|
|
<li>
|
|||
|
|
<!-- inner menu: contains the messages -->
|
|||
|
|
<ul class="menu" id="msglist">
|
|||
|
|
<!-- end message -->
|
|||
|
|
</ul>
|
|||
|
|
<!-- /.menu -->
|
|||
|
|
</li>
|
|||
|
|
<li class="footer"><a style="cursor:pointer " onclick="goToMsgListView();">查看所有信息</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
<!-- /.messages-menu -->
|
|||
|
|
<!-- 已办事项 20220601取消-->
|
|||
|
|
<!-- <li class="dropdown tasks-menu">
|
|||
|
|
<a onclick="goToDoneTaskList();" style="cursor:pointer " title="已办事项">
|
|||
|
|
<i class="fa fa-calendar-check-o fa-fw"></i>
|
|||
|
|
<span class="label label-danger" id="taskNum"></span>
|
|||
|
|
</a>
|
|||
|
|
</li> -->
|
|||
|
|
<!-- 二维码 -->
|
|||
|
|
<li class="dropdown ">
|
|||
|
|
<!-- Menu Toggle Button -->
|
|||
|
|
<a onclick="showQrCode()" href="#" class="dropdown-toggle" data-toggle="dropdown"><i
|
|||
|
|
class="glyphicon glyphicon-qrcode"></i></a>
|
|||
|
|
<ul class="dropdown-menu" data-stopPropagation="true">
|
|||
|
|
<li>
|
|||
|
|
<div id="qrcode"></div>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li class="dropdown ">
|
|||
|
|
<!-- <li class="dropdown" > -->
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="showSpeechRecognition();">
|
|||
|
|
<i class="fa fa-commenting-o"></i>
|
|||
|
|
</a>
|
|||
|
|
<ul id="speechRecognitiondrop" class="dropdown-menu" data-stopPropagation="true"
|
|||
|
|
style="width:280px;height:400px;overflow: auto;box-shadow:#d2cdcd 0px 3px 5px 0px;margin-left: -68px;">
|
|||
|
|
<div id="speechRecognitionContent" class="direct-chat-messages"
|
|||
|
|
style="float: left;width:100%;height: 360px;">
|
|||
|
|
<div style="width: 100%;text-align: center;">请按住录音键说话!</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- <div id="speechRecognitionContentWait" style="width: 100%;text-align: center;display:none;">识别中,请稍等!</div> -->
|
|||
|
|
<div style="float: left;width:100%;">
|
|||
|
|
<button style="float: right;margin-right: 5px;margin-top: 2px;" title="按住说话"
|
|||
|
|
onmousedown="speechRecognitionDown();" onmouseup="speechRecognitionUp();">
|
|||
|
|
<i class="fa fa-volume-down"></i>
|
|||
|
|
</button>
|
|||
|
|
<button style="float: right;margin-right: 5px;margin-top: 2px;" title="清除内容"
|
|||
|
|
onclick="delSpeechRecognition();">
|
|||
|
|
<i class="fa fa-trash-o"></i>
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
<!-- Menu Toggle Button -->
|
|||
|
|
<%-- <a onclick="showSpeechRecognition()" href="#" class="dropdown-toggle" data-toggle="dropdown"><i--%>
|
|||
|
|
<%-- class="fa fa-commenting-o"></i></a>--%>
|
|||
|
|
<%-- <ul class="dropdown-menu" data-stopPropagation="true" style="width:100%;height:200px;float: left;">--%>
|
|||
|
|
<%-- <li>--%>
|
|||
|
|
<%-- <div id="speechRecognition"></div>--%>
|
|||
|
|
<%-- </li>--%>
|
|||
|
|
<%-- </ul>--%>
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<!-- Notifications Menu -->
|
|||
|
|
<!-- <li class="dropdown notifications-menu">
|
|||
|
|
Menu toggle button
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|||
|
|
<i class="fa fa-bell-o"></i>
|
|||
|
|
<span class="label label-warning">10</span>
|
|||
|
|
</a>
|
|||
|
|
<ul class="dropdown-menu">
|
|||
|
|
<li class="header">You have 10 notifications</li>
|
|||
|
|
<li>
|
|||
|
|
Inner Menu: contains the notifications
|
|||
|
|
<ul class="menu">
|
|||
|
|
<li>start notification
|
|||
|
|
<a href="#">
|
|||
|
|
<i class="fa fa-users text-aqua"></i> 5 new members joined today
|
|||
|
|
</a>
|
|||
|
|
</li>
|
|||
|
|
end notification
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
<li class="footer"><a href="#">View all</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
Tasks Menu
|
|||
|
|
-->
|
|||
|
|
<!-- User Account Menu -->
|
|||
|
|
<li class="dropdown user user-menu">
|
|||
|
|
<!-- Menu Toggle Button -->
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|||
|
|
<!-- The user image in the navbar-->
|
|||
|
|
<!--如果用户没有上传过头像,显示系统默认头像 -->
|
|||
|
|
<c:if test="${empty cu.userDetail}">
|
|||
|
|
<c:choose>
|
|||
|
|
<c:when test="${cu.sex=='0'}">
|
|||
|
|
<img src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar2.png"
|
|||
|
|
class="user-image" alt="User Image">
|
|||
|
|
</c:when>
|
|||
|
|
<c:otherwise>
|
|||
|
|
<img src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar5.png"
|
|||
|
|
class="user-image" alt="User Image">
|
|||
|
|
</c:otherwise>
|
|||
|
|
</c:choose>
|
|||
|
|
</c:if>
|
|||
|
|
<c:if test="${not empty cu.userDetail}">
|
|||
|
|
<c:choose>
|
|||
|
|
<c:when test="${not empty cu.userDetail.icon}">
|
|||
|
|
<img src="${cu.userDetail.icon}"class="user-image" alt="User Image">
|
|||
|
|
</c:when>
|
|||
|
|
<c:otherwise>
|
|||
|
|
<c:choose>
|
|||
|
|
<c:when test="${cu.sex=='0'}">
|
|||
|
|
<img src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar2.png"
|
|||
|
|
class="user-image" alt="User Image">
|
|||
|
|
</c:when>
|
|||
|
|
<c:otherwise>
|
|||
|
|
<img src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar5.png"
|
|||
|
|
class="user-image" alt="User Image">
|
|||
|
|
</c:otherwise>
|
|||
|
|
</c:choose>
|
|||
|
|
</c:otherwise>
|
|||
|
|
</c:choose>
|
|||
|
|
</c:if>
|
|||
|
|
<!-- hidden-xs hides the username on small devices so only the image appears. -->
|
|||
|
|
<span class="hidden-xs">${cu.caption}</span>
|
|||
|
|
</a>
|
|||
|
|
<ul class="dropdown-menu">
|
|||
|
|
<!-- The user image in the menu -->
|
|||
|
|
<li class="user-header">
|
|||
|
|
<c:if test="${empty cu.userDetail}">
|
|||
|
|
<c:choose>
|
|||
|
|
<c:when test="${cu.sex=='0'}">
|
|||
|
|
<img onclick="viewPersonalInformation()" style="cursor: pointer;"
|
|||
|
|
src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar2.png"
|
|||
|
|
class="img-circle" alt="User Image">
|
|||
|
|
</c:when>
|
|||
|
|
<c:otherwise>
|
|||
|
|
<img onclick="viewPersonalInformation()" style="cursor: pointer;"
|
|||
|
|
src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar5.png"
|
|||
|
|
class="img-circle" alt="User Image">
|
|||
|
|
</c:otherwise>
|
|||
|
|
</c:choose>
|
|||
|
|
</c:if>
|
|||
|
|
<c:if test="${not empty cu.userDetail}">
|
|||
|
|
<c:choose>
|
|||
|
|
<c:when test="${not empty cu.userDetail.icon}">
|
|||
|
|
<img onclick="viewPersonalInformation()" style="cursor: pointer;"
|
|||
|
|
src="${cu.userDetail.icon}" class="img-circle" alt="User Image">
|
|||
|
|
</c:when>
|
|||
|
|
<c:otherwise>
|
|||
|
|
<c:choose>
|
|||
|
|
<c:when test="${cu.sex=='0'}">
|
|||
|
|
<img onclick="viewPersonalInformation()" style="cursor: pointer;"
|
|||
|
|
src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar2.png"
|
|||
|
|
class="img-circle" alt="User Image">
|
|||
|
|
</c:when>
|
|||
|
|
<c:otherwise>
|
|||
|
|
<img onclick="viewPersonalInformation()" style="cursor: pointer;"
|
|||
|
|
src="<%=request.getContextPath()%>/plugins/AdminLTE/img/avatar5.png"
|
|||
|
|
class="img-circle" alt="User Image">
|
|||
|
|
</c:otherwise>
|
|||
|
|
</c:choose>
|
|||
|
|
</c:otherwise>
|
|||
|
|
</c:choose>
|
|||
|
|
</c:if>
|
|||
|
|
<p>
|
|||
|
|
${cu.caption}
|
|||
|
|
<small>上次登录时间:${cu.lastlogintime}</small>
|
|||
|
|
</p>
|
|||
|
|
</li>
|
|||
|
|
<!-- Menu Body -->
|
|||
|
|
<li class="user-body">
|
|||
|
|
<div class="row">
|
|||
|
|
<div class="col-xs-4 text-center">
|
|||
|
|
<a onclick="changeTheme()" style="cursor: pointer;">切换主题</a>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-xs-4 text-center">
|
|||
|
|
<a onclick="changePassword()" style="cursor: pointer;">修改密码</a>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-xs-4 text-center">
|
|||
|
|
<a onclick="logout()" style="cursor: pointer;">登出</a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</li>
|
|||
|
|
<!-- Menu Footer-->
|
|||
|
|
<!-- <li class="user-footer">
|
|||
|
|
<div class="pull-right">
|
|||
|
|
<a onclick="logout()" class="btn btn-default btn-flat">登出</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li> -->
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
<!-- Control Sidebar Toggle Button -->
|
|||
|
|
<li>
|
|||
|
|
<!-- <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> -->
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</nav>
|
|||
|
|
</header>
|