extjs中treepanel和tabpanel结合实现布局

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutPage1.cshtml";
}

@section Script{

    <script>


        Ext.onReady(panelLayout);
        function panelLayout() {
            //新建tabpanel
            var tab = Ext.create('Ext.TabPanel', {
                region: 'center',
                deferredRender: false,
                activeTab: 0,
                resizeTabs: true, // turn on tab resizing
                minTabWidth: 115,
                tabWidth: 135,
                enableTabScroll: true
            });
            var viewPort = Ext.create('Ext.Viewport', {
                layout: "border",
                items: [{
                    region: 'north',
                    minHeight: 100,
                    html: 'north'
                }, {

                    region: 'west',
                    xtype: 'panel',
                    width: 200,
                    collapsible: true, // 设置可折叠
                    id: 'west-region-container',
                    layout: 'fit',
                    margins: '0 0 0 0',
                    layout: 'accordion',
                    title: '菜单',
                    split: true,
                    collapsible: true,
                    layoutConfig: {
                        animate: true
                    },
                    items: [{
                        title: '业务信息处理',
                        xtype: 'treepanel',
                        expanded: true,
                        animate: true,
                        enableDD: false,
                        border: false,
                        containerScroll: true,
                        root: {
                            text: '..',
                            id: 'root',
                            leaf:false,
                            children: [{
                                text: '业务信息',

                                leaf: false,
                                children: [{
                                    text: '组织管理',
                                    leaf: true,
                                    id: 'dept_list1.jsp'


                                }]
                            }, {
                                text: '组织管理',
                                leaf: true,
                                id: 'dept_list.jsp'
                            }]
                        }, listeners: {
                            //添加节点点击事件
                            itemclick: function (v, r, item) {
                                var n = tab.getComponent(r.raw.id);

                                alert(r.raw.leaf);//获取当前点击树节点的是否是子节点 (leaf=false)
                                alert(r.raw.id);
                                if (r.raw.leaf == false) {
                                    return;
                                }
                                if (!n) { // 判断是否已经打开该面板
                                    n = tab.add({
                                        'id': r.raw.id,
                                        'title': r.raw.text,
                                        closable: true, // 通过html载入目标页
                                        html: '<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + r.raw.id + '"></iframe>'
                                    });
                                }
                                tab.setActiveTab(n);
                            }
                        }

                    }, {
                        title: '信息中心',
                        border: false,
                        html: '<div id="tree2" style="overflow:auto;width:100%;height:100%"></div>'
                    }, {
                        title: '系统设置',
                        border: false,
                        html: '<div id="tree3" style="overflow:auto;width:100%;height:100%"></div>'
                    },



                    ]
                }, tab, {
                    region: 'south',
                    minHeight: 25,
                    html: "<div align='center'>版权所有 xxxx有限公司 © 信息服务中心</div>"
                }]
            })

        }

    </script>
};

### 如何使用 Keil5 Hex 文件 对于仅拥有已编译好的 hex 文件而无源文件的情况,在 Keil V5 平台上直接hex 文件至单片机(如华大单片机)需采取特定的方法,因为直接调用该平台进行此类操作不可行[^1]。 #### 设置 Output 路径 进入 Keil 的 output 设置界面,指定要录的 hex 文件的具体位置。确保在路径输入框中填完整的 hex 文件名称并附带 `.hex` 扩展名;缺少此扩展名可能导致系统继续尝试录先前编译的结果而非所选的 hex 文件[^3]。 #### 配置 Flash 工具选项 针对不同类型的微控制器(MCU),可能还需调整 flash 下载工具的相关配置参数以匹配目标设备的要求。这一步骤通常涉及选择合适的编程算法以及设定通信接口等细节[^2]。 #### 启动下载过程 完成上述准备工作之后,可以通过点击调试窗口内的 “Download” 或者快捷菜单里的相应命令来启动实际的程序入流程。如果一切顺利的话,软件会自动连接硬件并将选定的 hex 数据传输到 MCU 中存储起来[^4]。 ```python # Python 示例代码用于说明自动化脚本概念 (并非真实实现) def download_hex_to_mcu(hex_file_path, mcu_type): """ 自定义函数模拟将 HEX 文件下载到指定型号的 MCU 上 参数: hex_file_path -- 完整路径字符串指向待上传的 .hex 文件 mcu_type -- 字符串表示的目标单片机类型标识符 返回值: 成功则返回 True ,失败抛出异常信息 """ try: configure_output_settings(hex_file_path) # 设定输出设置 select_flash_tool(mcu_type) # 挑选适合的闪存工具 execute_download_command() # 发送下载指令 return True # 表明成功结束 except Exception as e: raise RuntimeError(f"Failed to upload {hex_file_path}: {e}") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值