Java全栈开发---Java ERP系统开发:商业ERP(二)数据库的建立,以及项目的搭建

六、数据库-ORACLE

(一)表空间的创建

1、使用PLSQL

在这里插入图片描述

--表空间--
CREATE TABLESPACE ERP_TS 
DATAFILE 'c:\ts\erp.dbf'
SIZE 100M
AUTOEXTEND ON
NEXT 10M; 

创建成功
在这里插入图片描述

(二)创建用户

-- 创建用户,关联默认的表空间
CREATE USER ERPUSER IDENTIFIED BY itzheng DEFAULT TABLESPACE ERP_TS;

(三)给用户赋权限

-- 给用户赋予权限,最大权限
grant dba to ERPUSER;

(四)退出登录,登录刚刚创建好的用户

退出登录
在这里插入图片描述
登录ERPUSER
在这里插入图片描述

(五)建表(使用PowerDesigner)

1、PowerDesigner生成数据库

在这里插入图片描述
在这里插入图片描述

2、使用PLSQL导入数据(先将上面生成的文件放入到C盘当中)

数据库文件下载:https://download.csdn.net/download/qq_44757034/12910524
解压后放入到C盘当中
创建数据表
在这里插入图片描述
在这里插入图片描述
导入成功
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

七、SSH2框架搭建

(一)创建Maven父工程

(1)创建Maven父工程(erp_parent)

在这里插入图片描述
点击Next
在这里插入图片描述
点击Next
在这里插入图片描述
点击Finish
在这里插入图片描述
工程创建完成
在pox.xml当中修改其中的内容
在这里插入图片描述

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.itheima</groupId>
  <artifactId>erp_parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>
  	<module>erp_entity</module>
  	<module>erp_dao</module>
  	<module>erp_web</module>
  	<module>erp_biz</module>
  </modules>
  <!-- 定义版本常量 -->
  <properties>
  	<spring.version>4.2.4.RELEASE</spring.version>
  	<struts.version>2.3.24</struts.version>
  	<hibernate.version>5.0.7.Final</hibernate.version>
  </properties>
  
  <dependencies>
  	<dependency>
  		<groupId>org.apache.struts</groupId>
  		<artifactId>struts2-core</artifactId>
  		<version>${
    
    struts.version}</version>
  		<!-- 排除依赖 -->
  		<exclusions>
  			<exclusion>
  				<artifactId>javassist</artifactId>
  				<groupId>javassist</groupId>
  			</exclusion>
  		</exclusions>
  	</dependency>
  	<dependency>
  		<groupId>org.hibernate</groupId>
  		<artifactId>hibernate-core</artifactId>
  		<version>${
    
    hibernate.version}</version>
  	</dependency>
  	
  	<!-- 第一个原则:第一申明者优先 -->
  	
  	<!-- 引入spring-beans-4.2.2 -->
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-context</artifactId>
  		<version>4.2.2.RELEASE</version>
  	</dependency>
  	<!-- 引入 spring-beans-3.0.5 -->
  	<dependency>
  		<groupId>org.apache.struts</groupId>
  		<artifactId>struts2-spring-plugin</artifactId>
  		<version>${
    
    struts.version}</version>
  	</dependency>
	<!-- 第二个原则:路径近者优先 -->
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-beans</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-core</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-context-support</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-aop</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-tx</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-orm</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-web</artifactId>
  		<version>${
    
    spring.version}</version>
  	</dependency>
  	<dependency>
  		<groupId>org.aspectj</groupId>
  		<artifactId>aspectjweaver</artifactId>
  		<version>1.8.7</version>
  	</dependency>
  	<dependency>
  		<groupId>org.slf4j</groupId>
  		<artifactId>slf4j-api</artifactId>
  		<version>1.7.12</version>
  	</dependency>
  	<dependency>
  		<groupId>org.slf4j</groupId>
  		<artifactId>slf4j-log4j12</artifactId>
  		<version>1.7.12</version>
  	</dependency>
  	<dependency>
  		<groupId>c3p0</groupId>
  		<artifactId>c3p0</artifactId>
  		<version>0.9.1.2</version>
  	</dependency>
  	<dependency>
  		<groupId>jstl</groupId>
  		<artifactId>jstl</artifactId>
  		<version>1.2</version>
  	</dependency>
  	<dependency>
  		<groupId>javax.servlet</groupId>
  		<artifactId>servlet-api</artifactId>
  		<version>2.5</version>
  		<scope>provided</scope>
  	</dependency>
  	<dependency>
  		<groupId>com.oracle</groupId>
  		<artifactId>ojdbc6</artifactId>
  		<version>11.2.0.3</version>
  	</dependency>
  	<dependency>
  		<groupId>com.alibaba</groupId>
  		<artifactId>fastjson</artifactId>
  		<version>1.2.8</version>
  	</dependency>
  </dependencies>
  	<!-- 版本锁定  -->
    <dependencyManagement>
		<dependencies>
			<dependency>
		  		<groupId>junit</groupId>
		  		<artifactId>junit</artifactId>
		  		<version>4.9</version>
		  		<scope>test</scope>
	  		</dependency>
		</dependencies>
    </dependencyManagement>
    <build>
    	<plugins>
    		<plugin>
    			<groupId>org.apache.tomcat.maven</groupId>
    			<artifactId>tomcat7-maven-plugin</artifactId>
    			<version>2.2</version>
    			<configuration>
    				<port>8080</port>
    				<path>/erp</path>
    			</configuration>
    		</plugin>
    	</plugins>
    </build>
