Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9dd006597 | ||
|
|
3a770f2818 | ||
|
|
4e16ddc6b1 | ||
|
|
8ecff6b07f | ||
|
|
de0d6f72e1 | ||
|
|
ab96f88dc4 | ||
|
|
a19f76788f | ||
|
|
b4c7f49589 | ||
|
|
708acb0817 | ||
|
|
8b629fe0f1 | ||
|
|
b2a0d0811b | ||
|
|
383f81a84b | ||
|
|
8e0ffb9591 | ||
|
|
222b66abeb | ||
|
|
19fc483274 |
@@ -73,15 +73,15 @@ public class DesUtils {
|
|||||||
String encData = "";
|
String encData = "";
|
||||||
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
|
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
|
||||||
int firstLength = 0, secondLength = 0, thirdLength = 0;
|
int firstLength = 0, secondLength = 0, thirdLength = 0;
|
||||||
if (firstKey != null && firstKey != "") {
|
if (firstKey != null && firstKey.equals("")) {
|
||||||
firstKeyBt = getKeyBytes(firstKey);
|
firstKeyBt = getKeyBytes(firstKey);
|
||||||
firstLength = firstKeyBt.size();
|
firstLength = firstKeyBt.size();
|
||||||
}
|
}
|
||||||
if (secondKey != null && secondKey != "") {
|
if (secondKey != null && secondKey.equals("")) {
|
||||||
secondKeyBt = getKeyBytes(secondKey);
|
secondKeyBt = getKeyBytes(secondKey);
|
||||||
secondLength = secondKeyBt.size();
|
secondLength = secondKeyBt.size();
|
||||||
}
|
}
|
||||||
if (thirdKey != null && thirdKey != "") {
|
if (thirdKey != null && thirdKey.equals("")) {
|
||||||
thirdKeyBt = getKeyBytes(thirdKey);
|
thirdKeyBt = getKeyBytes(thirdKey);
|
||||||
thirdLength = thirdKeyBt.size();
|
thirdLength = thirdKeyBt.size();
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ public class DesUtils {
|
|||||||
if (leng < 4) {
|
if (leng < 4) {
|
||||||
int[] bt = strToBt(data);
|
int[] bt = strToBt(data);
|
||||||
int[] encByte = null;
|
int[] encByte = null;
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
tempBt = bt;
|
tempBt = bt;
|
||||||
@@ -105,7 +105,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
encByte = tempBt;
|
encByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y;
|
int x, y;
|
||||||
tempBt = bt;
|
tempBt = bt;
|
||||||
@@ -117,7 +117,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
encByte = tempBt;
|
encByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "") {
|
if (firstKey != null && firstKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x = 0;
|
int x = 0;
|
||||||
tempBt = bt;
|
tempBt = bt;
|
||||||
@@ -137,7 +137,7 @@ public class DesUtils {
|
|||||||
String tempData = data.substring(i * 4 + 0, i * 4 + 4);
|
String tempData = data.substring(i * 4 + 0, i * 4 + 4);
|
||||||
int[] tempByte = strToBt(tempData);
|
int[] tempByte = strToBt(tempData);
|
||||||
int[] encByte = null;
|
int[] encByte = null;
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
tempBt = tempByte;
|
tempBt = tempByte;
|
||||||
@@ -152,7 +152,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
encByte = tempBt;
|
encByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y;
|
int x, y;
|
||||||
tempBt = tempByte;
|
tempBt = tempByte;
|
||||||
@@ -164,7 +164,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
encByte = tempBt;
|
encByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "") {
|
if (firstKey != null && firstKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x;
|
int x;
|
||||||
tempBt = tempByte;
|
tempBt = tempByte;
|
||||||
@@ -181,7 +181,7 @@ public class DesUtils {
|
|||||||
String remainderData = data.substring(iterator * 4 + 0, leng);
|
String remainderData = data.substring(iterator * 4 + 0, leng);
|
||||||
int[] tempByte = strToBt(remainderData);
|
int[] tempByte = strToBt(remainderData);
|
||||||
int[] encByte = null;
|
int[] encByte = null;
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
tempBt = tempByte;
|
tempBt = tempByte;
|
||||||
@@ -196,7 +196,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
encByte = tempBt;
|
encByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y;
|
int x, y;
|
||||||
tempBt = tempByte;
|
tempBt = tempByte;
|
||||||
@@ -208,7 +208,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
encByte = tempBt;
|
encByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "") {
|
if (firstKey != null && firstKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x;
|
int x;
|
||||||
tempBt = tempByte;
|
tempBt = tempByte;
|
||||||
@@ -236,15 +236,15 @@ public class DesUtils {
|
|||||||
String decStr = "";
|
String decStr = "";
|
||||||
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
|
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
|
||||||
int firstLength = 0, secondLength = 0, thirdLength = 0;
|
int firstLength = 0, secondLength = 0, thirdLength = 0;
|
||||||
if (firstKey != null && firstKey != "") {
|
if (firstKey != null && firstKey.equals("")) {
|
||||||
firstKeyBt = getKeyBytes(firstKey);
|
firstKeyBt = getKeyBytes(firstKey);
|
||||||
firstLength = firstKeyBt.size();
|
firstLength = firstKeyBt.size();
|
||||||
}
|
}
|
||||||
if (secondKey != null && secondKey != "") {
|
if (secondKey != null && secondKey.equals("")) {
|
||||||
secondKeyBt = getKeyBytes(secondKey);
|
secondKeyBt = getKeyBytes(secondKey);
|
||||||
secondLength = secondKeyBt.size();
|
secondLength = secondKeyBt.size();
|
||||||
}
|
}
|
||||||
if (thirdKey != null && thirdKey != "") {
|
if (thirdKey != null && thirdKey.equals("")) {
|
||||||
thirdKeyBt = getKeyBytes(thirdKey);
|
thirdKeyBt = getKeyBytes(thirdKey);
|
||||||
thirdLength = thirdKeyBt.size();
|
thirdLength = thirdKeyBt.size();
|
||||||
}
|
}
|
||||||
@@ -260,7 +260,7 @@ public class DesUtils {
|
|||||||
intByte[j] = Integer.parseInt(strByte.substring(j, j + 1));
|
intByte[j] = Integer.parseInt(strByte.substring(j, j + 1));
|
||||||
}
|
}
|
||||||
int[] decByte = null;
|
int[] decByte = null;
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
tempBt = intByte;
|
tempBt = intByte;
|
||||||
@@ -275,7 +275,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
decByte = tempBt;
|
decByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
|
if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
tempBt = intByte;
|
tempBt = intByte;
|
||||||
@@ -287,7 +287,7 @@ public class DesUtils {
|
|||||||
}
|
}
|
||||||
decByte = tempBt;
|
decByte = tempBt;
|
||||||
} else {
|
} else {
|
||||||
if (firstKey != null && firstKey != "") {
|
if (firstKey != null && firstKey.equals("")) {
|
||||||
int[] tempBt;
|
int[] tempBt;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
tempBt = intByte;
|
tempBt = intByte;
|
||||||
|
|||||||
@@ -218,21 +218,24 @@ public class PropertiesUtils {
|
|||||||
*/
|
*/
|
||||||
private static Logger initLogger(){
|
private static Logger initLogger(){
|
||||||
String logPath = null;
|
String logPath = null;
|
||||||
try {
|
if (StringUtils.isNotBlank(System.getProperty("customLogPath"))){
|
||||||
// 获取当前classes目录
|
// 如果 Tomcat 下部署多个项目的时候 logPath 会出现项目之间串用问题,所以启用 customLogPath 名字
|
||||||
logPath = ResourceUtils.getResource("/").getFile().getPath();
|
logPath = System.getProperty("customLogPath");
|
||||||
} catch (Exception e) {
|
}else{
|
||||||
// 取不到,取当前工作路径
|
try {
|
||||||
logPath = System.getProperty("user.dir");
|
// 获取当前classes目录
|
||||||
}
|
logPath = ResourceUtils.getResource("/").getFile().getPath();
|
||||||
// 取当前日志路径下有classes目录,则使用classes目录
|
} catch (Exception e) {
|
||||||
String classesLogPath = FileUtils.path(logPath + "/WEB-INF/classes");
|
// 取不到,取当前工作路径
|
||||||
if (new File(classesLogPath).exists()){
|
logPath = System.getProperty("user.dir");
|
||||||
logPath = classesLogPath;
|
}
|
||||||
}
|
// 取当前日志路径下有classes目录,则使用classes目录
|
||||||
if (StringUtils.isBlank(System.getProperty("logPath"))){
|
String classesLogPath = FileUtils.path(logPath + "/WEB-INF/classes");
|
||||||
System.setProperty("logPath", FileUtils.path(logPath));
|
if (new File(classesLogPath).exists()){
|
||||||
|
logPath = classesLogPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
System.setProperty("logPath", FileUtils.path(logPath));
|
||||||
return LoggerFactory.getLogger(PropertiesUtils.class);
|
return LoggerFactory.getLogger(PropertiesUtils.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.jeesite.common.lang.StringUtils;
|
|||||||
* @author ThinkGem
|
* @author ThinkGem
|
||||||
* @version 2020-10-26
|
* @version 2020-10-26
|
||||||
*/
|
*/
|
||||||
public class PropertyLoader extends PropertiesPropertySourceLoader implements org.springframework.boot.env.PropertySourceLoader, Ordered{
|
public class PropertyLoader implements org.springframework.boot.env.PropertySourceLoader, Ordered{
|
||||||
|
|
||||||
private static boolean isLoadJeeSitePropertySource = false;
|
private static boolean isLoadJeeSitePropertySource = false;
|
||||||
private PropertiesPropertySourceLoader propertiesPropertySourceLoader = new PropertiesPropertySourceLoader();
|
private PropertiesPropertySourceLoader propertiesPropertySourceLoader = new PropertiesPropertySourceLoader();
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.apache.shiro.session.Session;
|
|||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
import org.apache.shiro.web.servlet.Cookie;
|
import org.apache.shiro.web.servlet.Cookie;
|
||||||
import org.apache.shiro.web.servlet.SimpleCookie;
|
import org.apache.shiro.web.servlet.SimpleCookie;
|
||||||
|
import org.apache.shiro.web.servlet.Cookie.SameSiteOptions;
|
||||||
import org.apache.shiro.web.util.WebUtils;
|
import org.apache.shiro.web.util.WebUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -65,9 +66,12 @@ public class FormAuthenticationFilter extends org.apache.shiro.web.filter.authc.
|
|||||||
*/
|
*/
|
||||||
public FormAuthenticationFilter() {
|
public FormAuthenticationFilter() {
|
||||||
super();
|
super();
|
||||||
rememberUserCodeCookie = new SimpleCookie(REMEMBER_USERCODE_PARAM);
|
rememberUserCodeCookie = new SimpleCookie();
|
||||||
rememberUserCodeCookie.setHttpOnly(true);
|
rememberUserCodeCookie.setName(REMEMBER_USERCODE_PARAM);
|
||||||
rememberUserCodeCookie.setMaxAge(Cookie.ONE_YEAR);
|
rememberUserCodeCookie.setPath(Global.getProperty("session.sessionIdCookiePath"));
|
||||||
|
rememberUserCodeCookie.setSecure(Global.getPropertyToBoolean("session.sessionIdCookieSecure", "false"));
|
||||||
|
rememberUserCodeCookie.setHttpOnly(Global.getPropertyToBoolean("session.sessionIdCookieHttpOnly", "true"));
|
||||||
|
rememberUserCodeCookie.setSameSite(SameSiteOptions.valueOf(Global.getProperty("session.sessionIdCookieSameSite", "LAX")));
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,10 +130,10 @@ public class ShiroConfig {
|
|||||||
* Shiro认证过滤器
|
* Shiro认证过滤器
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public ShiroFilterFactoryBean shiroFilter(WebSecurityManager securityManager,
|
public ShiroFilterFactoryBean shiroFilter(WebSecurityManager webSecurityManager,
|
||||||
AuthorizingRealm authorizingRealm, CasAuthorizingRealm casAuthorizingRealm) {
|
AuthorizingRealm authorizingRealm, CasAuthorizingRealm casAuthorizingRealm) {
|
||||||
ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
|
ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
|
||||||
bean.setSecurityManager(securityManager);
|
bean.setSecurityManager(webSecurityManager);
|
||||||
bean.setLoginUrl(Global.getProperty("shiro.loginUrl"));
|
bean.setLoginUrl(Global.getProperty("shiro.loginUrl"));
|
||||||
bean.setSuccessUrl(Global.getProperty("adminPath")+"/index");
|
bean.setSuccessUrl(Global.getProperty("adminPath")+"/index");
|
||||||
Map<String, Filter> filters = bean.getFilters();
|
Map<String, Filter> filters = bean.getFilters();
|
||||||
@@ -187,7 +187,7 @@ public class ShiroConfig {
|
|||||||
* 定义Shiro安全管理配置
|
* 定义Shiro安全管理配置
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public WebSecurityManager securityManager(AuthorizingRealm authorizingRealm,
|
public WebSecurityManager webSecurityManager(AuthorizingRealm authorizingRealm,
|
||||||
CasAuthorizingRealm casAuthorizingRealm, SessionManager sessionManager,
|
CasAuthorizingRealm casAuthorizingRealm, SessionManager sessionManager,
|
||||||
CacheManager shiroCacheManager) {
|
CacheManager shiroCacheManager) {
|
||||||
WebSecurityManager bean = new WebSecurityManager();
|
WebSecurityManager bean = new WebSecurityManager();
|
||||||
@@ -226,20 +226,20 @@ public class ShiroConfig {
|
|||||||
* 启用Shrio授权注解拦截方式,AOP式方法级权限检查
|
* 启用Shrio授权注解拦截方式,AOP式方法级权限检查
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(WebSecurityManager securityManager) {
|
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(WebSecurityManager webSecurityManager) {
|
||||||
AuthorizationAttributeSourceAdvisor bean = new AuthorizationAttributeSourceAdvisor();
|
AuthorizationAttributeSourceAdvisor bean = new AuthorizationAttributeSourceAdvisor();
|
||||||
bean.setSecurityManager(securityManager);
|
bean.setSecurityManager(webSecurityManager);
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 在方法中 注入 securityManager 进行代理控制
|
// * 在方法中 注入 webSecurityManager 进行代理控制
|
||||||
// */
|
// */
|
||||||
// @Bean
|
// @Bean
|
||||||
// public MethodInvokingFactoryBean methodInvokingFactoryBean(DefaultWebSecurityManager securityManager) {
|
// public MethodInvokingFactoryBean methodInvokingFactoryBean(DefaultWebSecurityManager webSecurityManager) {
|
||||||
// MethodInvokingFactoryBean bean = new MethodInvokingFactoryBean();
|
// MethodInvokingFactoryBean bean = new MethodInvokingFactoryBean();
|
||||||
// bean.setStaticMethod("org.apache.shiro.SecurityUtils.setSecurityManager");
|
// bean.setStaticMethod("org.apache.shiro.SecurityUtils.setSecurityManager");
|
||||||
// bean.setArguments(new Object[] { securityManager });
|
// bean.setArguments(new Object[] { webSecurityManager });
|
||||||
// return bean;
|
// return bean;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class UserController extends BaseController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String infoSaveBase(User user, HttpServletRequest request) {
|
public String infoSaveBase(User user, HttpServletRequest request) {
|
||||||
if (StringUtils.isBlank(user.getUserName())){
|
if (StringUtils.isBlank(user.getUserName())){
|
||||||
return renderResult(Global.TRUE, text("sys.user.userNameNotBlank"));
|
return renderResult(Global.FALSE, text("sys.user.userNameNotBlank"));
|
||||||
}
|
}
|
||||||
Global.assertDemoMode();
|
Global.assertDemoMode();
|
||||||
User currentUser = UserUtils.getUser();
|
User currentUser = UserUtils.getUser();
|
||||||
|
|||||||
@@ -370,7 +370,8 @@ shiro:
|
|||||||
# 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许)
|
# 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许)
|
||||||
isAllowExternalSiteIframe: true
|
isAllowExternalSiteIframe: true
|
||||||
|
|
||||||
# 是否允许跨域访问 CORS,如果允许,设置允许的域名,全部域名设置*号,如果不允许,此设置应该为空
|
# 是否允许跨域访问 CORS,如果允许,设置允许的域名。当设置'*'号全部域名时,accessControlAllowCredentials应该设置为false。
|
||||||
|
# v4.2.3 开始支持多个域名和模糊匹配,例如:http://*.jeesite.com,http://*.jeesite.net
|
||||||
# accessControlAllowOrigin: http://demo.jeesite.com
|
# accessControlAllowOrigin: http://demo.jeesite.com
|
||||||
# accessControlAllowOrigin: '*'
|
# accessControlAllowOrigin: '*'
|
||||||
|
|
||||||
@@ -378,8 +379,8 @@ shiro:
|
|||||||
# accessControlAllowMethods: GET, POST, OPTIONS
|
# accessControlAllowMethods: GET, POST, OPTIONS
|
||||||
# accessControlAllowHeaders: Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With
|
# accessControlAllowHeaders: Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With
|
||||||
|
|
||||||
# 是否允许接收跨域的Cookie凭证数据 CORS
|
# 是否允许接收跨域的Cookie凭证数据 CORS,当设置为true时,accessControlAllowOrigin不能设置为'*'。
|
||||||
# accessControlAllowCredentials: true
|
# accessControlAllowCredentials: false
|
||||||
|
|
||||||
# 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
# 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
||||||
# allowReferers: http://127.0.0.1,http://localhost
|
# allowReferers: http://127.0.0.1,http://localhost
|
||||||
@@ -406,11 +407,11 @@ shiro:
|
|||||||
# ${adminPath}/${spring.application.name}/swagger/** = anon
|
# ${adminPath}/${spring.application.name}/swagger/** = anon
|
||||||
# ${adminPath}/** = user
|
# ${adminPath}/** = user
|
||||||
filterChainDefinitions: |
|
filterChainDefinitions: |
|
||||||
${adminPath}/sys/corpAdmin/treeData = anon
|
|
||||||
${adminPath}/** = user
|
${adminPath}/** = user
|
||||||
|
|
||||||
# 默认的授权过滤定义,如果在filterChainDefinitions中已经定义,则该定义会被覆盖。
|
# 默认的授权过滤定义,如果在filterChainDefinitions中已经定义,则该定义会被覆盖。
|
||||||
defaultFilterChainDefinitions: |
|
defaultFilterChainDefinitions: |
|
||||||
|
/tags/* = anon
|
||||||
/lang/** = anon
|
/lang/** = anon
|
||||||
/account/* = anon
|
/account/* = anon
|
||||||
/userfiles/** = anon
|
/userfiles/** = anon
|
||||||
@@ -422,6 +423,7 @@ shiro:
|
|||||||
${adminPath}/login = authc
|
${adminPath}/login = authc
|
||||||
${adminPath}/logout = logout
|
${adminPath}/logout = logout
|
||||||
${adminPath}/file/** = user
|
${adminPath}/file/** = user
|
||||||
|
${adminPath}/sys/corpAdmin/treeData = anon
|
||||||
${adminPath}/cms/* = perms[cms:view]
|
${adminPath}/cms/* = perms[cms:view]
|
||||||
${adminPath}/cms/site/select = user
|
${adminPath}/cms/site/select = user
|
||||||
${adminPath}/cms/site/* = perms[cms:site:view]
|
${adminPath}/cms/site/* = perms[cms:site:view]
|
||||||
@@ -453,6 +455,11 @@ session:
|
|||||||
# 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。
|
# 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。
|
||||||
#shareSessionIdCookieName: ${session.sessionIdCookieName}
|
#shareSessionIdCookieName: ${session.sessionIdCookieName}
|
||||||
|
|
||||||
|
# 其它 SimpleCookie 参数(v4.2.3)
|
||||||
|
#sessionIdCookieSecure: false
|
||||||
|
#sessionIdCookieHttpOnly: true
|
||||||
|
#sessionIdCookieSameSite: LAX
|
||||||
|
|
||||||
# 设置接收SessionId请求参数的名称
|
# 设置接收SessionId请求参数的名称
|
||||||
sessionIdParamName: __sid
|
sessionIdParamName: __sid
|
||||||
|
|
||||||
@@ -557,7 +564,7 @@ web:
|
|||||||
# 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
# 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
||||||
staticFileExcludeUri: /druid/
|
staticFileExcludeUri: /druid/
|
||||||
|
|
||||||
# 静态资源路径前缀,可做CDN加速优化
|
# 静态资源路径前缀,可做 CDN 加速优化,默认前面增加 ctxPath 前缀,如果前面写 “//” 两个斜杠 或 包含 “://” 不加 ctxPath。
|
||||||
staticPrefix: /static
|
staticPrefix: /static
|
||||||
|
|
||||||
# 严格模式(更严格的数据安全验证)
|
# 严格模式(更严格的数据安全验证)
|
||||||
|
|||||||
@@ -22,19 +22,19 @@
|
|||||||
</childTable>
|
</childTable>
|
||||||
</category>
|
</category>
|
||||||
<category value="crud_cloud" label="单表/主子表 (增删改查 Cloud,生成 Api/Client)">
|
<category value="crud_cloud" label="单表/主子表 (增删改查 Cloud,生成 Api/Client)">
|
||||||
<template>crud/mapper.xml</template>
|
<template>crud_cloud/mapper.xml</template>
|
||||||
<template>crud_cloud/entity.xml</template>
|
<template>crud_cloud/entity.xml</template>
|
||||||
<template>crud/dao.xml</template>
|
<template>crud_cloud/dao.xml</template>
|
||||||
<template>crud_cloud/api.xml</template>
|
<template>crud_cloud/api.xml</template>
|
||||||
<template>crud_cloud/client.xml</template>
|
<template>crud_cloud/client.xml</template>
|
||||||
<template>crud_cloud/service.xml</template>
|
<template>crud_cloud/service.xml</template>
|
||||||
<template>crud/controller.xml</template>
|
<template>crud_cloud/controller.xml</template>
|
||||||
<template>crud/viewList.xml</template>
|
<template>crud_cloud/viewList.xml</template>
|
||||||
<template>crud/viewForm.xml</template>
|
<template>crud_cloud/viewForm.xml</template>
|
||||||
<childTable>
|
<childTable>
|
||||||
<template>crud/mapper.xml</template>
|
<template>crud_cloud/mapper.xml</template>
|
||||||
<template>crud_cloud/entity.xml</template>
|
<template>crud_cloud/entity.xml</template>
|
||||||
<template>crud/dao.xml</template>
|
<template>crud_cloud/dao.xml</template>
|
||||||
</childTable>
|
</childTable>
|
||||||
</category>
|
</category>
|
||||||
<category value="treeGrid" label="树表/树结构表(增删改查)">
|
<category value="treeGrid" label="树表/树结构表(增删改查)">
|
||||||
|
|||||||
@@ -94,7 +94,11 @@ $('#btnDraft').click(function(){
|
|||||||
});
|
});
|
||||||
// 流程按钮操作事件
|
// 流程按钮操作事件
|
||||||
BpmButton = window.BpmButton || {};
|
BpmButton = window.BpmButton || {};
|
||||||
BpmButton.init = function(task){ }
|
BpmButton.init = function(task){
|
||||||
|
if (task && task.priority){
|
||||||
|
$('#bpm_priority').val(task.priority).trigger('change'); // 设置下一个任务的优先级
|
||||||
|
}
|
||||||
|
}
|
||||||
BpmButton.complete = function($this, task){
|
BpmButton.complete = function($this, task){
|
||||||
$('#status').val(Global.STATUS_AUDIT);
|
$('#status').val(Global.STATUS_AUDIT);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,318 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
|
<template>
|
||||||
|
<name>controller</name>
|
||||||
|
<filePath>${moduleName}/src/main/java/${packageName}/${moduleName}/web/${subModuleName}</filePath>
|
||||||
|
<fileName>${ClassName}Controller.java</fileName>
|
||||||
|
<content><![CDATA[
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
*/
|
||||||
|
package ${packageName}.${moduleName}.web${isNotEmpty(subModuleName)?'.'+subModuleName:''};
|
||||||
|
|
||||||
|
<% if (table.isTreeEntity){ %>
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
<% }else{ %>
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.jeesite.common.config.Global;
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
import com.jeesite.common.collect.ListUtils;
|
||||||
|
import com.jeesite.common.collect.MapUtils;
|
||||||
|
import com.jeesite.common.lang.StringUtils;
|
||||||
|
import com.jeesite.common.idgen.IdGen;
|
||||||
|
import com.jeesite.modules.sys.utils.UserUtils;
|
||||||
|
<% }else{ %>
|
||||||
|
import com.jeesite.common.entity.Page;
|
||||||
|
<% } %>
|
||||||
|
<% if (table.tplCategory == 'crud_select'){ %>
|
||||||
|
import com.alibaba.fastjson.JSONValidator;
|
||||||
|
import com.jeesite.common.codec.EncodeUtils;
|
||||||
|
<% } %>
|
||||||
|
import com.jeesite.common.web.BaseController;
|
||||||
|
import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${ClassName};
|
||||||
|
<% for (child in table.childList){ %>
|
||||||
|
import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${@StringUtils.cap(child.className)};
|
||||||
|
<% } %>
|
||||||
|
import ${packageName}.${moduleName}.service${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${ClassName}Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ${functionName}Controller
|
||||||
|
* @author ${functionAuthor}
|
||||||
|
* @version ${functionVersion}
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
|
||||||
|
public class ${ClassName}Controller extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ${ClassName}Service ${className}Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据
|
||||||
|
*/
|
||||||
|
@ModelAttribute
|
||||||
|
public ${ClassName} get(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>, boolean isNewRecord) {
|
||||||
|
<% if (table.pkList.~size == 1){ %>
|
||||||
|
return ${className}Service.get(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrName}<% } %>, isNewRecord);
|
||||||
|
<% }else{ %>
|
||||||
|
${ClassName} ${className} = new ${ClassName}();
|
||||||
|
<% for(pk in table.pkList){ %>
|
||||||
|
${className}.set${@StringUtils.cap(pk.simpleAttrName)}(${pk.simpleAttrName});
|
||||||
|
<% } %>
|
||||||
|
${className}.setIsNewRecord(isNewRecord);
|
||||||
|
return ${className}Service.getAndValid(${className});
|
||||||
|
<% } %>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:view")
|
||||||
|
@RequestMapping(value = {"list", ""})
|
||||||
|
public String list(${ClassName} ${className}, Model model) {
|
||||||
|
model.addAttribute("${className}", ${className});
|
||||||
|
return "${lastPackageName}/${viewPrefix}List";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:view")
|
||||||
|
@RequestMapping(value = "listData")
|
||||||
|
@ResponseBody
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
public List<${ClassName}> listData(${ClassName} ${className}) {
|
||||||
|
if (StringUtils.isBlank(${className}.getParentCode())) {
|
||||||
|
${className}.setParentCode(${ClassName}.ROOT_CODE);
|
||||||
|
}
|
||||||
|
<% for(c in table.columnList){ %>
|
||||||
|
<% if(c.isQuery == "1" && !c.isTreeEntityColumn && c.attrName != 'status'){ %>
|
||||||
|
<% if(c.attrType == 'String'){ %>
|
||||||
|
if (StringUtils.isNotBlank(${className}.${c.attrNameForGetMethod})){
|
||||||
|
${className}.setParentCode(null);
|
||||||
|
}
|
||||||
|
<% }else{ %>
|
||||||
|
if (${className}.${c.attrNameForGetMethod} != null){
|
||||||
|
${className}.setParentCode(null);
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
List<${ClassName}> list = ${className}Service.findList(${className});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
<% }else{ %>
|
||||||
|
public Page<${ClassName}> listData(${ClassName} ${className}, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
${className}.setPage(new Page<>(request, response));
|
||||||
|
Page<${ClassName}> page = ${className}Service.findPage(${className});
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
<% for (child in table.childList){ %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询子表数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:view")
|
||||||
|
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
|
||||||
|
@ResponseBody
|
||||||
|
public Page<${@StringUtils.cap(child.className)}> subListData(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
${@StringUtils.uncap(child.className)}.setPage(new Page<>(request, response));
|
||||||
|
Page<${@StringUtils.cap(child.className)}> page = ${className}Service.findSubPage(${@StringUtils.uncap(child.className)});
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看编辑表单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:view")
|
||||||
|
@RequestMapping(value = "form")
|
||||||
|
public String form(${ClassName} ${className}, Model model) {
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
// 创建并初始化下一个节点信息
|
||||||
|
${className} = createNextNode(${className});
|
||||||
|
<% } %>
|
||||||
|
model.addAttribute("${className}", ${className});
|
||||||
|
return "${lastPackageName}/${viewPrefix}Form";
|
||||||
|
}
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建并初始化下一个节点信息,如:排序号、默认值
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
|
@RequestMapping(value = "createNextNode")
|
||||||
|
@ResponseBody
|
||||||
|
public ${ClassName} createNextNode(${ClassName} ${className}) {
|
||||||
|
if (StringUtils.isNotBlank(${className}.getParentCode())){
|
||||||
|
${className}.setParent(${className}Service.get(${className}.getParentCode()));
|
||||||
|
}
|
||||||
|
if (${className}.getIsNewRecord()) {
|
||||||
|
${ClassName} where = new ${ClassName}();
|
||||||
|
where.setParentCode(${className}.getParentCode());
|
||||||
|
${ClassName} last = ${className}Service.getLastByParentCode(where);
|
||||||
|
// 获取到下级最后一个节点
|
||||||
|
if (last != null){
|
||||||
|
${className}.setTreeSort(last.getTreeSort() + 30);
|
||||||
|
<% if(table.isPkCustom){ %>
|
||||||
|
${className}.set${@StringUtils.cap(table.treeViewCodeAttrName)}(IdGen.nextCode(last.get${@StringUtils.cap(table.treeViewCodeAttrName)}()));
|
||||||
|
}else if (${className}.getParent() != null){
|
||||||
|
${className}.set${@StringUtils.cap(table.treeViewCodeAttrName)}(${className}.getParent().get${@StringUtils.cap(table.treeViewCodeAttrName)}() + "001");
|
||||||
|
<% } %>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 以下设置表单默认数据
|
||||||
|
if (${className}.getTreeSort() == null){
|
||||||
|
${className}.setTreeSort(${ClassName}.DEFAULT_TREE_SORT);
|
||||||
|
}
|
||||||
|
return ${className};
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
|
@PostMapping(value = "save")
|
||||||
|
@ResponseBody
|
||||||
|
public String save(@Validated ${ClassName} ${className}) {
|
||||||
|
${className}Service.save(${className});
|
||||||
|
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
|
||||||
|
}
|
||||||
|
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停用数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
|
@RequestMapping(value = "disable")
|
||||||
|
@ResponseBody
|
||||||
|
public String disable(${ClassName} ${className}) {
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
${ClassName} where = new ${ClassName}();
|
||||||
|
where.setStatus(${ClassName}.STATUS_NORMAL);
|
||||||
|
where.setParentCodes("," + ${className}.getId() + ",");
|
||||||
|
long count = ${className}Service.findCount(where);
|
||||||
|
if (count > 0) {
|
||||||
|
return renderResult(Global.FALSE, text("该${functionNameSimple}包含未停用的子${functionNameSimple}!"));
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
${className}.setStatus(${ClassName}.STATUS_DISABLE);
|
||||||
|
${className}Service.updateStatus(${className});
|
||||||
|
return renderResult(Global.TRUE, text("停用${functionNameSimple}成功"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
|
@RequestMapping(value = "enable")
|
||||||
|
@ResponseBody
|
||||||
|
public String enable(${ClassName} ${className}) {
|
||||||
|
${className}.setStatus(${ClassName}.STATUS_NORMAL);
|
||||||
|
${className}Service.updateStatus(${className});
|
||||||
|
return renderResult(Global.TRUE, text("启用${functionNameSimple}成功"));
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
<% if(toBoolean(table.optionMap['isHaveDelete'])){ %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
|
@RequestMapping(value = "delete")
|
||||||
|
@ResponseBody
|
||||||
|
public String delete(${ClassName} ${className}) {
|
||||||
|
${className}Service.delete(${className});
|
||||||
|
return renderResult(Global.TRUE, text("删除${functionNameSimple}成功!"));
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树结构数据
|
||||||
|
* @param excludeCode 排除的Code
|
||||||
|
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:view")
|
||||||
|
@RequestMapping(value = "treeData")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> treeData(String excludeCode, String isShowCode) {
|
||||||
|
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
||||||
|
List<${ClassName}> list = ${className}Service.findList(new ${ClassName}());
|
||||||
|
for (int i=0; i<list.size(); i++){
|
||||||
|
${ClassName} e = list.get(i);
|
||||||
|
<% if (table.statusExists){ %>
|
||||||
|
// 过滤非正常的数据
|
||||||
|
if (!${ClassName}.STATUS_NORMAL.equals(e.getStatus())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
// 过滤被排除的编码(包括所有子级)
|
||||||
|
if (StringUtils.isNotBlank(excludeCode)){
|
||||||
|
if (e.getId().equals(excludeCode)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (e.getParentCodes().contains("," + excludeCode + ",")){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, Object> map = MapUtils.newHashMap();
|
||||||
|
map.put("id", e.getId());
|
||||||
|
map.put("pId", e.getParentCode());
|
||||||
|
map.put("name", StringUtils.getTreeNodeName(isShowCode, e.get${@StringUtils.cap(table.treeViewCodeAttrName)}(), e.get${@StringUtils.cap(table.treeViewNameAttrName)}()));
|
||||||
|
mapList.add(map);
|
||||||
|
}
|
||||||
|
return mapList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修复表结构相关数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:edit")
|
||||||
|
@RequestMapping(value = "fixTreeData")
|
||||||
|
@ResponseBody
|
||||||
|
public String fixTreeData(${ClassName} ${className}){
|
||||||
|
if (!UserUtils.getUser().isAdmin()){
|
||||||
|
return renderResult(Global.FALSE, "操作失败,只有管理员才能进行修复!");
|
||||||
|
}
|
||||||
|
${className}Service.fixTreeData();
|
||||||
|
return renderResult(Global.TRUE, "数据修复成功");
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
<% if (table.tplCategory == 'crud_select'){ %>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表选择对话框
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("${permissionPrefix}:view")
|
||||||
|
@RequestMapping(value = "${className}Select")
|
||||||
|
public String ${className}Select(${ClassName} ${className}, String selectData, Model model) {
|
||||||
|
String selectDataJson = EncodeUtils.decodeUrl(selectData);
|
||||||
|
if (selectDataJson != null && JSONValidator.from(selectDataJson).validate()){
|
||||||
|
model.addAttribute("selectData", selectDataJson);
|
||||||
|
}
|
||||||
|
model.addAttribute("${className}", ${className});
|
||||||
|
return "${lastPackageName}/${viewPrefix}Select";
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
}]]>
|
||||||
|
</content>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
|
<template>
|
||||||
|
<name>dao</name>
|
||||||
|
<filePath>${moduleName}/src/main/java/${packageName}/${moduleName}/dao/${subModuleName}</filePath>
|
||||||
|
<fileName>${ClassName}Dao.java</fileName>
|
||||||
|
<content><![CDATA[
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
*/
|
||||||
|
package ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModuleName:''};
|
||||||
|
|
||||||
|
import com.jeesite.common.dao.${table.isTreeEntity?'Tree':'Crud'}Dao;
|
||||||
|
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||||
|
import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${ClassName};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ${functionName}DAO接口
|
||||||
|
* @author ${functionAuthor}
|
||||||
|
* @version ${functionVersion}
|
||||||
|
*/
|
||||||
|
@MyBatisDao<% if(isNotBlank(table.dataSourceName)){ %>(dataSourceName="${table.dataSourceName}")<% } %>
|
||||||
|
public interface ${ClassName}Dao extends ${table.isTreeEntity?'Tree':'Crud'}Dao<${ClassName}> {
|
||||||
|
|
||||||
|
}]]>
|
||||||
|
</content>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
|
<template>
|
||||||
|
<name>mapper</name>
|
||||||
|
<filePath>${moduleName}/src/main/resources/mappings/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||||
|
<fileName>${ClassName}Dao.xml</fileName>
|
||||||
|
<content><![CDATA[
|
||||||
|
<?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="${packageName}.${moduleName}.dao${isNotBlank(subModuleName)?'.'+subModuleName:''}.${ClassName}Dao">
|
||||||
|
|
||||||
|
<!-- 查询数据
|
||||||
|
<select id="findList" resultType="${ClassName}">
|
||||||
|
SELECT \${sqlMap.column.toSql()}
|
||||||
|
FROM \${sqlMap.table.toSql()}
|
||||||
|
<where>
|
||||||
|
\${sqlMap.where.toSql()}
|
||||||
|
</where>
|
||||||
|
ORDER BY \${sqlMap.order.toSql()}
|
||||||
|
</select> -->
|
||||||
|
|
||||||
|
</mapper>]]>
|
||||||
|
</content>
|
||||||
|
</template>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
<template>
|
<template>
|
||||||
<name>service</name>
|
<name>service</name>
|
||||||
<filePath>src/main/java/${packageName}/${moduleName}/service/${subModuleName}</filePath>
|
<filePath>${moduleName}/src/main/java/${packageName}/${moduleName}/service/${subModuleName}</filePath>
|
||||||
<fileName>${ClassName}Service.java</fileName>
|
<fileName>${ClassName}Service.java</fileName>
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
|
<template>
|
||||||
|
<name>viewForm</name>
|
||||||
|
<filePath>${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||||
|
<fileName>${className}Form.html</fileName>
|
||||||
|
<content><![CDATA[
|
||||||
|
<%
|
||||||
|
var extLibs = '';
|
||||||
|
if(toBoolean(table.optionMap['isImageUpload']) || toBoolean(table.optionMap['isFileUpload'])){
|
||||||
|
extLibs = extLibs + ',\'fileupload\'';
|
||||||
|
}
|
||||||
|
if(table.childList.~size > 0){
|
||||||
|
extLibs = extLibs + ',\'dataGrid\'';
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
\<% layout('/layouts/default.html', {title: '${functionNameSimple}管理', libs: ['validate'${extLibs}]}){ %>
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="box box-main">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<div class="box-title">
|
||||||
|
<i class="fa icon-note"></i> \${text(${className}.isNewRecord ? '新增${functionNameSimple}' : '编辑${functionNameSimple}')}
|
||||||
|
</div>
|
||||||
|
<div class="box-tools pull-right">
|
||||||
|
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<${'#'}form:form id="inputForm" model="\${${className}}" action="\${ctx}/${urlPrefix}/save" method="post" class="form-horizontal">
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="form-unit">\${text('基本信息')}</div>
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-sm-4">\${text('上级${functionNameSimple}')}:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<${'#'}form:treeselect id="parent" title="\${text('上级${functionNameSimple}')}"
|
||||||
|
path="parent.id" labelPath="parent.${table.treeViewNameAttrName}"
|
||||||
|
url="\${ctx}/${urlPrefix}/treeData?excludeCode=\${${className}.id}"
|
||||||
|
class="" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
<% include('/templates/modules/gen/include/formControl.html'){} %>
|
||||||
|
<% include('/templates/modules/gen/include/formChildTable.html'){} %>
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
\<% if(isNotBlank(${className}.bpm.taskId)){ %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2">${text('审批意见')}:</label>
|
||||||
|
<div class="col-xs-10">
|
||||||
|
<${'#'}bpm:comment bpmEntity="\${${className}}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
\<% } %>
|
||||||
|
<${'#'}bpm:nextTaskInfo bpmEntity="\${${className}}" />
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<div class="box-footer">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-offset-2 col-sm-10">
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
\<% if (hasPermi('${permissionPrefix}:edit')){ %>
|
||||||
|
<${'#'}form:hidden path="status"/>
|
||||||
|
\<% if (${className}.isNewRecord || ${className}.status == '9'){ %>
|
||||||
|
<button type="submit" class="btn btn-sm btn-info" id="btnDraft"><i class="fa fa-save"></i> ${text('暂 存')}</button>
|
||||||
|
\<% } %>
|
||||||
|
<${'#'}bpm:button bpmEntity="\${${className}}" formKey="${table.optionMap['bpmFormKey']}" completeText="${text('提 交')}"/>
|
||||||
|
\<% } %>
|
||||||
|
<% }else{ %>
|
||||||
|
\<% if (hasPermi('${permissionPrefix}:edit')){ %>
|
||||||
|
<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> \${text('保 存')}</button>
|
||||||
|
\<% } %>
|
||||||
|
<% } %>
|
||||||
|
<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> \${text('关 闭')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</${'#'}form:form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
\<% } %>
|
||||||
|
<% include('/templates/modules/gen/include/formChildTableScript.html'){} %>
|
||||||
|
<script>
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
// 业务实现草稿按钮
|
||||||
|
$('#btnDraft').click(function(){
|
||||||
|
$('#status').val(Global.STATUS_DRAFT);
|
||||||
|
});
|
||||||
|
// 流程按钮操作事件
|
||||||
|
BpmButton = window.BpmButton || {};
|
||||||
|
BpmButton.init = function(task){
|
||||||
|
if (task && task.priority){
|
||||||
|
$('#bpm_priority').val(task.priority).trigger('change'); // 设置下一个任务的优先级
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BpmButton.complete = function($this, task){
|
||||||
|
$('#status').val(Global.STATUS_AUDIT);
|
||||||
|
};
|
||||||
|
// 表单验证提交事件
|
||||||
|
<% } %>
|
||||||
|
$("#inputForm").validate({
|
||||||
|
submitHandler: function(form){
|
||||||
|
js.ajaxSubmitForm($(form), function(data){
|
||||||
|
js.showMessage(data.message);
|
||||||
|
if(data.result == Global.TRUE){
|
||||||
|
js.closeCurrentTabPage(function(contentWindow){
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
contentWindow.$('#dataGrid').dataGrid('refreshTreeChildren',
|
||||||
|
$('#parentCode').val(), '\${${className}.id}');
|
||||||
|
<% }else{ %>
|
||||||
|
contentWindow.page();
|
||||||
|
<% } %>
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, "json");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
|
||||||
|
// 选择上级节点回调方法
|
||||||
|
function treeselectCallback(id, act, index, layero){
|
||||||
|
if (id == 'parent' && (act == 'ok' || act == 'clear')){
|
||||||
|
// 创建并初始化下一个节点信息,如:排序号、默认值
|
||||||
|
$.get('\${ctx}/${urlPrefix}/createNextNode?parentCode='
|
||||||
|
+$('#parentCode').val(), function(data){
|
||||||
|
$('#treeSort').val(data.treeSort);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
</script>]]>
|
||||||
|
</content>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
|
<template>
|
||||||
|
<name>viewList</name>
|
||||||
|
<filePath>${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
|
||||||
|
<fileName>${className}List.html</fileName>
|
||||||
|
<content><![CDATA[
|
||||||
|
\<% layout('/layouts/default.html', {title: '${functionNameSimple}管理', libs: ['dataGrid']}){ %>
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="box box-main">
|
||||||
|
<div class="box-header">
|
||||||
|
<div class="box-title">
|
||||||
|
<i class="fa icon-notebook"></i> \${text('${functionNameSimple}管理')}
|
||||||
|
</div>
|
||||||
|
<div class="box-tools pull-right">
|
||||||
|
<a href="#" class="btn btn-default" id="btnSearch" title="\${text('查询')}"><i class="fa fa-filter"></i> \${text('查询')}</a>
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
<a href="#" class="btn btn-default" id="btnRefreshTree" title="\${text('刷新')}"><i class="fa fa-refresh"></i> \${text('刷新')}</a>
|
||||||
|
<a href="#" class="btn btn-default" id="btnExpandTreeNode" title="\${text('展开一级')}"><i class="fa fa-angle-double-down"></i> \${text('展开')}</a>
|
||||||
|
<a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="\${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> \${text('折叠')}</a>
|
||||||
|
<% } %>
|
||||||
|
\<% if(hasPermi('${permissionPrefix}:edit')){ %>
|
||||||
|
<a href="\${ctx}/${urlPrefix}/form" class="btn btn-default btnTool" title="\${text('新增${functionNameSimple}')}"><i class="fa fa-plus"></i> \${text('新增')}</a>
|
||||||
|
\<% } %>
|
||||||
|
<a href="#" class="btn btn-default" id="btnSetting" title="\${text('设置')}"><i class="fa fa-navicon"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<% include('/templates/modules/gen/include/searchForm.html'){} %>
|
||||||
|
<table id="dataGrid"></table>
|
||||||
|
<% if(!table.isTreeEntity){ %>
|
||||||
|
<div id="dataGridPage"></div>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
\<% } %>
|
||||||
|
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>]]>
|
||||||
|
</content>
|
||||||
|
</template>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<suspend_validator>false</suspend_validator>
|
<suspend_validator>false</suspend_validator>
|
||||||
<export_setting>
|
<export_setting>
|
||||||
<export_ddl_setting>
|
<export_ddl_setting>
|
||||||
<output_path>db\${module.moduleCode}.sql</output_path>
|
<output_path>db${'\\'}${module.moduleCode}.sql</output_path>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<line_feed>CR+LF</line_feed>
|
<line_feed>CR+LF</line_feed>
|
||||||
<is_open_after_saved>false</is_open_after_saved>
|
<is_open_after_saved>false</is_open_after_saved>
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
</export_ddl_setting>
|
</export_ddl_setting>
|
||||||
<export_excel_setting>
|
<export_excel_setting>
|
||||||
<category_id>null</category_id>
|
<category_id>null</category_id>
|
||||||
<output_path>db\${module.moduleCode}.xls</output_path>
|
<output_path>db${'\\'}${module.moduleCode}.xls</output_path>
|
||||||
<template></template>
|
<template></template>
|
||||||
<template_path></template_path>
|
<template_path></template_path>
|
||||||
<used_default_template_lang>en</used_default_template_lang>
|
<used_default_template_lang>en</used_default_template_lang>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<is_open_after_saved>true</is_open_after_saved>
|
<is_open_after_saved>true</is_open_after_saved>
|
||||||
</export_html_setting>
|
</export_html_setting>
|
||||||
<export_image_setting>
|
<export_image_setting>
|
||||||
<output_file_path>db\${module.moduleCode}.png</output_file_path>
|
<output_file_path>db${'\\'}${module.moduleCode}.png</output_file_path>
|
||||||
<category_dir_path></category_dir_path>
|
<category_dir_path></category_dir_path>
|
||||||
<with_category_image>true</with_category_image>
|
<with_category_image>true</with_category_image>
|
||||||
<is_open_after_saved>true</is_open_after_saved>
|
<is_open_after_saved>true</is_open_after_saved>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<suspend_validator>false</suspend_validator>
|
<suspend_validator>false</suspend_validator>
|
||||||
<export_setting>
|
<export_setting>
|
||||||
<export_ddl_setting>
|
<export_ddl_setting>
|
||||||
<output_path>db\${module.moduleCode}.sql</output_path>
|
<output_path>db${'\\'}${module.moduleCode}.sql</output_path>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<line_feed>CR+LF</line_feed>
|
<line_feed>CR+LF</line_feed>
|
||||||
<is_open_after_saved>false</is_open_after_saved>
|
<is_open_after_saved>false</is_open_after_saved>
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
</export_ddl_setting>
|
</export_ddl_setting>
|
||||||
<export_excel_setting>
|
<export_excel_setting>
|
||||||
<category_id>null</category_id>
|
<category_id>null</category_id>
|
||||||
<output_path>db\${module.moduleCode}.xls</output_path>
|
<output_path>db${'\\'}${module.moduleCode}.xls</output_path>
|
||||||
<template></template>
|
<template></template>
|
||||||
<template_path></template_path>
|
<template_path></template_path>
|
||||||
<used_default_template_lang>en</used_default_template_lang>
|
<used_default_template_lang>en</used_default_template_lang>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<is_open_after_saved>true</is_open_after_saved>
|
<is_open_after_saved>true</is_open_after_saved>
|
||||||
</export_html_setting>
|
</export_html_setting>
|
||||||
<export_image_setting>
|
<export_image_setting>
|
||||||
<output_file_path>db\${module.moduleCode}.png</output_file_path>
|
<output_file_path>db${'\\'}${module.moduleCode}.png</output_file_path>
|
||||||
<category_dir_path></category_dir_path>
|
<category_dir_path></category_dir_path>
|
||||||
<with_category_image>true</with_category_image>
|
<with_category_image>true</with_category_image>
|
||||||
<is_open_after_saved>true</is_open_after_saved>
|
<is_open_after_saved>true</is_open_after_saved>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved. -->
|
||||||
<template>
|
<template>
|
||||||
<name>pom</name>
|
<name>pom</name>
|
||||||
<filePath>${module.moduleCode}</filePath>
|
<filePath>${module.moduleCode}/${module.moduleCode}</filePath>
|
||||||
<fileName>pom.xml</fileName>
|
<fileName>pom.xml</fileName>
|
||||||
<charset></charset>
|
<charset></charset>
|
||||||
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
||||||
@@ -12,41 +12,165 @@
|
|||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-parent</artifactId>
|
<artifactId>jeesite-cloud-parent</artifactId>
|
||||||
<version>${jeesiteVersion}-SNAPSHOT</version>
|
<version>${jeesiteVersion}-SNAPSHOT</version>
|
||||||
<relativePath>../../parent/pom.xml</relativePath>
|
<relativePath>../../../parent/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>jeesite-module-${module.moduleCode}</artifactId>
|
<artifactId>jeesite-cloud-module-${module.moduleCode}</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<name>JeeSite Module ${module.moduleName}</name>
|
<name>JeeSite Cloud Module ${module.moduleName}</name>
|
||||||
<url>http://jeesite.com</url>
|
<url>http://jeesite.com</url>
|
||||||
<inceptionYear>2013-Now</inceptionYear>
|
<inceptionYear>2013-Now</inceptionYear>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
||||||
|
<finalName>web</finalName><!-- war包的名称 -->
|
||||||
|
<start-class>com.jeesite.modules.${@StringUtils.cap(module.moduleCode)}Application</start-class>
|
||||||
|
|
||||||
|
<!-- environment setting -->
|
||||||
|
<eclipse-plugin-download-sources>false</eclipse-plugin-download-sources>
|
||||||
|
<eclipse-plugin-download-javadocs>false</eclipse-plugin-download-javadocs>
|
||||||
|
|
||||||
|
<!-- docker setting -->
|
||||||
|
<docker.run.port>8989:8989</docker.run.port>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 服务发现 -->
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
|
</dependency> -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 配置中心 -->
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-config</artifactId>
|
||||||
|
</dependency> -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 链路追踪服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-zipkin</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 在线文档 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-module-core</artifactId>
|
<artifactId>jeesite-module-swagger</artifactId>
|
||||||
<version>\${project.parent.version}</version>
|
<version>\${project.parent.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 分布式事务
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jeesite</groupId>
|
||||||
|
<artifactId>jeesite-cloud-module-txlcn-client</artifactId>
|
||||||
|
<version>\${project.parent.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jeesite</groupId>
|
||||||
|
<artifactId>jeesite-cloud-module-seata-client</artifactId>
|
||||||
|
<version>\${project.parent.version}</version>
|
||||||
|
</dependency> -->
|
||||||
|
|
||||||
|
<!-- 核心模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jeesite</groupId>
|
||||||
|
<artifactId>jeesite-cloud-module-core-client</artifactId>
|
||||||
|
<version>\${project.parent.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jeesite</groupId>
|
||||||
|
<artifactId>jeesite-cloud-module-${module.moduleCode}-client</artifactId>
|
||||||
|
<version>\${project.parent.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 业务流程
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jeesite</groupId>
|
||||||
|
<artifactId>jeesite-cloud-module-bpm-client</artifactId>
|
||||||
|
<version>\${project.parent.version}</version>
|
||||||
|
</dependency> -->
|
||||||
|
|
||||||
|
<!-- Spring Boot Tomcat
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency> -->
|
||||||
|
|
||||||
|
<!-- 自定义jar依赖包演示
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jeesite</groupId>
|
||||||
|
<artifactId>test-core</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>\${project.basedir}/src/main/webapp/WEB-INF/lib/test-core-1.0.jar</systemPath>
|
||||||
|
</dependency> -->
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>\${finalName}</finalName>
|
||||||
|
<outputDirectory>\${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
|
<!-- Spring Boot -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<!-- <plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
</plugin> -->
|
||||||
|
|
||||||
|
<!-- 打包插件, war包名称不带版本号 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<!-- <packagingExcludes></packagingExcludes>
|
||||||
|
<warSourceExcludes></warSourceExcludes> -->
|
||||||
|
<webappDirectory>\${project.build.directory}/\${project.artifactId}</webappDirectory>
|
||||||
|
<warName>\${finalName}</warName>
|
||||||
|
<archive>
|
||||||
|
<addMavenDescriptor>false</addMavenDescriptor>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Eclipse插件 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-eclipse-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<downloadSources>\${eclipse-plugin-download-sources}</downloadSources>
|
||||||
|
<downloadJavadocs>\${eclipse-plugin-download-javadocs}</downloadJavadocs>
|
||||||
|
<wtpContextName>\${finalName}</wtpContextName>
|
||||||
|
<wtpversion>2.0</wtpversion>
|
||||||
|
<jeeversion>6.0</jeeversion>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
@@ -63,6 +187,25 @@
|
|||||||
<name>JeeSite</name>
|
<name>JeeSite</name>
|
||||||
<url>http://jeesite.com</url>
|
<url>http://jeesite.com</url>
|
||||||
</organization>
|
</organization>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>aliyun-repos</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
<releases><enabled>true</enabled></releases>
|
||||||
|
<snapshots><enabled>false</enabled></snapshots>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>jeesite-repos</id>
|
||||||
|
<url>http://maven.jeesite.net/repository/maven-public</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>aliyun-repos</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
]]>
|
]]>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<name>logback-spring</name>
|
<name>logback-spring</name>
|
||||||
<filePath>${module.moduleCode}/${module.moduleCode}/src/main/resources/config</filePath>
|
<filePath>${module.moduleCode}/${module.moduleCode}/src/main/resources/config</filePath>
|
||||||
<fileName>logback-spring.yml</fileName>
|
<fileName>logback-spring.xml</fileName>
|
||||||
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration debug="false" scan="false">
|
<configuration debug="false" scan="false">
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ else {
|
|||||||
</div>
|
</div>
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ else {
|
|||||||
</div>
|
</div>
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ else {
|
|||||||
</div>
|
</div>
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ else {
|
|||||||
</div>
|
</div>
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% if (@Global.getPropertyToBoolean('error.page.printErrorInfo', 'true')
|
<% if (@Global.getPropertyToBoolean('error.page.printErrorInfo', 'true')
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
if (corpCode != ''){
|
if (corpCode != ''){
|
||||||
js.ajaxSubmit("${ctx}/sys/corpAdmin/switch/"+corpCode, function(data){
|
js.ajaxSubmit("${ctx}/sys/corpAdmin/switch/"+corpCode, function(data){
|
||||||
js.showMessage(data.message);
|
js.showMessage(data.message);
|
||||||
top.location.reload();
|
js.window.location.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
<div class="login-copyright">
|
<div class="login-copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
||||||
href="http://jeesite.com" >JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<div class="login-copyright">
|
<div class="login-copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
||||||
href="http://jeesite.com" >JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
<script>
|
<script>
|
||||||
$('.full-opacity-hover').click(function(){
|
$('.full-opacity-hover').click(function(){
|
||||||
top.location = '${ctx}/switchSkin/' + $(this).data('skin');
|
js.window.location = '${ctx}/switchSkin/' + $(this).data('skin');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#formLayerModel')
|
$('#formLayerModel')
|
||||||
@@ -170,7 +170,7 @@ $('#formLayerModel')
|
|||||||
$('#tabPageModel').iCheck('uncheck');
|
$('#tabPageModel').iCheck('uncheck');
|
||||||
}).on('ifClicked', function(){
|
}).on('ifClicked', function(){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
top.location.reload(true);
|
js.window.location.reload(true);
|
||||||
},500);
|
},500);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ $('#tabPageModel')
|
|||||||
js.cookie('tabPageModel', 'false');
|
js.cookie('tabPageModel', 'false');
|
||||||
}).on('ifClicked', function(){
|
}).on('ifClicked', function(){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
top.location.reload(true);
|
js.window.location.reload(true);
|
||||||
},500);
|
},500);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -714,7 +714,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<footer class="main-footer m0">
|
<footer class="main-footer m0">
|
||||||
<div class="pull-right hidden-xs">当前版本: ${@Global.getConfig('productVersion')}</div>
|
<div class="pull-right hidden-xs">当前版本: ${@Global.getConfig('productVersion')}</div>
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a href="http://jeesite.com">JeeSite</a>
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By
|
||||||
|
<a href="http://jeesite.com" target="_blank">JeeSite</a>
|
||||||
</footer>
|
</footer>
|
||||||
<% } %>
|
<% } %>
|
||||||
<script src="${ctxStatic}/jquery/jquery-ui-sortable-1.12.1.min.js"></script>
|
<script src="${ctxStatic}/jquery/jquery-ui-sortable-1.12.1.min.js"></script>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
<div class="login-copyright">
|
<div class="login-copyright">
|
||||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||||
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
||||||
href="http://jeesite.com" >JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@@ -181,6 +181,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<version>3.2.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<warSourceExcludes>
|
<warSourceExcludes>
|
||||||
WEB-INF/classes/*.lic,
|
WEB-INF/classes/*.lic,
|
||||||
@@ -222,6 +223,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>3.2.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>prepare-package</phase>
|
<phase>prepare-package</phase>
|
||||||
|
|||||||
@@ -483,20 +483,21 @@ shiro:
|
|||||||
# # 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许)
|
# # 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许)
|
||||||
# isAllowExternalSiteIframe: true
|
# isAllowExternalSiteIframe: true
|
||||||
#
|
#
|
||||||
# # 是否允许跨域访问 CORS,如果允许,设置允许的域名,全部域名设置*号,如果不允许,此设置应该为空
|
# # 是否允许跨域访问 CORS,如果允许,设置允许的域名。当设置'*'号全部域名时,accessControlAllowCredentials应该设置为false。
|
||||||
|
# # v4.2.3 开始支持多个域名和模糊匹配,例如:http://*.jeesite.com,http://*.jeesite.net
|
||||||
## accessControlAllowOrigin: http://demo.jeesite.com
|
## accessControlAllowOrigin: http://demo.jeesite.com
|
||||||
## accessControlAllowOrigin: '*'
|
## accessControlAllowOrigin: '*'
|
||||||
#
|
#
|
||||||
# # 允许跨域访问时 CORS,可以使用的方法和标头
|
# # 允许跨域访问时 CORS,可以使用的方法和标头
|
||||||
# accessControlAllowMethods: GET, POST, OPTIONS
|
## accessControlAllowMethods: GET, POST, OPTIONS
|
||||||
# accessControlAllowHeaders: Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With
|
## accessControlAllowHeaders: Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With
|
||||||
#
|
#
|
||||||
# # 是否允许接收跨域的Cookie凭证数据 CORS
|
# # 是否允许接收跨域的Cookie凭证数据 CORS,当设置为true时,accessControlAllowOrigin不能设置为'*'。
|
||||||
## accessControlAllowCredentials: true
|
## accessControlAllowCredentials: false
|
||||||
#
|
#
|
||||||
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF)
|
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
||||||
# allowReferers: http://127.0.0.1,http://localhost
|
## allowReferers: http://127.0.0.1,http://localhost
|
||||||
# allowReferers: ~
|
## allowReferers: ~
|
||||||
#
|
#
|
||||||
# # 是否在登录后生成新的Session(默认false)
|
# # 是否在登录后生成新的Session(默认false)
|
||||||
# isGenerateNewSessionAfterLogin: false
|
# isGenerateNewSessionAfterLogin: false
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
<% if(hasPermi('test:testData:edit')){ %>
|
<% if(hasPermi('test:testData:edit')){ %>
|
||||||
<a href="${ctx}/test/testData/form" class="btn btn-default btnTool" title="新增数据"><i class="fa fa-plus"></i> 新增</a>
|
<a href="${ctx}/test/testData/form" class="btn btn-default btnTool" title="新增数据"><i class="fa fa-plus"></i> 新增</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<a href="${ctx}/demo/dataGrid/stateGrid" class="btn btn-default btnTool" title="统计表样例"><i class="fa fa-hand-lizard-o"></i> 统计表样例</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
@@ -174,6 +175,7 @@ $('#dataGrid').dataGrid({
|
|||||||
}}
|
}}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
shrinkToFit: false, // 是否按百分比自动调整列宽,当列比较多时,开启水平滚动,可设置为false
|
||||||
frozenCols: true, // 启用冻结列,并在colModel中设置frozen:true
|
frozenCols: true, // 启用冻结列,并在colModel中设置frozen:true
|
||||||
showRownum: true, // 是否显示行号,默认true
|
showRownum: true, // 是否显示行号,默认true
|
||||||
showFooter: true, // 是否显示底部合计行,数据载入详见 ajaxSuccess
|
showFooter: true, // 是否显示底部合计行,数据载入详见 ajaxSuccess
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
<% layout('/layouts/default.html', {title: '统计表样例', libs: ['dataGrid']}){ %>
|
||||||
|
<style>
|
||||||
|
.ui-jqgrid tr.jqgrow td {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
.ui-jqgrid .sum-child{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
line-height: 35px;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
}
|
||||||
|
.ui-jqgrid .sum-parent {
|
||||||
|
background-color: #65a1db;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="box box-main">
|
||||||
|
<div class="box-header">
|
||||||
|
<div class="box-title">
|
||||||
|
<i class="fa fa-list-alt"></i> ${text('统计表样例')}
|
||||||
|
</div>
|
||||||
|
<div class="box-tools pull-right">
|
||||||
|
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
|
||||||
|
<a href="${ctx}/psi/wechatUser/form" class="btn btn-default btnTool" title="${text('新增微信用户表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<#form:form id="searchForm" class="form-inline hide" >
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">${text('时间')}:</label>
|
||||||
|
<div class="control-inline width-150">
|
||||||
|
<#form:input path="dateStart" readonly="true" maxlength="20" class="form-control laydate width-datetime"
|
||||||
|
dataFormat="date" />
|
||||||
|
--
|
||||||
|
<#form:input path="dateEnd" readonly="true" maxlength="20" class="form-control laydate width-datetime"
|
||||||
|
dataFormat="date" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">区域选择:</label>
|
||||||
|
<div class="control-inline width-120" >
|
||||||
|
<#form:treeselect id="areaId" title="区域选择"
|
||||||
|
path="areaId" canSelectParent="true" canSelectRoot="true"
|
||||||
|
url="${ctx}/sys/area/treeData?parentCode=0" allowClear="true"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<button type="button" id="search" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||||
|
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||||
|
</div>
|
||||||
|
</#form:form>
|
||||||
|
<table id="dataGrid"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
<script>
|
||||||
|
var dataGridData = {
|
||||||
|
data: [
|
||||||
|
{name:"客户1-1-1",quantity:1,amount:0,return:0,virtual:0,balance:0,parentArea:'营销1部',childArea:'省区1-1'},
|
||||||
|
{name:"客户1-1-2",quantity:0,amount:2,return:0,virtual:0,balance:0,parentArea:'营销1部',childArea:'省区1-1'},
|
||||||
|
{name:"片区合计",quantity:1,amount:2,return:0,virtual:0,balance:0,sumSet:'child',parentArea:'营销1部',childArea:'片区合计'},
|
||||||
|
{name:"大区合计",quantity:1,amount:2,return:0,virtual:0,balance:0,sumSet:'parent',parentArea:'大区合计',childArea:'大区合计'},
|
||||||
|
{name:"客户2-1-1",quantity:0,amount:0,return:0,virtual:0,balance:0,parentArea:'营销2部',childArea:'省区2-1'},
|
||||||
|
{name:"客户2-1-2",quantity:0,amount:0,return:3,virtual:0,balance:0,parentArea:'营销2部',childArea:'省区2-1'},
|
||||||
|
{name:"片区合计",quantity:0,amount:0,return:3,virtual:4,balance:0,sumSet:'child',parentArea:'营销2部',childArea:'片区合计'},
|
||||||
|
{name:"客户2-2-1",quantity:0,amount:0,return:0,virtual:0,balance:0,parentArea:'营销2部',childArea:'省区2-2'},
|
||||||
|
{name:"客户2-2-2",quantity:0,amount:0,return:0,virtual:0,balance:5,parentArea:'营销2部',childArea:'省区2-2'},
|
||||||
|
{name:"片区合计",quantity:0,amount:0,return:0,virtual:0,balance:5,sumSet:'child',parentArea:'营销2部',childArea:'片区合计'},
|
||||||
|
{name:"大区合计",quantity:0,amount:0,return:3,virtual:4,balance:5,sumSet:'parent',parentArea:'大区合计',childArea:'大区合计'}
|
||||||
|
], sum: {quantity:1,amount:2,return:3,virtual:4,balance:5}
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatter(val, obj, row, act) {
|
||||||
|
if (row.sumSet === 'child') {
|
||||||
|
return '<div class="sum-child">' + val + '</div>'
|
||||||
|
} else if (row.sumSet === 'parent') {
|
||||||
|
return '<div class="sum-child sum-parent">' + val + '</div>'
|
||||||
|
} else {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化DataGrid对象
|
||||||
|
$('#dataGrid').dataGrid({
|
||||||
|
searchForm: $("#searchForm"),
|
||||||
|
data: dataGridData.data,
|
||||||
|
datatype: "local", // 设置本地数据
|
||||||
|
columnModel: [
|
||||||
|
{
|
||||||
|
header: '大区', name: 'parentArea', align: 'center', width: 150, sortable: false, formatter: formatter,
|
||||||
|
cellattr: function (rowId, tv, row, cm, val) {
|
||||||
|
if (row.sumSet === 'parent') {
|
||||||
|
return ' colspan=3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: '片区', name: 'childArea', align: 'center', width: 150, sortable: false, formatter: formatter,
|
||||||
|
cellattr: function (rowId, tv, row, cm, val) {
|
||||||
|
if (row.sumSet === 'parent') {
|
||||||
|
return ' style="display:none;'
|
||||||
|
}
|
||||||
|
if (row.sumSet === 'child') {
|
||||||
|
return ' colspan=2'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: '客户', name: 'name', align: 'center', width: 150, sortable: false, formatter: formatter,
|
||||||
|
cellattr: function (rowId, tv, row, cm, val) {
|
||||||
|
if (row.sumSet === 'parent' || row.sumSet === 'child') {
|
||||||
|
return ' style="display:none;'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{header: '数量', name: 'quantity', align: 'center', width: 150, sortable: false, formatter: formatter},
|
||||||
|
{header: '金额', name: 'amount', align: 'center', width: 150, sortable: false, formatter: formatter},
|
||||||
|
{header: '总回款', name: 'return', align: 'center', width: 150, sortable: false, formatter: formatter},
|
||||||
|
{header: '虚拟货款', name: 'virtual', align: 'center', width: 150, sortable: false, formatter: formatter},
|
||||||
|
{header: '最新余额', name: 'balance', align: 'center', width: 150, sortable: false, formatter: formatter}
|
||||||
|
],
|
||||||
|
altRows: false,
|
||||||
|
groupHeaders: {
|
||||||
|
threeLevel: [
|
||||||
|
{startColumnName: 'parentArea', numberOfColumns: 8, titleText: '时间'}
|
||||||
|
],
|
||||||
|
twoLevel: [
|
||||||
|
{startColumnName: 'quantity', numberOfColumns: 2, titleText: '发货', width: 150},
|
||||||
|
{startColumnName: 'return', numberOfColumns: 2, titleText: '回款', width: 150}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
showRownum: true, // 是否显示行号,默认true
|
||||||
|
showFooter: true, // 是否显示底部合计行,数据载入详见 ajaxSuccess
|
||||||
|
// 加载成功后执行事件
|
||||||
|
ajaxSuccess: function (data) {
|
||||||
|
$('#dataGrid').dataGrid('mergeCell', 'parentArea,childArea');
|
||||||
|
$('#dataGrid').dataGrid("footerData", "set", {
|
||||||
|
"parentArea": "<center><em>合计:</em></center>",
|
||||||
|
"quantity": "<em>" + dataGridData.sum.quantity + "</em>",
|
||||||
|
"amount": "<em>" + dataGridData.sum.amount + "</em>",
|
||||||
|
"return": "<em>" + dataGridData.sum.return + "</em>",
|
||||||
|
"virtual": "<em>" + dataGridData.sum.virtual + "</em>",
|
||||||
|
"balance": "<em>" + dataGridData.sum.balance + "</em>",
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -285,7 +285,14 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
columnModel: [
|
columnModel: [
|
||||||
{header:'状态', name:'status', editable:true, hidden:true},
|
{header:'状态', name:'status', editable:true, hidden:true},
|
||||||
{header:'主键', name:'id', editable:true, hidden:true},
|
{header:'主键', name:'id', editable:true, hidden:true},
|
||||||
{header:'排序号', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
|
{header:'排序号', name:'testSort', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits',
|
||||||
|
// 'data-inputmask-alias':"money", 'data-inputmask': "'digits':'2'",
|
||||||
|
dataInit: function(element){
|
||||||
|
// $(element).addClass('inputmask').attr('data-inputmask-alias', "money").attr('data-inputmask', "'digits':'2'").inputmask()
|
||||||
|
$(element).addClass('inputmask').attr({'data-inputmask-alias': "money", 'data-inputmask': "'digits':'2'"}).inputmask()
|
||||||
|
// $(element).inputmask();
|
||||||
|
}
|
||||||
|
}},
|
||||||
{header:'父表主键', name:'testData.id', editable:true, hidden:true},
|
{header:'父表主键', name:'testData.id', editable:true, hidden:true},
|
||||||
{header:'单行文本', name:'testInput', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
{header:'单行文本', name:'testInput', width:150, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||||
{header:'多行文本', name:'testTextarea', width:150, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
|
{header:'多行文本', name:'testTextarea', width:150, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<% layout('/layouts/default.html', {title: '文书内容', libs: ['validate','dataGrid','fileupload']}){ %>
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="box box-main">
|
||||||
|
<button type="button" class="btn btn-sm btn-primary" onclick="openEdit(1)" id="submitBtn"><i class="fa fa-arrow-right"></i> ${text('时间弹窗')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
<script>
|
||||||
|
function openEdit(docId){
|
||||||
|
js.layer.open({
|
||||||
|
type: 1,
|
||||||
|
area: ['400px'],
|
||||||
|
title: '${text("审核审批时间修改")}',
|
||||||
|
resize: false,
|
||||||
|
scrollbar: true,
|
||||||
|
content: js.template('importTpl'),
|
||||||
|
success: function(layero, index){
|
||||||
|
layero.find('.laydate').on('click', function(e){
|
||||||
|
var id = $(this).attr('id');
|
||||||
|
top.laydate.render({
|
||||||
|
elem: '#'+id, show: true, closeStop: '#'+id
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
btn: ['<i class="fa fa-check"></i> ${text("确认")}',
|
||||||
|
'<i class="fa fa-remove"></i> ${text("关闭")}'],
|
||||||
|
btn1: function(index, layero){
|
||||||
|
var form = {
|
||||||
|
inputForm: layero.find('#inputDateForm'),
|
||||||
|
shDate: layero.find('#shDate').val(),
|
||||||
|
spDate: layero.find('#spDate').val()
|
||||||
|
};
|
||||||
|
if (docId == '' || form.shDate == '' ||form.spDate == ''){
|
||||||
|
js.showMessage("${text('请确认需要修改的内容')}", null, 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script id="importTpl" type="text/template">//<!--
|
||||||
|
<form id="inputDateForm" action="${ctx}/doc/base/docBase/updateDate" method="post" enctype="multipart/form-data"
|
||||||
|
class="form-horizontal mt20 mb10" style="overflow:auto;max-height:200px;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-sm-4" title="">
|
||||||
|
<span class="required">*</span> ${text('审核时间')}:<i class="fa icon-question hide"></i>
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<#form:input name="shDate" dataFormat="yyyy-MM-dd" readonly="true" maxlength="20" class="form-control laydate width-250"
|
||||||
|
data-type="date" lay-key="1"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-sm-4" title="">
|
||||||
|
<span class="required">*</span> ${text('审批时间')}:<i class="fa icon-question hide"></i>
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<#form:input name="spDate" dataFormat="yyyy-MM-dd" readonly="true" maxlength="20" class="form-control laydate width-250"
|
||||||
|
data-type="date" lay-key="2"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
//--></script>
|
||||||
Reference in New Issue
Block a user