BOS项目练习(项目概述,环境,页面[easyUI,Ztree],数据库PowerDesigner)

1.    项目概述

1.1   项目背景介绍

BOS(Bussiness Operating System)-----业务操作系统 

本项目物流BOS项目分为基础设置、取派、中转、路由、报表部分

 

1.2   常见的软件项目类型

OA:办公自动化系统

CRM:客户关系管理系统

ERP:企业资源计划平台

CMS:内容管理系统

BBS:论坛系统

 

1.3   项目开发流程(瀑布模型)

1、  需求调研分析----需求规格说明书

2、  设计阶段(概要设计、详细设计)------数据库设计文档、原型

3、  编码阶段(单元测试)

4、  测试阶段(集成测试、系统测试)

5、  上线与运维

 

1.4   本项目开发的功能

三个业务功能模块

*基础数据模块

*取派模块

*中转流程管理

两个系统功能模块

*用户管理

*权限管理

 

1.5   开发环境

 

 

1.6   技术选型

 

OCUpload一键上传插件、pinyin4j

 

2.    搭建项目开发环境

2.1   数据库环境

第一步:创建一个数据库

CREATE DATABASE bos1 CHARACTER SET utf8

第二步:创建一个数据库用户

CREATE USER  'user_bos' IDENTIFIED BY "123"

第三步:为用户授权

GRANT ALL ON bos1.* TO "user_bos"

第四步:使用新创建的用户登录数据库系统

 

2.2   Web项目环境

第一步:创建一个动态web项目

第二步:导入jar包(SSH、数据库驱动、日志)

