Index: ssts-web/src/main/webapp/homepage/portalPage.js
===================================================================
diff -u -r18405 -r19361
--- ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 18405)
+++ ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 19361)
@@ -66,18 +66,6 @@
bindEvent('menus_box','mousedown',function(){
closeMenus_box();
});
- /*
- $("#windowBox").mousedown(function(){
- closeMenus_box();
- });
-
- $(".header").mousedown(function(){
- closeMenus_box();
- });
-
- $("#menus_box").blur(function(){
- closeMenus_box();
- });*/
}
//点击页面,隐藏菜单面板
function onOverlayStartMenuClick(){
@@ -88,15 +76,6 @@
}else{
hideElement("overlay_startmenu");
}
- /*$("#overlay_startmenu").click(function(){
- if(showOrHide){
- closeMenus_box();
- //隐藏遮罩层
- $("#overlay_startmenu").hide();
- }else{
- $("#overlay_startmenu").hide();
- }
-});*/
}
/**
@@ -126,23 +105,24 @@
var biologicalMonitoringWarningWindow = null;
var biologicalMonitoringWarningGrid = null;
+
+/**
+ * 跳转到历史回收界面.
+ */
function gosterilizationRecordView() {
-
addTab('sterilizationRecordView','历史灭菌记录管理',WWWROOT+'/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordView.jsp?editMode=true');
biologicalMonitoringWarningWindow.hide();
// if (warningWindow && warningWindow.isVisible()) { //考虑一下系统告警的窗口如果没关也帮他关闭了
// warningWindow.close();
// }
-
}
/**
- * 开启生物监测结束后的提示功能
+ * 开启生物监测结束后的提示功能.
* @param userName
* @param currentDepartCode
*/
function runBiologicalMonitoringWarning(userName, currentDepartCode) {
-
Ext4.Ajax.request({
url : WWWROOT + '/disinfectSystem/biologyMonitorWarningAction!getBiologyMonitorWarning.do',
params : {userName : userName, currentDepartCode : currentDepartCode},
@@ -193,10 +173,8 @@
}
}
});
-
}
-//window.onload start
Ext4.onReady(function(){
//屏蔽回退键,防止点击backspace键时,浏览器后退
disableBackspace();
@@ -206,7 +184,6 @@
bindEvent('overlay_startmenu','click',onOverlayStartMenuClick);
//初始化 tabs对象
- //tabs = initTabs(); extjs4的使用
initTabs();
createMenu();
@@ -215,25 +192,6 @@
//添加个人桌面tab标签 及 个人桌面ul、li信息
initPersonalDestop();
- //初始化个人桌面可拖动
- /*$(".desktop ul").sortable({
- items: "li",
- revert: true,
- scroll: false,
- tolerance: 'pointer',
- containment: ".desktop",
- connectWith: ".desktop ul",
- stop: serializeSlide,
- start: function(event,ui){
- isDrag = true;//拖拽事件start
- },
- sort : function(event,ui){
- initTipPosition();
- },
- stop : function(event,ui){
- initTipPosition();
- }
- });*/
var desktop = getById('personalDesktop');
Ext4.each(desktop.query('li'),function(item){
getElement(item).on('click',function(event){
@@ -257,27 +215,7 @@
CancelBuble(event);//阻止事件冒泡
})
});
- /*$(".desktop ul").disableSelection();
- $(".desktop ul > li").unbind("click").bind("click", function(event){
- if(!isDrag){
- var scrObj = $(this);
- var objId;
- if( (objId=scrObj.attr("id")) == "satisfactionSurveyTable"){
- showSatisfactionSurveyWinTips();
- }else if(objId == "systemWarning"){
- showSystemWarningWin();
- }else{
- setTimeout(function(){
- if(objId!= 'packing' && objId != 'reviewPacking' && objId != 'sterilizationRecord'){
- addTab(objId, scrObj.attr("title"), encodeURIComponent(scrObj.attr("href")));
- }
- }, 1); //延迟1毫秒
- }
- }else{
- isDrag = false;
- }
- CancelBuble(event);//阻止事件冒泡
- });*/
+
//系统告警
initShowSystemWarningWin();
@@ -347,21 +285,6 @@
//满意度调查数字提醒
var satisfactionSurveyTableObj = document.getElementById('satisfactionSurveyTable');
if(satisfactionSurveyTableObj){
- //给个人桌面图标添加入iphone风格的数字提示信息
- // DWREngine.setAsync(false);
- // SatisfactionSurveyTemplateTableManager.loadSatisfactionSurveyTemplateNoticeNum(function (amount){
- // if(amount>0 && amount<11){
- // insertHtml('

');
- // showSatisfactionSurveyWinTips();
- // }else if(amount >= 11){
- // insertHtml('
');
- // showSatisfactionSurveyWinTips();
- // }else{
- // //否则隐藏
- // satisfactionSurveyTableObj.style.display = "none";
- // }
- // });
- // DWREngine.setAsync(true);
sendDWRAsync(function () {
SatisfactionSurveyTemplateTableManager.loadSatisfactionSurveyTemplateNoticeNum(function(amount){
addIconTips(amount,satisfactionSurveyTableObj,'satisfactionSurveyTableTip',showSatisfactionSurveyWinTips,true);
@@ -489,7 +412,6 @@
store.load();
windowOnLoaded = true;
});
-//window.onload end
function initTipPosition(){
showInvoicePlanTipIsNeed();
@@ -596,16 +518,9 @@
}
}
-function addTabsDoubleClickEventToClose(){
-/*双击关闭TAB选项卡*/
- /*$(".tabs-inner").dblclick(function(){
- var subtitle = $.trim($(this).children("span").text());
- if(subtitle==personalDesktopTitle)return;
- $("#card_box").tabs("close",subtitle);
- });*/
-}
-
-//是否为iPad event
+/**
+ * 是否为iPad event
+ */
function isTouchDevice(){
try{
document.createEvent("TouchEvent");
@@ -660,7 +575,6 @@
//if(!$("#card_box").tabs("exists",subtitle)){ //这种判断会模糊匹配,比如已打开的选项卡名称是ABCDE,那么ABC,BCD,CDE等都会匹配上,所以改掉
if(!existsTab){
createIframeAppendToWindowBox(itemId, subtitle, url);
- //var height = isTouchDevice() ? "auto" : "100%";
$("#card_box").tabs("add",{
title:subtitle,
fit:true,
@@ -673,22 +587,7 @@
$("#card_box").tabs("select",subtitle);
}
}
-/*function addTabJquery(itemId, subtitle, url){
- if(!$("#card_box").tabs("exists",subtitle)){
- createIframeAppendToWindowBox(itemId, subtitle, url);
- //var height = isTouchDevice() ? "auto" : "100%";
- $("#card_box").tabs("add",{
- title:subtitle,
- fit:true,
- //iconCls:"",显示在tab panel 标题上的图标的 CSS 类
- content:'',
- closable:true,
- selected:true
- });
- }else{
- $("#card_box").tabs("select",subtitle);
- }
-}*/
+
function addTab(itemId, subtitle, url){
if(typeof itemId == "undefined" || itemId == "") return;
//var selected = (typeof(selected) == "undefined") ? true : selected;
@@ -699,12 +598,9 @@
return;
};
addTabJquery(itemId, subtitle, url);
-
- //添加tabs双击关闭事件
- //addTabsDoubleClickEventToClose();
}
/**
- * 判断此桌面图标是否不在config.js配置的白名单之内(不在则返回true,否则返回false)
+ * 判断此桌面图标是否不在config.js配置的白名单之内(不在则返回true,否则返回false).
* @param itemId 桌面图标的id
*/
function notInWhiteList2(itemId) {
@@ -801,6 +697,13 @@
}
return flag;
}
+
+/**
+ * 解析portalPage.xml配置的某个人桌面功能图标.
+ * @param portalPage
+ * @param item
+ * @returns {String}
+ */
function parsePortItem(portalPage,item){
var returnContent = "";
if(portalPage && item){
@@ -873,8 +776,13 @@
}
}
return returnContent;
-
}
+
+/**
+ * 解析portalPage.xml配置全部个人桌面功能图标.
+ * @param jsonObj
+ * @returns {String}
+ */
function parsePortal(jsonObj){
var returnContent = '';
if(jsonObj){
@@ -892,9 +800,17 @@
}
return returnContent;
}
+
+/**
+ * 创建iframe.
+ * @param itemId iframe的id,如果值为-1则为个人桌面的iframe(注意:实际的id会被加上iframe_作为前缀)
+ * @param url iframe的连接地址
+ * @param height iframe的高度
+ * @returns {String}
+ */
function createFrame(itemId,url,height){
var returnContent = '';
- if(itemId==-1){//个人桌面
+ if(itemId==-1){//个人桌面的iframe
returnContent = parsePortal(jsonObj);
}else{
var url = decodeURIComponent(url);
@@ -905,55 +821,9 @@
}
return returnContent;
}
-/*function createFrame(itemId,url,height){
- var returnContent = '';
- if(itemId==-1){//个人桌面
- $.each(jsonObj, function(commentIndex, portalPage) {
- returnContent += '';
- returnContent += '
';
- $.each(portalPage['portalItems'] ,function(itemIndex, item){
- itemUrl = "";
- var url = item['imgUrl'];
- if(isIE6){
- url = url.replace('.png','.jpg');
- }
- itemUrl = WWWROOT + url;
- if(item['itemId'] != 'packing' && item['itemId'] != 'reviewPacking' && item['itemId'] !='sterilizationRecord'){
- var supplyRoomRecall = false;
- if(item['itemId'] == "recallRecord"){
- if(SSTS_RecallRecord_Menu == false){
- supplyRoomRecall = true;
- }
- }
- if(supplyRoomRecall){//供应室召回管理界面
- returnContent += '- ';
- returnContent += '';
- returnContent += ''+item['title']+'
';
- }else{//临床科室查看召回记录界面
- returnContent += '- ';
- returnContent += '';
- returnContent += ''+item['title']+'
';
- }
- }else{
- returnContent += '- ';
- returnContent += '';
- returnContent += ''+item['title']+'
';
- }
- });
- returnContent +='
';
- });
- }else{
- var url = decodeURIComponent(url);
- if(url.indexOf((WWWROOT+"/"))==-1){
- url = WWWROOT + url;
- }
- returnContent = '';
- }
- return returnContent;
-}*/
/**
- * 创建tab标签所对应的页面iframe
+ * 创建tab标签所对应的页面iframe.
*/
function createIframeAppendToWindowBox(id,title,href){
var titelCode = escape(title.toString());
@@ -972,30 +842,17 @@
var content = createFrame(id,href,height);
var div = "" + content + "
";
insertHtml(div,'windowBox');
- /*
- var $div = $("");
- var $iframeContent = $(content);
- $div.append($iframeContent);
- $("#windowBox").append($div);*/
}
/**
* tab 标签选择变化时发生,title为新tab的标题
*/
function onTabChange(title){
//控制红色数字提醒的显示和隐藏
if(title == personalDesktopTitle){
- // showElement('invoicePlanTip');
- // showElement('problemReportTip');
- // showElement('satisfactionSurveyTableTip');
- // showElement('borrowManagerTip');
Ext.each(tipsEle,function (item) {
showElement(item);
});
}else{
- // hideElement('invoicePlanTip');
- // hideElement('problemReportTip');
- // hideElement('satisfactionSurveyTableTip');
- // hideElement('borrowManagerTip');
Ext.each(tipsEle,function (item) {
hideElement(item);
});
@@ -1141,6 +998,10 @@
});
tabs.setActiveTab(tab);
}
+
+/**
+ * 初始化个人桌面的iframe.
+ */
function insertPersonalDesktopContent(){
var height = isTouchDevice() ? "auto" : "100%";
var destopContent = createFrame("-1","",height);
@@ -1152,23 +1013,17 @@
insertPersonalDesktopContent();
}
/**
- * 添加个人桌面tab标签 及 初始化个人桌面
+ * 添加个人桌面tab标签 及 初始化个人桌面.
*/
function initPersonalDestop(){
$("#card_box").tabs("add",{
title:personalDesktopTitle,
fit:true,
- //iconCls:"",显示在tab panel 标题上的图标的 CSS 类
content:'',
closable:false,
selected:true
});
insertPersonalDesktopContent();
- /*var height = isTouchDevice() ? "auto" : "100%";
- var destopContent = createFrame("-1","",height);
- var $personalDesktopDiv = $("#personalDesktop");
- var $desktopContent = $(destopContent);
- $personalDesktopDiv.append($desktopContent);*/
}
/**
@@ -1186,13 +1041,10 @@
function serializeSlide() {
//目前码面只有一页,所以此处先写死为0,拖拽翻页还没实现
var pageId = jsonObj[0]["pageId"];
- //alert(pageId);
- //var flag = false;
var idStrList = "";
var liList = $("ul#desktopPanel_"+pageId+" > li");
$.each(liList, function(){
- //if(!$(this).attr("id"))
if(idStrList!=""){
idStrList += ",";
}
@@ -1204,28 +1056,22 @@
url: WWWROOT+"/homepage/saveOrUpdatePortalPage.do",
success: function(r) {
if (r == "+ok") {
- // flag = true;
}
}
});
-// return flag;
-}
+}
function closeMenus_box(){
showOrHide = false;
showOrHideOverlay();//隐藏遮罩层
if(getById('menus_box').isVisible(true)){
getById('menus_box').hide();
}
- /*if($("#menus_box:visible").length){
- $("#menus_box").hide(300);
- }*/
}
function showOrHideOverlay(){
if(showOrHide){
getById('overlay_startmenu').show();
- //$("#overlay_startmenu").show();
}else{
hideOverlayStartMenu();
}
@@ -1235,9 +1081,6 @@
if(getById('overlay_startmenu').isVisible()){
hideElement('overlay_startmenu');
}
- /*if($("#overlay_startmenu:visible").length){
- $("#overlay_startmenu").hide();
- }*/
}
function swapimg(myimgObj,secNum){
@@ -1296,30 +1139,6 @@
});
return window;
}
-//获取当前打开的tab里的iframe对象,即放置主要内容的子窗口
-/*function getCurrentTab() {
- var iframes = $("iframe.iframeClass:visible");
- var window;
- $.each(iframes,function(){
- if($.browser.msie) {
- //IE 6,7 不支持contentDocument
- window = this.contentWindow;
- //window = document.frames['desktopIframe'];此写法有问题,得到的是最后打开的iframe
- if(window.document.frames['mainFrame'] != null){
- if('mainFrame'==window.document.frames['mainFrame'].name){
- window = window.document.frames['mainFrame'];
- }
- }
- } else {
- var context = $(this).context;
- window = context.contentWindow;
- if('iframe_enterpriseView'==context.id) {
- window = context.contentDocument.getElementById('mainFrame').contentWindow;
- }
- }
- });
- return window;
-}*/
function initShowSystemWarningWin(){
doShowSystemWarningWinByParam(true);
@@ -1595,5 +1414,4 @@
method : 'POST',
params : {currentOrgUnitCode: currentOrgUnitId}
});
-
}
\ No newline at end of file