@ -1,12 +1,29 @@ |
|||||
|
# Created by .ignore support plugin (hsz.mobi) |
||||
|
### Java template |
||||
|
# Compiled class file |
||||
*.class |
*.class |
||||
|
|
||||
|
# Log file |
||||
|
*.log |
||||
|
|
||||
|
# BlueJ files |
||||
|
*.ctxt |
||||
|
|
||||
# Mobile Tools for Java (J2ME) |
# Mobile Tools for Java (J2ME) |
||||
.mtj.tmp/ |
.mtj.tmp/ |
||||
|
|
||||
# Package Files # |
# Package Files # |
||||
*.jar |
*.jar |
||||
*.war |
*.war |
||||
|
*.nar |
||||
*.ear |
*.ear |
||||
|
*.zip |
||||
|
*.tar.gz |
||||
|
*.rar |
||||
|
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
||||
hs_err_pid* |
hs_err_pid* |
||||
|
.idea/ |
||||
|
*.iml |
||||
|
target/ |
||||
|
|
||||
|
|||||
@ -0,0 +1,6 @@ |
|||||
|
## epmet-cloud-generator |
||||
|
|
||||
|
党群e事通代码生成器 |
||||
|
|
||||
|
http://localhost:8070/epmet-cloud-generator/#generator.html |
||||
|
|
||||
@ -0,0 +1,147 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<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.esua.epmet</groupId> |
||||
|
<artifactId>epmet-cloud-generator</artifactId> |
||||
|
<version>1.2.0</version> |
||||
|
<packaging>jar</packaging> |
||||
|
<description>党群e事通代码生成器</description> |
||||
|
|
||||
|
<parent> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-parent</artifactId> |
||||
|
<version>2.0.7.RELEASE</version> |
||||
|
</parent> |
||||
|
|
||||
|
<properties> |
||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
||||
|
<java.version>1.8</java.version> |
||||
|
<mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version> |
||||
|
<pagehelper.spring.boot.version>1.2.5</pagehelper.spring.boot.version> |
||||
|
<druid.version>1.0.28</druid.version> |
||||
|
<commons.lang.version>2.6</commons.lang.version> |
||||
|
<commons.io.version>2.5</commons.io.version> |
||||
|
<commons.configuration.version>1.10</commons.configuration.version> |
||||
|
<fastjson.version>1.2.79</fastjson.version> |
||||
|
<velocity.version>1.7</velocity.version> |
||||
|
<mysql.version>5.1.38</mysql.version> |
||||
|
<mssql.version>4.0</mssql.version> |
||||
|
<oracle.version>11.2.0.3</oracle.version> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.mybatis.spring.boot</groupId> |
||||
|
<artifactId>mybatis-spring-boot-starter</artifactId> |
||||
|
<version>${mybatis.spring.boot.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.github.pagehelper</groupId> |
||||
|
<artifactId>pagehelper-spring-boot-starter</artifactId> |
||||
|
<version>${pagehelper.spring.boot.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<version>${mysql.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>druid</artifactId> |
||||
|
<version>${druid.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>commons-lang</groupId> |
||||
|
<artifactId>commons-lang</artifactId> |
||||
|
<version>${commons.lang.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>commons-io</groupId> |
||||
|
<artifactId>commons-io</artifactId> |
||||
|
<version>${commons.io.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>commons-configuration</groupId> |
||||
|
<artifactId>commons-configuration</artifactId> |
||||
|
<version>${commons.configuration.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>fastjson</artifactId> |
||||
|
<version>${fastjson.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<artifactId>velocity</artifactId> |
||||
|
<groupId>org.apache.velocity</groupId> |
||||
|
<version>${velocity.version}</version> |
||||
|
</dependency> |
||||
|
<!-- mysql驱动 --> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<version>${mysql.version}</version> |
||||
|
</dependency> |
||||
|
<!-- oracle驱动 --> |
||||
|
<dependency> |
||||
|
<groupId>com.oracle</groupId> |
||||
|
<artifactId>ojdbc6</artifactId> |
||||
|
<version>${oracle.version}</version> |
||||
|
</dependency> |
||||
|
<!-- sqlserver驱动 --> |
||||
|
<dependency> |
||||
|
<groupId>com.microsoft.sqlserver</groupId> |
||||
|
<artifactId>sqljdbc4</artifactId> |
||||
|
<version>${mssql.version}</version> |
||||
|
</dependency> |
||||
|
<!-- postgresql驱动 --> |
||||
|
<dependency> |
||||
|
<groupId>org.postgresql</groupId> |
||||
|
<artifactId>postgresql</artifactId> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
<repositories> |
||||
|
<repository> |
||||
|
<id>public</id> |
||||
|
<name>aliyun nexus</name> |
||||
|
<url>http://maven.aliyun.com/nexus/content/groups/public/</url> |
||||
|
<releases> |
||||
|
<enabled>true</enabled> |
||||
|
</releases> |
||||
|
</repository> |
||||
|
</repositories> |
||||
|
<pluginRepositories> |
||||
|
<pluginRepository> |
||||
|
<id>public</id> |
||||
|
<name>aliyun nexus</name> |
||||
|
<url>http://maven.aliyun.com/nexus/content/groups/public/</url> |
||||
|
<releases> |
||||
|
<enabled>true</enabled> |
||||
|
</releases> |
||||
|
<snapshots> |
||||
|
<enabled>false</enabled> |
||||
|
</snapshots> |
||||
|
</pluginRepository> |
||||
|
</pluginRepositories> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,12 @@ |
|||||
|
package io.renren; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
@SpringBootApplication |
||||
|
public class GeneratorApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(GeneratorApplication.class, args); |
||||
|
System.out.println("http://localhost:8070/epmet-cloud-generator/#generator.html"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,61 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 http://www.renren.io
|
||||
|
* <p> |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
||||
|
* use this file except in compliance with the License. You may obtain a copy of |
||||
|
* the License at |
||||
|
* <p> |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* <p> |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
|
* License for the specific language governing permissions and limitations under |
||||
|
* the License. |
||||
|
*/ |
||||
|
|
||||
|
package io.renren.config; |
||||
|
|
||||
|
import io.renren.dao.*; |
||||
|
import io.renren.utils.RRException; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.context.annotation.Primary; |
||||
|
|
||||
|
/** |
||||
|
* 数据库配置 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 2018-07-24 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
public class DbConfig { |
||||
|
@Value("${renren.database: mysql}") |
||||
|
private String database; |
||||
|
@Autowired |
||||
|
private MySQLGeneratorDao mySQLGeneratorDao; |
||||
|
@Autowired |
||||
|
private OracleGeneratorDao oracleGeneratorDao; |
||||
|
@Autowired |
||||
|
private SQLServerGeneratorDao sqlServerGeneratorDao; |
||||
|
@Autowired |
||||
|
private PostgreSQLGeneratorDao postgreSQLGeneratorDao; |
||||
|
|
||||
|
@Bean |
||||
|
@Primary |
||||
|
public GeneratorDao getGeneratorDao(){ |
||||
|
if("mysql".equalsIgnoreCase(database)){ |
||||
|
return mySQLGeneratorDao; |
||||
|
}else if("oracle".equalsIgnoreCase(database)){ |
||||
|
return oracleGeneratorDao; |
||||
|
}else if("sqlserver".equalsIgnoreCase(database)){ |
||||
|
return sqlServerGeneratorDao; |
||||
|
}else if("postgresql".equalsIgnoreCase(database)){ |
||||
|
return postgreSQLGeneratorDao; |
||||
|
}else { |
||||
|
throw new RRException("不支持当前数据库:" + database); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
package io.renren.controller; |
||||
|
|
||||
|
import io.renren.service.SysGeneratorService; |
||||
|
import io.renren.utils.PageUtils; |
||||
|
import io.renren.utils.Query; |
||||
|
import io.renren.utils.R; |
||||
|
import org.apache.commons.io.IOUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.io.IOException; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 代码生成器 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年12月19日 下午9:12:58 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/sys/generator") |
||||
|
public class SysGeneratorController { |
||||
|
@Autowired |
||||
|
private SysGeneratorService sysGeneratorService; |
||||
|
|
||||
|
/** |
||||
|
* 列表 |
||||
|
*/ |
||||
|
@ResponseBody |
||||
|
@RequestMapping("/list") |
||||
|
public R list(@RequestParam Map<String, Object> params){ |
||||
|
PageUtils pageUtil = sysGeneratorService.queryList(new Query(params)); |
||||
|
|
||||
|
return R.ok().put("page", pageUtil); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 生成代码 |
||||
|
*/ |
||||
|
@RequestMapping("/code") |
||||
|
public void code(String tables, HttpServletResponse response) throws IOException{ |
||||
|
byte[] data = sysGeneratorService.generatorCode(tables.split(",")); |
||||
|
|
||||
|
response.reset(); |
||||
|
response.setHeader("Content-Disposition", "attachment; filename=\"renren.zip\""); |
||||
|
response.addHeader("Content-Length", "" + data.length); |
||||
|
response.setContentType("application/octet-stream; charset=UTF-8"); |
||||
|
|
||||
|
IOUtils.write(data, response.getOutputStream()); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 http://www.renren.io
|
||||
|
* <p> |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
||||
|
* use this file except in compliance with the License. You may obtain a copy of |
||||
|
* the License at |
||||
|
* <p> |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* <p> |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
|
* License for the specific language governing permissions and limitations under |
||||
|
* the License. |
||||
|
*/ |
||||
|
|
||||
|
package io.renren.dao; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 数据库接口 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 2018-07-24 |
||||
|
*/ |
||||
|
public interface GeneratorDao { |
||||
|
List<Map<String, Object>> queryList(Map<String, Object> map); |
||||
|
|
||||
|
Map<String, String> queryTable(String tableName); |
||||
|
|
||||
|
List<Map<String, String>> queryColumns(String tableName); |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package io.renren.dao; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* MySQL代码生成器 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 2018-07-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface MySQLGeneratorDao extends GeneratorDao { |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package io.renren.dao; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* Oracle代码生成器 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 2018-07-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface OracleGeneratorDao extends GeneratorDao { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package io.renren.dao; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* PostgreSQL代码生成器 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 2018-07-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface PostgreSQLGeneratorDao extends GeneratorDao { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package io.renren.dao; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* SQLServer代码生成器 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 2018-07-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface SQLServerGeneratorDao extends GeneratorDao { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,69 @@ |
|||||
|
package io.renren.entity; |
||||
|
|
||||
|
/** |
||||
|
* 列的属性 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年12月20日 上午12:01:45 |
||||
|
*/ |
||||
|
public class ColumnEntity { |
||||
|
//列名
|
||||
|
private String columnName; |
||||
|
//列名类型
|
||||
|
private String dataType; |
||||
|
//列名备注
|
||||
|
private String comments; |
||||
|
|
||||
|
//属性名称(第一个字母大写),如:user_name => UserName
|
||||
|
private String attrName; |
||||
|
//属性名称(第一个字母小写),如:user_name => userName
|
||||
|
private String attrname; |
||||
|
//属性类型
|
||||
|
private String attrType; |
||||
|
//auto_increment
|
||||
|
private String extra; |
||||
|
|
||||
|
public String getColumnName() { |
||||
|
return columnName; |
||||
|
} |
||||
|
public void setColumnName(String columnName) { |
||||
|
this.columnName = columnName; |
||||
|
} |
||||
|
public String getDataType() { |
||||
|
return dataType; |
||||
|
} |
||||
|
public void setDataType(String dataType) { |
||||
|
this.dataType = dataType; |
||||
|
} |
||||
|
public String getComments() { |
||||
|
return comments; |
||||
|
} |
||||
|
public void setComments(String comments) { |
||||
|
this.comments = comments; |
||||
|
} |
||||
|
public String getAttrname() { |
||||
|
return attrname; |
||||
|
} |
||||
|
public void setAttrname(String attrname) { |
||||
|
this.attrname = attrname; |
||||
|
} |
||||
|
public String getAttrName() { |
||||
|
return attrName; |
||||
|
} |
||||
|
public void setAttrName(String attrName) { |
||||
|
this.attrName = attrName; |
||||
|
} |
||||
|
public String getAttrType() { |
||||
|
return attrType; |
||||
|
} |
||||
|
public void setAttrType(String attrType) { |
||||
|
this.attrType = attrType; |
||||
|
} |
||||
|
public String getExtra() { |
||||
|
return extra; |
||||
|
} |
||||
|
public void setExtra(String extra) { |
||||
|
this.extra = extra; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
package io.renren.entity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 表数据 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年12月20日 上午12:02:55 |
||||
|
*/ |
||||
|
public class TableEntity { |
||||
|
//表的名称
|
||||
|
private String tableName; |
||||
|
//表的备注
|
||||
|
private String comments; |
||||
|
//表的主键
|
||||
|
private ColumnEntity pk; |
||||
|
//表的列名(不包含主键)
|
||||
|
private List<ColumnEntity> columns; |
||||
|
|
||||
|
//类名(第一个字母大写),如:sys_user => SysUser
|
||||
|
private String className; |
||||
|
//类名(第一个字母小写),如:sys_user => sysUser
|
||||
|
private String classname; |
||||
|
|
||||
|
public String getTableName() { |
||||
|
return tableName; |
||||
|
} |
||||
|
public void setTableName(String tableName) { |
||||
|
this.tableName = tableName; |
||||
|
} |
||||
|
public String getComments() { |
||||
|
return comments; |
||||
|
} |
||||
|
public void setComments(String comments) { |
||||
|
this.comments = comments; |
||||
|
} |
||||
|
public ColumnEntity getPk() { |
||||
|
return pk; |
||||
|
} |
||||
|
public void setPk(ColumnEntity pk) { |
||||
|
this.pk = pk; |
||||
|
} |
||||
|
public List<ColumnEntity> getColumns() { |
||||
|
return columns; |
||||
|
} |
||||
|
public void setColumns(List<ColumnEntity> columns) { |
||||
|
this.columns = columns; |
||||
|
} |
||||
|
public String getClassName() { |
||||
|
return className; |
||||
|
} |
||||
|
public void setClassName(String className) { |
||||
|
this.className = className; |
||||
|
} |
||||
|
public String getClassname() { |
||||
|
return classname; |
||||
|
} |
||||
|
public void setClassname(String classname) { |
||||
|
this.classname = classname; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,60 @@ |
|||||
|
package io.renren.service; |
||||
|
|
||||
|
import com.github.pagehelper.Page; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import io.renren.dao.GeneratorDao; |
||||
|
import io.renren.utils.GenUtils; |
||||
|
import io.renren.utils.PageUtils; |
||||
|
import io.renren.utils.Query; |
||||
|
import org.apache.commons.io.IOUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.io.ByteArrayOutputStream; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.zip.ZipOutputStream; |
||||
|
|
||||
|
/** |
||||
|
* 代码生成器 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年12月19日 下午3:33:38 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SysGeneratorService { |
||||
|
@Autowired |
||||
|
private GeneratorDao generatorDao; |
||||
|
|
||||
|
public PageUtils queryList(Query query) { |
||||
|
Page<?> page = PageHelper.startPage(query.getPage(), query.getLimit()); |
||||
|
List<Map<String, Object>> list = generatorDao.queryList(query); |
||||
|
|
||||
|
return new PageUtils(list, (int)page.getTotal(), query.getLimit(), query.getPage()); |
||||
|
} |
||||
|
|
||||
|
public Map<String, String> queryTable(String tableName) { |
||||
|
return generatorDao.queryTable(tableName); |
||||
|
} |
||||
|
|
||||
|
public List<Map<String, String>> queryColumns(String tableName) { |
||||
|
return generatorDao.queryColumns(tableName); |
||||
|
} |
||||
|
|
||||
|
public byte[] generatorCode(String[] tableNames) { |
||||
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
||||
|
ZipOutputStream zip = new ZipOutputStream(outputStream); |
||||
|
|
||||
|
for(String tableName : tableNames){ |
||||
|
//查询表信息
|
||||
|
Map<String, String> table = queryTable(tableName); |
||||
|
//查询列信息
|
||||
|
List<Map<String, String>> columns = queryColumns(tableName); |
||||
|
//生成代码
|
||||
|
GenUtils.generatorCode(table, columns, zip); |
||||
|
} |
||||
|
IOUtils.closeQuietly(zip); |
||||
|
return outputStream.toByteArray(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package io.renren.utils; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 日期处理 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年12月21日 下午12:53:33 |
||||
|
*/ |
||||
|
public class DateUtils { |
||||
|
/** 时间格式(yyyy-MM-dd) */ |
||||
|
public final static String DATE_PATTERN = "yyyy-MM-dd"; |
||||
|
/** 时间格式(yyyy-MM-dd HH:mm:ss) */ |
||||
|
public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; |
||||
|
|
||||
|
public static String format(Date date) { |
||||
|
return format(date, DATE_PATTERN); |
||||
|
} |
||||
|
|
||||
|
public static String format(Date date, String pattern) { |
||||
|
if(date != null){ |
||||
|
SimpleDateFormat df = new SimpleDateFormat(pattern); |
||||
|
return df.format(date); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,248 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 http://www.renren.io
|
||||
|
* <p> |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
||||
|
* use this file except in compliance with the License. You may obtain a copy of |
||||
|
* the License at |
||||
|
* <p> |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* <p> |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
|
* License for the specific language governing permissions and limitations under |
||||
|
* the License. |
||||
|
*/ |
||||
|
|
||||
|
package io.renren.utils; |
||||
|
|
||||
|
import io.renren.entity.ColumnEntity; |
||||
|
import io.renren.entity.TableEntity; |
||||
|
import org.apache.commons.configuration.Configuration; |
||||
|
import org.apache.commons.configuration.ConfigurationException; |
||||
|
import org.apache.commons.configuration.PropertiesConfiguration; |
||||
|
import org.apache.commons.io.IOUtils; |
||||
|
import org.apache.commons.lang.StringUtils; |
||||
|
import org.apache.commons.lang.WordUtils; |
||||
|
import org.apache.velocity.Template; |
||||
|
import org.apache.velocity.VelocityContext; |
||||
|
import org.apache.velocity.app.Velocity; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.io.IOException; |
||||
|
import java.io.StringWriter; |
||||
|
import java.util.*; |
||||
|
import java.util.zip.ZipEntry; |
||||
|
import java.util.zip.ZipOutputStream; |
||||
|
|
||||
|
/** |
||||
|
* 代码生成器 工具类 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
*/ |
||||
|
public class GenUtils { |
||||
|
|
||||
|
public static List<String> getTemplates(){ |
||||
|
List<String> templates = new ArrayList<>(); |
||||
|
templates.add("template/Entity.java.vm"); |
||||
|
templates.add("template/Dao.java.vm"); |
||||
|
templates.add("template/Dao.xml.vm"); |
||||
|
templates.add("template/Service.java.vm"); |
||||
|
templates.add("template/ServiceImpl.java.vm"); |
||||
|
templates.add("template/Controller.java.vm"); |
||||
|
templates.add("template/Excel.java.vm"); |
||||
|
templates.add("template/Redis.java.vm"); |
||||
|
templates.add("template/DTO.java.vm"); |
||||
|
templates.add("template/index.vue.vm"); |
||||
|
templates.add("template/add-or-update.vue.vm"); |
||||
|
return templates; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 生成代码 |
||||
|
*/ |
||||
|
public static void generatorCode(Map<String, String> table, |
||||
|
List<Map<String, String>> columns, ZipOutputStream zip){ |
||||
|
//配置信息
|
||||
|
Configuration config = getConfig(); |
||||
|
boolean hasBigDecimal = false; |
||||
|
//表信息
|
||||
|
TableEntity tableEntity = new TableEntity(); |
||||
|
tableEntity.setTableName(table.get("tableName")); |
||||
|
tableEntity.setComments(table.get("tableComment")); |
||||
|
//表名转换成Java类名
|
||||
|
String className = tableToJava(tableEntity.getTableName(), config.getString("tablePrefix")); |
||||
|
tableEntity.setClassName(className); |
||||
|
tableEntity.setClassname(StringUtils.uncapitalize(className)); |
||||
|
|
||||
|
//列信息
|
||||
|
List<ColumnEntity> columsList = new ArrayList<>(); |
||||
|
for(Map<String, String> column : columns){ |
||||
|
ColumnEntity columnEntity = new ColumnEntity(); |
||||
|
columnEntity.setColumnName(column.get("columnName")); |
||||
|
columnEntity.setDataType(column.get("dataType")); |
||||
|
columnEntity.setComments(column.get("columnComment")); |
||||
|
columnEntity.setExtra(column.get("extra")); |
||||
|
|
||||
|
//列名转换成Java属性名
|
||||
|
String attrName = columnToJava(columnEntity.getColumnName()); |
||||
|
columnEntity.setAttrName(attrName); |
||||
|
columnEntity.setAttrname(StringUtils.uncapitalize(attrName)); |
||||
|
|
||||
|
//列的数据类型,转换成Java类型
|
||||
|
String attrType = config.getString(columnEntity.getDataType(), "unknowType"); |
||||
|
columnEntity.setAttrType(attrType); |
||||
|
if (!hasBigDecimal && attrType.equals("BigDecimal" )) { |
||||
|
hasBigDecimal = true; |
||||
|
} |
||||
|
//是否主键
|
||||
|
if("PRI".equalsIgnoreCase(column.get("columnKey")) && tableEntity.getPk() == null){ |
||||
|
tableEntity.setPk(columnEntity); |
||||
|
} |
||||
|
|
||||
|
columsList.add(columnEntity); |
||||
|
} |
||||
|
tableEntity.setColumns(columsList); |
||||
|
|
||||
|
//没主键,则第一个字段为主键
|
||||
|
if(tableEntity.getPk() == null){ |
||||
|
tableEntity.setPk(tableEntity.getColumns().get(0)); |
||||
|
} |
||||
|
|
||||
|
//设置velocity资源加载器
|
||||
|
Properties prop = new Properties(); |
||||
|
prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); |
||||
|
Velocity.init(prop); |
||||
|
|
||||
|
String main = config.getString("main" ); |
||||
|
main = StringUtils.isBlank(main) ? config.getString("package" ) : main; |
||||
|
|
||||
|
//封装模板数据
|
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
map.put("tableName", tableEntity.getTableName()); |
||||
|
map.put("comments", tableEntity.getComments()); |
||||
|
map.put("pk", tableEntity.getPk()); |
||||
|
map.put("className", tableEntity.getClassName()); |
||||
|
map.put("classname", tableEntity.getClassname()); |
||||
|
map.put("pathName", tableEntity.getClassname()); |
||||
|
map.put("columns", tableEntity.getColumns()); |
||||
|
map.put("hasBigDecimal", hasBigDecimal); |
||||
|
map.put("main", main); |
||||
|
map.put("package", config.getString("package" )); |
||||
|
map.put("moduleName", config.getString("moduleName" )); |
||||
|
map.put("author", config.getString("author")); |
||||
|
map.put("version", config.getString("version")); |
||||
|
map.put("email", config.getString("email")); |
||||
|
map.put("datetime", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)); |
||||
|
map.put("date", DateUtils.format(new Date(), DateUtils.DATE_PATTERN)); |
||||
|
VelocityContext context = new VelocityContext(map); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//获取模板列表
|
||||
|
List<String> templates = getTemplates(); |
||||
|
for(String template : templates){ |
||||
|
//渲染模板
|
||||
|
StringWriter sw = new StringWriter(); |
||||
|
Template tpl = Velocity.getTemplate(template, "UTF-8"); |
||||
|
tpl.merge(context, sw); |
||||
|
|
||||
|
try { |
||||
|
//添加到zip
|
||||
|
zip.putNextEntry(new ZipEntry(getFileName(template, tableEntity.getClassName(), config.getString("package"), config.getString("moduleName")))); |
||||
|
IOUtils.write(sw.toString(), zip, "UTF-8"); |
||||
|
IOUtils.closeQuietly(sw); |
||||
|
zip.closeEntry(); |
||||
|
} catch (IOException e) { |
||||
|
throw new RRException("渲染模板失败,表名:" + tableEntity.getTableName(), e); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 列名转换成Java属性名 |
||||
|
*/ |
||||
|
public static String columnToJava(String columnName) { |
||||
|
return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", ""); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 表名转换成Java类名 |
||||
|
*/ |
||||
|
public static String tableToJava(String tableName, String tablePrefix) { |
||||
|
if(StringUtils.isNotBlank(tablePrefix)){ |
||||
|
tableName = tableName.replaceFirst(tablePrefix, ""); |
||||
|
} |
||||
|
return columnToJava(tableName); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取配置信息 |
||||
|
*/ |
||||
|
public static Configuration getConfig(){ |
||||
|
try { |
||||
|
return new PropertiesConfiguration("generator.properties"); |
||||
|
} catch (ConfigurationException e) { |
||||
|
throw new RRException("获取配置文件失败,", e); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取文件名 |
||||
|
*/ |
||||
|
public static String getFileName(String template, String className, String packageName, String moduleName) { |
||||
|
String packagePath = "main" + File.separator + "java" + File.separator; |
||||
|
if (StringUtils.isNotBlank(packageName)) { |
||||
|
packagePath += packageName.replace(".", File.separator) + File.separator; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Entity.java.vm" )) { |
||||
|
return packagePath + "entity" + File.separator + className + "Entity.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Excel.java.vm" )) { |
||||
|
return packagePath + "excel" + File.separator + className + "Excel.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Dao.java.vm" )) { |
||||
|
return packagePath + "dao" + File.separator + className + "Dao.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Service.java.vm" )) { |
||||
|
return packagePath + "service" + File.separator + className + "Service.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("ServiceImpl.java.vm" )) { |
||||
|
return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Controller.java.vm" )) { |
||||
|
return packagePath + "controller" + File.separator + className + "Controller.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Redis.java.vm" )) { |
||||
|
return packagePath + "redis" + File.separator + className + "Redis.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("DTO.java.vm" )) { |
||||
|
return "dto" + File.separator + className + "DTO.java"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("Dao.xml.vm" )) { |
||||
|
return "main" + File.separator + "resources" + File.separator + "mapper" + File.separator + className + "Dao.xml"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("index.vue.vm" )) { |
||||
|
return "vue" + File.separator + "views" + File.separator + "modules" + |
||||
|
File.separator + moduleName + File.separator + className.toLowerCase() + ".vue"; |
||||
|
} |
||||
|
|
||||
|
if (template.contains("add-or-update.vue.vm" )) { |
||||
|
return "vue" + File.separator + "views" + File.separator + "modules" + |
||||
|
File.separator + moduleName + File.separator + className.toLowerCase() + "-add-or-update.vue"; |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
package io.renren.utils; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 分页工具类 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年11月4日 下午12:59:00 |
||||
|
*/ |
||||
|
public class PageUtils implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
//总记录数
|
||||
|
private int totalCount; |
||||
|
//每页记录数
|
||||
|
private int pageSize; |
||||
|
//总页数
|
||||
|
private int totalPage; |
||||
|
//当前页数
|
||||
|
private int currPage; |
||||
|
//列表数据
|
||||
|
private List<?> list; |
||||
|
|
||||
|
/** |
||||
|
* 分页 |
||||
|
* @param list 列表数据 |
||||
|
* @param totalCount 总记录数 |
||||
|
* @param pageSize 每页记录数 |
||||
|
* @param currPage 当前页数 |
||||
|
*/ |
||||
|
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) { |
||||
|
this.list = list; |
||||
|
this.totalCount = totalCount; |
||||
|
this.pageSize = pageSize; |
||||
|
this.currPage = currPage; |
||||
|
this.totalPage = (int)Math.ceil((double)totalCount/pageSize); |
||||
|
} |
||||
|
|
||||
|
public int getTotalCount() { |
||||
|
return totalCount; |
||||
|
} |
||||
|
|
||||
|
public void setTotalCount(int totalCount) { |
||||
|
this.totalCount = totalCount; |
||||
|
} |
||||
|
|
||||
|
public int getPageSize() { |
||||
|
return pageSize; |
||||
|
} |
||||
|
|
||||
|
public void setPageSize(int pageSize) { |
||||
|
this.pageSize = pageSize; |
||||
|
} |
||||
|
|
||||
|
public int getTotalPage() { |
||||
|
return totalPage; |
||||
|
} |
||||
|
|
||||
|
public void setTotalPage(int totalPage) { |
||||
|
this.totalPage = totalPage; |
||||
|
} |
||||
|
|
||||
|
public int getCurrPage() { |
||||
|
return currPage; |
||||
|
} |
||||
|
|
||||
|
public void setCurrPage(int currPage) { |
||||
|
this.currPage = currPage; |
||||
|
} |
||||
|
|
||||
|
public List<?> getList() { |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
public void setList(List<?> list) { |
||||
|
this.list = list; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package io.renren.utils; |
||||
|
|
||||
|
|
||||
|
import java.util.LinkedHashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 查询参数 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2017-03-14 23:15 |
||||
|
*/ |
||||
|
public class Query extends LinkedHashMap<String, Object> { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
//当前页码
|
||||
|
private int page; |
||||
|
//每页条数
|
||||
|
private int limit; |
||||
|
|
||||
|
public Query(Map<String, Object> params){ |
||||
|
this.putAll(params); |
||||
|
|
||||
|
//分页参数
|
||||
|
this.page = Integer.parseInt(params.get("page").toString()); |
||||
|
this.limit = Integer.parseInt(params.get("limit").toString()); |
||||
|
this.put("offset", (page - 1) * limit); |
||||
|
this.put("page", page); |
||||
|
this.put("limit", limit); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public int getPage() { |
||||
|
return page; |
||||
|
} |
||||
|
|
||||
|
public void setPage(int page) { |
||||
|
this.page = page; |
||||
|
} |
||||
|
|
||||
|
public int getLimit() { |
||||
|
return limit; |
||||
|
} |
||||
|
|
||||
|
public void setLimit(int limit) { |
||||
|
this.limit = limit; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package io.renren.utils; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 返回数据 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年10月27日 下午9:59:27 |
||||
|
*/ |
||||
|
public class R extends HashMap<String, Object> { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public R() { |
||||
|
put("code", 0); |
||||
|
} |
||||
|
|
||||
|
public static R error() { |
||||
|
return error(500, "未知异常,请联系管理员"); |
||||
|
} |
||||
|
|
||||
|
public static R error(String msg) { |
||||
|
return error(500, msg); |
||||
|
} |
||||
|
|
||||
|
public static R error(int code, String msg) { |
||||
|
R r = new R(); |
||||
|
r.put("code", code); |
||||
|
r.put("msg", msg); |
||||
|
return r; |
||||
|
} |
||||
|
|
||||
|
public static R ok(String msg) { |
||||
|
R r = new R(); |
||||
|
r.put("msg", msg); |
||||
|
return r; |
||||
|
} |
||||
|
|
||||
|
public static R ok(Map<String, Object> map) { |
||||
|
R r = new R(); |
||||
|
r.putAll(map); |
||||
|
return r; |
||||
|
} |
||||
|
|
||||
|
public static R ok() { |
||||
|
return new R(); |
||||
|
} |
||||
|
|
||||
|
public R put(String key, Object value) { |
||||
|
super.put(key, value); |
||||
|
return this; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package io.renren.utils; |
||||
|
|
||||
|
/** |
||||
|
* 自定义异常 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年10月27日 下午10:11:27 |
||||
|
*/ |
||||
|
public class RRException extends RuntimeException { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private String msg; |
||||
|
private int code = 500; |
||||
|
|
||||
|
public RRException(String msg) { |
||||
|
super(msg); |
||||
|
this.msg = msg; |
||||
|
} |
||||
|
|
||||
|
public RRException(String msg, Throwable e) { |
||||
|
super(msg, e); |
||||
|
this.msg = msg; |
||||
|
} |
||||
|
|
||||
|
public RRException(String msg, int code) { |
||||
|
super(msg); |
||||
|
this.msg = msg; |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public RRException(String msg, int code, Throwable e) { |
||||
|
super(msg, e); |
||||
|
this.msg = msg; |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getMsg() { |
||||
|
return msg; |
||||
|
} |
||||
|
|
||||
|
public void setMsg(String msg) { |
||||
|
this.msg = msg; |
||||
|
} |
||||
|
|
||||
|
public int getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(int code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package io.renren.utils; |
||||
|
|
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.web.bind.annotation.ExceptionHandler; |
||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice; |
||||
|
|
||||
|
/** |
||||
|
* 异常处理器 |
||||
|
* |
||||
|
* @author chenshun |
||||
|
* @email sunlightcs@gmail.com |
||||
|
* @date 2016年10月27日 下午10:16:19 |
||||
|
*/ |
||||
|
@RestControllerAdvice |
||||
|
public class RRExceptionHandler { |
||||
|
private Logger logger = LoggerFactory.getLogger(getClass()); |
||||
|
|
||||
|
/** |
||||
|
* 处理自定义异常 |
||||
|
*/ |
||||
|
@ExceptionHandler(RRException.class) |
||||
|
public R handleRRException(RRException e){ |
||||
|
R r = new R(); |
||||
|
r.put("code", e.getCode()); |
||||
|
r.put("msg", e.getMessage()); |
||||
|
|
||||
|
return r; |
||||
|
} |
||||
|
|
||||
|
@ExceptionHandler(Exception.class) |
||||
|
public R handleException(Exception e){ |
||||
|
logger.error(e.getMessage(), e); |
||||
|
return R.error(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
server: |
||||
|
port: 8070 |
||||
|
servlet: |
||||
|
context-path: /epmet-cloud-generator |
||||
|
|
||||
|
|
||||
|
spring: |
||||
|
datasource: |
||||
|
type: com.alibaba.druid.pool.DruidDataSource |
||||
|
#MySQL配置 |
||||
|
driverClassName: com.mysql.jdbc.Driver |
||||
|
url: jdbc:mysql://118.190.150.119:43306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false |
||||
|
username: root |
||||
|
password: root |
||||
|
#oracle配置 |
||||
|
# driverClassName: oracle.jdbc.OracleDriver |
||||
|
# url: jdbc:oracle:thin:@192.168.10.10:1521:helowin |
||||
|
# username: renren |
||||
|
# password: 123456 |
||||
|
#SQLServer配置 |
||||
|
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver |
||||
|
# url: jdbc:sqlserver://192.168.10.10:1433;DatabaseName=renren_cloud |
||||
|
# username: sa |
||||
|
# password: 123456 |
||||
|
#PostgreSQL配置 |
||||
|
# driverClassName: org.postgresql.Driver |
||||
|
# url: jdbc:postgresql://192.168.10.10:5432/renren_cloud |
||||
|
# username: postgres |
||||
|
# password: 123456 |
||||
|
jackson: |
||||
|
time-zone: GMT+8 |
||||
|
date-format: yyyy-MM-dd HH:mm:ss |
||||
|
resources: |
||||
|
static-locations: classpath:/static/,classpath:/views/ |
||||
|
|
||||
|
|
||||
|
mybatis: |
||||
|
mapperLocations: classpath:mapper/**/*.xml |
||||
|
|
||||
|
|
||||
|
pagehelper: |
||||
|
reasonable: true |
||||
|
supportMethodsArguments: true |
||||
|
params: count=countSql |
||||
|
|
||||
|
|
||||
|
#指定数据库,可选值有【mysql、oracle、sqlserver、postgresql】 |
||||
|
renren: |
||||
|
database: mysql |
||||
@ -0,0 +1,64 @@ |
|||||
|
#代码生成器,配置信息 |
||||
|
|
||||
|
main= |
||||
|
#包名 |
||||
|
package=com.epmet |
||||
|
moduleName= |
||||
|
#作者 |
||||
|
author=generator |
||||
|
#版本号 |
||||
|
version=v1.0.0 |
||||
|
#Email |
||||
|
email=generator@elink-cn.com |
||||
|
#表前缀(类名不会包含表前缀) |
||||
|
tablePrefix=epmet_ |
||||
|
|
||||
|
#类型转换,配置信息 |
||||
|
tinyint=Integer |
||||
|
smallint=Integer |
||||
|
mediumint=Integer |
||||
|
int=Integer |
||||
|
integer=Integer |
||||
|
bigint=Long |
||||
|
float=Float |
||||
|
double=Double |
||||
|
decimal=BigDecimal |
||||
|
bit=Boolean |
||||
|
|
||||
|
char=String |
||||
|
varchar=String |
||||
|
tinytext=String |
||||
|
text=String |
||||
|
mediumtext=String |
||||
|
longtext=String |
||||
|
|
||||
|
date=Date |
||||
|
datetime=Date |
||||
|
timestamp=Date |
||||
|
|
||||
|
NUMBER=Integer |
||||
|
INT=Integer |
||||
|
INTEGER=Integer |
||||
|
BINARY_INTEGER=Integer |
||||
|
LONG=String |
||||
|
FLOAT=Float |
||||
|
BINARY_FLOAT=Float |
||||
|
DOUBLE=Double |
||||
|
BINARY_DOUBLE=Double |
||||
|
DECIMAL=BigDecimal |
||||
|
CHAR=String |
||||
|
VARCHAR=String |
||||
|
VARCHAR2=String |
||||
|
NVARCHAR=String |
||||
|
NVARCHAR2=String |
||||
|
CLOB=String |
||||
|
BLOB=String |
||||
|
DATE=Date |
||||
|
DATETIME=Date |
||||
|
TIMESTAMP=Date |
||||
|
TIMESTAMP(6)=Date |
||||
|
|
||||
|
int8=Long |
||||
|
int4=Integer |
||||
|
int2=Integer |
||||
|
numeric=BigDecimal |
||||
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
<include resource="org/springframework/boot/logging/logback/base.xml" /> |
||||
|
<logger name="org.springframework.web" level="INFO"/> |
||||
|
<logger name="org.springboot.sample" level="TRACE" /> |
||||
|
|
||||
|
<logger name="org.springframework.web" level="INFO"/> |
||||
|
<logger name="org.springboot.sample" level="INFO" /> |
||||
|
<logger name="io.renren" level="DEBUG" /> |
||||
|
|
||||
|
</configuration> |
||||
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="io.renren.dao.MySQLGeneratorDao"> |
||||
|
<select id="queryList" resultType="map"> |
||||
|
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables |
||||
|
where table_schema = (select database()) |
||||
|
<if test="tableName != null and tableName.trim() != ''"> |
||||
|
and table_name like concat('%', #{tableName}, '%') |
||||
|
</if> |
||||
|
order by create_time desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryTable" resultType="map"> |
||||
|
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables |
||||
|
where table_schema = (select database()) and table_name = #{tableName} |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryColumns" resultType="map"> |
||||
|
select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns |
||||
|
where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,63 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="io.renren.dao.OracleGeneratorDao"> |
||||
|
<resultMap id="tableMap" type="map"> |
||||
|
<result column="TABLENAME" property="tableName"></result> |
||||
|
<result column="TABLECOMMENT" property="tableComment"></result> |
||||
|
<result column="COLUMNNAME" property="columnName"></result> |
||||
|
<result column="DATATYPE" property="dataType"></result> |
||||
|
<result column="COLUMNCOMMENT" property="columnComment"></result> |
||||
|
<result column="COLUMNKEY" property="columnKey"></result> |
||||
|
<result column="EXTRA" property="extra"></result> |
||||
|
<result column="CREATETIME" property="createTime"></result> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="queryList" resultMap="tableMap"> |
||||
|
select dt.table_name tableName, |
||||
|
dtc.comments tableComment, |
||||
|
uo.created createTime |
||||
|
from user_tables dt, |
||||
|
user_tab_comments dtc, |
||||
|
user_objects uo |
||||
|
where dt.table_name = dtc.table_name and dt.table_name = uo.object_name and uo.object_type='TABLE' |
||||
|
<if test="tableName != null and tableName.trim() != ''"> |
||||
|
and dt.table_name like concat('%', UPPER(#{tableName})) |
||||
|
</if> |
||||
|
order by uo.CREATED desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryTable" resultMap="tableMap"> |
||||
|
select dt.table_name tableName,dtc.comments tableComment,dt.last_analyzed createTime from user_tables dt,user_tab_comments dtc where dt.table_name=dtc.table_name and dt.table_name = UPPER(#{tableName}) |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryColumns" resultMap="tableMap"> |
||||
|
select temp.column_name columnname, |
||||
|
temp.data_type dataType, |
||||
|
temp.comments columnComment, |
||||
|
case temp.constraint_type when 'P' then 'PRI' when 'C' then 'UNI' else '' end "COLUMNKEY", |
||||
|
'' "EXTRA" |
||||
|
from ( |
||||
|
select col.column_id, |
||||
|
col.column_name, |
||||
|
col.data_type, |
||||
|
colc.comments, |
||||
|
uc.constraint_type, |
||||
|
-- 去重 |
||||
|
row_number() over (partition by col.column_name order by uc.constraint_type desc) as row_flg |
||||
|
from user_tab_columns col |
||||
|
left join user_col_comments colc |
||||
|
on colc.table_name = col.table_name |
||||
|
and colc.column_name = col.column_name |
||||
|
left join user_cons_columns ucc |
||||
|
on ucc.table_name = col.table_name |
||||
|
and ucc.column_name = col.column_name |
||||
|
left join user_constraints uc |
||||
|
on uc.constraint_name = ucc.constraint_name |
||||
|
where col.table_name = upper(#{tableName}) |
||||
|
) temp |
||||
|
where temp.row_flg = 1 |
||||
|
order by temp.column_id |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,37 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="io.renren.dao.PostgreSQLGeneratorDao"> |
||||
|
<resultMap id="tableMap" type="map"> |
||||
|
<result column="tablename" property="tableName"></result> |
||||
|
<result column="tablecomment" property="tableComment"></result> |
||||
|
<result column="columnname" property="columnName"></result> |
||||
|
<result column="datatype" property="dataType"></result> |
||||
|
<result column="columncomment" property="columnComment"></result> |
||||
|
<result column="columnkey" property="columnKey"></result> |
||||
|
<result column="extra" property="extra"></result> |
||||
|
<result column="createtime" property="createTime"></result> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="queryList" resultMap="tableMap"> |
||||
|
select t1.tablename as tableName, obj_description(relfilenode, 'pg_class') as tableComment, now() as createTime from pg_tables t1, pg_class t2 |
||||
|
where t1.tablename not like 'pg%' and t1.tablename not like 'sql_%' and t1.tablename = t2.relname |
||||
|
<if test="tableName != null and tableName.trim() != ''"> |
||||
|
and t1.tablename like concat('%', #{tableName}, '%') |
||||
|
</if> |
||||
|
order by t1.tablename desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryTable" resultMap="tableMap"> |
||||
|
select t1.tablename as tableName, obj_description(relfilenode, 'pg_class') as tableComment, now() as createTime from pg_tables t1, pg_class t2 |
||||
|
where t1.tablename = #{tableName} and t1.tablename = t2.relname |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryColumns" resultMap="tableMap"> |
||||
|
select t2.attname as columnName, pg_type.typname as dataType, col_description(t2.attrelid,t2.attnum) as columnComment, '' as extra, |
||||
|
(CASE t3.contype WHEN 'p' THEN 'PRI' ELSE '' END) as columnKey |
||||
|
from pg_class as t1, pg_attribute as t2 inner join pg_type on pg_type.oid = t2.atttypid |
||||
|
left join pg_constraint t3 on t2.attnum = t3.conkey[1] and t2.attrelid = t3.conrelid |
||||
|
where t1.relname = #{tableName} and t2.attrelid = t1.oid and t2.attnum>0 |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,90 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="io.renren.dao.SQLServerGeneratorDao"> |
||||
|
<select id="queryList" resultType="map"> |
||||
|
select * from |
||||
|
( |
||||
|
select cast(so.name as varchar(500)) as tableName, cast(sep.value as varchar(500)) as tableComment, getDate() as createTime |
||||
|
from sysobjects so |
||||
|
left JOIN sys.extended_properties sep |
||||
|
on sep.major_id=so.id and sep.minor_id=0 |
||||
|
where (xtype='U' or xtype='v') |
||||
|
) t where 1=1 |
||||
|
<if test="tableName != null and tableName.trim() != ''"> |
||||
|
and t.tableName like concat('%', #{tableName}, '%') |
||||
|
</if> |
||||
|
order by t.tableName |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryTable" resultType="map"> |
||||
|
select * from ( |
||||
|
select cast(so.name as varchar(500)) as tableName, 'mssql' as engine,cast(sep.value as varchar(500)) as tableComment, getDate() as createTime |
||||
|
from sysobjects so |
||||
|
left JOIN sys.extended_properties sep on sep.major_id=so.id and sep.minor_id=0 |
||||
|
where (xtype='U' or xtype='v') |
||||
|
) t where t.tableName=#{tableName} |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryColumns" resultType="map"> |
||||
|
SELECT |
||||
|
cast( |
||||
|
b.NAME AS VARCHAR(500) |
||||
|
) AS columnName, |
||||
|
cast( |
||||
|
sys.types.NAME AS VARCHAR(500) |
||||
|
) AS dataType, |
||||
|
cast( |
||||
|
c.VALUE AS VARCHAR(500) |
||||
|
) AS columnComment, |
||||
|
( |
||||
|
SELECT |
||||
|
CASE |
||||
|
count( 1 ) |
||||
|
WHEN 1 then 'PRI' |
||||
|
ELSE '' |
||||
|
END |
||||
|
FROM |
||||
|
syscolumns, |
||||
|
sysobjects, |
||||
|
sysindexes, |
||||
|
sysindexkeys, |
||||
|
systypes |
||||
|
WHERE |
||||
|
syscolumns.xusertype = systypes.xusertype |
||||
|
AND syscolumns.id = object_id(A.NAME) |
||||
|
AND sysobjects.xtype = 'PK' |
||||
|
AND sysobjects.parent_obj = syscolumns.id |
||||
|
AND sysindexes.id = syscolumns.id |
||||
|
AND sysobjects.NAME = sysindexes.NAME |
||||
|
AND sysindexkeys.id = syscolumns.id |
||||
|
AND sysindexkeys.indid = sysindexes.indid |
||||
|
AND syscolumns.colid = sysindexkeys.colid |
||||
|
AND syscolumns.NAME = B.NAME |
||||
|
) as columnKey, |
||||
|
'' as extra |
||||
|
FROM |
||||
|
( |
||||
|
select |
||||
|
name, |
||||
|
object_id |
||||
|
from |
||||
|
sys.tables |
||||
|
UNION all select |
||||
|
name, |
||||
|
object_id |
||||
|
from |
||||
|
sys.views |
||||
|
) a |
||||
|
INNER JOIN sys.COLUMNS b ON |
||||
|
b.object_id = a.object_id |
||||
|
LEFT JOIN sys.types ON |
||||
|
b.user_type_id = sys.types.user_type_id |
||||
|
LEFT JOIN sys.extended_properties c ON |
||||
|
c.major_id = b.object_id |
||||
|
AND c.minor_id = b.column_id |
||||
|
WHERE |
||||
|
a.NAME = #{tableName} |
||||
|
and sys.types.NAME != 'sysname' |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,54 @@ |
|||||
|
html { overflow-x:hidden; } |
||||
|
.content-header { |
||||
|
position: relative; |
||||
|
padding: 0 0 3px 8px |
||||
|
} |
||||
|
|
||||
|
.content-header>.breadcrumb { |
||||
|
position: relative; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
float: none; |
||||
|
margin-top: 0px; |
||||
|
padding-left: 10px; |
||||
|
background: #ecf0f5; |
||||
|
} |
||||
|
|
||||
|
.main-footer { |
||||
|
padding: 7px; |
||||
|
color: #444; |
||||
|
border-top: 1px solid #eee; |
||||
|
} |
||||
|
|
||||
|
[v-cloak] { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.grid-btn{ |
||||
|
margin-bottom:12px; |
||||
|
} |
||||
|
.grid-btn .btn{ |
||||
|
margin-right:10px; |
||||
|
} |
||||
|
.pointer{cursor: pointer;} |
||||
|
|
||||
|
.ml-10 { margin-left:0 !important; } |
||||
|
@media (min-width: 768px) { |
||||
|
.ml-10 { margin-left:10px !important; } |
||||
|
.col-sm-10 {width: 70%;padding-left: 0px;} |
||||
|
.col-sm-2 {width: 24%;} |
||||
|
} |
||||
|
tbody > tr > th {font-weight: normal; } |
||||
|
.panel .table { margin:0 0; } |
||||
|
.panel .pagination { margin:0; } |
||||
|
.panel-default>.panel-heading {background-color: #f5f5f5;} |
||||
|
.row{ |
||||
|
border-top: 1px solid #ddd; |
||||
|
margin:0; |
||||
|
padding:20px 2px 0px 2px; |
||||
|
} |
||||
|
.col-xs-6{padding-left: 0px;padding-right: 0px;} |
||||
|
.form-horizontal .form-group {margin-left:0px;margin-right:0px;} |
||||
|
.form-horizontal{ |
||||
|
width:550px;padding-top:20px; |
||||
|
} |
||||
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 434 KiB |
|
After Width: | Height: | Size: 106 KiB |
@ -0,0 +1,83 @@ |
|||||
|
//jqGrid的配置信息
|
||||
|
$.jgrid.defaults.width = 1000; |
||||
|
$.jgrid.defaults.responsive = true; |
||||
|
$.jgrid.defaults.styleUI = 'Bootstrap'; |
||||
|
|
||||
|
//工具集合Tools
|
||||
|
window.T = {}; |
||||
|
|
||||
|
// 获取请求参数
|
||||
|
// 使用示例
|
||||
|
// location.href = http://localhost:8080/index.html?id=123
|
||||
|
// T.p('id') --> 123;
|
||||
|
var url = function(name) { |
||||
|
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); |
||||
|
var r = window.location.search.substr(1).match(reg); |
||||
|
if(r!=null)return unescape(r[2]); return null; |
||||
|
}; |
||||
|
T.p = url; |
||||
|
|
||||
|
//全局配置
|
||||
|
$.ajaxSetup({ |
||||
|
dataType: "json", |
||||
|
contentType: "application/json", |
||||
|
cache: false |
||||
|
}); |
||||
|
|
||||
|
function hasPermission(permission) { |
||||
|
if (window.parent.permissions.indexOf(permission) > -1) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//重写alert
|
||||
|
window.alert = function(msg, callback){ |
||||
|
parent.layer.alert(msg, function(index){ |
||||
|
parent.layer.close(index); |
||||
|
if(typeof(callback) === "function"){ |
||||
|
callback("ok"); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
//重写confirm式样框
|
||||
|
window.confirm = function(msg, callback){ |
||||
|
parent.layer.confirm(msg, {btn: ['确定','取消']}, |
||||
|
function(){//确定事件
|
||||
|
if(typeof(callback) === "function"){ |
||||
|
callback("ok"); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
//选择一条记录
|
||||
|
function getSelectedRow() { |
||||
|
var grid = $("#jqGrid"); |
||||
|
var rowKey = grid.getGridParam("selrow"); |
||||
|
if(!rowKey){ |
||||
|
alert("请选择一条记录"); |
||||
|
return ; |
||||
|
} |
||||
|
|
||||
|
var selectedIDs = grid.getGridParam("selarrrow"); |
||||
|
if(selectedIDs.length > 1){ |
||||
|
alert("只能选择一条记录"); |
||||
|
return ; |
||||
|
} |
||||
|
|
||||
|
return selectedIDs[0]; |
||||
|
} |
||||
|
|
||||
|
//选择多条记录
|
||||
|
function getSelectedRows() { |
||||
|
var grid = $("#jqGrid"); |
||||
|
var rowKey = grid.getGridParam("selrow"); |
||||
|
if(!rowKey){ |
||||
|
alert("请选择一条记录"); |
||||
|
return ; |
||||
|
} |
||||
|
|
||||
|
return grid.getGridParam("selarrrow"); |
||||
|
} |
||||
@ -0,0 +1,60 @@ |
|||||
|
$(function () { |
||||
|
$("#jqGrid").jqGrid({ |
||||
|
url: 'sys/generator/list', |
||||
|
datatype: "json", |
||||
|
colModel: [ |
||||
|
{ label: '表名', name: 'tableName', width: 100, key: true }, |
||||
|
{ label: '表备注', name: 'tableComment', width: 100 }, |
||||
|
{ label: '创建时间', name: 'createTime', width: 100 } |
||||
|
], |
||||
|
viewrecords: true, |
||||
|
height: 385, |
||||
|
rowNum: 10, |
||||
|
rowList : [10,30,50,100,200], |
||||
|
rownumbers: true, |
||||
|
rownumWidth: 25, |
||||
|
autowidth:true, |
||||
|
multiselect: true, |
||||
|
pager: "#jqGridPager", |
||||
|
jsonReader : { |
||||
|
root: "page.list", |
||||
|
page: "page.currPage", |
||||
|
total: "page.totalPage", |
||||
|
records: "page.totalCount" |
||||
|
}, |
||||
|
prmNames : { |
||||
|
page:"page", |
||||
|
rows:"limit", |
||||
|
order: "order" |
||||
|
}, |
||||
|
gridComplete:function(){ |
||||
|
//隐藏grid底部滚动条
|
||||
|
$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
var vm = new Vue({ |
||||
|
el:'#rrapp', |
||||
|
data:{ |
||||
|
q:{ |
||||
|
tableName: null |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
query: function () { |
||||
|
$("#jqGrid").jqGrid('setGridParam',{ |
||||
|
postData:{'tableName': vm.q.tableName}, |
||||
|
page:1 |
||||
|
}).trigger("reloadGrid"); |
||||
|
}, |
||||
|
generator: function() { |
||||
|
var tableNames = getSelectedRows(); |
||||
|
if(tableNames == null){ |
||||
|
return ; |
||||
|
} |
||||
|
location.href = "sys/generator/code?tables=" + tableNames.join(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
@ -0,0 +1,52 @@ |
|||||
|
//iframe自适应
|
||||
|
$(window).on('resize', function() { |
||||
|
var $content = $('.content'); |
||||
|
$content.height($(this).height() - 120); |
||||
|
$content.find('iframe').each(function() { |
||||
|
$(this).height($content.height()); |
||||
|
}); |
||||
|
}).resize(); |
||||
|
|
||||
|
|
||||
|
var vm = new Vue({ |
||||
|
el:'#rrapp', |
||||
|
data:{ |
||||
|
main:"main.html", |
||||
|
navTitle:"欢迎页" |
||||
|
}, |
||||
|
methods: { |
||||
|
donate: function () { |
||||
|
layer.open({ |
||||
|
type: 2, |
||||
|
title: false, |
||||
|
area: ['806px', '467px'], |
||||
|
closeBtn: 1, |
||||
|
shadeClose: false, |
||||
|
content: ['http://cdn.renren.io/donate.jpg', 'no'] |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
//路由
|
||||
|
var router = new Router(); |
||||
|
var menus = ["main.html","generator.html"]; |
||||
|
routerList(router, menus); |
||||
|
router.start(); |
||||
|
|
||||
|
function routerList(router, menus){ |
||||
|
for(var index in menus){ |
||||
|
router.add('#'+menus[index], function() { |
||||
|
var url = window.location.hash; |
||||
|
|
||||
|
//替换iframe的url
|
||||
|
vm.main = url.replace('#', ''); |
||||
|
|
||||
|
//导航菜单展开
|
||||
|
$(".treeview-menu li").removeClass("active"); |
||||
|
$("a[href='"+url+"']").parents("li").addClass("active"); |
||||
|
|
||||
|
vm.navTitle = $("a[href='"+url+"']").text(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,763 @@ |
|||||
|
/*! AdminLTE app.js |
||||
|
* ================ |
||||
|
* Main JS application file for AdminLTE v2. This file |
||||
|
* should be included in all pages. It controls some layout |
||||
|
* options and implements exclusive AdminLTE plugins. |
||||
|
* |
||||
|
* @Author Almsaeed Studio |
||||
|
* @Support <http://www.almsaeedstudio.com>
|
||||
|
* @Email <abdullah@almsaeedstudio.com> |
||||
|
* @version 2.3.7 |
||||
|
* @license MIT <http://opensource.org/licenses/MIT>
|
||||
|
*/ |
||||
|
|
||||
|
//Make sure jQuery has been loaded before app.js
|
||||
|
if (typeof jQuery === "undefined") { |
||||
|
throw new Error("AdminLTE requires jQuery"); |
||||
|
} |
||||
|
|
||||
|
/* AdminLTE |
||||
|
* |
||||
|
* @type Object |
||||
|
* @description $.AdminLTE is the main object for the template's app. |
||||
|
* It's used for implementing functions and options related |
||||
|
* to the template. Keeping everything wrapped in an object |
||||
|
* prevents conflict with other plugins and is a better |
||||
|
* way to organize our code. |
||||
|
*/ |
||||
|
$.AdminLTE = {}; |
||||
|
|
||||
|
/* -------------------- |
||||
|
* - AdminLTE Options - |
||||
|
* -------------------- |
||||
|
* Modify these options to suit your implementation |
||||
|
*/ |
||||
|
$.AdminLTE.options = { |
||||
|
//Add slimscroll to navbar menus
|
||||
|
//This requires you to load the slimscroll plugin
|
||||
|
//in every page before app.js
|
||||
|
navbarMenuSlimscroll: true, |
||||
|
navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar
|
||||
|
navbarMenuHeight: "200px", //The height of the inner menu
|
||||
|
//General animation speed for JS animated elements such as box collapse/expand and
|
||||
|
//sidebar treeview slide up/down. This options accepts an integer as milliseconds,
|
||||
|
//'fast', 'normal', or 'slow'
|
||||
|
animationSpeed: 'fast', |
||||
|
//Sidebar push menu toggle button selector
|
||||
|
sidebarToggleSelector: "[data-toggle='offcanvas']", |
||||
|
//Activate sidebar push menu
|
||||
|
sidebarPushMenu: true, |
||||
|
//Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin)
|
||||
|
sidebarSlimScroll: true, |
||||
|
//Enable sidebar expand on hover effect for sidebar mini
|
||||
|
//This option is forced to true if both the fixed layout and sidebar mini
|
||||
|
//are used together
|
||||
|
sidebarExpandOnHover: false, |
||||
|
//BoxRefresh Plugin
|
||||
|
enableBoxRefresh: true, |
||||
|
//Bootstrap.js tooltip
|
||||
|
enableBSToppltip: true, |
||||
|
BSTooltipSelector: "[data-toggle='tooltip']", |
||||
|
//Enable Fast Click. Fastclick.js creates a more
|
||||
|
//native touch experience with touch devices. If you
|
||||
|
//choose to enable the plugin, make sure you load the script
|
||||
|
//before AdminLTE's app.js
|
||||
|
enableFastclick: false, |
||||
|
//Control Sidebar Options
|
||||
|
enableControlSidebar: true, |
||||
|
controlSidebarOptions: { |
||||
|
//Which button should trigger the open/close event
|
||||
|
toggleBtnSelector: "[data-toggle='control-sidebar']", |
||||
|
//The sidebar selector
|
||||
|
selector: ".control-sidebar", |
||||
|
//Enable slide over content
|
||||
|
slide: true |
||||
|
}, |
||||
|
//Box Widget Plugin. Enable this plugin
|
||||
|
//to allow boxes to be collapsed and/or removed
|
||||
|
enableBoxWidget: true, |
||||
|
//Box Widget plugin options
|
||||
|
boxWidgetOptions: { |
||||
|
boxWidgetIcons: { |
||||
|
//Collapse icon
|
||||
|
collapse: 'fa-minus', |
||||
|
//Open icon
|
||||
|
open: 'fa-plus', |
||||
|
//Remove icon
|
||||
|
remove: 'fa-times' |
||||
|
}, |
||||
|
boxWidgetSelectors: { |
||||
|
//Remove button selector
|
||||
|
remove: '[data-widget="remove"]', |
||||
|
//Collapse button selector
|
||||
|
collapse: '[data-widget="collapse"]' |
||||
|
} |
||||
|
}, |
||||
|
//Direct Chat plugin options
|
||||
|
directChat: { |
||||
|
//Enable direct chat by default
|
||||
|
enable: true, |
||||
|
//The button to open and close the chat contacts pane
|
||||
|
contactToggleSelector: '[data-widget="chat-pane-toggle"]' |
||||
|
}, |
||||
|
//Define the set of colors to use globally around the website
|
||||
|
colors: { |
||||
|
lightBlue: "#3c8dbc", |
||||
|
red: "#f56954", |
||||
|
green: "#00a65a", |
||||
|
aqua: "#00c0ef", |
||||
|
yellow: "#f39c12", |
||||
|
blue: "#0073b7", |
||||
|
navy: "#001F3F", |
||||
|
teal: "#39CCCC", |
||||
|
olive: "#3D9970", |
||||
|
lime: "#01FF70", |
||||
|
orange: "#FF851B", |
||||
|
fuchsia: "#F012BE", |
||||
|
purple: "#8E24AA", |
||||
|
maroon: "#D81B60", |
||||
|
black: "#222222", |
||||
|
gray: "#d2d6de" |
||||
|
}, |
||||
|
//The standard screen sizes that bootstrap uses.
|
||||
|
//If you change these in the variables.less file, change
|
||||
|
//them here too.
|
||||
|
screenSizes: { |
||||
|
xs: 480, |
||||
|
sm: 768, |
||||
|
md: 992, |
||||
|
lg: 1200 |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
/* ------------------ |
||||
|
* - Implementation - |
||||
|
* ------------------ |
||||
|
* The next block of code implements AdminLTE's |
||||
|
* functions and plugins as specified by the |
||||
|
* options above. |
||||
|
*/ |
||||
|
$(function () { |
||||
|
"use strict"; |
||||
|
|
||||
|
//Fix for IE page transitions
|
||||
|
$("body").removeClass("hold-transition"); |
||||
|
|
||||
|
//Extend options if external options exist
|
||||
|
if (typeof AdminLTEOptions !== "undefined") { |
||||
|
$.extend(true, |
||||
|
$.AdminLTE.options, |
||||
|
AdminLTEOptions); |
||||
|
} |
||||
|
|
||||
|
//Easy access to options
|
||||
|
var o = $.AdminLTE.options; |
||||
|
|
||||
|
//Set up the object
|
||||
|
_init(); |
||||
|
|
||||
|
//Activate the layout maker
|
||||
|
$.AdminLTE.layout.activate(); |
||||
|
|
||||
|
//Enable sidebar tree view controls
|
||||
|
$.AdminLTE.tree('.sidebar'); |
||||
|
|
||||
|
//Enable control sidebar
|
||||
|
if (o.enableControlSidebar) { |
||||
|
$.AdminLTE.controlSidebar.activate(); |
||||
|
} |
||||
|
|
||||
|
//Add slimscroll to navbar dropdown
|
||||
|
if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') { |
||||
|
$(".navbar .menu").slimscroll({ |
||||
|
height: o.navbarMenuHeight, |
||||
|
alwaysVisible: false, |
||||
|
size: o.navbarMenuSlimscrollWidth |
||||
|
}).css("width", "100%"); |
||||
|
} |
||||
|
|
||||
|
//Activate sidebar push menu
|
||||
|
if (o.sidebarPushMenu) { |
||||
|
$.AdminLTE.pushMenu.activate(o.sidebarToggleSelector); |
||||
|
} |
||||
|
|
||||
|
//Activate Bootstrap tooltip
|
||||
|
if (o.enableBSToppltip) { |
||||
|
$('body').tooltip({ |
||||
|
selector: o.BSTooltipSelector |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
//Activate box widget
|
||||
|
if (o.enableBoxWidget) { |
||||
|
$.AdminLTE.boxWidget.activate(); |
||||
|
} |
||||
|
|
||||
|
//Activate fast click
|
||||
|
if (o.enableFastclick && typeof FastClick != 'undefined') { |
||||
|
FastClick.attach(document.body); |
||||
|
} |
||||
|
|
||||
|
//Activate direct chat widget
|
||||
|
if (o.directChat.enable) { |
||||
|
$(document).on('click', o.directChat.contactToggleSelector, function () { |
||||
|
var box = $(this).parents('.direct-chat').first(); |
||||
|
box.toggleClass('direct-chat-contacts-open'); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* |
||||
|
* INITIALIZE BUTTON TOGGLE |
||||
|
* ------------------------ |
||||
|
*/ |
||||
|
$('.btn-group[data-toggle="btn-toggle"]').each(function () { |
||||
|
var group = $(this); |
||||
|
$(this).find(".btn").on('click', function (e) { |
||||
|
group.find(".btn.active").removeClass("active"); |
||||
|
$(this).addClass("active"); |
||||
|
e.preventDefault(); |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
/* ---------------------------------- |
||||
|
* - Initialize the AdminLTE Object - |
||||
|
* ---------------------------------- |
||||
|
* All AdminLTE functions are implemented below. |
||||
|
*/ |
||||
|
function _init() { |
||||
|
'use strict'; |
||||
|
/* Layout |
||||
|
* ====== |
||||
|
* Fixes the layout height in case min-height fails. |
||||
|
* |
||||
|
* @type Object |
||||
|
* @usage $.AdminLTE.layout.activate() |
||||
|
* $.AdminLTE.layout.fix() |
||||
|
* $.AdminLTE.layout.fixSidebar() |
||||
|
*/ |
||||
|
$.AdminLTE.layout = { |
||||
|
activate: function () { |
||||
|
var _this = this; |
||||
|
_this.fix(); |
||||
|
_this.fixSidebar(); |
||||
|
$(window, ".wrapper").resize(function () { |
||||
|
_this.fix(); |
||||
|
_this.fixSidebar(); |
||||
|
}); |
||||
|
}, |
||||
|
fix: function () { |
||||
|
//Get window height and the wrapper height
|
||||
|
var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight(); |
||||
|
var window_height = $(window).height(); |
||||
|
var sidebar_height = $(".sidebar").height(); |
||||
|
//Set the min-height of the content and sidebar based on the
|
||||
|
//the height of the document.
|
||||
|
if ($("body").hasClass("fixed")) { |
||||
|
$(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight()); |
||||
|
} else { |
||||
|
var postSetWidth; |
||||
|
if (window_height >= sidebar_height) { |
||||
|
$(".content-wrapper, .right-side").css('min-height', window_height - neg); |
||||
|
postSetWidth = window_height - neg; |
||||
|
} else { |
||||
|
$(".content-wrapper, .right-side").css('min-height', sidebar_height); |
||||
|
postSetWidth = sidebar_height; |
||||
|
} |
||||
|
|
||||
|
//Fix for the control sidebar height
|
||||
|
var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector); |
||||
|
if (typeof controlSidebar !== "undefined") { |
||||
|
if (controlSidebar.height() > postSetWidth) |
||||
|
$(".content-wrapper, .right-side").css('min-height', controlSidebar.height()); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
fixSidebar: function () { |
||||
|
//Make sure the body tag has the .fixed class
|
||||
|
if (!$("body").hasClass("fixed")) { |
||||
|
if (typeof $.fn.slimScroll != 'undefined') { |
||||
|
$(".sidebar").slimScroll({destroy: true}).height("auto"); |
||||
|
} |
||||
|
return; |
||||
|
} else if (typeof $.fn.slimScroll == 'undefined' && window.console) { |
||||
|
window.console.error("Error: the fixed layout requires the slimscroll plugin!"); |
||||
|
} |
||||
|
//Enable slimscroll for fixed layout
|
||||
|
if ($.AdminLTE.options.sidebarSlimScroll) { |
||||
|
if (typeof $.fn.slimScroll != 'undefined') { |
||||
|
//Destroy if it exists
|
||||
|
$(".sidebar").slimScroll({destroy: true}).height("auto"); |
||||
|
//Add slimscroll
|
||||
|
$(".sidebar").slimscroll({ |
||||
|
height: ($(window).height() - $(".main-header").height()) + "px", |
||||
|
color: "rgba(0,0,0,0.2)", |
||||
|
size: "3px" |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
/* PushMenu() |
||||
|
* ========== |
||||
|
* Adds the push menu functionality to the sidebar. |
||||
|
* |
||||
|
* @type Function |
||||
|
* @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']") |
||||
|
*/ |
||||
|
$.AdminLTE.pushMenu = { |
||||
|
activate: function (toggleBtn) { |
||||
|
//Get the screen sizes
|
||||
|
var screenSizes = $.AdminLTE.options.screenSizes; |
||||
|
|
||||
|
//Enable sidebar toggle
|
||||
|
$(document).on('click', toggleBtn, function (e) { |
||||
|
e.preventDefault(); |
||||
|
|
||||
|
//Enable sidebar push menu
|
||||
|
if ($(window).width() > (screenSizes.sm - 1)) { |
||||
|
if ($("body").hasClass('sidebar-collapse')) { |
||||
|
$("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu'); |
||||
|
} else { |
||||
|
$("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); |
||||
|
} |
||||
|
} |
||||
|
//Handle sidebar push menu for small screens
|
||||
|
else { |
||||
|
if ($("body").hasClass('sidebar-open')) { |
||||
|
$("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); |
||||
|
} else { |
||||
|
$("body").addClass('sidebar-open').trigger('expanded.pushMenu'); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
$(".content-wrapper").click(function () { |
||||
|
//Enable hide menu when clicking on the content-wrapper on small screens
|
||||
|
if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) { |
||||
|
$("body").removeClass('sidebar-open'); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
//Enable expand on hover for sidebar mini
|
||||
|
if ($.AdminLTE.options.sidebarExpandOnHover |
||||
|
|| ($('body').hasClass('fixed') |
||||
|
&& $('body').hasClass('sidebar-mini'))) { |
||||
|
this.expandOnHover(); |
||||
|
} |
||||
|
}, |
||||
|
expandOnHover: function () { |
||||
|
var _this = this; |
||||
|
var screenWidth = $.AdminLTE.options.screenSizes.sm - 1; |
||||
|
//Expand sidebar on hover
|
||||
|
$('.main-sidebar').hover(function () { |
||||
|
if ($('body').hasClass('sidebar-mini') |
||||
|
&& $("body").hasClass('sidebar-collapse') |
||||
|
&& $(window).width() > screenWidth) { |
||||
|
_this.expand(); |
||||
|
} |
||||
|
}, function () { |
||||
|
if ($('body').hasClass('sidebar-mini') |
||||
|
&& $('body').hasClass('sidebar-expanded-on-hover') |
||||
|
&& $(window).width() > screenWidth) { |
||||
|
_this.collapse(); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
expand: function () { |
||||
|
$("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); |
||||
|
}, |
||||
|
collapse: function () { |
||||
|
if ($('body').hasClass('sidebar-expanded-on-hover')) { |
||||
|
$('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse'); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
/* Tree() |
||||
|
* ====== |
||||
|
* Converts the sidebar into a multilevel |
||||
|
* tree view menu. |
||||
|
* |
||||
|
* @type Function |
||||
|
* @Usage: $.AdminLTE.tree('.sidebar') |
||||
|
*/ |
||||
|
$.AdminLTE.tree = function (menu) { |
||||
|
var _this = this; |
||||
|
var animationSpeed = $.AdminLTE.options.animationSpeed; |
||||
|
$(document).off('click', menu + ' li a') |
||||
|
.on('click', menu + ' li a', function (e) { |
||||
|
//Get the clicked link and the next element
|
||||
|
var $this = $(this); |
||||
|
var checkElement = $this.next(); |
||||
|
|
||||
|
//Check if the next element is a menu and is visible
|
||||
|
if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { |
||||
|
//Close the menu
|
||||
|
checkElement.slideUp(animationSpeed, function () { |
||||
|
checkElement.removeClass('menu-open'); |
||||
|
//Fix the layout in case the sidebar stretches over the height of the window
|
||||
|
//_this.layout.fix();
|
||||
|
}); |
||||
|
checkElement.parent("li").removeClass("active"); |
||||
|
} |
||||
|
//If the menu is not visible
|
||||
|
else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { |
||||
|
//Get the parent menu
|
||||
|
var parent = $this.parents('ul').first(); |
||||
|
//Close all open menus within the parent
|
||||
|
var ul = parent.find('ul:visible').slideUp(animationSpeed); |
||||
|
//Remove the menu-open class from the parent
|
||||
|
ul.removeClass('menu-open'); |
||||
|
//Get the parent li
|
||||
|
var parent_li = $this.parent("li"); |
||||
|
|
||||
|
//Open the target menu and add the menu-open class
|
||||
|
checkElement.slideDown(animationSpeed, function () { |
||||
|
//Add the class active to the parent li
|
||||
|
checkElement.addClass('menu-open'); |
||||
|
parent.find('li.active').removeClass('active'); |
||||
|
parent_li.addClass('active'); |
||||
|
//Fix the layout in case the sidebar stretches over the height of the window
|
||||
|
_this.layout.fix(); |
||||
|
}); |
||||
|
} |
||||
|
//if this isn't a link, prevent the page from being redirected
|
||||
|
if (checkElement.is('.treeview-menu')) { |
||||
|
e.preventDefault(); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
/* ControlSidebar |
||||
|
* ============== |
||||
|
* Adds functionality to the right sidebar |
||||
|
* |
||||
|
* @type Object |
||||
|
* @usage $.AdminLTE.controlSidebar.activate(options) |
||||
|
*/ |
||||
|
$.AdminLTE.controlSidebar = { |
||||
|
//instantiate the object
|
||||
|
activate: function () { |
||||
|
//Get the object
|
||||
|
var _this = this; |
||||
|
//Update options
|
||||
|
var o = $.AdminLTE.options.controlSidebarOptions; |
||||
|
//Get the sidebar
|
||||
|
var sidebar = $(o.selector); |
||||
|
//The toggle button
|
||||
|
var btn = $(o.toggleBtnSelector); |
||||
|
|
||||
|
//Listen to the click event
|
||||
|
btn.on('click', function (e) { |
||||
|
e.preventDefault(); |
||||
|
//If the sidebar is not open
|
||||
|
if (!sidebar.hasClass('control-sidebar-open') |
||||
|
&& !$('body').hasClass('control-sidebar-open')) { |
||||
|
//Open the sidebar
|
||||
|
_this.open(sidebar, o.slide); |
||||
|
} else { |
||||
|
_this.close(sidebar, o.slide); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
//If the body has a boxed layout, fix the sidebar bg position
|
||||
|
var bg = $(".control-sidebar-bg"); |
||||
|
_this._fix(bg); |
||||
|
|
||||
|
//If the body has a fixed layout, make the control sidebar fixed
|
||||
|
if ($('body').hasClass('fixed')) { |
||||
|
_this._fixForFixed(sidebar); |
||||
|
} else { |
||||
|
//If the content height is less than the sidebar's height, force max height
|
||||
|
if ($('.content-wrapper, .right-side').height() < sidebar.height()) { |
||||
|
_this._fixForContent(sidebar); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
//Open the control sidebar
|
||||
|
open: function (sidebar, slide) { |
||||
|
//Slide over content
|
||||
|
if (slide) { |
||||
|
sidebar.addClass('control-sidebar-open'); |
||||
|
} else { |
||||
|
//Push the content by adding the open class to the body instead
|
||||
|
//of the sidebar itself
|
||||
|
$('body').addClass('control-sidebar-open'); |
||||
|
} |
||||
|
}, |
||||
|
//Close the control sidebar
|
||||
|
close: function (sidebar, slide) { |
||||
|
if (slide) { |
||||
|
sidebar.removeClass('control-sidebar-open'); |
||||
|
} else { |
||||
|
$('body').removeClass('control-sidebar-open'); |
||||
|
} |
||||
|
}, |
||||
|
_fix: function (sidebar) { |
||||
|
var _this = this; |
||||
|
if ($("body").hasClass('layout-boxed')) { |
||||
|
sidebar.css('position', 'absolute'); |
||||
|
sidebar.height($(".wrapper").height()); |
||||
|
if (_this.hasBindedResize) { |
||||
|
return; |
||||
|
} |
||||
|
$(window).resize(function () { |
||||
|
_this._fix(sidebar); |
||||
|
}); |
||||
|
_this.hasBindedResize = true; |
||||
|
} else { |
||||
|
sidebar.css({ |
||||
|
'position': 'fixed', |
||||
|
'height': 'auto' |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
_fixForFixed: function (sidebar) { |
||||
|
sidebar.css({ |
||||
|
'position': 'fixed', |
||||
|
'max-height': '100%', |
||||
|
'overflow': 'auto', |
||||
|
'padding-bottom': '50px' |
||||
|
}); |
||||
|
}, |
||||
|
_fixForContent: function (sidebar) { |
||||
|
$(".content-wrapper, .right-side").css('min-height', sidebar.height()); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
/* BoxWidget |
||||
|
* ========= |
||||
|
* BoxWidget is a plugin to handle collapsing and |
||||
|
* removing boxes from the screen. |
||||
|
* |
||||
|
* @type Object |
||||
|
* @usage $.AdminLTE.boxWidget.activate() |
||||
|
* Set all your options in the main $.AdminLTE.options object |
||||
|
*/ |
||||
|
$.AdminLTE.boxWidget = { |
||||
|
selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors, |
||||
|
icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons, |
||||
|
animationSpeed: $.AdminLTE.options.animationSpeed, |
||||
|
activate: function (_box) { |
||||
|
var _this = this; |
||||
|
if (!_box) { |
||||
|
_box = document; // activate all boxes per default
|
||||
|
} |
||||
|
//Listen for collapse event triggers
|
||||
|
$(_box).on('click', _this.selectors.collapse, function (e) { |
||||
|
e.preventDefault(); |
||||
|
_this.collapse($(this)); |
||||
|
}); |
||||
|
|
||||
|
//Listen for remove event triggers
|
||||
|
$(_box).on('click', _this.selectors.remove, function (e) { |
||||
|
e.preventDefault(); |
||||
|
_this.remove($(this)); |
||||
|
}); |
||||
|
}, |
||||
|
collapse: function (element) { |
||||
|
var _this = this; |
||||
|
//Find the box parent
|
||||
|
var box = element.parents(".box").first(); |
||||
|
//Find the body and the footer
|
||||
|
var box_content = box.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer"); |
||||
|
if (!box.hasClass("collapsed-box")) { |
||||
|
//Convert minus into plus
|
||||
|
element.children(":first") |
||||
|
.removeClass(_this.icons.collapse) |
||||
|
.addClass(_this.icons.open); |
||||
|
//Hide the content
|
||||
|
box_content.slideUp(_this.animationSpeed, function () { |
||||
|
box.addClass("collapsed-box"); |
||||
|
}); |
||||
|
} else { |
||||
|
//Convert plus into minus
|
||||
|
element.children(":first") |
||||
|
.removeClass(_this.icons.open) |
||||
|
.addClass(_this.icons.collapse); |
||||
|
//Show the content
|
||||
|
box_content.slideDown(_this.animationSpeed, function () { |
||||
|
box.removeClass("collapsed-box"); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
remove: function (element) { |
||||
|
//Find the box parent
|
||||
|
var box = element.parents(".box").first(); |
||||
|
box.slideUp(this.animationSpeed); |
||||
|
} |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
/* ------------------ |
||||
|
* - Custom Plugins - |
||||
|
* ------------------ |
||||
|
* All custom plugins are defined below. |
||||
|
*/ |
||||
|
|
||||
|
/* |
||||
|
* BOX REFRESH BUTTON |
||||
|
* ------------------ |
||||
|
* This is a custom plugin to use with the component BOX. It allows you to add |
||||
|
* a refresh button to the box. It converts the box's state to a loading state. |
||||
|
* |
||||
|
* @type plugin |
||||
|
* @usage $("#box-widget").boxRefresh( options ); |
||||
|
*/ |
||||
|
(function ($) { |
||||
|
|
||||
|
"use strict"; |
||||
|
|
||||
|
$.fn.boxRefresh = function (options) { |
||||
|
|
||||
|
// Render options
|
||||
|
var settings = $.extend({ |
||||
|
//Refresh button selector
|
||||
|
trigger: ".refresh-btn", |
||||
|
//File source to be loaded (e.g: ajax/src.php)
|
||||
|
source: "", |
||||
|
//Callbacks
|
||||
|
onLoadStart: function (box) { |
||||
|
return box; |
||||
|
}, //Right after the button has been clicked
|
||||
|
onLoadDone: function (box) { |
||||
|
return box; |
||||
|
} //When the source has been loaded
|
||||
|
|
||||
|
}, options); |
||||
|
|
||||
|
//The overlay
|
||||
|
var overlay = $('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>'); |
||||
|
|
||||
|
return this.each(function () { |
||||
|
//if a source is specified
|
||||
|
if (settings.source === "") { |
||||
|
if (window.console) { |
||||
|
window.console.log("Please specify a source first - boxRefresh()"); |
||||
|
} |
||||
|
return; |
||||
|
} |
||||
|
//the box
|
||||
|
var box = $(this); |
||||
|
//the button
|
||||
|
var rBtn = box.find(settings.trigger).first(); |
||||
|
|
||||
|
//On trigger click
|
||||
|
rBtn.on('click', function (e) { |
||||
|
e.preventDefault(); |
||||
|
//Add loading overlay
|
||||
|
start(box); |
||||
|
|
||||
|
//Perform ajax call
|
||||
|
box.find(".box-body").load(settings.source, function () { |
||||
|
done(box); |
||||
|
}); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
function start(box) { |
||||
|
//Add overlay and loading img
|
||||
|
box.append(overlay); |
||||
|
|
||||
|
settings.onLoadStart.call(box); |
||||
|
} |
||||
|
|
||||
|
function done(box) { |
||||
|
//Remove overlay and loading img
|
||||
|
box.find(overlay).remove(); |
||||
|
|
||||
|
settings.onLoadDone.call(box); |
||||
|
} |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
})(jQuery); |
||||
|
|
||||
|
/* |
||||
|
* EXPLICIT BOX CONTROLS |
||||
|
* ----------------------- |
||||
|
* This is a custom plugin to use with the component BOX. It allows you to activate |
||||
|
* a box inserted in the DOM after the app.js was loaded, toggle and remove box. |
||||
|
* |
||||
|
* @type plugin |
||||
|
* @usage $("#box-widget").activateBox(); |
||||
|
* @usage $("#box-widget").toggleBox(); |
||||
|
* @usage $("#box-widget").removeBox(); |
||||
|
*/ |
||||
|
(function ($) { |
||||
|
|
||||
|
'use strict'; |
||||
|
|
||||
|
$.fn.activateBox = function () { |
||||
|
$.AdminLTE.boxWidget.activate(this); |
||||
|
}; |
||||
|
|
||||
|
$.fn.toggleBox = function () { |
||||
|
var button = $($.AdminLTE.boxWidget.selectors.collapse, this); |
||||
|
$.AdminLTE.boxWidget.collapse(button); |
||||
|
}; |
||||
|
|
||||
|
$.fn.removeBox = function () { |
||||
|
var button = $($.AdminLTE.boxWidget.selectors.remove, this); |
||||
|
$.AdminLTE.boxWidget.remove(button); |
||||
|
}; |
||||
|
|
||||
|
})(jQuery); |
||||
|
|
||||
|
/* |
||||
|
* TODO LIST CUSTOM PLUGIN |
||||
|
* ----------------------- |
||||
|
* This plugin depends on iCheck plugin for checkbox and radio inputs |
||||
|
* |
||||
|
* @type plugin |
||||
|
* @usage $("#todo-widget").todolist( options ); |
||||
|
*/ |
||||
|
(function ($) { |
||||
|
|
||||
|
'use strict'; |
||||
|
|
||||
|
$.fn.todolist = function (options) { |
||||
|
// Render options
|
||||
|
var settings = $.extend({ |
||||
|
//When the user checks the input
|
||||
|
onCheck: function (ele) { |
||||
|
return ele; |
||||
|
}, |
||||
|
//When the user unchecks the input
|
||||
|
onUncheck: function (ele) { |
||||
|
return ele; |
||||
|
} |
||||
|
}, options); |
||||
|
|
||||
|
return this.each(function () { |
||||
|
|
||||
|
if (typeof $.fn.iCheck != 'undefined') { |
||||
|
$('input', this).on('ifChecked', function () { |
||||
|
var ele = $(this).parents("li").first(); |
||||
|
ele.toggleClass("done"); |
||||
|
settings.onCheck.call(ele); |
||||
|
}); |
||||
|
|
||||
|
$('input', this).on('ifUnchecked', function () { |
||||
|
var ele = $(this).parents("li").first(); |
||||
|
ele.toggleClass("done"); |
||||
|
settings.onUncheck.call(ele); |
||||
|
}); |
||||
|
} else { |
||||
|
$('input', this).on('change', function () { |
||||
|
var ele = $(this).parents("li").first(); |
||||
|
ele.toggleClass("done"); |
||||
|
if ($('input', ele).is(":checked")) { |
||||
|
settings.onCheck.call(ele); |
||||
|
} else { |
||||
|
settings.onUncheck.call(ele); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
}(jQuery)); |
||||
@ -0,0 +1,97 @@ |
|||||
|
(function() { |
||||
|
window.Router = function() { |
||||
|
var self = this; |
||||
|
|
||||
|
self.hashList = {}; /* 路由表 */ |
||||
|
self.index = null; |
||||
|
self.key = '!'; |
||||
|
|
||||
|
window.onhashchange = function() { |
||||
|
self.reload(); |
||||
|
}; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 添加路由,如果路由已经存在则会覆盖 |
||||
|
* @param addr: 地址 |
||||
|
* @param callback: 回调函数,调用回调函数的时候同时也会传入相应参数 |
||||
|
*/ |
||||
|
Router.prototype.add = function(addr, callback) { |
||||
|
var self = this; |
||||
|
|
||||
|
self.hashList[addr] = callback; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 删除路由 |
||||
|
* @param addr: 地址 |
||||
|
*/ |
||||
|
Router.prototype.remove = function(addr) { |
||||
|
var self = this; |
||||
|
|
||||
|
delete self.hashList[addr]; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 设置主页地址 |
||||
|
* @param index: 主页地址 |
||||
|
*/ |
||||
|
Router.prototype.setIndex = function(index) { |
||||
|
var self = this; |
||||
|
|
||||
|
self.index = index; |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 跳转到指定地址 |
||||
|
* @param addr: 地址值 |
||||
|
*/ |
||||
|
Router.prototype.go = function(addr) { |
||||
|
var self = this; |
||||
|
|
||||
|
window.location.hash = '#' + self.key + addr; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 重载页面 |
||||
|
*/ |
||||
|
Router.prototype.reload = function() { |
||||
|
var self = this; |
||||
|
|
||||
|
var hash = window.location.hash.replace('#' + self.key, ''); |
||||
|
//var addr = hash.split('/')[0];
|
||||
|
var addr = hash; |
||||
|
var cb = getCb(addr, self.hashList); |
||||
|
if(cb != false) { |
||||
|
var arr = hash.split('/'); |
||||
|
arr.shift(); |
||||
|
cb.apply(self, arr); |
||||
|
} |
||||
|
else { |
||||
|
self.index && self.go(self.index); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 开始路由,实际上只是为了当直接访问路由路由地址的时候能够及时调用回调 |
||||
|
*/ |
||||
|
Router.prototype.start = function() { |
||||
|
var self = this; |
||||
|
|
||||
|
self.reload(); |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 获取callback |
||||
|
* @return false or callback |
||||
|
*/ |
||||
|
function getCb(addr, hashList) { |
||||
|
for(var key in hashList) { |
||||
|
if(key == addr) { |
||||
|
return hashList[key] |
||||
|
} |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
})(); |
||||
@ -0,0 +1,219 @@ |
|||||
|
/** |
||||
|
* jqGrid Chinese Translation |
||||
|
* 咖啡兔 yanhonglei@gmail.com |
||||
|
* http://www.kafeitu.me
|
||||
|
* Dual licensed under the MIT and GPL licenses: |
||||
|
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
* http://www.gnu.org/licenses/gpl.html
|
||||
|
**/ |
||||
|
/*global jQuery, define */ |
||||
|
(function( factory ) { |
||||
|
"use strict"; |
||||
|
if ( typeof define === "function" && define.amd ) { |
||||
|
// AMD. Register as an anonymous module.
|
||||
|
define([ |
||||
|
"jquery", |
||||
|
"../grid.base" |
||||
|
], factory ); |
||||
|
} else { |
||||
|
// Browser globals
|
||||
|
factory( jQuery ); |
||||
|
} |
||||
|
}(function( $ ) { |
||||
|
|
||||
|
$.jgrid = $.jgrid || {}; |
||||
|
if(!$.jgrid.hasOwnProperty("regional")) { |
||||
|
$.jgrid.regional = []; |
||||
|
} |
||||
|
$.jgrid.regional["cn"] = { |
||||
|
defaults : { |
||||
|
recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
|
||||
|
emptyrecords: "无数据显示", |
||||
|
loadtext: "读取中...", |
||||
|
savetext: "Saving...", |
||||
|
pgtext : " {0} 共 {1} 页", |
||||
|
pgfirst : "First Page", |
||||
|
pglast : "Last Page", |
||||
|
pgnext : "Next Page", |
||||
|
pgprev : "Previous Page", |
||||
|
pgrecs : "Records per Page", |
||||
|
showhide: "Toggle Expand Collapse Grid", |
||||
|
// mobile
|
||||
|
pagerCaption : "Grid::Page Settings", |
||||
|
pageText : "Page:", |
||||
|
recordPage : "Records per Page", |
||||
|
nomorerecs : "No more records...", |
||||
|
scrollPullup: "Pull up to load more...", |
||||
|
scrollPulldown : "Pull down to refresh...", |
||||
|
scrollRefresh : "Release to refresh..." |
||||
|
}, |
||||
|
search : { |
||||
|
caption: "搜索...", |
||||
|
Find: "查找", |
||||
|
Reset: "重置", |
||||
|
odata: [{ oper:'eq', text:'等于\u3000\u3000'},{ oper:'ne', text:'不等\u3000\u3000'},{ oper:'lt', text:'小于\u3000\u3000'},{ oper:'le', text:'小于等于'},{ oper:'gt', text:'大于\u3000\u3000'},{ oper:'ge', text:'大于等于'},{ oper:'bw', text:'开始于'},{ oper:'bn', text:'不开始于'},{ oper:'in', text:'属于\u3000\u3000'},{ oper:'ni', text:'不属于'},{ oper:'ew', text:'结束于'},{ oper:'en', text:'不结束于'},{ oper:'cn', text:'包含\u3000\u3000'},{ oper:'nc', text:'不包含'},{ oper:'nu', text:'不存在'},{ oper:'nn', text:'存在'}, {oper:'bt', text:'between'}], |
||||
|
groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ], |
||||
|
operandTitle : "Click to select search operation.", |
||||
|
resetTitle : "Reset Search Value" |
||||
|
}, |
||||
|
edit : { |
||||
|
addCaption: "添加记录", |
||||
|
editCaption: "编辑记录", |
||||
|
bSubmit: "提交", |
||||
|
bCancel: "取消", |
||||
|
bClose: "关闭", |
||||
|
saveData: "数据已改变,是否保存?", |
||||
|
bYes : "是", |
||||
|
bNo : "否", |
||||
|
bExit : "取消", |
||||
|
msg: { |
||||
|
required:"此字段必需", |
||||
|
number:"请输入有效数字", |
||||
|
minValue:"输值必须大于等于 ", |
||||
|
maxValue:"输值必须小于等于 ", |
||||
|
email: "这不是有效的e-mail地址", |
||||
|
integer: "请输入有效整数", |
||||
|
date: "请输入有效时间", |
||||
|
url: "无效网址。前缀必须为 ('http://' 或 'https://')", |
||||
|
nodefined : " 未定义!", |
||||
|
novalue : " 需要返回值!", |
||||
|
customarray : "自定义函数需要返回数组!", |
||||
|
customfcheck : "必须有自定义函数!" |
||||
|
} |
||||
|
}, |
||||
|
view : { |
||||
|
caption: "查看记录", |
||||
|
bClose: "关闭" |
||||
|
}, |
||||
|
del : { |
||||
|
caption: "删除", |
||||
|
msg: "删除所选记录?", |
||||
|
bSubmit: "删除", |
||||
|
bCancel: "取消" |
||||
|
}, |
||||
|
nav : { |
||||
|
edittext: "", |
||||
|
edittitle: "编辑所选记录", |
||||
|
addtext:"", |
||||
|
addtitle: "添加新记录", |
||||
|
deltext: "", |
||||
|
deltitle: "删除所选记录", |
||||
|
searchtext: "", |
||||
|
searchtitle: "查找", |
||||
|
refreshtext: "", |
||||
|
refreshtitle: "刷新表格", |
||||
|
alertcap: "注意", |
||||
|
alerttext: "请选择记录", |
||||
|
viewtext: "", |
||||
|
viewtitle: "查看所选记录", |
||||
|
savetext: "", |
||||
|
savetitle: "Save row", |
||||
|
canceltext: "", |
||||
|
canceltitle : "Cancel row editing", |
||||
|
selectcaption : "Actions..." |
||||
|
}, |
||||
|
col : { |
||||
|
caption: "选择列", |
||||
|
bSubmit: "确定", |
||||
|
bCancel: "取消" |
||||
|
}, |
||||
|
errors : { |
||||
|
errcap : "错误", |
||||
|
nourl : "没有设置url", |
||||
|
norecords: "没有要处理的记录", |
||||
|
model : "colNames 和 colModel 长度不等!" |
||||
|
}, |
||||
|
formatter : { |
||||
|
integer : {thousandsSeparator: ",", defaultValue: '0'}, |
||||
|
number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'}, |
||||
|
currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'}, |
||||
|
date : { |
||||
|
dayNames: [ |
||||
|
"日", "一", "二", "三", "四", "五", "六", |
||||
|
"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", |
||||
|
], |
||||
|
monthNames: [ |
||||
|
"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", |
||||
|
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" |
||||
|
], |
||||
|
AmPm : ["am","pm","上午","下午"], |
||||
|
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';}, |
||||
|
srcformat: 'Y-m-d', |
||||
|
newformat: 'Y-m-d', |
||||
|
parseRe : /[#%\\\/:_;.,\t\s-]/, |
||||
|
masks : { |
||||
|
// see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
|
||||
|
// and see http://docs.jquery.com/UI/Datepicker/formatDate
|
||||
|
// and https://github.com/jquery/globalize#dates for alternative formats used frequently
|
||||
|
// one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
|
||||
|
// information about date, time, numbers and currency formats used in different countries
|
||||
|
// one should just convert the information in PHP format
|
||||
|
ISO8601Long:"Y-m-d H:i:s", |
||||
|
ISO8601Short:"Y-m-d", |
||||
|
// short date:
|
||||
|
// n - Numeric representation of a month, without leading zeros
|
||||
|
// j - Day of the month without leading zeros
|
||||
|
// Y - A full numeric representation of a year, 4 digits
|
||||
|
// example: 3/1/2012 which means 1 March 2012
|
||||
|
ShortDate: "n/j/Y", // in jQuery UI Datepicker: "M/d/yyyy"
|
||||
|
// long date:
|
||||
|
// l - A full textual representation of the day of the week
|
||||
|
// F - A full textual representation of a month
|
||||
|
// d - Day of the month, 2 digits with leading zeros
|
||||
|
// Y - A full numeric representation of a year, 4 digits
|
||||
|
LongDate: "l, F d, Y", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy"
|
||||
|
// long date with long time:
|
||||
|
// l - A full textual representation of the day of the week
|
||||
|
// F - A full textual representation of a month
|
||||
|
// d - Day of the month, 2 digits with leading zeros
|
||||
|
// Y - A full numeric representation of a year, 4 digits
|
||||
|
// g - 12-hour format of an hour without leading zeros
|
||||
|
// i - Minutes with leading zeros
|
||||
|
// s - Seconds, with leading zeros
|
||||
|
// A - Uppercase Ante meridiem and Post meridiem (AM or PM)
|
||||
|
FullDateTime: "l, F d, Y g:i:s A", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy h:mm:ss tt"
|
||||
|
// month day:
|
||||
|
// F - A full textual representation of a month
|
||||
|
// d - Day of the month, 2 digits with leading zeros
|
||||
|
MonthDay: "F d", // in jQuery UI Datepicker: "MMMM dd"
|
||||
|
// short time (without seconds)
|
||||
|
// g - 12-hour format of an hour without leading zeros
|
||||
|
// i - Minutes with leading zeros
|
||||
|
// A - Uppercase Ante meridiem and Post meridiem (AM or PM)
|
||||
|
ShortTime: "g:i A", // in jQuery UI Datepicker: "h:mm tt"
|
||||
|
// long time (with seconds)
|
||||
|
// g - 12-hour format of an hour without leading zeros
|
||||
|
// i - Minutes with leading zeros
|
||||
|
// s - Seconds, with leading zeros
|
||||
|
// A - Uppercase Ante meridiem and Post meridiem (AM or PM)
|
||||
|
LongTime: "g:i:s A", // in jQuery UI Datepicker: "h:mm:ss tt"
|
||||
|
SortableDateTime: "Y-m-d\\TH:i:s", |
||||
|
UniversalSortableDateTime: "Y-m-d H:i:sO", |
||||
|
// month with year
|
||||
|
// Y - A full numeric representation of a year, 4 digits
|
||||
|
// F - A full textual representation of a month
|
||||
|
YearMonth: "F, Y" // in jQuery UI Datepicker: "MMMM, yyyy"
|
||||
|
}, |
||||
|
reformatAfterEdit : false, |
||||
|
userLocalTime : false |
||||
|
}, |
||||
|
baseLinkUrl: '', |
||||
|
showAction: '', |
||||
|
target: '', |
||||
|
checkbox : {disabled:true}, |
||||
|
idName : 'id' |
||||
|
}, |
||||
|
colmenu : { |
||||
|
sortasc : "Sort Ascending", |
||||
|
sortdesc : "Sort Descending", |
||||
|
columns : "Columns", |
||||
|
filter : "Filter", |
||||
|
grouping : "Group By", |
||||
|
ungrouping : "Ungroup", |
||||
|
searchTitle : "Get items with value that:", |
||||
|
freeze : "Freeze", |
||||
|
unfreeze : "Unfreeze", |
||||
|
reorder : "Move to reorder" |
||||
|
} |
||||
|
}; |
||||
|
})); |
||||
@ -0,0 +1,31 @@ |
|||||
|
/* |
||||
|
To change this license header, choose License Headers in Project Properties. |
||||
|
To change this template file, choose Tools | Templates |
||||
|
and open the template in the editor. |
||||
|
*/ |
||||
|
/* |
||||
|
Created on : Mar 16, 2015, 10:24:01 AM |
||||
|
Author : tony |
||||
|
*/ |
||||
|
|
||||
|
.ui-jqgrid tr.jqgrow td { height: 26px;} |
||||
|
.ui-jqgrid .ui-pg-input,.ui-jqgrid .ui-jqgrid-toppager .ui-pg-input { height:20px } |
||||
|
.ui-state-hover |
||||
|
{ |
||||
|
border: .15em solid; |
||||
|
border-color: inherit; |
||||
|
|
||||
|
} |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar { |
||||
|
height:29px; |
||||
|
border-color: inherit; |
||||
|
} |
||||
|
|
||||
|
.ui-jqdialog-content input.FormElement { |
||||
|
padding: 0.25em; |
||||
|
} |
||||
|
|
||||
|
.fm-button { |
||||
|
height:30px; |
||||
|
} |
||||
|
#nData, #pData { height:20px; width:18px; } |
||||
@ -0,0 +1,930 @@ |
|||||
|
/*Grid*/ |
||||
|
.ui-jqgrid { |
||||
|
position: relative; |
||||
|
border: 1px solid #ddd; /*default*/ |
||||
|
-webkit-border-radius: 3px; |
||||
|
-moz-border-radius: 3px; |
||||
|
border-radius: 3px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-view { |
||||
|
position: relative; |
||||
|
left:0; |
||||
|
top: 0; |
||||
|
padding: 0; |
||||
|
} |
||||
|
.ui-jqgrid .ui-common-table {} |
||||
|
|
||||
|
/* Caption*/ |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar { |
||||
|
font-weight: normal; |
||||
|
min-height:37px; |
||||
|
padding: 4px 8px; |
||||
|
position: relative; |
||||
|
margin-right: 2px; |
||||
|
border-bottom: 1px solid #ddd; /*default*/ |
||||
|
|
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-caption { |
||||
|
text-align: left; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-title { |
||||
|
padding-top: 5px; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar-close { |
||||
|
color: inherit; |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
margin: -10px 7px 0 0; |
||||
|
padding: 1px; |
||||
|
cursor:pointer; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar-close span { |
||||
|
display: block; |
||||
|
margin: 1px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar-close:hover { } |
||||
|
|
||||
|
/* Header*/ |
||||
|
.ui-jqgrid .ui-jqgrid-hdiv { |
||||
|
position: relative; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-hbox { |
||||
|
float: left; |
||||
|
padding-right: 20px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable { |
||||
|
margin-bottom: 0; |
||||
|
table-layout: fixed; |
||||
|
border-top:none; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable thead th { |
||||
|
overflow : hidden; |
||||
|
border-bottom : none; |
||||
|
padding-right: 2px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable thead th div { |
||||
|
overflow: hidden; |
||||
|
position:relative; |
||||
|
} |
||||
|
.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column { |
||||
|
overflow: hidden; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.ui-th-column-header, |
||||
|
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header { |
||||
|
overflow: hidden; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.ui-th-ltr, .ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {} |
||||
|
.ui-th-rtl, .ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {text-align: center; } |
||||
|
.ui-first-th-ltr { } |
||||
|
.ui-first-th-rtl { } |
||||
|
.ui-jqgrid tr.jqg-first-row-header th { |
||||
|
height:auto; |
||||
|
border-top:none; |
||||
|
padding-bottom: 0; |
||||
|
padding-top: 0; |
||||
|
border-bottom: none; |
||||
|
padding-right: 2px; |
||||
|
text-align: center; |
||||
|
} |
||||
|
.ui-jqgrid tr.jqg-second-row-header th, |
||||
|
.ui-jqgrid tr.jqg-third--row-header th |
||||
|
{ |
||||
|
border-top:none; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid .ui-th-div-ie { |
||||
|
white-space: nowrap; |
||||
|
zoom :1; |
||||
|
height:17px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-resize { |
||||
|
height:20px !important; |
||||
|
position: relative; |
||||
|
cursor :e-resize; |
||||
|
display: inline; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .ui-grid-ico-sort { |
||||
|
margin-left:5px; |
||||
|
overflow:hidden; |
||||
|
position:absolute; |
||||
|
right: auto; |
||||
|
font-size:12px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-icon-asc { |
||||
|
margin-top:-3px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-icon-desc { |
||||
|
margin-top:4px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-i-asc { |
||||
|
margin-top:0; |
||||
|
} |
||||
|
.ui-jqgrid .ui-i-desc { |
||||
|
margin-top:0; |
||||
|
margin-right:13px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-single-sort-asc { |
||||
|
margin-top:0; |
||||
|
} |
||||
|
.ui-jqgrid .ui-single-sort-desc {} |
||||
|
.ui-jqgrid .ui-jqgrid-sortable { |
||||
|
cursor:pointer; |
||||
|
} |
||||
|
.ui-jqgrid tr.ui-search-toolbar th { } |
||||
|
.ui-jqgrid .ui-search-table td.ui-search-clear { } |
||||
|
.ui-jqgrid tr.ui-search-toolbar td > input { } |
||||
|
.ui-jqgrid tr.ui-search-toolbar select {} |
||||
|
|
||||
|
/* Body */ |
||||
|
.ui-jqgrid .table-bordered, |
||||
|
.ui-jqgrid .table-bordered td, |
||||
|
.ui-jqgrid .table-bordered th.ui-th-ltr |
||||
|
{ |
||||
|
border-left:0px none !important; |
||||
|
} |
||||
|
.ui-jqgrid .table-bordered th.ui-th-rtl |
||||
|
{ |
||||
|
border-right:0px none !important; |
||||
|
} |
||||
|
.ui-jqgrid .table-bordered tr.ui-row-rtl td |
||||
|
{ |
||||
|
border-right:0px none !important; |
||||
|
border-left: 1px solid #ddd !important; |
||||
|
} |
||||
|
div.tablediv > .table-bordered { |
||||
|
border-left : 1px solid #ddd !important; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-bdiv table.table-bordered td { |
||||
|
border-top: 0px none; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-bdiv { |
||||
|
position: relative; |
||||
|
margin: 0; |
||||
|
padding:0; |
||||
|
overflow: auto; |
||||
|
text-align:left; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-btable { |
||||
|
table-layout: fixed; |
||||
|
border-left:none ; |
||||
|
border-top:none; |
||||
|
margin-bottom: 0px |
||||
|
} |
||||
|
.ui-jqgrid tr.jqgrow { |
||||
|
outline-style: none; |
||||
|
} |
||||
|
.ui-jqgrid tr.jqgroup { |
||||
|
outline-style: none; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { |
||||
|
overflow: hidden; |
||||
|
white-space: pre; |
||||
|
padding-right: 2px; |
||||
|
} |
||||
|
.ui-jqgrid tr.jqgfirstrow td { |
||||
|
height:auto; |
||||
|
border-top:none; |
||||
|
padding-bottom: 0; |
||||
|
padding-top: 0; |
||||
|
border-bottom: none; |
||||
|
padding-right: 2px; |
||||
|
} |
||||
|
.ui-jqgrid tr.jqgroup td { |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.ui-jqgrid tr.jqfoot td { |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.ui-jqgrid tr.ui-row-ltr td {} |
||||
|
.ui-jqgrid tr.ui-row-rtl td {} |
||||
|
.ui-jqgrid td.jqgrid-rownum { } |
||||
|
.ui-jqgrid .ui-jqgrid-resize-mark { |
||||
|
width:2px; |
||||
|
left:0; |
||||
|
background-color:#777; |
||||
|
cursor: e-resize; |
||||
|
cursor: col-resize; |
||||
|
position:absolute; |
||||
|
top:0; |
||||
|
height:100px; |
||||
|
overflow:hidden; |
||||
|
display:none; |
||||
|
border:0 none; |
||||
|
z-index: 99999; |
||||
|
|
||||
|
} |
||||
|
/* Footer */ |
||||
|
.ui-jqgrid .ui-jqgrid-sdiv { |
||||
|
position: relative; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
overflow: hidden; |
||||
|
border-left: 0 none !important; |
||||
|
border-top : 0 none !important; |
||||
|
border-right : 0 none !important; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-ftable { |
||||
|
table-layout:fixed; |
||||
|
margin-bottom:0; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid tr.footrow td { |
||||
|
font-weight: bold; |
||||
|
overflow: hidden; |
||||
|
white-space:nowrap; |
||||
|
padding-right: 2px; |
||||
|
border-bottom: 0px none; |
||||
|
} |
||||
|
.ui-jqgrid tr.footrow-ltr td { |
||||
|
text-align:left; |
||||
|
} |
||||
|
.ui-jqgrid tr.footrow-rtl td { |
||||
|
text-align:right; |
||||
|
} |
||||
|
|
||||
|
/* Pager*/ |
||||
|
.ui-jqgrid .ui-jqgrid-pager, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager |
||||
|
{ |
||||
|
border-left-width: 0px; |
||||
|
border-top: 1px solid #ddd; |
||||
|
/*padding : 4px 0px;*/ |
||||
|
position: relative; |
||||
|
/*height: auto; */ |
||||
|
white-space: nowrap; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-toppager { |
||||
|
border-top-width :0; |
||||
|
border-bottom : 1px solid #ddd; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pager-control, |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pager-control { |
||||
|
position: relative; |
||||
|
border-left: 0; |
||||
|
border-bottom: 0; |
||||
|
border-top: 0; |
||||
|
/*height: 30px;*/ |
||||
|
} |
||||
|
.ui-jqgrid .ui-pg-table { |
||||
|
position: relative; |
||||
|
padding: 1px 0; |
||||
|
width:auto; |
||||
|
margin: 0; |
||||
|
} |
||||
|
.ui-jqgrid .ui-pg-table td { |
||||
|
font-weight:normal; |
||||
|
vertical-align:middle; |
||||
|
/*padding:0px 6px;*/ |
||||
|
} |
||||
|
.ui-jqgrid .ui-pager-control .ui-pager-table td { |
||||
|
border-top : 0px none !important; |
||||
|
min-height : 20px !important; |
||||
|
} |
||||
|
.ui-jqgrid .ui-pg-button { |
||||
|
height:auto; |
||||
|
} |
||||
|
.ui-jqgrid .ui-paging-pager td { |
||||
|
padding : 0 5px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-pg-button span { |
||||
|
display: block; |
||||
|
margin: 0px 2px; |
||||
|
float:left; |
||||
|
} |
||||
|
.ui-jqgrid .ui-pg-button:hover { } |
||||
|
.ui-jqgrid .ui-disabled:hover {} |
||||
|
.ui-jqgrid .ui-pg-input, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-input { |
||||
|
display: inline-block; |
||||
|
height:auto; |
||||
|
width: auto; |
||||
|
font-size:.9em; |
||||
|
margin:0; |
||||
|
line-height: inherit; |
||||
|
border: none; |
||||
|
padding: 0px 3px |
||||
|
} |
||||
|
.ui-jqgrid .ui-pg-selbox, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-selbox { |
||||
|
font-size:.9em; |
||||
|
line-height:inherit; |
||||
|
display:block; |
||||
|
height:22px; |
||||
|
margin: 0; |
||||
|
padding: 3px 0px 3px 3px; |
||||
|
border:none; |
||||
|
} |
||||
|
.ui-jqgrid .ui-separator { |
||||
|
height: 18px; |
||||
|
border : none; |
||||
|
border-left: 2px solid #ccc ; /*default*/ |
||||
|
|
||||
|
} |
||||
|
.ui-separator-li { |
||||
|
height: 2px; |
||||
|
border : none; |
||||
|
border-top: 2px solid #ccc ; /*default*/ |
||||
|
margin: 0; padding: 0; width:100% |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div |
||||
|
{ |
||||
|
float:left; |
||||
|
position:relative; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pg-button, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-button |
||||
|
{ |
||||
|
cursor:pointer; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span |
||||
|
{ |
||||
|
float:left; |
||||
|
} |
||||
|
.ui-jqgrid td input, |
||||
|
.ui-jqgrid td select, |
||||
|
.ui-jqgrid td textarea { |
||||
|
margin: 0; |
||||
|
} |
||||
|
.ui-jqgrid td textarea { |
||||
|
width:auto; |
||||
|
height:auto; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pager-table, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pager-table |
||||
|
{ |
||||
|
width:100%; |
||||
|
table-layout:fixed; |
||||
|
height:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-paging-info, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-paging-info |
||||
|
{ |
||||
|
font-weight: normal; |
||||
|
height:auto; |
||||
|
margin-top:3px; |
||||
|
margin-right:4px; |
||||
|
display: inline; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-paging-pager, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-paging-pager |
||||
|
{ |
||||
|
table-layout:auto; |
||||
|
height:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .navtable, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .navtable |
||||
|
{ |
||||
|
float:left; |
||||
|
table-layout:auto; |
||||
|
height:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .navtable td, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .navtable td |
||||
|
{ |
||||
|
padding : 0 5px; |
||||
|
} |
||||
|
|
||||
|
/*Subgrid*/ |
||||
|
|
||||
|
.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span { |
||||
|
display: block; |
||||
|
} |
||||
|
.ui-jqgrid .ui-subgrid { |
||||
|
margin:0; |
||||
|
padding:0; |
||||
|
width:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-subgrid table { |
||||
|
table-layout: fixed; |
||||
|
} |
||||
|
.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {} |
||||
|
.ui-jqgrid .ui-subgrid td.subgrid-data { |
||||
|
border-top: 0 none !important; |
||||
|
} |
||||
|
.ui-jqgrid .ui-subgrid td.subgrid-cell { |
||||
|
vertical-align: middle |
||||
|
} |
||||
|
.ui-jqgrid a.ui-sghref { |
||||
|
text-decoration: none; |
||||
|
color : #010101; /*default*/ |
||||
|
} |
||||
|
.ui-jqgrid .ui-th-subgrid {height:20px;} |
||||
|
.tablediv > .row { margin: 0 0} |
||||
|
/* loading */ |
||||
|
.ui-jqgrid .loading { |
||||
|
position: absolute; |
||||
|
top: 45%; |
||||
|
left: 45%; |
||||
|
width: auto; |
||||
|
z-index:101; |
||||
|
padding: 6px; |
||||
|
margin: 5px; |
||||
|
text-align: center; |
||||
|
display: none; |
||||
|
border: 1px solid #ddd; /*default*/ |
||||
|
font-size: 14px; |
||||
|
background-color: #d9edf7; |
||||
|
} |
||||
|
.ui-jqgrid .jqgrid-overlay { |
||||
|
display:none; |
||||
|
z-index:100; |
||||
|
} |
||||
|
/* IE * html .jqgrid-overlay {width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');} */ |
||||
|
* .jqgrid-overlay iframe { |
||||
|
position:absolute; |
||||
|
top:0; |
||||
|
left:0; |
||||
|
z-index:-1; |
||||
|
} |
||||
|
/* IE width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}*/ |
||||
|
/* end loading div */ |
||||
|
|
||||
|
/* Toolbar */ |
||||
|
.ui-jqgrid .ui-userdata { |
||||
|
padding: 4px 0px; |
||||
|
overflow: hidden; |
||||
|
min-height: 32px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-userdata-top { |
||||
|
border-left-width: 0px; /*default*/ |
||||
|
border-bottom: 1px solid #ddd; |
||||
|
} |
||||
|
.ui-jqgrid .ui-userdata-bottom { |
||||
|
border-left-width: 0px; /*default*/ |
||||
|
border-top: 1px solid #ddd; |
||||
|
} |
||||
|
/*Modal Window */ |
||||
|
.ui-jqdialog { } |
||||
|
.ui-jqdialog { |
||||
|
display: none; |
||||
|
width: 500px; |
||||
|
position: absolute; |
||||
|
/*padding: 5px; */ |
||||
|
overflow:visible; |
||||
|
} |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar { |
||||
|
padding: .1em .1em; |
||||
|
min-height: 35px; |
||||
|
} |
||||
|
.ui-jqdialog .ui-jqdialog-title { |
||||
|
margin: .3em 0 .2em; |
||||
|
font-weight: bold; |
||||
|
padding-left :6px; |
||||
|
padding-right:6px; |
||||
|
} |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close { |
||||
|
position: absolute; |
||||
|
top: 0%; |
||||
|
margin: 3px 5px 0 0; |
||||
|
padding: 8px; |
||||
|
cursor:pointer; |
||||
|
} |
||||
|
|
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close span { } |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close:hover, |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close:focus { |
||||
|
padding: 8px; |
||||
|
} |
||||
|
.ui-jqdialog-content, .ui-jqdialog .ui-jqdialog-content { |
||||
|
border: 0; |
||||
|
padding: .3em .2em; |
||||
|
background: none; |
||||
|
height:auto; |
||||
|
} |
||||
|
.ui-jqdialog .ui-jqconfirm { |
||||
|
padding: .4em 1em; |
||||
|
border-width:3px; |
||||
|
position:absolute; |
||||
|
bottom:10px; |
||||
|
right:10px; |
||||
|
overflow:visible; |
||||
|
display:none; |
||||
|
height:120px; |
||||
|
width:220px; |
||||
|
text-align:center; |
||||
|
background-color: #fff; |
||||
|
border-radius: 4px; |
||||
|
-webkit-border-radius: 4px; |
||||
|
-moz-border-radius: 4px; |
||||
|
} |
||||
|
.ui-jqdialog>.ui-resizable-se { } |
||||
|
.ui-jqgrid>.ui-resizable-se { } |
||||
|
/* end Modal window*/ |
||||
|
/* Form edit */ |
||||
|
.ui-jqdialog-content .FormGrid { |
||||
|
margin: 0 8px 0 8px; |
||||
|
overflow:auto; |
||||
|
position:relative; |
||||
|
} |
||||
|
.ui-jqdialog-content .EditTable { |
||||
|
width: 100%; |
||||
|
margin-bottom:0; |
||||
|
} |
||||
|
.ui-jqdialog-content .DelTable { |
||||
|
width: 100%; |
||||
|
margin-bottom:0; |
||||
|
} |
||||
|
.EditTable td input, |
||||
|
.EditTable td select, |
||||
|
.EditTable td textarea { |
||||
|
width: 98%; |
||||
|
display: inline-block; |
||||
|
} |
||||
|
.EditTable td textarea { |
||||
|
width:auto; |
||||
|
height:auto; |
||||
|
} |
||||
|
.EditTable .FormData td { |
||||
|
height:37px !important; |
||||
|
} |
||||
|
.ui-jqdialog-content td.EditButton { |
||||
|
text-align: right; |
||||
|
padding: 5px 5px 5px 0; |
||||
|
} |
||||
|
.ui-jqdialog-content td.navButton { |
||||
|
text-align: center; |
||||
|
border-left: 0 none; |
||||
|
border-top: 0 none; |
||||
|
border-right: 0 none; |
||||
|
padding-bottom:5px; |
||||
|
padding-top:5px; |
||||
|
} |
||||
|
.ui-jqdialog-content input.FormElement { |
||||
|
padding: .5em .3em; |
||||
|
margin-bottom: 5px |
||||
|
} |
||||
|
.ui-jqdialog-content select.FormElement { |
||||
|
padding:.3em; |
||||
|
margin-bottom: 3px; |
||||
|
} |
||||
|
.ui-jqdialog-content .data-line { |
||||
|
padding-top:.1em; |
||||
|
border: 0 none; |
||||
|
} |
||||
|
|
||||
|
.ui-jqdialog-content .CaptionTD { |
||||
|
vertical-align: middle; |
||||
|
border: 0 none; |
||||
|
padding: 2px; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.ui-jqdialog-content .DataTD { |
||||
|
padding: 2px; |
||||
|
border: 0 none; |
||||
|
vertical-align: top; |
||||
|
} |
||||
|
.ui-jqdialog-content .form-view-data { |
||||
|
white-space:pre |
||||
|
} |
||||
|
.fm-button { } |
||||
|
.fm-button-icon-left { |
||||
|
margin-left: 4px; |
||||
|
margin-right: 4px; |
||||
|
} |
||||
|
.fm-button-icon-right { |
||||
|
margin-left: 4px; |
||||
|
margin-right: 4px; |
||||
|
} |
||||
|
.fm-button-icon-left { } |
||||
|
.fm-button-icon-right { } |
||||
|
#nData, #pData { |
||||
|
margin-left: 4px; |
||||
|
margin-right: 4px; |
||||
|
} |
||||
|
#sData span, #cData span { |
||||
|
margin-left: 5px; |
||||
|
} |
||||
|
/* End Eorm edit */ |
||||
|
/*.ui-jqgrid .edit-cell {}*/ |
||||
|
.ui-jqgrid .selected-row, |
||||
|
div.ui-jqgrid .selected-row td { |
||||
|
font-style : normal; |
||||
|
} |
||||
|
/* inline edit actions button*/ |
||||
|
.ui-inline-del, .ui-inline-cancel { |
||||
|
margin-left: 14px; |
||||
|
} |
||||
|
.ui-jqgrid .inline-edit-cell {} |
||||
|
/* Tree Grid */ |
||||
|
.ui-jqgrid .tree-wrap { |
||||
|
float: left; |
||||
|
position: relative; |
||||
|
height: 18px; |
||||
|
white-space: nowrap; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .tree-minus { |
||||
|
position: absolute; |
||||
|
height: 18px; |
||||
|
width: 18px; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .tree-plus { |
||||
|
position: absolute; |
||||
|
height: 18px; |
||||
|
width: 18px; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .tree-leaf { |
||||
|
position: absolute; |
||||
|
height: 18px; |
||||
|
width: 18px; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-jqgrid .treeclick { |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
/* moda dialog */ |
||||
|
* iframe.jqm { |
||||
|
position:absolute; |
||||
|
top:0; |
||||
|
left:0; |
||||
|
z-index:-1; |
||||
|
} |
||||
|
/* width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}*/ |
||||
|
.ui-jqgrid-dnd tr td { |
||||
|
border-right-width: 1px; |
||||
|
border-right-color: inherit; |
||||
|
border-right-style: solid; |
||||
|
height:20px |
||||
|
} |
||||
|
/* RTL Support */ |
||||
|
.ui-jqgrid .ui-jqgrid-caption-rtl { |
||||
|
text-align: right; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-hbox-rtl { |
||||
|
float: right; |
||||
|
/*padding-left: 20px;*/ |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-resize-ltr { |
||||
|
float: right; |
||||
|
margin: -2px -2px -2px 0; |
||||
|
height:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-resize-rtl { |
||||
|
float: left; |
||||
|
margin: -2px -2px -2px -0px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-sort-rtl { |
||||
|
|
||||
|
} |
||||
|
.ui-jqgrid .tree-wrap-ltr { |
||||
|
float: left; |
||||
|
} |
||||
|
.ui-jqgrid .tree-wrap-rtl { |
||||
|
float: right; |
||||
|
} |
||||
|
.ui-jqgrid .ui-ellipsis { |
||||
|
-moz-text-overflow:ellipsis; |
||||
|
text-overflow:ellipsis; |
||||
|
} |
||||
|
/* Toolbar Search Menu. Nav menu */ |
||||
|
.ui-search-menu, |
||||
|
.ui-nav-menu { |
||||
|
position: absolute; |
||||
|
padding: 2px 5px; |
||||
|
z-index:99999; |
||||
|
} |
||||
|
.ui-search-menu.ui-menu .ui-menu-item, |
||||
|
.ui-nav-menu.ui-menu .ui-menu-item |
||||
|
{ |
||||
|
list-style-image: none; |
||||
|
padding-right: 0; |
||||
|
padding-left: 0; |
||||
|
} |
||||
|
.ui-search-menu.ui-menu .ui-menu-item a, |
||||
|
.ui-nav-menu.ui-menu .ui-menu-item a |
||||
|
{ |
||||
|
display: block; |
||||
|
} |
||||
|
.ui-search-menu.ui-menu .ui-menu-item a.g-menu-item:hover, |
||||
|
.ui-nav-menu.ui-menu .ui-menu-item a.g-menu-item:hover |
||||
|
{ |
||||
|
margin: -1px; |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
.ui-jqgrid .ui-search-table { |
||||
|
padding: 0; |
||||
|
border: 0 none; |
||||
|
height:20px; |
||||
|
width:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-search-table .ui-search-oper { |
||||
|
width:20px; |
||||
|
} |
||||
|
a.g-menu-item, a.soptclass, a.clearsearchclass { |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-view input, |
||||
|
.ui-jqgrid .ui-jqgrid-view select, |
||||
|
.ui-jqgrid .ui-jqgrid-view textarea, |
||||
|
.ui-jqgrid .ui-jqgrid-view button { |
||||
|
/*font-size: 11px*/ |
||||
|
} |
||||
|
.ui-jqgrid .ui-scroll-popup { |
||||
|
width: 100px; |
||||
|
} |
||||
|
.ui-search-table select, |
||||
|
.ui-search-table input |
||||
|
{ |
||||
|
padding: 4px 3px; |
||||
|
} |
||||
|
|
||||
|
.ui-disabled { |
||||
|
opacity: .35; |
||||
|
filter:Alpha(Opacity=35); /* support: IE8 */ |
||||
|
background-image: none; |
||||
|
} |
||||
|
.ui-overlay { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background-color: rgba(0,0,0,0.5); |
||||
|
opacity: .3; |
||||
|
filter: Alpha(Opacity=30); /* support: IE8 */ |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid-pager .ui-pg-table .ui-pg-button:hover, |
||||
|
.ui-jqgrid-toppager .ui-pg-table .ui-pg-button:hover |
||||
|
{ |
||||
|
background-color: #ddd; |
||||
|
} |
||||
|
.ui-jqgrid-corner { |
||||
|
border-radius: 5px |
||||
|
} |
||||
|
.ui-resizable-handle { |
||||
|
/*position: absolute;*/ |
||||
|
display: block; |
||||
|
left :97%; |
||||
|
} |
||||
|
.ui-jqdialog .ui-resizable-se { |
||||
|
width: 12px; |
||||
|
height: 12px; |
||||
|
right: -5px; |
||||
|
bottom: -5px; |
||||
|
background-position: 16px 16px; |
||||
|
} |
||||
|
.ui-resizable-se { |
||||
|
cursor: se-resize; |
||||
|
width: 12px; |
||||
|
height: 12px; |
||||
|
right: 1px; |
||||
|
bottom: 1px; |
||||
|
} |
||||
|
.ui-top-corner { |
||||
|
border-top-left-radius: 5px; |
||||
|
border-top-right-radius: 5px; |
||||
|
} |
||||
|
.ui-bottom-corner { |
||||
|
border-bottom-left-radius: 5px; |
||||
|
border-bottom-right-radius: 5px; |
||||
|
} |
||||
|
|
||||
|
.ui-search-table { |
||||
|
margin-bottom: 0; |
||||
|
} |
||||
|
.ui-search-table .columns, .ui-search-table .operators { |
||||
|
padding-right: 5px; |
||||
|
} |
||||
|
.opsel { |
||||
|
float :left; |
||||
|
width : 100px; |
||||
|
margin-right : 5px; |
||||
|
} |
||||
|
.add-group, .add-rule, .delete-group { |
||||
|
width: 14%; |
||||
|
margin-right : 5px; |
||||
|
} |
||||
|
.delete-rule { |
||||
|
width : 15px; |
||||
|
} |
||||
|
ul.ui-search-menu, ul.ui-nav-menu { |
||||
|
list-style-type: none; |
||||
|
} |
||||
|
ul.ui-search-menu li a, |
||||
|
ul.ui-nav-menu li a, |
||||
|
.soptclass, |
||||
|
.clearsearchclass { |
||||
|
text-decoration: none; |
||||
|
color : #010101; |
||||
|
} |
||||
|
ul.ui-search-menu li a:hover, ul.ui-nav-menu li a:hover, a.soptclass:hover, a.clearsearchclass:hover { |
||||
|
background-color: #ddd; |
||||
|
padding: 1px 1px; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
ul.ui-search-menu li, ul.ui-nav-menu li { |
||||
|
padding : 5px 5px; |
||||
|
} |
||||
|
.ui-menu-item hr { |
||||
|
margin-bottom: 0px; |
||||
|
margin-top:0px; |
||||
|
} |
||||
|
|
||||
|
.searchFilter .ui-search-table td, |
||||
|
.searchFilter .ui-search-table th |
||||
|
{ |
||||
|
border-top: 0px none !important; |
||||
|
} |
||||
|
|
||||
|
.searchFilter .queryresult { |
||||
|
margin-bottom: 5px; |
||||
|
} |
||||
|
.searchFilter .queryresult tr td{ |
||||
|
border-top: 0px none; |
||||
|
} |
||||
|
.ui-search-label { |
||||
|
padding-left: 5px; |
||||
|
} |
||||
|
|
||||
|
.frozen-div, .frozen-bdiv { |
||||
|
background-color: #fff; |
||||
|
} |
||||
|
/* |
||||
|
.ui-jqgrid .ui-jqgrid-caption, |
||||
|
.ui-jqgrid .ui-jqgrid-pager, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager, |
||||
|
.ui-jqgrid .ui-jqgrid-htable thead th, |
||||
|
.ui-jqgrid .ui-userdata-top, |
||||
|
.ui-jqgrid .ui-userdata-bottom, |
||||
|
.ui-jqgrid .ui-jqgrid-hdiv, |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar |
||||
|
{ |
||||
|
background-image: none, linear-gradient(to bottom, #fff 0px, #e0e0e0 100%); |
||||
|
background-repeat: repeat-x; |
||||
|
border-color: #ccc; |
||||
|
text-shadow: 0 1px 0 #fff; |
||||
|
} |
||||
|
*/ |
||||
|
/* Column menu */ |
||||
|
.ui-jqgrid .ui-jqgrid-htable .colmenu { |
||||
|
position:absolute; |
||||
|
right:1px; |
||||
|
height:100%; |
||||
|
color : black; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable .colmenu-rtl { |
||||
|
right: auto; |
||||
|
left : 1px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable .colmenuspan { |
||||
|
display:inline-block; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid .ui-jqgrid-htable .ui-th-div { |
||||
|
height:17px; |
||||
|
margin-top:5px; |
||||
|
display:inine-block; |
||||
|
} |
||||
|
.column-menu, .ui-search-menu { |
||||
|
padding: 10px 15px; |
||||
|
} |
||||
|
.column-menu .divider { |
||||
|
background-color: #e5e5e5; |
||||
|
height: 1px; |
||||
|
padding:0 0; |
||||
|
margin: 5px 0; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-menu-item .ui-common-table .menu_icon { |
||||
|
padding-right: 8px; |
||||
|
padding-left: 8px; |
||||
|
} |
||||
|
td.menu_text { |
||||
|
width: auto; |
||||
|
padding-left: 1px; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
#search_menu .ui-menu-item div { |
||||
|
padding: 3px 0; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
|
||||
|
#search_menu .search_buttons { |
||||
|
display:inline-block; |
||||
|
width:50%; |
||||
|
padding: 3px 3px; |
||||
|
} |
||||
|
.search_buttons .btn-default:hover { |
||||
|
padding-bottom: 6px; |
||||
|
padding-top: 6px; |
||||
|
} |
||||
|
.search_buttons #bs_reset { |
||||
|
margin-right: 3px; |
||||
|
} |
||||
|
.search_buttons #bs_search { |
||||
|
margin-left: 3px; |
||||
|
} |
||||
@ -0,0 +1,354 @@ |
|||||
|
/*Grid*/ |
||||
|
.ui-jqgrid { |
||||
|
position: relative; |
||||
|
-moz-box-sizing: content-box; |
||||
|
-webkit-box-sizing: content-box; |
||||
|
box-sizing: content-box; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-view {position: relative;left:0; top: 0; padding: 0; font-size:11px; z-index:100;} |
||||
|
.ui-jqgrid .ui-common-table {border-width: 0px; border-style: none; border-spacing: 0px; padding: 0;} |
||||
|
/* caption*/ |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar {height:19px; padding: .3em .2em .2em .3em; position: relative; font-size: 12px; border-left: 0 none;border-right: 0 none; border-top: 0 none;} |
||||
|
.ui-jqgrid .ui-jqgrid-caption {text-align: left;} |
||||
|
.ui-jqgrid .ui-jqgrid-title { margin: .1em 0 .2em; } |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar-close { position: absolute;top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height:18px; cursor:pointer;} |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar-close span { display: block; margin: 1px; } |
||||
|
.ui-jqgrid .ui-jqgrid-titlebar-close:hover { padding: 0; } |
||||
|
/* header*/ |
||||
|
.ui-jqgrid .ui-jqgrid-hdiv {position: relative; margin: 0;padding: 0; overflow: hidden; border-left: 0 none !important; border-top : 0 none !important; border-right : 0 none !important;} |
||||
|
.ui-jqgrid .ui-jqgrid-hbox {float: left; padding-right: 20px;} |
||||
|
.ui-jqgrid .ui-jqgrid-htable {table-layout:fixed;margin:0;border-collapse: separate;} |
||||
|
.ui-jqgrid .ui-jqgrid-htable th { height: 27px; padding: 0 2px 0 2px;} |
||||
|
.ui-jqgrid .ui-jqgrid-htable th div {overflow: hidden; position:relative;margin: .1em 0em .1em 0em;} |
||||
|
.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {overflow: hidden;white-space: nowrap;text-align:center;border-top : 0 none;border-bottom : 0 none;} |
||||
|
.ui-th-column-header, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header {overflow: hidden;white-space: nowrap;text-align:center;border-top : 0 none; height: 26px;} |
||||
|
.ui-th-ltr, .ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {border-left : 0 none;} |
||||
|
.ui-th-rtl, .ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {border-right : 0 none;} |
||||
|
.ui-first-th-ltr {border-right: 1px solid; } |
||||
|
.ui-first-th-rtl {border-left: 1px solid; } |
||||
|
.ui-jqgrid .ui-th-div-ie {white-space: nowrap; zoom :1; height:17px;} |
||||
|
.ui-jqgrid .ui-jqgrid-resize {height:20px !important;position: relative; cursor :e-resize;display: inline;overflow: hidden;} |
||||
|
.ui-jqgrid .ui-grid-ico-sort {overflow:hidden;position:absolute;display:inline; cursor: pointer !important;} |
||||
|
.ui-jqgrid .ui-icon-asc {margin-top:-3px; height:12px;} |
||||
|
.ui-jqgrid .ui-icon-desc {margin-top:3px;margin-left:-1px;height:12px;} |
||||
|
.ui-jqgrid .ui-i-asc {margin-top:0;height:18px;} |
||||
|
.ui-jqgrid .ui-i-desc {margin-top:0;margin-left:12px;height:18px;} |
||||
|
.ui-jqgrid .ui-single-sort-asc {margin-top:0;height:18px;} |
||||
|
.ui-jqgrid .ui-single-sort-desc {margin-top:-1px;height:18px;} |
||||
|
.ui-jqgrid .ui-jqgrid-sortable {cursor:pointer;height:14px} |
||||
|
.ui-jqgrid tr.ui-search-toolbar th { } |
||||
|
.ui-jqgrid .ui-search-table td.ui-search-clear { width:25px;} |
||||
|
.ui-jqgrid tr.ui-search-toolbar td > input { padding-right: 0px; width: 95%;} |
||||
|
.ui-jqgrid tr.ui-search-toolbar select {} |
||||
|
/* body */ |
||||
|
.ui-jqgrid .ui-jqgrid-bdiv {position: relative; margin: 0; padding:0; overflow: auto; text-align:left;z-index: 101;} |
||||
|
.ui-jqgrid .ui-jqgrid-btable {table-layout:fixed; margin:0; outline-style: none; border-collapse: separate;} |
||||
|
.ui-jqgrid tr.jqgrow { outline-style: none; } |
||||
|
.ui-jqgrid tr.jqgroup { outline-style: none; } |
||||
|
.ui-jqgrid tr.jqgrow td {font-weight: normal; overflow: hidden; white-space: pre; height: 23px;padding: 1px 2px 1px 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;} |
||||
|
.ui-jqgrid tr.jqgfirstrow td {padding: 0 2px 0 2px;border-right-width: 1px; border-right-style: solid; height:auto;} |
||||
|
.ui-jqgrid tr.jqgroup td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;} |
||||
|
.ui-jqgrid tr.jqfoot td {font-weight: bold; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;} |
||||
|
.ui-jqgrid tr.ui-row-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;} |
||||
|
.ui-jqgrid tr.ui-row-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;} |
||||
|
.ui-jqgrid td.jqgrid-rownum { padding: 0 2px 0 2px; margin: 0; border: 0 none;} |
||||
|
.ui-jqgrid .ui-jqgrid-resize-mark { width:2px; left:0; background-color:#777; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; display:none; border:0 none; z-index: 99999;} |
||||
|
/* footer */ |
||||
|
.ui-jqgrid .ui-jqgrid-sdiv {position: relative; margin: 0;padding: 0; overflow: hidden; border-left: 0 none !important; border-top : 0 none !important; border-right : 0 none !important;} |
||||
|
.ui-jqgrid .ui-jqgrid-ftable {table-layout:fixed; margin-bottom:0;border-collapse: separate;} |
||||
|
.ui-jqgrid tr.footrow td {font-weight: bold; overflow: hidden; white-space:nowrap; height: 20px;padding: 0 2px 0 2px;border-top-width: 1px; border-top-color: inherit; border-top-style: solid;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;} |
||||
|
.ui-jqgrid tr.footrow-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;} |
||||
|
.ui-jqgrid tr.footrow-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;} |
||||
|
/* Pager*/ |
||||
|
.ui-jqgrid .ui-jqgrid-pager { border-left: 0 none !important;border-right: 0 none !important; border-bottom: 0 none !important; border-top: 0 none; margin: 0 !important; padding: 0 !important; position: relative; height: auto; min-height: 28px; white-space: nowrap;overflow: hidden;font-size:11px; z-index:101} |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pager-control, .ui-jqgrid .ui-jqgrid-pager .ui-pager-control {position: relative;border-left: 0;border-bottom: 0;border-top: 0; height: 28px;} |
||||
|
.ui-jqgrid .ui-pg-table {position: relative; padding: 1px 0; width:auto; margin: 0;} |
||||
|
.ui-jqgrid .ui-pg-table td {font-weight:normal; vertical-align:middle; padding:0px 1px;} |
||||
|
.ui-jqgrid .ui-pg-button { height:auto} |
||||
|
.ui-jqgrid .ui-pg-button span { display: block; margin: 2px; float:left;} |
||||
|
.ui-jqgrid .ui-pg-button:hover { padding: 0;} |
||||
|
.ui-jqgrid .ui-state-disabled:hover {padding:0px;} |
||||
|
.ui-jqgrid .ui-pg-input,.ui-jqgrid .ui-jqgrid-toppager .ui-pg-input { height:14px;width: auto;font-size:.9em; margin:0;line-height: inherit;border: none; padding: 3px 2px} |
||||
|
.ui-jqgrid .ui-pg-selbox, .ui-jqgrid .ui-jqgrid-toppager .ui-pg-selbox {font-size:.9em; line-height:inherit; display:block; height:19px; margin: 0; padding: 3px 0px; border:none;} |
||||
|
.ui-jqgrid .ui-separator {height: 18px; border-left: 2px solid #ccc ;} |
||||
|
.ui-separator-li {height: 2px; border : none;border-top: 2px solid #ccc ; margin: 0; padding: 0; width:100%} |
||||
|
.ui-jqgrid .dropdownmenu { |
||||
|
padding: 3px 0 3px 0; |
||||
|
margin-left: 4px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div |
||||
|
{padding:1px 0;float:left;position:relative; line-height: 20px;} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pg-button, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-button |
||||
|
{ cursor:pointer; } |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span.ui-icon, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span.ui-icon |
||||
|
{float:left;margin: 2px; width:18px;} |
||||
|
.ui-jqgrid td input, .ui-jqgrid td select, .ui-jqgrid td textarea { margin: 0; padding-top:5px;padding-bottom: 5px;} |
||||
|
.ui-jqgrid td textarea {width:auto;height:auto;} |
||||
|
.ui-jqgrid .ui-jqgrid-toppager {border-left: 0 none !important;border-right: 0 none !important; border-top: 0 none !important; margin: 0 !important; padding: 0 !important; position: relative;white-space: nowrap;overflow: hidden;} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-pager-table, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pager-table |
||||
|
{ |
||||
|
width:100%; |
||||
|
table-layout:fixed; |
||||
|
height:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-paging-info, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-paging-info |
||||
|
{ |
||||
|
font-weight: normal; |
||||
|
height:auto; |
||||
|
margin-top:3px; |
||||
|
margin-right:4px; |
||||
|
display: inline; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .ui-paging-pager, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-paging-pager |
||||
|
{ |
||||
|
table-layout:auto; |
||||
|
height:100%; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-pager .navtable, |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .navtable |
||||
|
{ |
||||
|
float:left; |
||||
|
table-layout:auto; |
||||
|
height:100%; |
||||
|
} |
||||
|
|
||||
|
/*.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div {padding:1px 0;float:left;position:relative; line-height: 20px; margin-right:3px;} |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-button { cursor:pointer; } |
||||
|
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span.ui-icon {float:left;margin: 2px; width:18px;} |
||||
|
*/ |
||||
|
|
||||
|
/*subgrid*/ |
||||
|
.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span {display: block;} |
||||
|
.ui-jqgrid .ui-subgrid {margin:0;padding:0; width:100%;} |
||||
|
.ui-jqgrid .ui-subgrid table {table-layout: fixed;} |
||||
|
.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {height:18px;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;} |
||||
|
.ui-jqgrid .ui-subgrid td.subgrid-data {border-top: 0 none !important; border-left: 0 none !important;} |
||||
|
.ui-jqgrid .ui-subgrid td.subgrid-cell {border-width: 0 1px 1px 0;} |
||||
|
.ui-jqgrid .ui-th-subgrid {height:20px;} |
||||
|
/* loading */ |
||||
|
.ui-jqgrid .loading {position: absolute; top: 45%;left: 45%;width: auto;z-index:101;padding: 6px; margin: 5px;text-align: center;font-weight: bold;display: none;border-width: 2px !important; font-size:11px;} |
||||
|
.ui-jqgrid .jqgrid-overlay {display:none;z-index:100;} |
||||
|
/* IE * html .jqgrid-overlay {width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');} */ |
||||
|
* .jqgrid-overlay iframe {position:absolute;top:0;left:0;z-index:-1;} |
||||
|
/* IE width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}*/ |
||||
|
/* end loading div */ |
||||
|
/* toolbar */ |
||||
|
.ui-jqgrid .ui-userdata {border-left: 0 none; border-right: 0 none; height : 27px;overflow: hidden; } |
||||
|
/*Modal Window */ |
||||
|
.ui-jqdialog { font-size:11px !important; } |
||||
|
.ui-jqdialog { display: none; width: 300px; position: absolute; padding: .2em; font-size:11px; overflow:visible;} |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar { padding: .3em .2em; position: relative; height:20px;} |
||||
|
.ui-jqdialog .ui-jqdialog-title { margin: .3em .2em .2em .2em;} |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close { position: absolute; top: 50%; width: 19px; margin: -12px 0 0 0; padding: 1px; height: 18px; cursor:pointer;} |
||||
|
|
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: 1px; } |
||||
|
.ui-jqdialog .ui-jqdialog-titlebar-close:hover, .ui-jqdialog .ui-jqdialog-titlebar-close:focus { padding: 0; } |
||||
|
.ui-jqdialog-content, .ui-jqdialog .ui-jqdialog-content { border: 0; padding: .3em .2em; background: none; height:auto;} |
||||
|
.ui-jqdialog .ui-jqconfirm {padding: .4em 1em; border-width:3px;position:absolute;bottom:10px;right:10px;overflow:visible;display:none;height:80px;width:220px;text-align:center;} |
||||
|
.ui-jqdialog>.ui-resizable-se { bottom: -3px; right: -3px} |
||||
|
.ui-jqgrid>.ui-resizable-se { bottom: -3px; right: -3px } |
||||
|
/* end Modal window*/ |
||||
|
/* Form edit */ |
||||
|
.ui-jqdialog-content .FormGrid {margin: 0; overflow:auto;position:relative;} |
||||
|
.ui-jqdialog-content .EditTable { width: 100%; margin-bottom:0;} |
||||
|
.ui-jqdialog-content .DelTable { width: 100%; margin-bottom:0;} |
||||
|
.EditTable td input, .EditTable td select, .EditTable td textarea {margin: 0;} |
||||
|
.EditTable td textarea { width:auto; height:auto;} |
||||
|
.ui-jqdialog-content td.EditButton {text-align: right;border-top: 0 none;border-left: 0 none;border-right: 0 none; padding-bottom:5px; padding-top:5px;} |
||||
|
.ui-jqdialog-content td.navButton {text-align: center; border-left: 0 none;border-top: 0 none;border-right: 0 none; padding-bottom:5px; padding-top:5px;} |
||||
|
.ui-jqdialog-content input.FormElement {padding: .5em .3em; margin-bottom: 3px} |
||||
|
.ui-jqdialog-content select.FormElement {padding:.3em; margin-bottom: 3px;} |
||||
|
.ui-jqdialog-content .data-line {padding-top:.1em;border: 0 none;} |
||||
|
|
||||
|
.ui-jqdialog-content .CaptionTD {vertical-align: middle;border: 0 none; padding: 2px;white-space: nowrap;} |
||||
|
.ui-jqdialog-content .DataTD {padding: 2px; border: 0 none; vertical-align: top;} |
||||
|
.ui-jqdialog-content .form-view-data {white-space:pre} |
||||
|
.fm-button { height: 18px; display: inline-block; margin:2px 4px 0 0; padding: .6em .5em .2em .5em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; } |
||||
|
.fm-button-icon-left { padding-left: 1.9em; } |
||||
|
.fm-button-icon-right { padding-right: 1.9em; } |
||||
|
.fm-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px; } |
||||
|
.fm-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px;} |
||||
|
#nData, #pData { float: left; margin:3px;padding: 0; width: 15px; } |
||||
|
.ViewTable { |
||||
|
border-width: 0; |
||||
|
border-style: none; |
||||
|
border-spacing: 1px; |
||||
|
padding: 4px; |
||||
|
table-layout: fixed; |
||||
|
} |
||||
|
.ViewTable .CaptionTD, .ViewTable .DataTD {padding : 4px;} |
||||
|
/* End Eorm edit */ |
||||
|
/*cell edit*/ |
||||
|
.ui-jqgrid .edit-cell { |
||||
|
padding: 4px 0px 4px 4px; |
||||
|
} |
||||
|
.ui-jqgrid .selected-row, div.ui-jqgrid .selected-row td {font-style : normal;border-left: 0 none;} |
||||
|
/* inline edit actions button*/ |
||||
|
.ui-inline-del.ui-state-hover span, .ui-inline-edit.ui-state-hover span, |
||||
|
.ui-inline-save.ui-state-hover span, .ui-inline-cancel.ui-state-hover span { |
||||
|
margin: -1px; |
||||
|
} |
||||
|
.ui-inline-del, .ui-inline-cancel { |
||||
|
margin-left: 8px; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid .inline-edit-cell { |
||||
|
padding: 4px 0px 4px 4px; |
||||
|
} |
||||
|
/* Tree Grid */ |
||||
|
.ui-jqgrid .tree-wrap {float: left; position: relative;height: 18px;white-space: nowrap;overflow: hidden;} |
||||
|
.ui-jqgrid .tree-minus {position: absolute; height: 18px; width: 18px; overflow: hidden;} |
||||
|
.ui-jqgrid .tree-plus {position: absolute; height: 18px; width: 18px; overflow: hidden;} |
||||
|
.ui-jqgrid .tree-leaf {position: absolute; height: 18px; width: 18px;overflow: hidden;} |
||||
|
.ui-jqgrid .treeclick {cursor: pointer;} |
||||
|
/* moda dialog */ |
||||
|
* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;} |
||||
|
/* width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}*/ |
||||
|
.ui-jqgrid-dnd tr td {border-right-width: 1px; border-right-color: inherit; border-right-style: solid; height:20px} |
||||
|
/* RTL Support */ |
||||
|
.ui-jqgrid .ui-jqgrid-caption-rtl {text-align: right;} |
||||
|
.ui-jqgrid .ui-jqgrid-hbox-rtl {float: right;} |
||||
|
.ui-jqgrid .ui-jqgrid-resize-ltr {float: right;margin: -2px -2px -2px 0;} |
||||
|
.ui-jqgrid .ui-jqgrid-resize-rtl {float: left;margin: -2px 0 -1px -3px;} |
||||
|
.ui-jqgrid .ui-sort-rtl {left:0;} |
||||
|
.ui-jqgrid .tree-wrap-ltr {float: left;} |
||||
|
.ui-jqgrid .tree-wrap-rtl {float: right;} |
||||
|
.ui-jqgrid .ui-ellipsis {-moz-text-overflow:ellipsis;text-overflow:ellipsis;} |
||||
|
|
||||
|
/* Toolbar Search Menu , Nav menu*/ |
||||
|
.ui-search-menu, |
||||
|
.ui-nav-menu { |
||||
|
position: absolute; |
||||
|
padding: 2px 5px; |
||||
|
z-index:99999; |
||||
|
-webkit-box-shadow: 7px 7px 5px 0px rgba(50, 50, 50, 0.75); |
||||
|
-moz-box-shadow: 7px 7px 5px 0px rgba(50, 50, 50, 0.75); |
||||
|
box-shadow: 7px 7px 5px 0px rgba(50, 50, 50, 0.75); |
||||
|
} |
||||
|
.ui-search-menu.ui-menu .ui-menu-item, |
||||
|
.ui-nav-menu.ui-menu .ui-menu-item |
||||
|
{ |
||||
|
list-style-image: none; |
||||
|
padding-right: 0; |
||||
|
padding-left: 0; |
||||
|
} |
||||
|
.ui-search-menu.ui-menu .ui-menu-item a, |
||||
|
.ui-nav-menu.ui-menu .ui-menu-item a |
||||
|
{ |
||||
|
display: block; |
||||
|
} |
||||
|
.ui-search-menu.ui-menu .ui-menu-item a.g-menu-item:hover, |
||||
|
.ui-nav-menu.ui-menu .ui-menu-item a.g-menu-item:hover |
||||
|
{ |
||||
|
margin: -1px; |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
.ui-jqgrid .ui-search-table { padding: 0; border: 0 none; height:20px; width:100%;} |
||||
|
.ui-jqgrid .ui-search-table .ui-search-oper { width:20px; } |
||||
|
a.g-menu-item, a.soptclass, a.clearsearchclass { cursor: pointer; } |
||||
|
.ui-jqgrid .ui-jqgrid-view input, |
||||
|
.ui-jqgrid .ui-jqgrid-view select, |
||||
|
.ui-jqgrid .ui-jqgrid-view textarea, |
||||
|
.ui-jqgrid .ui-jqgrid-view button { |
||||
|
font-size: 11px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-scroll-popup {width: 95px;} |
||||
|
.ui-search-table select, |
||||
|
.ui-search-table input |
||||
|
{ |
||||
|
padding: 4px 3px; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid .ui-pg-table .ui-pg-button.ui-state-disabled:hover > .ui-separator { |
||||
|
margin-left: 3px; |
||||
|
margin-right: 3px; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid .ui-pg-table .ui-pg-button.ui-state-disabled:hover > .ui-pg-div > .ui-icon { |
||||
|
margin-left: 3px; |
||||
|
margin-right: 3px; |
||||
|
} |
||||
|
/* Column menu */ |
||||
|
.ui-jqgrid .ui-jqgrid-htable .colmenu { |
||||
|
position:absolute; |
||||
|
right:1px; |
||||
|
height:100%; |
||||
|
color : black; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable .colmenu-rtl { |
||||
|
right:auto; |
||||
|
left : 1px; |
||||
|
} |
||||
|
.ui-jqgrid .ui-jqgrid-htable .colmenuspan { |
||||
|
display:inline-block; |
||||
|
} |
||||
|
|
||||
|
.ui-jqgrid .ui-jqgrid-htable .ui-th-div { |
||||
|
height:17px; |
||||
|
margin-top:5px; |
||||
|
display:inine-block; |
||||
|
} |
||||
|
.column-menu, .ui-search-menu { |
||||
|
padding: 10px 10px; |
||||
|
} |
||||
|
.column-menu .divider { |
||||
|
background-color: #e5e5e5; |
||||
|
height: 1px; |
||||
|
padding:0 0; |
||||
|
margin: 5px 0; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.ui-menu-item .ui-common-table .menu_icon { |
||||
|
white-space: pre; |
||||
|
padding-right: 4px; |
||||
|
padding-left: 4px; |
||||
|
width : auto; |
||||
|
} |
||||
|
.ui-menu-item .ui-common-table .menu_icon .ui-icon { |
||||
|
display : inline-block; |
||||
|
position: relative; |
||||
|
} |
||||
|
td.menu_text { |
||||
|
width: auto; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.ui-search-menu .ui-menu-item { |
||||
|
padding : 0 0; |
||||
|
} |
||||
|
.ui-col-menu .ui-menu-item td.menu_text{ |
||||
|
padding-top: 0; |
||||
|
padding-bottom: 0; |
||||
|
padding-left : 1px; |
||||
|
} |
||||
|
.ui-col-menu .ui-menu-item td.menu_icon{ |
||||
|
padding-top: 0; |
||||
|
padding-bottom: 0; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
.ui-col-menu .ui-menu-item td.menu_icon input{ |
||||
|
margin: 2px 0; |
||||
|
|
||||
|
} |
||||
|
#search_menu .ui-menu-item div { |
||||
|
margin: 3px 0; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
|
||||
|
#search_menu .ui-menu-item div input, |
||||
|
#search_menu .ui-menu-item div select |
||||
|
{ |
||||
|
padding: 3px 2px; |
||||
|
} |
||||
|
#search_menu .search_buttons { |
||||
|
display:inline-block; |
||||
|
width:50%; |
||||
|
} |
||||
|
#column_menu.ui-menu .ui-menu-item { |
||||
|
position :static; |
||||
|
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ |
||||
|
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window); |
||||
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
@ -0,0 +1 @@ |
|||||
|
html #layui_layer_skinmoonstylecss{display:none;position:absolute;width:1989px}body .layer-ext-moon[type=dialog]{min-width:320px}body .layer-ext-moon-msg[type=dialog]{min-width:200px}body .layer-ext-moon .layui-layer-title{background:#f6f6f6;color:#212a31;font-size:16px;font-weight:700;height:46px;line-height:46px;border-bottom:1px solid #D5D5D5}body .layer-ext-moon .layui-layer-content .layui-layer-ico{height:32px;width:32px;top:18.5px}body .layer-ext-moon .layui-layer-ico0{background:url(default.png) -96px 0 no-repeat}body .layer-ext-moon .layui-layer-ico1{background:url(default.png) -224px 0 no-repeat}body .layer-ext-moon .layui-layer-ico2{background:url(default.png) -192px 0 no-repeat}body .layer-ext-moon .layui-layer-ico3{background:url(default.png) -160px 0 no-repeat}body .layer-ext-moon .layui-layer-ico4{background:url(default.png) -320px 0 no-repeat}body .layer-ext-moon .layui-layer-ico5{background:url(default.png) -288px 0 no-repeat}body .layer-ext-moon .layui-layer-ico6{background:url(default.png) -256px 0}body .layer-ext-moon .layui-layer-ico7{background:url(default.png) -128px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin{top:15px;right:15px}body .layer-ext-moon .layui-layer-setwin a{width:16px;height:16px}body .layer-ext-moon .layui-layer-setwin .layui-layer-min cite:hover{background-color:#56abe4}body .layer-ext-moon .layui-layer-setwin .layui-layer-max{background:url(default.png) -80px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-max:hover{background:url(default.png) -64px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin{background:url(default.png) -32px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover{background:url(default.png) -16px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2{background:url(default.png)}body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover{background:url(default.png) -48px 0}body .layer-ext-moon .layui-layer-padding{padding-top:24px}body .layer-ext-moon .layui-layer-btn{text-align:center;padding-top:15px;padding-bottom:15px;background:#f0f4f7;border-top:1px #c7c7c7 solid}body .layer-ext-moon .layui-layer-btn a{font-size:12px;font-weight:400;margin:0 7px;padding:6px 20px;color:#fff;border:1px solid #0064b6;background:no-repeat #0071ce;border-radius:3px;display:inline-block;height:20px;line-height:20px;text-align:center;vertical-align:middle;text-decoration:none;outline:0}body .layer-ext-moon .layui-layer-btn .layui-layer-btn0{background:#0071ce}body .layer-ext-moon .layui-layer-btn .layui-layer-btn1{background:#fff;color:#404a58;border:1px solid #c0c4cd;border-radius:3px}body .layer-ext-moon .layui-layer-btn .layui-layer-btn2{background:#f60;color:#fff;border:1px solid #f60;border-radius:3px}body .layer-ext-moon .layui-layer-btn .layui-layer-btn3{background:red;color:#fff;border:1px solid red;border-radius:3px}body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{height:47px} |
||||
@ -0,0 +1,82 @@ |
|||||
|
package ${package}.controller; |
||||
|
|
||||
|
import ${main}.commons.tools.aop.NoRepeatSubmit; |
||||
|
import ${main}.commons.tools.page.PageData; |
||||
|
import ${main}.commons.tools.utils.ExcelUtils; |
||||
|
import ${main}.commons.tools.utils.Result; |
||||
|
import ${main}.commons.tools.validator.AssertUtils; |
||||
|
import ${main}.commons.tools.validator.ValidatorUtils; |
||||
|
import ${main}.commons.tools.validator.group.AddGroup; |
||||
|
import ${main}.commons.tools.validator.group.UpdateGroup; |
||||
|
import ${main}.commons.tools.validator.group.DefaultGroup; |
||||
|
import ${package}.dto.${className}DTO; |
||||
|
import ${package}.excel.${className}Excel; |
||||
|
import ${package}.service.${className}Service; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("${pathName}") |
||||
|
public class ${className}Controller { |
||||
|
|
||||
|
@Autowired |
||||
|
private ${className}Service ${classname}Service; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<${className}DTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<${className}DTO> page = ${classname}Service.page(params); |
||||
|
return new Result<PageData<${className}DTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<${className}DTO> get(@PathVariable("id") String id){ |
||||
|
${className}DTO data = ${classname}Service.get(id); |
||||
|
return new Result<${className}DTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody ${className}DTO dto){ |
||||
|
//效验数据 |
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
${classname}Service.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody ${className}DTO dto){ |
||||
|
//效验数据 |
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
${classname}Service.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据 |
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
${classname}Service.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<${className}DTO> list = ${classname}Service.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, ${className}Excel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
package ${package}.controller; |
||||
|
|
||||
|
import ${main}.commons.tools.page.PageData; |
||||
|
import ${main}.commons.tools.utils.ExcelUtils; |
||||
|
import ${main}.commons.tools.utils.Result; |
||||
|
import ${main}.commons.tools.validator.AssertUtils; |
||||
|
import ${main}.commons.tools.validator.ValidatorUtils; |
||||
|
import ${main}.commons.tools.validator.group.AddGroup; |
||||
|
import ${main}.commons.tools.validator.group.UpdateGroup; |
||||
|
import ${main}.commons.tools.validator.group.DefaultGroup; |
||||
|
import ${package}.dto.${className}DTO; |
||||
|
import ${package}.excel.${className}Excel; |
||||
|
import ${package}.service.${className}Service; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("${pathName}") |
||||
|
public class ${className}Controller { |
||||
|
|
||||
|
@Autowired |
||||
|
private ${className}Service ${classname}Service; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<${className}DTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<${className}DTO> page = ${classname}Service.page(params); |
||||
|
return new Result<PageData<${className}DTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<${className}DTO> get(@PathVariable("id") String id){ |
||||
|
${className}DTO data = ${classname}Service.get(id); |
||||
|
return new Result<${className}DTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody ${className}DTO dto){ |
||||
|
//效验数据 |
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
${classname}Service.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody ${className}DTO dto){ |
||||
|
//效验数据 |
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
${classname}Service.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据 |
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
${classname}Service.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<${className}DTO> list = ${classname}Service.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, ${className}Excel.class); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package ${package}.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
#if(${hasBigDecimal}) |
||||
|
import java.math.BigDecimal; |
||||
|
#end |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ${className}DTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
#foreach ($column in $columns) |
||||
|
/** |
||||
|
* $column.comments |
||||
|
*/ |
||||
|
private $column.attrType $column.attrname; |
||||
|
|
||||
|
#end |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package ${package}.dao; |
||||
|
|
||||
|
import ${main}.commons.mybatis.dao.BaseDao; |
||||
|
import ${package}.entity.${className}Entity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ${className}Dao extends BaseDao<${className}Entity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="${package}.dao.${className}Dao"> |
||||
|
|
||||
|
<resultMap type="${package}.entity.${className}Entity" id="${classname}Map"> |
||||
|
#foreach($column in $columns) |
||||
|
<result property="${column.attrname}" column="${column.columnName}"/> |
||||
|
#end |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,36 @@ |
|||||
|
package ${package}.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import ${main}.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
#if(${hasBigDecimal}) |
||||
|
import java.math.BigDecimal; |
||||
|
#end |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("${tableName}") |
||||
|
public class ${className}Entity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
#foreach ($column in $columns) |
||||
|
#if($column.columnName != 'ID' && $column.columnName != 'CREATED_TIME' && $column.columnName != 'CREATED_BY' && $column.columnName != 'UPDATED_TIME' && $column.columnName != 'UPDATED_BY' && $column.columnName != 'DEL_FLAG' && $column.columnName != 'REVISION') |
||||
|
/** |
||||
|
* $column.comments |
||||
|
*/ |
||||
|
private $column.attrType $column.attrname; |
||||
|
|
||||
|
#end |
||||
|
#end |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package ${package}.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
#if(${hasBigDecimal}) |
||||
|
import java.math.BigDecimal; |
||||
|
#end |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ${className}Excel { |
||||
|
|
||||
|
#foreach ($column in $columns) |
||||
|
@Excel(name = "$!column.comments") |
||||
|
private $column.attrType $column.attrname; |
||||
|
|
||||
|
#end |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package ${package}.redis; |
||||
|
|
||||
|
import ${main}.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Component |
||||
|
public class ${className}Redis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,78 @@ |
|||||
|
package ${package}.service; |
||||
|
|
||||
|
import ${main}.commons.mybatis.service.BaseService; |
||||
|
import ${main}.commons.tools.page.PageData; |
||||
|
import ${package}.dto.${className}DTO; |
||||
|
import ${package}.entity.${className}Entity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
public interface ${className}Service extends BaseService<${className}Entity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<${className}DTO> |
||||
|
* @author generator |
||||
|
* @date ${date} |
||||
|
*/ |
||||
|
PageData<${className}DTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<${className}DTO> |
||||
|
* @author generator |
||||
|
* @date ${date} |
||||
|
*/ |
||||
|
List<${className}DTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return ${className}DTO |
||||
|
* @author generator |
||||
|
* @date ${date} |
||||
|
*/ |
||||
|
${className}DTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date ${date} |
||||
|
*/ |
||||
|
void save(${className}DTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date ${date} |
||||
|
*/ |
||||
|
void update(${className}DTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date ${date} |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,87 @@ |
|||||
|
package ${package}.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import ${main}.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import ${main}.commons.tools.page.PageData; |
||||
|
import ${main}.commons.tools.utils.ConvertUtils; |
||||
|
import ${package}.commons.tools.constant.FieldConstant; |
||||
|
import ${package}.dao.${className}Dao; |
||||
|
import ${package}.dto.${className}DTO; |
||||
|
import ${package}.entity.${className}Entity; |
||||
|
import ${package}.redis.${className}Redis; |
||||
|
import ${package}.service.${className}Service; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service { |
||||
|
|
||||
|
@Autowired |
||||
|
private ${className}Redis ${classname}Redis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<${className}DTO> page(Map<String, Object> params) { |
||||
|
IPage<${className}Entity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, ${className}DTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<${className}DTO> list(Map<String, Object> params) { |
||||
|
List<${className}Entity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, ${className}DTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<${className}Entity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<${className}Entity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ${className}DTO get(String id) { |
||||
|
${className}Entity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, ${className}DTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(${className}DTO dto) { |
||||
|
${className}Entity entity = ConvertUtils.sourceToTarget(dto, ${className}Entity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(${className}DTO dto) { |
||||
|
${className}Entity entity = ConvertUtils.sourceToTarget(dto, ${className}Entity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解) |
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,87 @@ |
|||||
|
package ${package}.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import ${main}.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import ${main}.commons.tools.page.PageData; |
||||
|
import ${main}.commons.tools.utils.ConvertUtils; |
||||
|
import ${package}.commons.tools.constant.FieldConstant; |
||||
|
import ${package}.dao.${className}Dao; |
||||
|
import ${package}.dto.${className}DTO; |
||||
|
import ${package}.entity.${className}Entity; |
||||
|
import ${package}.redis.${className}Redis; |
||||
|
import ${package}.service.${className}Service; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* ${comments} |
||||
|
* |
||||
|
* @author ${author} ${email} |
||||
|
* @since ${version} ${date} |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service { |
||||
|
|
||||
|
@Autowired |
||||
|
private ${className}Redis ${classname}Redis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<${className}DTO> page(Map<String, Object> params) { |
||||
|
IPage<${className}Entity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, ${className}DTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<${className}DTO> list(Map<String, Object> params) { |
||||
|
List<${className}Entity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, ${className}DTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<${className}Entity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<${className}Entity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ${className}DTO get(String id) { |
||||
|
${className}Entity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, ${className}DTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(${className}DTO dto) { |
||||
|
${className}Entity entity = ConvertUtils.sourceToTarget(dto, ${className}Entity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(${className}DTO dto) { |
||||
|
${className}Entity entity = ConvertUtils.sourceToTarget(dto, ${className}Entity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解) |
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,93 @@ |
|||||
|
<template> |
||||
|
<el-dialog :visible.sync="visible" :title="!dataForm.${pk.attrname} ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> |
||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
||||
|
#foreach($column in $columns) |
||||
|
#if($column.columnName != $pk.columnName) |
||||
|
<el-form-item label="${column.comments}" prop="${column.attrname}"> |
||||
|
<el-input v-model="dataForm.${column.attrname}" placeholder="${column.comments}"></el-input> |
||||
|
</el-form-item> |
||||
|
#end |
||||
|
#end |
||||
|
</el-form> |
||||
|
<template slot="footer"> |
||||
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
||||
|
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import debounce from 'lodash/debounce' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
visible: false, |
||||
|
dataForm: {; |
||||
|
#foreach($column in $columns) |
||||
|
${column.attrname}: ''#if($velocityCount != $columns.size()),;#end |
||||
|
|
||||
|
#end |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
dataRule () { |
||||
|
return {; |
||||
|
#foreach($column in $columns) |
||||
|
#if($column.columnName != $pk.columnName) |
||||
|
${column.attrname}: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
]#if($velocityCount != $columns.size()),;#end |
||||
|
|
||||
|
#end |
||||
|
#end |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init () { |
||||
|
this.visible = true; |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['dataForm'].resetFields() |
||||
|
if (this.dataForm.${pk.attrname}); { |
||||
|
this.getInfo() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取信息 |
||||
|
getInfo () { |
||||
|
#[[this.$http.get(]];#`/${moduleName}/${pathName}/#[[${]]#this.dataForm.${pk.attrname}}`;).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
#[[;return this.$message.error(res.msg);]]# |
||||
|
} |
||||
|
this.dataForm = { |
||||
|
...this.dataForm, |
||||
|
...res.data |
||||
|
} |
||||
|
}).catch(() => {}) |
||||
|
}, |
||||
|
// 表单提交 |
||||
|
dataFormSubmitHandle: debounce(function () { |
||||
|
#[[this.$refs['dataForm'].validate((valid) => {]]# |
||||
|
if (!valid); { |
||||
|
return false |
||||
|
} |
||||
|
#[[this.$http]];#[!this.dataForm.$;{pk.attrname} ? 'post' : 'put';]('/${moduleName}/${pathName}/', this.dataForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
#[[;return this.$message.error(res.msg);]]# |
||||
|
} |
||||
|
this.$message({; |
||||
|
#[[message;: this.$t('prompt.success'),;]]# |
||||
|
type;: 'success', |
||||
|
duration;: 500, |
||||
|
onClose;: () => { |
||||
|
this.visible = false; |
||||
|
this.$emit('refreshDataList') |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
}) |
||||
|
}, 1000, { 'leading': true, 'trailing': false }) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,67 @@ |
|||||
|
<template> |
||||
|
<el-card shadow="never" class="aui-card--fill"> |
||||
|
<div class="mod-${moduleName}__${pathName}}"> |
||||
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
||||
|
<el-form-item> |
||||
|
<el-input v-model="dataForm.${pk.attrname}" placeholder="${pk.attrname}" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button v-if="$hasPermission('${moduleName}:${pathName}:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button v-if="$hasPermission('${moduleName}:${pathName}:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
||||
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> |
||||
|
#foreach($column in $columns) |
||||
|
<el-table-column prop="${column.attrname}" label="${column.comments}" header-align="center" align="center"></el-table-column> |
||||
|
#end |
||||
|
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button v-if="$hasPermission('${moduleName}:${pathName}:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
||||
|
<el-button v-if="$hasPermission('${moduleName}:${pathName}:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination |
||||
|
:current-page="page" |
||||
|
:page-sizes="[10, 20, 50, 100]" |
||||
|
:page-size="limit" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@size-change="pageSizeChangeHandle" |
||||
|
@current-change="pageCurrentChangeHandle"> |
||||
|
</el-pagination> |
||||
|
<!-- 弹窗, 新增 / 修改 --> |
||||
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import mixinViewModule from '@/mixins/view-module' |
||||
|
import AddOrUpdate from './${pathName}-add-or-update' |
||||
|
export default { |
||||
|
mixins: [mixinViewModule], |
||||
|
data () { |
||||
|
return { |
||||
|
mixinViewModuleOptions: { |
||||
|
getDataListURL: '/${moduleName}/${pathName}/page', |
||||
|
getDataListIsPage: true, |
||||
|
deleteURL: '/${moduleName}/${pathName}', |
||||
|
deleteIsBatch: true |
||||
|
}, |
||||
|
dataForm: {; |
||||
|
${pk.attrname}: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
AddOrUpdate |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,35 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<title>代码生成器</title> |
||||
|
<meta charset="UTF-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> |
||||
|
<link rel="stylesheet" href="css/bootstrap.min.css"> |
||||
|
<link rel="stylesheet" href="css/font-awesome.min.css"> |
||||
|
<link rel="stylesheet" href="plugins/jqgrid/ui.jqgrid-bootstrap.css"> |
||||
|
<link rel="stylesheet" href="css/main.css"> |
||||
|
<script src="libs/jquery.min.js"></script> |
||||
|
<script src="plugins/layer/layer.js"></script> |
||||
|
<script src="libs/bootstrap.min.js"></script> |
||||
|
<script src="libs/vue.min.js"></script> |
||||
|
<script src="plugins/jqgrid/grid.locale-cn.js"></script> |
||||
|
<script src="plugins/jqgrid/jquery.jqGrid.min.js"></script> |
||||
|
<script src="js/common.js"></script> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="rrapp"> |
||||
|
<div class="grid-btn"> |
||||
|
<div class="form-group col-sm-2"> |
||||
|
<input type="text" class="form-control" v-model="q.tableName" @keyup.enter="query" placeholder="表名"> |
||||
|
</div> |
||||
|
<a class="btn btn-default" @click="query">查询</a> |
||||
|
<a class="btn btn-primary" @click="generator"><i class="fa fa-file-code-o"></i> 生成代码</a> |
||||
|
</div> |
||||
|
<table id="jqGrid"></table> |
||||
|
<div id="jqGridPager"></div> |
||||
|
</div> |
||||
|
|
||||
|
<script src="js/generator.js"></script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,115 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<title>人人代码生成器</title> |
||||
|
<!-- Tell the browser to be responsive to screen width --> |
||||
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> |
||||
|
<link rel="stylesheet" href="css/bootstrap.min.css"> |
||||
|
<link rel="stylesheet" href="css/font-awesome.min.css"> |
||||
|
<link rel="stylesheet" href="css/AdminLTE.min.css"> |
||||
|
<!-- AdminLTE Skins. Choose a skin from the css/skins |
||||
|
folder instead of downloading all of them to reduce the load. --> |
||||
|
<link rel="stylesheet" href="css/all-skins.min.css"> |
||||
|
<link rel="stylesheet" href="css/main.css"> |
||||
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
||||
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
||||
|
<!--[if lt IE 9]> |
||||
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> |
||||
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> |
||||
|
<![endif]--> |
||||
|
</head> |
||||
|
<!-- ADD THE CLASS layout-boxed TO GET A BOXED LAYOUT --> |
||||
|
<body class="hold-transition skin-blue sidebar-mini"> |
||||
|
<!-- Site wrapper --> |
||||
|
<div class="wrapper" id="rrapp" v-cloak> |
||||
|
<header class="main-header"> |
||||
|
<a href="javascript:void(0);" class="logo"> |
||||
|
<!-- mini logo for sidebar mini 50x50 pixels --> |
||||
|
<span class="logo-mini"><b>人人</b></span> |
||||
|
<!-- logo for regular state and mobile devices --> |
||||
|
<span class="logo-lg"><b>人人代码生成器</b></span> |
||||
|
</a> |
||||
|
<!-- Header Navbar: style can be found in header.less --> |
||||
|
<nav class="navbar navbar-static-top" role="navigation"> |
||||
|
<!-- Sidebar toggle button--> |
||||
|
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"> |
||||
|
<span class="sr-only">Toggle navigation</span> |
||||
|
</a> |
||||
|
<div style="float:left;color:#fff;padding:15px 10px;">代码的搬运工</div> |
||||
|
<div class="navbar-custom-menu"> |
||||
|
<ul class="nav navbar-nav"> |
||||
|
<li><a href="javascript:" @click="donate"><i class="fa fa-jpy"></i> 捐赠作者</a></li> |
||||
|
<li><a href="https://www.renren.io" target="_blank"><i class="fa fa-home"></i> 人人开源</a></li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</nav> |
||||
|
</header> |
||||
|
|
||||
|
<!-- =============================================== --> |
||||
|
|
||||
|
<!-- Left side column. contains the sidebar --> |
||||
|
<aside class="main-sidebar"> |
||||
|
<!-- sidebar: style can be found in sidebar.less --> |
||||
|
<section class="sidebar"> |
||||
|
<!-- /.search form --> |
||||
|
<!-- sidebar menu: : style can be found in sidebar.less --> |
||||
|
<ul class="sidebar-menu"> |
||||
|
<li class="header">导航菜单</li> |
||||
|
<li class="active"> |
||||
|
<a href="javascript:"><i class="fa fa-cog"></i><span>代码生成器</span><i class="fa fa-angle-left pull-right"></i></a> |
||||
|
<ul class="treeview-menu menu-open" style="display: block;"> |
||||
|
<li class="active"><a href="#main.html"><i class="fa fa-rocket"></i> 控制台</a></li> |
||||
|
<li><a href="#generator.html"><i class="fa fa-rocket"></i> renren-cloud</a></li> |
||||
|
</ul> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</section> |
||||
|
<!-- /.sidebar --> |
||||
|
</aside> |
||||
|
<!-- =============================================== --> |
||||
|
<!-- Content Wrapper. Contains page content --> |
||||
|
<div class="content-wrapper"> |
||||
|
<!-- Content Header (Page header) --> |
||||
|
<section class="content-header"> |
||||
|
<ol class="breadcrumb" id="nav_title" style="position:static;float:none;"> |
||||
|
<li class="active"><i class="fa fa-home" style="font-size:20px;position:relative;top:2px;left:-3px;"></i> 首页</li> |
||||
|
<li class="active">{{navTitle}}</li> |
||||
|
</ol> |
||||
|
</section> |
||||
|
|
||||
|
<!-- Main content --> |
||||
|
<section class="content" style="background:#fff;"> |
||||
|
<iframe scrolling="yes" frameborder="0" style="width:100%;min-height:200px;overflow:visible;background:#fff;" :src="main"></iframe> |
||||
|
</section> |
||||
|
<!-- /.content --> |
||||
|
</div> |
||||
|
<!-- /.content-wrapper --> |
||||
|
|
||||
|
<footer class="main-footer"> |
||||
|
<div class="pull-right hidden-xs"> |
||||
|
Version 1.0.0 |
||||
|
</div> |
||||
|
Copyright © 2018 <a href="https://www.renren.io" target="_blank">renren.io</a> All Rights Reserved |
||||
|
</footer> |
||||
|
|
||||
|
<!-- Add the sidebar's background. This div must be placed |
||||
|
immediately after the control sidebar --> |
||||
|
<div class="control-sidebar-bg"></div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
<!-- ./wrapper --> |
||||
|
|
||||
|
<script src="libs/jquery.min.js"></script> |
||||
|
<script src="libs/vue.min.js"></script> |
||||
|
<script src="libs/router.js"></script> |
||||
|
<script src="libs/bootstrap.min.js"></script> |
||||
|
<script src="libs/fastclick.min.js"></script> |
||||
|
<script src="libs/app.js"></script> |
||||
|
<script src="plugins/layer/layer.js"></script> |
||||
|
<script src="js/index.js"></script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,30 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<title>欢迎页</title> |
||||
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> |
||||
|
<link rel="stylesheet" href="css/bootstrap.min.css"> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div class="panel panel-default"> |
||||
|
<div class="panel-heading">基本信息</div> |
||||
|
<div style="padding: 10px 0 20px 10px;"> |
||||
|
<h3> 获取帮助</h3> |
||||
|
<ul> |
||||
|
<li>Git地址:<a href="https://gitee.com/renrenio/renren-security" target="_blank">https://gitee.com/renrenio/renren-security</a></li> |
||||
|
<li>官方社区:<a href="http://www.renren.io/community" target="_blank">https://www.renren.io/community</a></li> |
||||
|
<li>如需寻求帮助、项目建议、技术讨论等,请移步到官方社区,我会在第一时间进行解答或回复</li> |
||||
|
<li>如需关注项目最新动态,请Watch、Star项目,同时也是对项目最好的支持</li> |
||||
|
</ul> |
||||
|
|
||||
|
<h3> 官方QQ群</h3> |
||||
|
<ul> |
||||
|
<li>高级群:324780204(大牛云集,跟大牛学习新技能)</li> |
||||
|
<li>普通群:145799952(学习交流,互相解答各种疑问)</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,28 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<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"> |
||||
|
<parent> |
||||
|
<artifactId>epmet-plugins</artifactId> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<version>2.0.0</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>epmet-plugins-common</artifactId> |
||||
|
|
||||
|
|
||||
|
<properties> |
||||
|
<lombok.version>1.18.4</lombok.version> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-commons-tools</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,27 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<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> |
||||
|
|
||||
|
<parent> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>pli-power-axis</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</parent> |
||||
|
|
||||
|
<artifactId>pli-power-axis-client</artifactId> |
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-plugins-common</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<finalName>${project.artifactId}</finalName> |
||||
|
</build> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,11 @@ |
|||||
|
FROM java:8 |
||||
|
|
||||
|
RUN export LANG="zh_CN.UTF-8" |
||||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
||||
|
RUN echo 'Asia/Shanghai' > /etc/timezone |
||||
|
|
||||
|
COPY ./target/*.jar ./pli-power-axis.jar |
||||
|
|
||||
|
EXPOSE 8096 |
||||
|
|
||||
|
ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] |
||||
@ -0,0 +1,18 @@ |
|||||
|
version: "3.7" |
||||
|
services: |
||||
|
pli-power-axis-server: |
||||
|
container_name: pli-power-axis-server-dev |
||||
|
image: 192.168.1.140:5000/epmet-cloud-dev/pli-power-axis-server:version_placeholder |
||||
|
ports: |
||||
|
- "8096:8096" |
||||
|
network_mode: host # 使用现有网络 |
||||
|
volumes: |
||||
|
- "/opt/epmet-cloud-logs/dev:/logs" |
||||
|
environment: |
||||
|
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./pli-power-axis.jar" |
||||
|
restart: "unless-stopped" |
||||
|
deploy: |
||||
|
resources: |
||||
|
limits: |
||||
|
cpus: '0.1' |
||||
|
memory: 250M |
||||
@ -0,0 +1,18 @@ |
|||||
|
version: "3.7" |
||||
|
services: |
||||
|
pli-power-axis-server: |
||||
|
container_name: pli-power-axis-server-prod |
||||
|
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/pli-power-axis-server:0.3.83 |
||||
|
ports: |
||||
|
- "8096:8096" |
||||
|
network_mode: host # 使用现有网络 |
||||
|
volumes: |
||||
|
- "/opt/epmet-cloud-logs/prod:/logs" |
||||
|
environment: |
||||
|
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./pli-power-axis.jar" |
||||
|
restart: "unless-stopped" |
||||
|
deploy: |
||||
|
resources: |
||||
|
limits: |
||||
|
cpus: '0.1' |
||||
|
memory: 600M |
||||
@ -0,0 +1,18 @@ |
|||||
|
version: "3.7" |
||||
|
services: |
||||
|
pli-power-axis-server: |
||||
|
container_name: pli-power-axis-server-test |
||||
|
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/pli-power-axis-server:version_placeholder |
||||
|
ports: |
||||
|
- "8096:8096" |
||||
|
network_mode: host # 使用现有网络 |
||||
|
volumes: |
||||
|
- "/opt/epmet-cloud-logs/test:/logs" |
||||
|
environment: |
||||
|
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./pli-power-axis.jar" |
||||
|
restart: "unless-stopped" |
||||
|
deploy: |
||||
|
resources: |
||||
|
limits: |
||||
|
cpus: '0.1' |
||||
|
memory: 250M |
||||
@ -0,0 +1,305 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<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> |
||||
|
<version>0.3.83</version> |
||||
|
<parent> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>pli-power-axis</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</parent> |
||||
|
<artifactId>pli-power-axis-server</artifactId> |
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-plugins-common</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>pli-power-axis-client</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-commons-mybatis</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework</groupId> |
||||
|
<artifactId>spring-context-support</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-actuator</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>de.codecentric</groupId> |
||||
|
<artifactId>spring-boot-admin-starter-client</artifactId> |
||||
|
<version>${spring.boot.admin.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
||||
|
</dependency> |
||||
|
<!-- 替换Feign原生httpclient --> |
||||
|
<dependency> |
||||
|
<groupId>io.github.openfeign</groupId> |
||||
|
<artifactId>feign-httpclient</artifactId> |
||||
|
<version>10.3.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>info.debatty</groupId> |
||||
|
<artifactId>java-string-similarity</artifactId> |
||||
|
<version>1.2.1</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.jetbrains</groupId> |
||||
|
<artifactId>annotations</artifactId> |
||||
|
<version>RELEASE</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<finalName>${project.artifactId}</finalName> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||
|
<artifactId>maven-surefire-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<skipTests>true</skipTests> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||
|
<artifactId>maven-resources-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<nonFilteredFileExtensions> |
||||
|
<nonFilteredFileExtension>xls</nonFilteredFileExtension> |
||||
|
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension> |
||||
|
</nonFilteredFileExtensions> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory> |
||||
|
<resources> |
||||
|
<resource> |
||||
|
<filtering>true</filtering> |
||||
|
<directory>${basedir}/src/main/resources</directory> |
||||
|
</resource> |
||||
|
</resources> |
||||
|
</build> |
||||
|
<profiles> |
||||
|
<profile> |
||||
|
<id>dev</id> |
||||
|
<properties> |
||||
|
<server.port>8096</server.port> |
||||
|
<spring.profiles.active>dev</spring.profiles.active> |
||||
|
|
||||
|
<!-- 数据库配置--> |
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_pli_power?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epmet_pli_power</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password> |
||||
|
<!-- redis配置 --> |
||||
|
<spring.redis.index>0</spring.redis.index> |
||||
|
<spring.redis.host>192.168.1.140</spring.redis.host> |
||||
|
<spring.redis.port>6379</spring.redis.port> |
||||
|
<spring.redis.password>123456</spring.redis.password> |
||||
|
<!-- nacos --> |
||||
|
<nacos.register-enabled>true</nacos.register-enabled> |
||||
|
<nacos.server-addr>192.168.1.140:8848</nacos.server-addr> |
||||
|
<nacos.discovery.namespace>1fecc730-5e6e-464c-aae9-7567944e7936</nacos.discovery.namespace> |
||||
|
<nacos.config.namespace></nacos.config.namespace> |
||||
|
<nacos.config.group></nacos.config.group> |
||||
|
<nacos.config-enabled>false</nacos.config-enabled> |
||||
|
<nacos.ip/> |
||||
|
<!--是否开启服务列表变更监听--> |
||||
|
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable> |
||||
|
|
||||
|
<!--线程池--> |
||||
|
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize> |
||||
|
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size> |
||||
|
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size> |
||||
|
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity> |
||||
|
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds> |
||||
|
<thread.threadPool.thread-name-prefix>pli-power-axis-</thread.threadPool.thread-name-prefix> |
||||
|
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler> |
||||
|
|
||||
|
<spring.flyway.enabled>false</spring.flyway.enabled> |
||||
|
|
||||
|
<!--钉钉 机器人地址--> |
||||
|
<dingTalk.robot.webHook> |
||||
|
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 |
||||
|
</dingTalk.robot.webHook> |
||||
|
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd |
||||
|
</dingTalk.robot.secret> |
||||
|
</properties> |
||||
|
</profile> |
||||
|
<profile> |
||||
|
<id>local</id> |
||||
|
<activation> |
||||
|
<activeByDefault>true</activeByDefault> |
||||
|
</activation> |
||||
|
<properties> |
||||
|
<server.port>8096</server.port> |
||||
|
<spring.profiles.active>local</spring.profiles.active> |
||||
|
|
||||
|
<!-- 数据库配置--> |
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://rm-bp1l2b53j508j1176xo.mysql.rds.aliyuncs.com:3306/epmet_pli_power?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>root</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>Abc@123456</spring.datasource.druid.password> |
||||
|
<!-- redis配置 --> |
||||
|
<spring.redis.index>0</spring.redis.index> |
||||
|
<spring.redis.host>192.168.1.140</spring.redis.host> |
||||
|
<spring.redis.port>6379</spring.redis.port> |
||||
|
<spring.redis.password>123456</spring.redis.password> |
||||
|
<!-- nacos --> |
||||
|
<nacos.register-enabled>false</nacos.register-enabled> |
||||
|
<nacos.server-addr>192.168.1.140:8848</nacos.server-addr> |
||||
|
<nacos.discovery.namespace>1fecc730-5e6e-464c-aae9-7567944e7936</nacos.discovery.namespace> |
||||
|
<nacos.config.namespace></nacos.config.namespace> |
||||
|
<nacos.config.group></nacos.config.group> |
||||
|
<nacos.config-enabled>false</nacos.config-enabled> |
||||
|
<nacos.ip/> |
||||
|
<!--是否开启服务列表变更监听--> |
||||
|
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable> |
||||
|
|
||||
|
<!--线程池--> |
||||
|
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize> |
||||
|
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size> |
||||
|
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size> |
||||
|
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity> |
||||
|
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds> |
||||
|
<thread.threadPool.thread-name-prefix>pli-power-axis-</thread.threadPool.thread-name-prefix> |
||||
|
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler> |
||||
|
|
||||
|
<spring.flyway.enabled>false</spring.flyway.enabled> |
||||
|
|
||||
|
<!--钉钉 机器人地址--> |
||||
|
<dingTalk.robot.webHook> |
||||
|
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 |
||||
|
</dingTalk.robot.webHook> |
||||
|
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd |
||||
|
</dingTalk.robot.secret> |
||||
|
</properties> |
||||
|
</profile> |
||||
|
<profile> |
||||
|
<id>test</id> |
||||
|
<!--<activation> |
||||
|
<activeByDefault>true</activeByDefault> |
||||
|
</activation>--> |
||||
|
<properties> |
||||
|
<server.port>8096</server.port> |
||||
|
<spring.profiles.active>test</spring.profiles.active> |
||||
|
|
||||
|
<!-- 数据库配置--> |
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_pli_power?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epmet</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password> |
||||
|
<!-- redis配置 --> |
||||
|
<spring.redis.index>0</spring.redis.index> |
||||
|
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host> |
||||
|
<spring.redis.port>6379</spring.redis.port> |
||||
|
<spring.redis.password>EpmEtrEdIs!q@w</spring.redis.password> |
||||
|
<!-- nacos --> |
||||
|
<nacos.register-enabled>true</nacos.register-enabled> |
||||
|
<nacos.server-addr>192.168.10.150:8848</nacos.server-addr> |
||||
|
<nacos.discovery.namespace>67e3c350-533e-4d7c-9f8f-faf1b4aa82ae</nacos.discovery.namespace> |
||||
|
<nacos.config.namespace></nacos.config.namespace> |
||||
|
<nacos.config.group></nacos.config.group> |
||||
|
<nacos.config-enabled>false</nacos.config-enabled> |
||||
|
<nacos.ip/> |
||||
|
<!--是否开启服务列表变更监听--> |
||||
|
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable> |
||||
|
|
||||
|
<!--线程池--> |
||||
|
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize> |
||||
|
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size> |
||||
|
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size> |
||||
|
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity> |
||||
|
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds> |
||||
|
<thread.threadPool.thread-name-prefix>pli-power-axis-</thread.threadPool.thread-name-prefix> |
||||
|
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler> |
||||
|
|
||||
|
<spring.flyway.enabled>true</spring.flyway.enabled> |
||||
|
|
||||
|
<!--测试钉钉 机器人地址--> |
||||
|
<dingTalk.robot.webHook> |
||||
|
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 |
||||
|
</dingTalk.robot.webHook> |
||||
|
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd |
||||
|
</dingTalk.robot.secret> |
||||
|
</properties> |
||||
|
</profile> |
||||
|
<profile> |
||||
|
<id>prod</id> |
||||
|
<properties> |
||||
|
<server.port>8096</server.port> |
||||
|
<spring.profiles.active>prod</spring.profiles.active> |
||||
|
|
||||
|
<!-- 数据库配置--> |
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_pli_power?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epmet_pli_power</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password> |
||||
|
<!-- redis配置 --> |
||||
|
<spring.redis.index>0</spring.redis.index> |
||||
|
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host> |
||||
|
<spring.redis.port>6379</spring.redis.port> |
||||
|
<spring.redis.password>EpmEtclOUdrEdIs!Q2w</spring.redis.password> |
||||
|
<!-- nacos --> |
||||
|
<nacos.register-enabled>true</nacos.register-enabled> |
||||
|
<nacos.server-addr>192.168.11.180:8848</nacos.server-addr> |
||||
|
<nacos.discovery.namespace>bd205d23-e696-47be-b995-916313f86e99</nacos.discovery.namespace> |
||||
|
<nacos.config.namespace></nacos.config.namespace> |
||||
|
<nacos.config.group></nacos.config.group> |
||||
|
<nacos.config-enabled>false</nacos.config-enabled> |
||||
|
<nacos.ip/> |
||||
|
|
||||
|
<!--是否开启服务列表变更监听--> |
||||
|
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable> |
||||
|
|
||||
|
<!--线程池--> |
||||
|
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize> |
||||
|
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size> |
||||
|
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size> |
||||
|
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity> |
||||
|
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds> |
||||
|
<thread.threadPool.thread-name-prefix>pli-power-axis-</thread.threadPool.thread-name-prefix> |
||||
|
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler> |
||||
|
|
||||
|
<spring.flyway.enabled>true</spring.flyway.enabled> |
||||
|
|
||||
|
|
||||
|
<!--生产钉钉 机器人地址--> |
||||
|
<dingTalk.robot.webHook> |
||||
|
https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c |
||||
|
</dingTalk.robot.webHook> |
||||
|
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 |
||||
|
</dingTalk.robot.secret> |
||||
|
</properties> |
||||
|
</profile> |
||||
|
</profiles> |
||||
|
</project> |
||||
@ -0,0 +1,35 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.plugin.power; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.boot.web.servlet.ServletComponentScan; |
||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
||||
|
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
|
||||
|
/** |
||||
|
* 模块 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@SpringBootApplication |
||||
|
@EnableDiscoveryClient |
||||
|
@EnableFeignClients |
||||
|
@ServletComponentScan |
||||
|
@EnableAsync |
||||
|
public class PliPowerAxisApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(PliPowerAxisApplication.class, args); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.plugin.power.aspect; |
||||
|
|
||||
|
import com.epmet.commons.tools.aspect.BaseRequestLogAspect; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestAttributes; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
/** |
||||
|
* 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 |
||||
|
*/ |
||||
|
@Aspect |
||||
|
@Component |
||||
|
@Order(0) |
||||
|
public class RequestLogAspect extends BaseRequestLogAspect { |
||||
|
|
||||
|
@Override |
||||
|
@Around(value = "execution(* com.epmet.modules.*.controller.*Controller*.*(..)) ") |
||||
|
public Object proceed(ProceedingJoinPoint point) throws Throwable { |
||||
|
return super.proceed(point, getRequest()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取Request对象 |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
private HttpServletRequest getRequest() { |
||||
|
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
||||
|
ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
||||
|
return sra.getRequest(); |
||||
|
} |
||||
|
|
||||
|
} |
||||