|
|
|
@ -96,42 +96,48 @@
|
|
|
|
|
window.AddTab = function (modname, url, cname) {
|
|
|
|
|
var MainCenter = Ext.getCmp("MainCenter");
|
|
|
|
|
if (url == '#') return;
|
|
|
|
|
var tmpurl = url;
|
|
|
|
|
if (tmpurl.indexOf('?') > 0) tmpurl = tmpurl.substring(0, tmpurl.indexOf('?'));
|
|
|
|
|
var finded = false;
|
|
|
|
|
var isenable = false;
|
|
|
|
|
var storeModuleEnable = MainCenter.ownerCt.PubStore_storeModuleEnable;
|
|
|
|
|
if (storeModuleEnable.getCount() > 0) {
|
|
|
|
|
for (var j = 0; j < storeModuleEnable.getCount(); j += 1) {
|
|
|
|
|
var member = storeModuleEnable.getAt(j);
|
|
|
|
|
if (member.data.MODULEURL == tmpurl) {
|
|
|
|
|
isenable = true;
|
|
|
|
|
var obj = MainCenter.queryById('pnl' + modname);
|
|
|
|
|
if (obj != null)
|
|
|
|
|
MainCenter.remove(obj);
|
|
|
|
|
|
|
|
|
|
if (finded == false) {
|
|
|
|
|
var paneltabitems = new Ext.Panel({
|
|
|
|
|
id: 'pnl' + modname,
|
|
|
|
|
layout: "fit",
|
|
|
|
|
region: "center",
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
frame: false,
|
|
|
|
|
closable: true,
|
|
|
|
|
bodyStyle: {
|
|
|
|
|
// background: 'rgba(0, 0, 0, 1) none repeat scroll 0 0 !important'
|
|
|
|
|
},
|
|
|
|
|
title: cname,
|
|
|
|
|
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + url + '"> </iframe>'
|
|
|
|
|
});
|
|
|
|
|
MainCenter.add(paneltabitems);
|
|
|
|
|
MainCenter.setActiveTab(paneltabitems);
|
|
|
|
|
MainCenter.doLayout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (!isenable) {
|
|
|
|
|
Ext.Msg.show({ title: '提示', msg: '没有此模块权限!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var obj = MainCenter.queryById('pnl' + modname);
|
|
|
|
|
if (obj != null)
|
|
|
|
|
MainCenter.remove(obj);
|
|
|
|
|
//var children = MainCenter.items;
|
|
|
|
|
//if (children) {
|
|
|
|
|
// for (var i = 0, len = children.length; i < len; i++) {
|
|
|
|
|
// if (children.items[i].id) {
|
|
|
|
|
// if (children.items[i].id == 'pnl' + modname) {
|
|
|
|
|
// MainCenter.remove(obj);
|
|
|
|
|
// //MainCenter.setActiveTab(i);
|
|
|
|
|
// //finded = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
if (finded == false) {
|
|
|
|
|
var paneltabitems = new Ext.Panel({
|
|
|
|
|
id: 'pnl' + modname,
|
|
|
|
|
layout: "fit",
|
|
|
|
|
region: "center",
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
frame: false,
|
|
|
|
|
closable: true,
|
|
|
|
|
bodyStyle: {
|
|
|
|
|
// background: 'rgba(0, 0, 0, 1) none repeat scroll 0 0 !important'
|
|
|
|
|
},
|
|
|
|
|
title: cname,
|
|
|
|
|
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + url + '"> </iframe>'
|
|
|
|
|
});
|
|
|
|
|
MainCenter.add(paneltabitems);
|
|
|
|
|
MainCenter.setActiveTab(paneltabitems);
|
|
|
|
|
MainCenter.doLayout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|