</project>

(二)创建Maven子模块

1、创建erp_parent

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
点击finish
在这里插入图片描述

2、与上面同理创建其他的子项目工程

在这里插入图片描述

3、创建erp_web(存放action类和前端源代码)

在这里插入图片描述

4、在erp_web工程当中展开src\main\webapp目录 建立WEB-INF文件夹,并创建web.xml到文件夹WEB-INF当中

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
web.xml当中的内容

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath*:applicationContext*.xml</param-value>
	</context-param>
	<filter>
   		<filter-name>openSessionInView</filter-name>
   		<filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>openSessionInView</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>struts2</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>	
</web-app>
5、在erp_dao下

将spring配置文件中的applicationContext_datasource.xml和
applicationContext_dao.xml创建到erp_dao工程的src/main/resources下。
在这里插入图片描述
applicationContext_datasource.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
		<property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:ORCL"/>
		<property name="username" value="用户名"/>
		<property name="password" value="密码"/>
	</bean>
	<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">false</prop>
			</props>
		</property>
		<property name="mappingLocations">
			<value>classpath:实体类所在的包/*.hbm.xml</value>
		</property>
	</bean>
</beans>

applicationContext_dao.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
</beans>
6、在erp_biz下

创建到erp_biz工程的src/main/resources下。
创建spring配置文件中的applicationContext_tx.xml和applicationContext_biz.xml
在这里插入图片描述
applicationContext_tx.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
	<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory"/>
	</bean>
	<tx:advice id="advice" transaction-manager="transactionManager">
	    <tx:attributes>	     
	      <tx:method name="do*" propagation="REQUIRED"/>
	      <tx:method name="add*" propagation="REQUIRED"/>
	      <tx:method name="update*" propagation="REQUIRED"/>
	      <tx:method name="save*" propagation="REQUIRED"/>
	      <tx:method name="delete*" propagation="REQUIRED"/>
	      <tx:method name="*" read-only="true"/>
	    </tx:attributes>
	</tx:advice>
	<aop:config>
		<aop:pointcut id="serviceMethod" expression="execution(* 业务逻辑所在的包.*.*(..))"/>
		<aop:advisor pointcut-ref="serviceMethod" advice-ref="advice" />
	</aop:config>
</beans>

applicationContext_biz.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
</beans>
7、在erp_web下

工程的src/main/resources下。
将struts.xml和spring配置文件中的applicationContext_action.xml创建到erp_web
在这里插入图片描述
applicationContext_action.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
</beans>

(三)在各模块当中创建包

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

(四)修改Spring的配置文件

1、修改erp_dao工程的applicationContext_datasource.xml,将ip账号密码换成自己对应的

在这里插入图片描述

2、修改erp_biz工程的applicationContext_tx.xml

在这里插入图片描述
在这里插入图片描述

(五)添加easyUI到erp_web工程下面

相关文件下载链接:
在这里插入图片描述

(六)设置各个模块的依赖关系

在这里插入图片描述
添加依赖在pom.xml当中的dependencies当中的点击add,当中选框当中的填入上面的内容
在这里插入图片描述

八、【部门管理】实现列表查询

(一)需求

将数据库当中的这些数据显示到页面上去
在这里插入图片描述

(二)在erp_entity的src/main/java的com.itzheng.erp.entity下创建Dep类

在这里插入图片描述

package com.itzheng.erp.entity;
/*
 * 部门
 */
public class Dep {
    
    
	/* 部门编号 */
	private Long uuid;
	/*
	 * 部门名称
	 */
	private String name;
	/*
	 * 联系电话
	 */
	private String tele;
	public Long getUuid() {
    
    
		return uuid;
	}
	public void setUuid(Long uuid) {
    
    
		this.uuid = uuid;
	}
	public String getName() {
    
    
		return name;
	}
	public void setName(String name) {
    
    
		this.name = name;
	}
	public String getTele() {
    
    
		return tele;
	}
	public void setTele(String tele) {
    
    
		this.tele = tele;
	}
}

创建对应的配置文件
在这里插入图片描述
在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.itzheng.erp.entity.Dep" table="Dep" >
        <id name="uuid" >           
        </id>
        <property name="name" />      
        <property name="tele" />     
    </class>
</hibernate-mapping>

(三)在erp_dao当中编辑数据访问层

1、创建接口

在这里插入图片描述

package com.itzheng.erp.dao;
import java.util.List;
import com.itzheng.erp.entity.Dep;
public interface IDepDao {
    
    
	public List<Dep> getList();
}
2、创建dao的实现类
package com.itzheng.erp.dao.impl;
import java.util.List;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
import com.itzheng.erp.dao.IDepDao;
import com.itzheng.erp.entity.Dep;
/*
 * 部门的数据访问权限
 */
