|
@@ -4,7 +4,7 @@ require('jquery-templates');
|
|
|
const md5 = require('js-md5');
|
|
|
require("./modal.js")
|
|
|
const {api} = require('./api.js')
|
|
|
-const {post,pageMap,delCookie,setCookie,getCookie} = require('./utils.js');
|
|
|
+const {post,pageMap,delCookie,setCookie,getCookie,focusMenuItem} = require('./utils.js');
|
|
|
let userInfo={};
|
|
|
$(function(){
|
|
|
getMenu();
|
|
@@ -28,10 +28,16 @@ $(function(){
|
|
|
$("#changeWord").css("opacity",hasData('FUNC000002')?'1':'0.5').hover(function(){
|
|
|
$(this).css("color","#777777")
|
|
|
})
|
|
|
- $("#contentIframe").attr("src",hasData('YH-KZT')?'console.html':hasData('YH-KZTKS')?'deptConsole.html':'console.html');
|
|
|
+ // $("#contentIframe").attr("src",hasData('YH-KZT')?'console.html':hasData('YH-KZTKS')?'deptConsole.html':'console.html');
|
|
|
});
|
|
|
//判断有无某一权限
|
|
|
-function hasData(data){
|
|
|
+function hasData(data,list){
|
|
|
+ if(list&&list.length>0){
|
|
|
+ if(list.indexOf(data)>-1){//有权限
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let lis = JSON.parse(getCookie("codeLis"))||[]
|
|
|
if(lis.indexOf(data)>-1){//有权限
|
|
|
return true
|
|
@@ -120,7 +126,7 @@ function getOwnDept(){
|
|
|
let result = data.data
|
|
|
setCookie("deptList",JSON.stringify(result))
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
// }
|
|
|
}
|
|
|
function getMenu(){
|
|
@@ -132,7 +138,7 @@ function getMenu(){
|
|
|
setCookie("hospital",data.basHospitalInfoDTO.name)
|
|
|
getAllCode(data.menuWrappers);
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
};
|
|
|
function getAllCode(data){
|
|
|
let lis = [],personCodeLis=[],deptCodeLis=[],trdObj={}
|
|
@@ -158,6 +164,12 @@ function getAllCode(data){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // $("#contentIframe").attr("src",hasData('YH-KZT')?'console.html':hasData('YH-KZTKS')?'deptConsole.html':'console.html');
|
|
|
+ if(hasData('YH-KZT',lis)){
|
|
|
+ focusMenuItem("YH-KZT");
|
|
|
+ }else if(hasData('YH-KZTKS',lis)){
|
|
|
+ focusMenuItem("YH-KZTKS");
|
|
|
+ }
|
|
|
setCookie("codeLis",JSON.stringify(lis))
|
|
|
setCookie("trdObj",JSON.stringify(trdObj))
|
|
|
}
|