第三步:配置web.xml(struts2过滤器、spring监听器、解决hibernate延迟加载的过滤器、解决中文乱码的过滤器)

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">  
  3.   <display-name>BOS</display-name>  
  4. <!-- 中文乱码问题解决过滤器 -->  
  5.   <filter>  
  6.     <filter-name>characterFilter</filter-name>  
  7.     <filter-class>  
  8.         org.springframework.web.filter.CharacterEncodingFilter  
  9.     </filter-class>  
  10.     <!-- 提供初始化参数 -->  
  11.     <init-param>  
  12.         <param-name>encoding</param-name>  
  13.         <param-value>UTF-8</param-value>  
  14.     </init-param>  
  15.   </filter>  
  16.   <filter-mapping>  
  17.     <filter-name>characterFilter</filter-name>  
  18.     <url-pattern>/*</url-pattern>  
  19.   </filter-mapping>    
  20.     
  21. <!-- spring提供的解决hibernate延迟加载问题的过滤器 -->  
  22.   <filter>  
  23.     <filter-name>openSessionInView</filter-name>  
  24.     <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>  
  25.   </filter>  
  26.   <filter-mapping>  
  27.     <filter-name>openSessionInView</filter-name>  
  28.     <url-pattern>/*</url-pattern>  
  29.   </filter-mapping>    
  30.     
  31. <!-- spring      
  32.     * 设置初始化参数,确定spring配置文件位置    
  33.     * 使用监听器去加载配置文件,并将spring容器存放到ServletContext作用域    
  34. -->    
  35.   <context-param>  
  36.     <param-name>contextConfigLocation</param-name>  
  37.     <param-value>classpath:applicationContext.xml</param-value>  
  38.   </context-param>  
  39. <!-- spring监听器,加载xml文件 -->  
  40.   <listener>  
  41.     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
  42.   </listener>  
  43. <!-- struts      
  44.     * 配置struts2前端控制器,服务器在启动时,初始化init(FilerConfig)将自动调用    
  45.     * struts在初始化方法中,将自动的加载 classpath:struts.xml 文件  (src/config 两个源码目录都表示 类路径 classpath)    
  46. -->   
  47.   <filter>  
  48.     <filter-name>struts2</filter-name>  
  49.     <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>  
  50.   </filter>  
  51.   <filter-mapping>  
  52.     <filter-name>struts2</filter-name>  
  53.     <url-pattern>/*</url-pattern>  
  54.     <dispatcher>REQUEST</dispatcher>  
  55.     <dispatcher>FORWARD</dispatcher>  
  56.   </filter-mapping>  
  57.   <welcome-file-list>  
  58.     <welcome-file>index.jsp</welcome-file>  
  59.   </welcome-file-list>  
  60.     
  61. </web-app>  


第四步:配置struts.xml,将WEB-INF下的jsp页面访问映射为Action访问路径 

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <!DOCTYPE struts PUBLIC  
  3.     "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"  
  4.     "http://struts.apache.org/dtds/struts-2.3.dtd">  
  5. <struts>  
  6.     <constant name="struts.devMode" value="true" />  
  7.     <constant name="struts.objectFactory" value="spring"/>  
  8.     <package name="basicstruts2" extends="struts-default">  
  9.         <!-- 需要进行权限控制的页面访问 -->  
  10.         <action name="page_*_*">  
  11.             <result type="dispatcher">/WEB-INF/pages/{1}/{2}.jsp</result>  
  12.         </action>  
  13.     </package>  
  14. </struts>  


第五步:配置spring 配置文件applicationContext.xml

数据源、LocalSessionFactoryBean、事务管理器、组件扫描、支持注解配置

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <beans xmlns="http://www.springframework.org/schema/beans"  
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  4.     xmlns:context="http://www.springframework.org/schema/context"  
  5.     xmlns:aop="http://www.springframework.org/schema/aop"  
  6.     xmlns:tx="http://www.springframework.org/schema/tx"  
  7.     xsi:schemaLocation="http://www.springframework.org/schema/beans   
  8.                         http://www.springframework.org/schema/beans/spring-beans.xsd  
  9.                         http://www.springframework.org/schema/context  
  10.                         http://www.springframework.org/schema/context/spring-context.xsd  
  11.                         http://www.springframework.org/schema/aop  
  12.                         http://www.springframework.org/schema/aop/spring-aop.xsd  
  13.                         http://www.springframework.org/schema/tx   
  14.                         http://www.springframework.org/schema/tx/spring-tx.xsd">  
  15.                         <!-- 公共配置文件,web.xml配置加载核心文件 -->    
  16. <!-- 1 加载properties文件   
  17. jdbcinfo.properties  
  18. jdbc.driverClass=com.mysql.jdbc.Driver  
  19. jdbc.jdbcUrl=jdbc:mysql://localhost:3306/bos1  
  20. jdbc.user=user_bos  
  21. jdbc.password=123  
  22. -->    
  23.     <context:property-placeholder location="classpath:jdbcinfo.properties"/>    
  24. <!-- 2数据源 -->                       
  25.     <bean id="dataSource"  class="com.mchange.v2.c3p0.ComboPooledDataSource" >  
  26.         <property name="driverClass" value="${jdbc.driverClass}"></property>    
  27.         <property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>    
  28.         <property name="user" value="${jdbc.user}"></property>    
  29.         <property name="password" value="${jdbc.password}"></property>   
  30.     </bean>  
  31. <!-- 3 配置hibernate SessionFactory -->    
  32.     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">    
  33.     <!-- 3.1 配置数据源     
  34.         * <property name="属性名" ref="另一个bean引用">    
  35.             name 必须是对象的setter方法推断获得,setDataSource(...), 去掉set DataSource ,首字母小写  dataSource    
  36.         * ref 其他bean引用 <bean id=""> 可以任意,一般情况与上面属性名称相同。    
  37.     -->    
  38.     <property name="dataSource" ref="dataSource"></property>    
  39.     <!-- 3.2 配置hibernate其他属性     
  40.         * 在hibernate.cfg.xml 配置文件 “hibernate.dialect” 和 “dialect” 等效的    
  41.         * 在spring配置文件中,必须使用“hibernate.dialect”    
  42.     -->   
  43.     <!-- 2.2 其他属性设置 -->   
  44.     <property name="hibernateProperties">    
  45.         <props>    
  46.             <!-- 方言 -->    
  47.             <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>    
  48.             <!-- 显示sql语句 -->    
  49.             <prop key="hibernate.show_sql">true</prop>    
  50.             <!-- 格式化sql语句 -->    
  51.             <prop key="hibernate.format_sql">true</prop>   
  52.             <prop key="hibernate.hbm2ddl.auto">update</prop>   
  53.         </props>    
  54.     </property>    
  55.     <!-- 3.3 加载映射文件     
  56.            mappingResources 加载资源,从src获取,必须确定指定的资源    
  57.             mappingLocations 建议“classpath:” 可以通配符【】    
  58.                 classpath:com/itheima/*/User.hbm.xml ,目录任意    
  59.                 classpath:com/itheima/domain/*.hbm.xml, 文件名任意    
  60.             mappingDirectoryLocations 设置目录    
  61.                 classpath:com/itheima/domain/    
  62.             mappingJarLocations 从jar获得配置文   
  63.     -->    
  64.     <property name="mappingDirectoryLocations" value="classpath:cn/feibai/bos/domain"></property>  
  65.     </bean>  
  66. <!-- 4 事务管理 -->    
  67. <!-- 4.1 事务管理器,spring事务必须在事务管理器平台上工作     
  68.     * 在hibernate中事务需要session,session是从sessionFactory中获取的。    
  69. -->    
  70.     <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">    
  71.     <property name="sessionFactory" ref="sessionFactory"></property>    
  72.     </bean>   
  73. <!-- 组件扫描 -->  
  74.     <context:component-scan base-package="cn.feibai.bos"/>      
  75. <!-- 引入注解解析器 -->  
  76.     <context:annotation-config/>    
  77. <!-- 事务注解支持 -->  
  78.     <tx:annotation-driven transaction-manager="transactionManager"/>  
  79. </beans>  


3.    主页设计(easyUI)


在项目中引入jQuery Easy UI 

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <!-- 导入jquery核心类库 -->  
  2. <script type="text/javascript"  
  3. src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>  
  4.   
  5. <!-- 导入easyui类库 -->  
  6. <script type="text/javascript"  
  7. src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"></script>  
  8. <!--   导入默认主题CSS文件-->  
  9. <link id="easyuiTheme" rel="stylesheet" type="text/css"  
  10. href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css">  
  11. <!-- 导入图标CSS文件 -->  
  12. <link rel="stylesheet" type="text/css"  
  13. href="${pageContext.request.contextPath }/js/easyui/themes/icon.css">  
  14. <!-- 导入国际化信息文件-->  
  15. <script  
  16. src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"  
  17. type="text/javascript"></script>  



3.1   Layout使用---页面布局


*layout控件用于布局可以对 div标签使用或者body使用
*布局后内容分为 东西南北中 五个部分,只有center区域是必须的


[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>    
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">    
  3. <html>    
  4. <head>    
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">    
  6. <title>layout页面布局控件使用</title>    
  7. <!-- 引入easyui相关资源文件 -->    
  8. <!-- 导入jquery核心类库 -->    
  9. <script type="text/javascript"    
  10.     src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>    
  11. <!-- 导入默认主题CSS文件 -->    
  12. <link rel="stylesheet" type="text/css"    
  13.     href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css">    
  14. <!-- 导入图标CSS文件 -->        
  15. <link rel="stylesheet" type="text/css"    
  16.     href="${pageContext.request.contextPath }/js/easyui/themes/icon.css">    
  17. <link rel="stylesheet" type="text/css"    
  18.     href="${pageContext.request.contextPath }/js/easyui/ext/portal.css">     
  19. <link rel="stylesheet" type="text/css"    
  20.     href="${pageContext.request.contextPath }/css/default.css">    
  21. <!-- 导入easyui类库 -->               
  22. <script type="text/javascript"    
  23.     src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"></script>    
  24. <script type="text/javascript"    
  25.     src="${pageContext.request.contextPath }/js/easyui/ext/jquery.portal.js"></script>    
  26. <script type="text/javascript"    
  27.     src="${pageContext.request.contextPath }/js/easyui/ext/jquery.cookie.js"></script>    
  28. <!-- 导入国际化信息文件 -->        
  29. <script    
  30.     src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"    
  31.     type="text/javascript"></script>    
  32. </head>    
  33. <body class="easyui-layout">    
  34.     <!-- 每个div是一个区域 -->    
  35.     <div title="XXX系统" data-options="region:'north'" style="height: 100px">北部区域</div>    
  36.     <div title="系统菜单" data-options="region:'west'" style="width: 200px">西部区域</div>    
  37.     <div data-options="region:'center'" >中部区域</div>    
  38.     <div data-options="region:'east'" style="width: 100px">东部区域</div>    
  39.     <div data-options="region:'south'" style="height: 50px">南部区域</div>    
  40. </body>    
  41. </html>  


3.2   Accordion----折叠面板

*fit:true 属性可以让accordion 的div的大小,占满父类容器
*为每个折叠面板设置title属性指定显示标题
*iconCls 可以显示面板标题左侧的图标 


[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <body class="easyui-layout">  
  2.     <!-- 每个div是一个区域 -->  
  3.     <div title="XXX系统" data-options="region:'north'" style="height: 100px">北部区域</div>  
  4.     <div title="系统菜单" data-options="region:'west'" style="width: 200px">  
  5.     <!-- 西部区域内:折叠面板 -->  
  6.         <div id="aa" class="easyui-accordion" data-options="fit:true">    
  7.             <!-- 每个子div是一个面板 -->   
  8.             <div title="Title1" data-options="iconCls:'icon-save'" >   
  9.                 内容一    
  10.             </div>     
  11.             <div title="Title2" data-options="iconCls:'icon-reload'" >   
  12.                 内容二       
  13.             </div>     
  14.             <div title="Title3">    
  15.                 内容三     
  16.             </div>     
  17.         </div>    
  18.     </div>  
  19.     <div data-options="region:'center'" >中部区域</div>  
  20.     <div data-options="region:'east'" style="width: 100px">东部区域</div>  
  21.     <div data-options="region:'south'" style="height: 50px">南部区域</div>  
  22. </body>  

3.3   Tabs----选项卡面板

*通过设置closeable属性可以关闭选项卡
*fit:true 使选项卡适应父容器大小



3.4   动态添加选项卡

*判断选项卡是否存在:$('#tt').tabs("exists","新选项卡面板")
*选中选项卡:$('#tt').tabs("select","新选项卡面板")
*添加选项卡:$('#tt').tabs('add',{选项卡属性:选项卡值});

*把一个jsp页面设置成选项卡新增选项卡内容:
src="page_admin_role"→<action name="page_*_*">
content:'<iframe src="page_admin_role" frameborder="0" width="100%" height="100%"></iframe>'


[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <body class="easyui-layout">  
  2.     <!-- 每个div是一个区域 -->  
  3.     <div title="XXX系统" data-options="region:'north'" style="height: 100px">北部区域</div>  
  4.     <div title="系统菜单" data-options="region:'west'" style="width: 200px">  
  5.     <!-- 折叠面板 -->  
  6.         <div id="aa" class="easyui-accordion" data-options="fit:true">    
  7.             <!-- 每个子div是一个面板 -->   
  8.             <div title="Title1" data-options="iconCls:'icon-save'" >   
  9.                 <!-- 动态增加选项卡按钮 -->  
  10.                 <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">增加选项卡</a>   
  11.                 <!-- 给按钮添加点击事件 -->  
  12.                 <script type="text/javascript">  
  13.                 $(function(){  
  14.                     $("#btn").click(function(){  
  15.                         //判断当前选项卡是否已经打开  
  16.                         if($('#tt').tabs("exists","新选项卡面板")){  
  17.                             //选中  
  18.                             $('#tt').tabs("select","新选项卡面板");  
  19.                         }else{  
  20.                         // 添加一个选中状态的选项卡面板  
  21.                         $('#tt').tabs('add',{  
  22.                             title: '新选项卡面板',  
  23.                             selected: true,  
  24.                             closable:true,  
  25.                             content:'<iframe src="page_admin_role" frameborder="0" width="100%" height="100%"></iframe>'      
  26.                         });  
  27.                         }     
  28.                     });  
  29.                 });   
  30.                 </script>  
  31.             </div>     
  32.             <div title="Title2" data-options="iconCls:'icon-reload'" >   
  33.                 内容二       
  34.             </div>     
  35.             <div title="Title3">    
  36.                 内容三   
  37.             </div>     
  38.         </div>    
  39.     </div>  
  40.     <div data-options="region:'center'" >  
  41.     <!--中部区域内 选项卡  -->  
  42.         <div id="tt" class="easyui-tabs" data-options="fit:true">     
  43.             <div title="选项卡1" data-options="closable:true">     
  44.                 tab1      
  45.             </div>     
  46.             <div title="选项卡2" data-options="closable:true" >     
  47.                 tab2      
  48.             </div>     
  49.             <div title="选项卡3" data-options="iconCls:'icon-reload',closable:true">     
  50.                 tab3      
  51.             </div>     
  52.         </div>          
  53.     </div>  
  54.     <div data-options="region:'east'" style="width: 100px">东部区域</div>  
  55.     <div data-options="region:'south'" style="height: 50px">南部区域</div>  
  56. </body>  

 

3.5   Ztree插件使用

官网:ztree.me

目录结构



引入ztree

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <!-- 先引入 jquery的 js -->  
  2. <script type="text/javascript"   
  3. src="${pageContext.request.contextPath }/js/jquery-1.8.3.js“/>  
  4.   
  5. <!-- 引入ztree  -->  
  6. <script type="text/javascript" src="${pageContext.request.contextPath }/js/ztree/jquery.ztree.all-3.5.js“/>  
  7. <!– 引入ztree样式文件-->  
  8. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/js/ztree/zTreeStyle.css"/>  

步骤:

1.在显示树的地方写ul标签

<ul id="tree" class="ztree"></ul>

2.设置参数

var setting = {属性:值};

3.设置节点数据

var treeNodes = [{},{}..];

4.初始化树

$.fn.zTree.init($("#tree"), setting, treeNodes);


3.5.1       使用标准(StandardData)json数据构造ztree



[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <!-- 导入ztree样式文件 -->  
  2. <link rel="stylesheet" href="${pageContext.request.contextPath }/js/ztree/zTreeStyle.css" type="text/css">  
  3. <!-- 导入ztree js文件 -->  
  4. <script type="text/javascript" src="${pageContext.request.contextPath }/js/ztree/jquery.ztree.all-3.5.js"></script>  
  5. ...  
  6.   
  7.             <!-- 内容二内:点击加载ztree 在显示树的地方写ul标签-->   
  8.                 <ul id="tree" class="ztree"></ul>  
  9.                 <!-- 通过js编写setting对象-->   
  10.                 <script type="text/javascript">  
  11.                 $(function(){  
  12.                 //使用StandardData构造Ztree  
  13.                 //1.设置参数  
  14.                 var setting = {};  
  15.                 //2.设置节点数据  
  16.                 var treeNodes = [  
  17.                     {"name":"菜单一"},  
  18.                     {"name":"菜单二","children":[{"name":"二级菜单"}]}      
  19.                 ];    
  20.                 //3.初始化树  
  21.                 $.fn.zTree.init($("#tree"), setting, treeNodes);  
  22.                  });                  
  23.                 </script>                                
  24.             </div>     
  25.             <div title="Title3">    
  26.                 内容三   
  27.             </div>     
  28.         </div>    
  29.     </div>  

3.5.2       使用简单(SimpleData)json数据构造ztree

区别:

1.data的simpleData参数设置为,enable: true 不使用json嵌套格式

2.节点数据不同: id 为本节点id /    pId为父节点id /    "pId"="0" 为根节点


[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1.   <div title="Title3">    
  2.     <!-- 内容三内:点击加载ztree 在显示树的地方写ul标签-->   
  3.     <ul id="tree2" class="ztree"></ul>  
  4.     <!-- 通过js编写setting对象-->   
  5. <script type="text/javascript">  
  6. $(function(){  
  7. //使用SimpleData构造Ztree  
  8. //1.设置参数,enable: true 不使用json嵌套格式  
  9. var setting = {  
  10.         data: {  
  11.         simpleData: {  
  12.             enable: true,  
  13.             idKey: "id",  
  14.             pIdKey: "pId",  
  15.             rootPId: 0,  
  16.         }  
  17.         }  
  18. };  
  19. //2.设置节点数据  
  20. var treeNodes = [  
  21.     {"id":"1","pId":"0","name":"菜单1"},  
  22.     {"id":"2","pId":"0","name":"菜单2"},  
  23.     {"id":"3","pId":"2","name":"2级菜单3"}  
  24. ];    
  25. //3.初始化树  
  26. $.fn.zTree.init($("#tree2"), setting, treeNodes);  
  27.  });                  
  28. </script>  
  29.   </div>     

3.5.3       使用ajax加载远程json数据

*点击节点事件的回调Function 参数说明
event:标准的 js event 对象
treeId:对应 zTree 的 treeId
treeNode:被点击的节点 JSON 数据对象


[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1.     <div title="Title4">    
  2.         <!-- 内容四内:点击加载ztree 在显示树的地方写ul标签-->   
  3.         <ul id="tree3" class="ztree"></ul>  
  4.         <!-- 通过js编写setting对象-->   
  5.         <script type="text/javascript">  
  6.         $(function(){  
  7.         //使用ajax加载宣城json数据  
  8.         //1.设置点击事件的回调函数  
  9.         var setting = {  
  10.                 data: {  
  11.                 simpleData: {  
  12.                     enable: true  
  13.                 }  
  14.                 },  
  15.                 callback: {  
  16.                     onClick:function(event,treeId,treeNode){  
  17.                         //判断当前点击的选项page属性是否存在是否存在  
  18.                         //例(有page):{ "id":"11", "pId":"0", "name":"基础数据"},  
  19.                         //例(无page):{ "id":"112", "pId":"11", "name":"取派员设置",  "page":"page_base_staff.action"},  
  20.                         if(treeNode.page!=undefined){  
  21.                             //有page就添加到右边的选项卡  
  22.                               
  23.                             //判断当前选项卡是否已经打开存在  
  24.                             if($('#tt').tabs("exists",treeNode.name)){  
  25.                                 //选中  
  26.                                 $('#tt').tabs("select",treeNode.name);  
  27.                             }else{  
  28.                             // 添加一个选中状态的选项卡面板  
  29.                             $('#tt').tabs('add',{  
  30.                                 title:treeNode.name,  
  31.                                 closable:true,  
  32.                                 content:'<iframe src="'+treeNode.page+'" frameborder="0" width="100%" height="100%"></iframe>'    
  33.                             });  
  34.                             }  
  35.                               
  36.                         }  
  37.                     }  
  38.                 }  
  39.         };  
  40.         //ajax请求  
  41.         var url="${pageContext.request.contextPath }/json/menu.json";  
  42.         $.post(url,{},function(data){  
  43.             //返回值data为节点数据直接初始化  
  44.             $.fn.zTree.init($("#tree3"), setting,data);  
  45.          });  
  46.          });                  
  47.         </script>  
  48.     </div>     
  49. </div>    
  50. lt;/div>  


4.    使用PowerDesigner设计数据库

*PowerDesigner 的 4 种模型文件
概念数据模型(CDM)
物理数据模型(PDM) 
面向对象模型(OOM) 
业务程序模型(BPM)


1.创建PDM模型工作空间

点击文件建立新模型或者右键工作空间创建PDM


DBMS没有选项的话,点击右侧文件夹找安装目录下\Resource Files\DBMS ,就有选项了



2.创建表

右键PDM模型→新增→table

或拖拽右侧图形化界面的table图标



3建立外键

选择图形界面的Reference图标点击子表拖动虚线指向父表即可生成fk外键关系  




双击中间的连线选择join可以编辑外键



4生成sql文件:

选择数据库→Generate Database


 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值