|
@ -4,10 +4,10 @@ new Vue({
|
|
|
return {
|
|
|
// iframeSrc: "../../new-quailty-manager/html/new-quailty-manager.html",
|
|
|
loading: false,
|
|
|
tabList: [],
|
|
|
historyArr:[{url:'../../bigData/html/home.html',text:'测试'},], //历史记录
|
|
|
|
|
|
historyArr:[{url:'../html/home.html',text:'首页'},], //历史记录
|
|
|
activeIndex:'0' , //当前历史记录选中的下标
|
|
|
leftTabActive:'2-0',//左边菜单中当前高亮下标
|
|
|
leftTabActive:'0-0',//左边菜单中当前高亮下标
|
|
|
isCollapse: false, //导航栏是否隐藏
|
|
|
screenWidth: document.body.clientWidth,//屏幕宽度
|
|
|
}
|
|
@ -23,21 +23,30 @@ new Vue({
|
|
|
},
|
|
|
mounted:function() {
|
|
|
this.resize()
|
|
|
GlobalEventBus.$on("setLoading", function(arg) {
|
|
|
|
|
|
if(arg.loading){
|
|
|
vm.loading = true
|
|
|
}
|
|
|
else{
|
|
|
vm.loading = false
|
|
|
}
|
|
|
});
|
|
|
GlobalEventBus.$on("setIframeUrl", function(arg) {
|
|
|
|
|
|
vm.setHistory(arg.history)
|
|
|
});
|
|
|
this.bidnEvent()
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
bidnEvent:function(){ //供子页面调用的事件 (子页面是iframe)
|
|
|
var vm =this;
|
|
|
GlobalEventBus.$on("setLoading", function(arg) { //控制整个界面加载
|
|
|
|
|
|
if(arg && arg.loading){
|
|
|
vm.loading = true
|
|
|
}
|
|
|
else{
|
|
|
vm.loading = false
|
|
|
}
|
|
|
});
|
|
|
GlobalEventBus.$on("setIframeUrl", function(arg) { //新打开窗口并且记录历史记录
|
|
|
|
|
|
vm.setHistory(arg.history)
|
|
|
});
|
|
|
GlobalEventBus.$on("setleftTabUrl", function(arg) { //打开左边菜单中的页面 可直接传对应
|
|
|
|
|
|
vm.handleSelect(arg.key)
|
|
|
});
|
|
|
},
|
|
|
resize:function() { //监听页面改变大小
|
|
|
const that = this
|
|
|
this.isCollapse = this.screenWidth >= 786 ? false : true;
|
|
@ -57,25 +66,30 @@ new Vue({
|
|
|
this.isCollapse = !this.isCollapse;
|
|
|
break;
|
|
|
case '2-0':
|
|
|
|
|
|
activeObj = {url:'../html/search.html',text:'全文病历检索'};
|
|
|
break;
|
|
|
case '2-1':
|
|
|
activeObj = {url:'../../bigData/html/medical.html',text:'各个'};
|
|
|
window.open('../../bigData/html/medical.html')
|
|
|
break;
|
|
|
case '2-2':
|
|
|
|
|
|
window.open('../../bigData/html/medical.html')
|
|
|
break;
|
|
|
case '2-3':
|
|
|
|
|
|
}
|
|
|
window.open('../../bigData/html/home.html')
|
|
|
break;
|
|
|
case '2-4':
|
|
|
activeObj = {url:'../html/search.html',text:'医保控费分析'};
|
|
|
break;
|
|
|
}
|
|
|
if(!activeObj)return
|
|
|
this.leftTabActive=key
|
|
|
|
|
|
|
|
|
activeObj.fromLeft=true
|
|
|
// key=key.toString()
|
|
|
// this.isActive = key.substring(0, 1)
|
|
|
// var childrenIndex= key.split('-')[1]-1;
|
|
|
// var activeObj = this.tabList[(this.isActive-1)].children[childrenIndex];
|
|
|
if(activeObj)
|
|
|
|
|
|
vm.setHistory(activeObj)
|
|
|
},
|
|
|
deleteHistory:function(index){
|
|
@ -85,30 +99,34 @@ new Vue({
|
|
|
}
|
|
|
},
|
|
|
setHistory:function(obj){
|
|
|
|
|
|
|
|
|
var vm = this;
|
|
|
var exist = false;
|
|
|
var index = null;
|
|
|
|
|
|
|
|
|
if(typeof(obj)=='string'){ //有些页面直接传url过来 先检测是是左边菜单中的哪个
|
|
|
|
|
|
// if(typeof(obj)=='string'){ //如果左边菜单换成数组的话 现在暂时没空
|
|
|
|
|
|
vm.tabList.forEach(function(v){
|
|
|
v.children.forEach(function(value){
|
|
|
if(typeof(obj)=='string' && obj.indexOf(value.url) != -1){
|
|
|
var obj1 =newObj(value);
|
|
|
obj1.url=obj;
|
|
|
obj=obj1;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
// vm.tabList.forEach(function(v){
|
|
|
// v.children.forEach(function(value){
|
|
|
// if(typeof(obj)=='string' && obj.indexOf(value.url) != -1){
|
|
|
// var obj1 =newObj(value);
|
|
|
// obj1.url=obj;
|
|
|
// obj=obj1;
|
|
|
// }
|
|
|
// })
|
|
|
// })
|
|
|
// }
|
|
|
|
|
|
vm.historyArr= vm.historyArr.map(function(v,i){ //检测要跳转的url是否在历史记录中
|
|
|
if(obj.url.indexOf(v.url.split('?')[0]) != -1 ){
|
|
|
switch (obj.url){ //已经存在并且在左边的菜单的话则需要高亮左边菜单
|
|
|
case "../html/home.html":obj.index='0-0';break;
|
|
|
case "../html/search.html":obj.index='2-0';break;
|
|
|
}
|
|
|
exist=true;
|
|
|
index = i;
|
|
|
if(v.url!=obj.url) v.url=obj.url //如果参数不同则重新赋值
|
|
|
if(v.url!=obj.url && !obj.fromLeft) v.url=obj.url //如果参数不同则重新赋值 按左边的则不需要比较
|
|
|
|
|
|
}
|
|
|
return v
|
|
@ -120,10 +138,11 @@ new Vue({
|
|
|
else{ //存在则直接跳转
|
|
|
this.activeIndex =index
|
|
|
}
|
|
|
if(obj.index) this.leftTabActive=obj.index //控制左边菜单选中
|
|
|
if(obj.index)
|
|
|
this.leftTabActive=obj.index //控制左边菜单选中
|
|
|
},
|
|
|
controlRouter:function(key) {
|
|
|
debugger
|
|
|
|
|
|
switch (key) {
|
|
|
case '1':
|
|
|
this.closeAllHistory();
|
|
@ -147,7 +166,7 @@ new Vue({
|
|
|
})
|
|
|
this.activeIndex=0
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
screenWidth:function(value) {
|