public class DepDao extends HibernateDaoSupport implements IDepDao {
    
    
	/*
	 * 查询出所有的部门信息
	 */
	@Override
	public List<Dep> getList() {
    
    
		return (List<Dep>) this.getHibernateTemplate().find("from Dep");
	}
}
3、配置对应的applicationContext_dao.xml

在这里插入图片描述

	<bean id="depDao" class="com.itzheng.erp.dao.impl.DepDao" >
		<property name="sessionFactory" ref="sessionFactory"></property>
	</bean>
4、创建测试类

在这里插入图片描述

package com.itzheng.erp.test.dao;
public class DepDaoTest {
    
    
	@Test
	public void testDep() {
    
    	
	}
}
5、添加测试的定位

在这里插入图片描述
在这里插入图片描述

6、修改测试类
package com.itzheng.erp.test.dao;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.itzheng.erp.dao.impl.DepDao;
public class DepDaoTest {
    
    
	@Test
	public void testDep() {
    
    
		ApplicationContext ac = new ClassPathXmlApplicationContext("classpath*:applicationContext_*.xml");
		DepDao depDao = (DepDao) ac.getBean("depDao");
		System.out.println(depDao.getList().size());
		ac.getBean("sessionFactory");
	}
}

在这里插入图片描述

(四)在业务层添加内容erp_biz当中

1、创建一个接口:IDepBiz
package com.itzheng.erp.biz;
import java.util.List;
import com.itzheng.erp.entity.Dep;
/*
 * 部门业务接口
 */
public interface IDepBiz {
    
    
	/*
	 * 查询所有部门列表
	 */
	List<Dep> getList();
}
2、创建实现类
package com.itzheng.erp.biz.impl;
import java.util.List;
import com.itzheng.erp.biz.IDepBiz;
import com.itzheng.erp.dao.IDepDao;
import com.itzheng.erp.entity.Dep;
/*
 * 部门业务实现
 */
public class DepBiz implements IDepBiz {
    
    
	/*
	 * 数据访问层的调用
	 */
	private IDepDao depDao;
	public void setDepDao(IDepDao depDao) {
    
    
		this.depDao = depDao;
	}
	@Override
	public List<Dep> getList() {
    
    
		// TODO Auto-generated method stub
		return depDao.getList();
	}
}

(五)在Actionweb层添加

1、创建Action

在这里插入图片描述

package com.itzheng.erp.action;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import com.alibaba.fastjson.JSON;
import com.itzheng.erp.biz.IDepBiz;
import com.itzheng.erp.entity.Dep;
/*
 * 部门Action
 */
public class DeptAction {
    
    
	private IDepBiz depBiz;
	public void setDepBiz(IDepBiz depBiz) {
    
    
		this.depBiz = depBiz;
	}
	/*
	 * 查询所有部门
	 */
	public void list() {
    
    
		/*
		 * 调用业务部门的业务,查询所有部门信息
		 */
		List<Dep> list = depBiz.getList();
		//把部门列表转换为JSON字符串
		String listString = JSON.toJSONString(list);
		try {
    
    
			//响应对象
			HttpServletResponse response = ServletActionContext.getResponse();
			response.setContentType("text/html;charset=utf-8");
			//输出给页面
			response.getWriter().write(listString);
		} catch (IOException e) {
    
    
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
2、在erp_biz applicationContext_biz.xml当中配置dao
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
	<bean id="depBiz" class="com.itzheng.erp.biz.impl.DepBiz" >
		<property name="daoDao" ref="depDao" ></property>
	</bean>
</beans>
3、在erp_web当中的applicationContext_action.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context 
		http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop.xsd
		">  
	<bean id="depAction" class="com.itzheng.erp.action.DeptAction">
		<property name="depBiz" ref="depBiz" ></property>
	</bean>
</beans>
	

4、在erp_web当中的struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
    <package name="default" namespace="/" extends="struts-default">  
    	<action name="dep_*" class="depAction" method="{1}" ></action>
    </package>
</struts>

(六)运行并测试项目在这里插入图片描述

在这里插入图片描述
访问对应的
在这里插入图片描述

(七)前端的实现

1、在erp_web下的webapp引入easy_ui的相关文件

在这里插入图片描述
文件下载地址:https://download.csdn.net/download/qq_44757034/12915475

2、在erp_web下的webapp下创建dep.html

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>部门管理</title>
<link rel="stylesheet" type="text/css" href="ui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="ui/themes/icon.css">
<script type="text/javascript" src="ui/jquery.min.js"></script>
<script type="text/javascript" src="ui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="ui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	$(function(){
    
    
		$('#grid').datagrid({
    
        
				url:'dep_list',    
				columns:[[    
					 {
    
    field:'uuid',title:'部门编号',width:100},    
					{
    
    field:'name',title:'部门名称',width:100},    
					 {
    
    field:'tele',title:'部门联系电话',width:100,align:'right'}    
				]]    
		}); 		
	});
</script>
</head>
<body>
	<table id="grid">
	</table>
</body>
</html>
3、访问对应的页面http://localhost:8080/erp/dep.html

访问成功
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_44757034/article/details/108904641