hanxuntao 4 months ago
parent 417b9d0f9f
commit f5ab1c260e

@ -1048,6 +1048,26 @@ Ext.extend(Shipping.MainForm, Ext.Panel, {
});
this.PubStore_OpCode.load();
this.PubStore_storeModuleEnable = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.ModuleModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnableList',
reader: {
id: 'id',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.PubStore_storeModuleEnable.load({
params: { condition: "sys_module.MODULEURL<>'#' and sys_module.MODULEURL<>'@'" },
callback: function (r, options, success) {
},
scope: this
});
//this.LoadPubStore("INFOCLIENT_ISCONTROLLER");
////var StoreStatusTask = { //Ext的定时器每隔30秒刷新store。

@ -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();
}
}

Loading…
Cancel
Save