$ns("main.views");
$import("mx.containers.VSplit");
$import("mx.containers.Accordion");
$import("mx.datacontainers.TreeEntityContainer");
$import("mx.datacontrols.DataTree");
$import("mx.containers.TabControl");
$import("userinfo.views.UserInfoMainViewController");
$import("cjdw.views.CjdwMainViewController");
$import("dbt.views.DbtMainViewController");
main.views.MainView = function()
{
var me = $extend(mx.views.View);
var base = {};
//垂直切分
var _myVsplit=null;
//outlook面板
var _myAccordion=null;
var _myZhpjDataTree=null;
var _myCjdwDataTree=null;
var _myTabControl=null;
var _myUserInfoMainView=null;
var _myCjdwMainView=null;
var _myDbtMainView=null;
base.init = me.init;
me.init = function()
{
base.init();
_initControls();
};
function _initControls()
{
_initMyVsplit();
_initMyAccordion();
_initMyZhpjDataTree();
_initMyCjdwDataTree();
_initMyTabControl();
me.on("activate", me.controller._onactivate);
}
//初始化布局
function _initMyVsplit(){
_myVSplit = new mx.containers.VSplit({
id:"_myVSplit",
cols:"250,auto"
});
me.addControl(_myVSplit);
}
//初始化outlook面板
function _initMyAccordion(){
_myAccordion = new mx.containers.Accordion({
height:"100%",
panels:[
{ title: "综合评价", name: "zhpj" },
{ title: "参建队伍", name: "cjdw" }
]
});
_myVSplit.addControl(_myAccordion,0);
}
function _initMyZhpjDataTree(){
var zhpjDataTreeEntityContainer = new mx.datacontainers.TreeEntityContainer({
type: "local",
data: [
{
id: "userinfo",
text: "用户信息查看"
},
{
id: "cxfx",
text: "查询分析",
hasChildren: true,
childNodes:[
{
id: "sgscxhz",
text: "省公司查询汇总"
}
]
}
]
});
_myZhpjDataTree = new mx.datacontrols.DataTree({
entityContainer: zhpjDataTreeEntityContainer,
onnodeclick:_initMyZhpjTabPage
});
_myZhpjDataTree.load();
_myAccordion.panels["zhpj"].addControl(_myZhpjDataTree);
}
function _initMyCjdwDataTree(){
var cjdwDataTreeEntityContainer = new mx.datacontainers.TreeEntityContainer({
type: "local",
data: [
{
id: "cjdwdj",
text: "参加队伍登记"
}
]
});
_myCjdwDataTree = new mx.datacontrols.DataTree({
entityContainer: cjdwDataTreeEntityContainer,
onnodeclick:_initMyCjdwTabPage
});
_myCjdwDataTree.load();
_myAccordion.panels["cjdw"].addControl(_myCjdwDataTree);
}
function _initMyTabControl(){
_myTabControl = new mx.containers.TabControl({
pages:[
{ text: "欢迎", name: "welcome" }
]
});
_myVSplit.addControl(_myTabControl,1);
}
function _initMyZhpjTabPage(e){
var _tabPage=_myTabControl.pages[e.node.id];
if(_tabPage!=null){
_myTabControl.selectPage(_tabPage);
return;
}
if(e.node.id=="userinfo"){
_myTabControl.appendPage(e.node.id,"当前用户信息查询",true);
_myTabControl.selectPage(_myTabControl.pages[e.node.id]);
if(_myUserInfoMainView==null){
var mvc=new userinfo.views.UserInfoMainViewController();
_myTabControl.pages[e.node.id].addControl(mvc.getView());
}
}else if(e.node.id=="sgscxhz"){
_myTabControl.appendPage(e.node.id,"省公司查询汇总",true);
_myTabControl.selectPage(_myTabControl.pages[e.node.id]);
if(_myDbtMainView==null){
var mvc=new dbt.views.DbtMainViewController();
_myTabControl.pages[e.node.id].addControl(mvc.getView());
}
}
}
function _initMyCjdwTabPage(e){
var _tabPage=_myTabControl.pages[e.node.id];
if(_tabPage!=null){
_myTabControl.selectPage(_tabPage);
return;
}
if(e.node.id=="cjdwdj"){
_myTabControl.appendPage(e.node.id,"参加队伍登记",true);
_myTabControl.selectPage(_myTabControl.pages[e.node.id]);
if(_myCjdwMainView==null){
var mvc=new cjdw.views.CjdwMainViewController();
_myTabControl.pages[e.node.id].addControl(mvc.getView());
}
}
}
return me.endOfClass(arguments);
};
$import("mx.containers.VSplit");
$import("mx.containers.Accordion");
$import("mx.datacontainers.TreeEntityContainer");
$import("mx.datacontrols.DataTree");
$import("mx.containers.TabControl");
$import("userinfo.views.UserInfoMainViewController");
$import("cjdw.views.CjdwMainViewController");
$import("dbt.views.DbtMainViewController");
main.views.MainView = function()
{
var me = $extend(mx.views.View);
var base = {};
//垂直切分
var _myVsplit=null;
//outlook面板
var _myAccordion=null;
var _myZhpjDataTree=null;
var _myCjdwDataTree=null;
var _myTabControl=null;
var _myUserInfoMainView=null;
var _myCjdwMainView=null;
var _myDbtMainView=null;
base.init = me.init;
me.init = function()
{
base.init();
_initControls();
};
function _initControls()
{
_initMyVsplit();
_initMyAccordion();
_initMyZhpjDataTree();
_initMyCjdwDataTree();
_initMyTabControl();
me.on("activate", me.controller._onactivate);
}
//初始化布局
function _initMyVsplit(){
_myVSplit = new mx.containers.VSplit({
id:"_myVSplit",
cols:"250,auto"
});
me.addControl(_myVSplit);
}
//初始化outlook面板
function _initMyAccordion(){
_myAccordion = new mx.containers.Accordion({
height:"100%",
panels:[
{ title: "综合评价", name: "zhpj" },
{ title: "参建队伍", name: "cjdw" }
]
});
_myVSplit.addControl(_myAccordion,0);
}
function _initMyZhpjDataTree(){
var zhpjDataTreeEntityContainer = new mx.datacontainers.TreeEntityContainer({
type: "local",
data: [
{
id: "userinfo",
text: "用户信息查看"
},
{
id: "cxfx",
text: "查询分析",
hasChildren: true,
childNodes:[
{
id: "sgscxhz",
text: "省公司查询汇总"
}
]
}
]
});
_myZhpjDataTree = new mx.datacontrols.DataTree({
entityContainer: zhpjDataTreeEntityContainer,
onnodeclick:_initMyZhpjTabPage
});
_myZhpjDataTree.load();
_myAccordion.panels["zhpj"].addControl(_myZhpjDataTree);
}
function _initMyCjdwDataTree(){
var cjdwDataTreeEntityContainer = new mx.datacontainers.TreeEntityContainer({
type: "local",
data: [
{
id: "cjdwdj",
text: "参加队伍登记"
}
]
});
_myCjdwDataTree = new mx.datacontrols.DataTree({
entityContainer: cjdwDataTreeEntityContainer,
onnodeclick:_initMyCjdwTabPage
});
_myCjdwDataTree.load();
_myAccordion.panels["cjdw"].addControl(_myCjdwDataTree);
}
function _initMyTabControl(){
_myTabControl = new mx.containers.TabControl({
pages:[
{ text: "欢迎", name: "welcome" }
]
});
_myVSplit.addControl(_myTabControl,1);
}
function _initMyZhpjTabPage(e){
var _tabPage=_myTabControl.pages[e.node.id];
if(_tabPage!=null){
_myTabControl.selectPage(_tabPage);
return;
}
if(e.node.id=="userinfo"){
_myTabControl.appendPage(e.node.id,"当前用户信息查询",true);
_myTabControl.selectPage(_myTabControl.pages[e.node.id]);
if(_myUserInfoMainView==null){
var mvc=new userinfo.views.UserInfoMainViewController();
_myTabControl.pages[e.node.id].addControl(mvc.getView());
}
}else if(e.node.id=="sgscxhz"){
_myTabControl.appendPage(e.node.id,"省公司查询汇总",true);
_myTabControl.selectPage(_myTabControl.pages[e.node.id]);
if(_myDbtMainView==null){
var mvc=new dbt.views.DbtMainViewController();
_myTabControl.pages[e.node.id].addControl(mvc.getView());
}
}
}
function _initMyCjdwTabPage(e){
var _tabPage=_myTabControl.pages[e.node.id];
if(_tabPage!=null){
_myTabControl.selectPage(_tabPage);
return;
}
if(e.node.id=="cjdwdj"){
_myTabControl.appendPage(e.node.id,"参加队伍登记",true);
_myTabControl.selectPage(_myTabControl.pages[e.node.id]);
if(_myCjdwMainView==null){
var mvc=new cjdw.views.CjdwMainViewController();
_myTabControl.pages[e.node.id].addControl(mvc.getView());
}
}
}
return me.endOfClass(arguments);
};