Compare commits

...

42 Commits

Author SHA1 Message Date
thinkgem
44ca71d681 5.9.2 2024-11-23 09:56:20 +08:00
thinkgem
6ecd94b954 update 2024-11-21 09:49:23 +08:00
thinkgem
cba1010a45 更新注册提示信息 2024-11-13 17:17:07 +08:00
thinkgem
9f1ebcd8e5 切换系统时,清除当前岗位和角色状态 2024-11-12 10:54:58 +08:00
thinkgem
998c3204a9 设备信息字段 device_info 长度调整为 4000 2024-11-11 17:12:05 +08:00
thinkgem
ac314d9070 登录后重定向地址验证,如果是非法地址,则指定默认的登录成功地址 2024-11-07 17:53:12 +08:00
thinkgem
7826863bb5 update README.md 2024-11-07 16:13:02 +08:00
thinkgem
4c96681055 新建 mini 迷你服务工具,最小化启动项目 2024-11-07 16:07:44 +08:00
thinkgem
7ca01a354a update version 2024-11-07 15:28:00 +08:00
thinkgem
71771421d5 Vue登录界面useCorpModel更改为loginCodeCorpUnique 2024-11-07 15:15:39 +08:00
thinkgem
5f664bd84b 新增 窗口右上角的头像下拉菜单,切换当前用户所属岗位,并联动切换当前菜单权限 2024-11-07 10:26:04 +08:00
thinkgem
5ea41881de 提升登录性能;支持普通用户升级为超管用户。 2024-11-07 10:22:36 +08:00
thinkgem
6e2843869d 优化 MenuDao.xml 接口 findByUserCode 替换为 findByRoleCodes 升级时注意 2024-11-07 10:19:30 +08:00
thinkgem
6a0ebd6c2d 新增 当前用户 user.getRoleList() 支持返回 岗位关联角色数据 2024-11-07 10:19:04 +08:00
thinkgem
48bd4778e6 新增 岗位关联角色(用户->岗位->角色)权限控制,可通过 user.postRolePermi=true 参数开启 2024-11-07 10:17:51 +08:00
thinkgem
d7ada6e4e6 增加岗位切换接口;优化登录菜单权限查询,直接通过当前用户角色查询,减少联表,提升查询效率。 2024-11-07 10:15:20 +08:00
thinkgem
f8a008d88b 优化 增加岗位保存时清理关联的用户缓存 2024-11-07 10:14:37 +08:00
thinkgem
7bfb458981 优化 超级管理员作为普通员工时的角色数据查询,允许修改超级管理员员工信息,不允许停用禁用删除超管 2024-11-07 10:12:46 +08:00
thinkgem
a2ffa1e47a 增加手机端单表代码生成模板 2024-11-05 11:25:53 +08:00
thinkgem
80b397e9e4 quartz 2.4.0.rc3 2024-11-04 18:14:03 +08:00
thinkgem
b008b0c956 修正代码生成时,子表文件生成目录不对问题,vue日期类型不匹配问题 2024-11-04 17:52:19 +08:00
thinkgem
d79339b891 jackson 2.18.1 2024-11-04 17:36:24 +08:00
thinkgem
81acccfe66 优化 mvc 接受字段类型不一致信息显示,方便调试 2024-11-01 19:59:56 +08:00
thinkgem
fe6004d81d 调整代码生成模板目录 2024-11-01 10:44:10 +08:00
thinkgem
e404d2652d 优化表单内表格的行高和边距 2024-10-28 21:27:42 +08:00
thinkgem
827d461437 update 2024-10-25 19:07:25 +08:00
thinkgem
a2da4f095b 5.9.1 2024-10-21 22:34:17 +08:00
thinkgem
302eb47b83 update app name 2024-10-21 14:12:03 +08:00
thinkgem
4fa6225017 logback 1.2.13 2024-10-14 21:16:38 +08:00
thinkgem
68058f948f spring 5.3.39 2024-10-10 20:48:58 +08:00
thinkgem
fc59e3a7aa 编辑表格中被隐藏的旧数据行控件忽略前端校验 2024-10-10 09:03:20 +08:00
thinkgem
d1cd3ad5ad update 2024-10-08 16:34:03 +08:00
thinkgem
213834810c 代码生成模板新增vue子表独立组件的生成 2024-10-08 14:13:37 +08:00
thinkgem
6d381b31da 代码生成支持带减号的工程模块名生成工程和微服务工程 2024-10-08 14:07:22 +08:00
thinkgem
5e55b5f4b3 驼峰命名法工具增加减号替换 2024-10-08 14:04:51 +08:00
thinkgem
e3dc77b75a 增加启动完成提示信息日志 2024-10-08 14:03:15 +08:00
thinkgem
58b22924dd 生成前端路径更改为 Vue 前端路径,仅用于分离端的代码生成路径。 2024-09-27 15:09:40 +08:00
thinkgem
f7cdda05d1 代码生成模板新增classNameSimple参数,不带模块名的类名。子表List字段名不带模块名。 2024-09-27 15:08:29 +08:00
thinkgem
cb52f25931 启动日志中显示 tomcat 版本号 2024-09-24 14:02:29 +08:00
thinkgem
5b9a7c1d2c 新增监控开关参数 服务器监控 state.server 缓存监控 state.cache 数据监控 state.druid 2024-09-23 13:32:53 +08:00
thinkgem
c295b87f35 文件预览列表增加文件名返回参数 2024-09-23 12:02:28 +08:00
thinkgem
d6eecc1c56 update upbw html 2024-09-22 19:28:28 +08:00
149 changed files with 2566 additions and 526 deletions

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.0-SNAPSHOT</version>
<version>5.9.2-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

View File

@@ -28,6 +28,8 @@ public class ExceptionUtils {
ex = (Throwable) request.getAttribute("exception");
} else if (request.getAttribute(RequestDispatcher.ERROR_EXCEPTION) != null) {
ex = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
} else if (request.getAttribute("org.springframework.web.servlet.DispatcherServlet.EXCEPTION") != null) {
ex = (Throwable) request.getAttribute("org.springframework.web.servlet.DispatcherServlet.EXCEPTION");
}
return ex;
}

View File

@@ -26,6 +26,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
public static final String COLON = ":";
public static final String TILDE = "~";
public static final String UNDERLINE = "_";
public static final String MINUS = "-";
/**
* 分隔字符串(逗号分隔)
@@ -284,7 +285,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
boolean upperCase = false;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == UNDERLINE.charAt(0)) {
if (c == UNDERLINE.charAt(0) || c == MINUS.charAt(0)) {
upperCase = i != 1; // 不允许第二个字符是大写
} else if (upperCase) {
sb.append(Character.toUpperCase(c));

View File

@@ -14,6 +14,7 @@ import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.common.mapper.XmlMapper;
import org.apache.commons.lang3.Validate;
import org.springframework.http.MediaType;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -57,6 +58,11 @@ public class ServletUtils {
// 是否打印错误信息参数到视图页面(生产环境关闭)
private static final Boolean PRINT_ERROR_INFO = PROPS.getPropertyToBoolean("error.page.printErrorInfo", "true");
// 允许重定向的地址不设置为全部允许设置this只允许本项目内部跳转多个用逗号隔开例如this,http://*.jeesite.com
private static final String[] ALLOW_REDIRECTS = PROPS.getPropertyToArray("shiro.allowRedirects", "");
private static final Boolean SCHEME_HTTPS = PROPS.getPropertyToBoolean("server.schemeHttps", "false");
private static final AntPathMatcher PATH_MATCHER = new AntPathMatcher();
/**
* 获取当前请求对象
* web.xml: <listener><listener-class>
@@ -384,10 +390,15 @@ public class ServletUtils {
}
/**
* 获取请求的域名(含端口)
* 获取当前请求的域名(含端口)
* @author ThinkGem
*/
public static String getRequestDomain(String url) {
public static String getThisDomain(HttpServletRequest request) {
String url = request.getRequestURL().toString();
String scheme = StringUtils.substringBefore(url, "://");
if (SCHEME_HTTPS && StringUtils.equals(scheme, "http")) {
scheme = "https";
}
String domain = StringUtils.substringAfter(url, "://");
if (StringUtils.contains(domain, "/")) {
domain = StringUtils.substringBefore(domain, "/");
@@ -395,6 +406,28 @@ public class ServletUtils {
return scheme + "://" + domain;
}
/**
* 验证地址是否允许重定向
* @author ThinkGem
*/
public static boolean isAllowRedirects(HttpServletRequest request, String url) {
if (ALLOW_REDIRECTS == null || ALLOW_REDIRECTS.length == 0) {
return true;
}
boolean allow = false;
for (String pattern : ALLOW_REDIRECTS) {
String p = StringUtils.trim(pattern);
if ("this".equals(p)) {
p = getThisDomain(request);
}
if (PATH_MATCHER.match(p + "/**", url)){
allow = true;
break;
}
}
return allow;
}
/**
* 获得请求参数值
*/

View File

@@ -235,3 +235,6 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:46px!important;}
.ui-jqgrid .ui-jqgrid-htable th div {padding:15px 0 15px 2px;}
.ui-jqgrid tr.jqgrow td {height: 49px;}
.table-form .ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:36px!important;}
.table-form .ui-jqgrid .ui-jqgrid-htable th div {padding:9px 0 8px 2px;}
.table-form .ui-jqgrid tr.jqgrow td {height: 39px;}

View File

@@ -235,3 +235,6 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:46px!important;}
.ui-jqgrid .ui-jqgrid-htable th div {padding:15px 0 15px 2px;}
.ui-jqgrid tr.jqgrow td {height: 49px;}
.table-form .ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:36px!important;}
.table-form .ui-jqgrid .ui-jqgrid-htable th div {padding:9px 0 8px 2px;}
.table-form .ui-jqgrid tr.jqgrow td {height: 39px;}

View File

@@ -296,6 +296,9 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:46px!important;}
.ui-jqgrid .ui-jqgrid-htable th div {padding:15px 0 15px 2px;}
.ui-jqgrid tr.jqgrow td {height: 49px;}
.table-form .ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:36px!important;}
.table-form .ui-jqgrid .ui-jqgrid-htable th div {padding:9px 0 8px 2px;}
.table-form .ui-jqgrid tr.jqgrow td {height: 39px;}
.ui-jqgrid tr.jqgroup td, .ui-jqgrid tr.footrow td, .ui-jqgrid tr.jqfoot td {background:#323232;}
.ui-jqgrid .actions .moreItems {background:#1a1a1a;border-color:#3c3c3c;box-shadow:none;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -20,11 +20,11 @@ span{display:block;font-size:12px;line-height:12px;}
<p>您正在使用 Internet Explorer 的过期版本IE6、IE7、IE8 内核的浏览器)。这意味着在升级浏览器前,您将无法继续访问。</p>
<hr>
<h2>为什么会出现这个页面?</h2>
<p>如果您不知道升级浏览器是什么意思请请教一些熟练电脑操作的朋友。如果您使用的不是IE6/7/8而是360、QQ、搜狗等双核浏览器出现这个页面可能是您切换到了兼容模式<strong style="color:#f00;">切换到极速模式</strong>下,如果还不行请升级至最新版浏览器。</p>
<p>如果您不知道升级浏览器是什么意思请请教一些熟练电脑操作的朋友。如果您使用的不是Internet Explorer而是360、QQ、搜狗等双核浏览器出现这个页面可能是您切换到了兼容模式<strong style="color:#f00;">切换到极速模式</strong>下,如果还不行请升级至最新版浏览器。</p>
<hr>
<h2>请注意微软Microsoft Windows XP 及 IE6、IE7、IE8、IE9、IE10 的支持已经结束</h2>
<p>自 2014 年 4 月 8 日起微软Microsoft不再为 Windows XP 和 Internet Explorer 8 及以下版本提供相应支持和更新。如果您继续使用这些,您将可能受到病毒、间谍软件和其他恶意软件的攻击,无法确保个人信息的安全。请参阅 <a href="http://windows.microsoft.com/zh-cn/windows/end-support-help">Microsoft 关于 Windows XP 支持已经结束的说明</a></p>
<p>尽管 Internet Explorer 11 将于 2022 年 6 月 15 日也停止了支持。但您也可以继续使用 <a href="http://windows.microsoft.com/zh-cn/internet-explorer/download-ie"> Internet Explorer 11 浏览器</a></p>
<h2>请注意微软Microsoft对 Windows XP、Vista、7、8、8.1 及 Internet Explorer 的支持已经结束</h2>
<p>微软Microsoft不再为已经结束的版本提供相应支持和更新。如果您继续使用这些,您将可能受到病毒、间谍软件和其他恶意软件的攻击,无法确保个人信息的安全。请参阅 <a href="http://windows.microsoft.com/zh-cn/windows/end-support-help">Windows XP 支持已经结束的说明</a></p>
<p>于 2022 年 6 月 15 日,微软对 Internet Explorer 11 的支持也已结束。请参阅 <a href="http://windows.microsoft.com/zh-cn/internet-explorer/download-ie"> Internet Explorer 浏览器下载</a></p>
<hr>
<h2>您可以选择更先进的浏览器</h2>
<p>推荐使用以下浏览器的最新版本。如果您的电脑已有以下浏览器的最新版本则直接使用该浏览器访问 <b id="url"></b>即可。</p>
@@ -32,7 +32,7 @@ span{display:block;font-size:12px;line-height:12px;}
<li><img src="img/chrome360.jpg"><a href="http://chrome.360.cn/"> 360极速浏览器<span>360 Chrome</span></a></li>
<li><img src="img/chrome.jpg"><a href="http://www.google.cn/intl/zh-CN/chrome/browser/desktop/index.html"> 谷歌浏览器<span>Google Chrome</span></a></li>
<li><img src="img/firefox.jpg"><a href="http://www.firefox.com.cn/download/"> 火狐浏览器<span>Mozilla Firefox</span></a></li>
<li><img src="img/ie.jpg"><a href="https://www.microsoft.com/zh-cn/edge"> Edge 浏览器<span>Microsoft Edge</span></a></li>
<li><img src="img/edge.png"><a href="https://www.microsoft.com/zh-cn/edge"> Edge 浏览器<span>Microsoft Edge</span></a></li>
</ul><div class="clean"></div></div>
<hr><br/>
<script>

View File

@@ -329,7 +329,7 @@
</word>
<word>
<id>a63e3fda50530388ba263296184d8a6919a75791</id>
<length>1000</length>
<length>4000</length>
<decimal>null</decimal>
<array>false</array>
<array_dimension>null</array_dimension>

View File

@@ -16,7 +16,7 @@ CREATE TABLE js_app_comment
update_date timestamp NOT NULL,
remarks vargraphic(500),
create_by_name varchar(200),
device_info varchar(1000),
device_info varchar(4000),
reply_date date,
reply_content vargraphic(500),
reply_user_code varchar(64),

View File

@@ -16,7 +16,7 @@ CREATE TABLE js_app_comment
update_date datetime NOT NULL,
remarks varchar(500),
create_by_name varchar(200),
device_info varchar(1000),
device_info varchar(4000),
reply_date date,
reply_content varchar(500),
reply_user_code varchar(64),

View File

@@ -16,7 +16,7 @@ CREATE TABLE [js_app_comment]
[update_date] datetime NOT NULL,
[remarks] nvarchar(500),
[create_by_name] varchar(200),
[device_info] varchar(1000),
[device_info] varchar(4000),
[reply_date] date,
[reply_content] nvarchar(500),
[reply_user_code] varchar(64),

View File

@@ -17,7 +17,7 @@ CREATE TABLE js_app_comment
update_date datetime NOT NULL COMMENT '更新时间',
remarks varchar(500) COMMENT '备注信息',
create_by_name varchar(200) COMMENT '提问人员姓名',
device_info varchar(1000) COMMENT '设备信息',
device_info varchar(4000) COMMENT '设备信息',
reply_date date COMMENT '回复时间',
reply_content varchar(500) COMMENT '回复意见',
reply_user_code varchar(64) COMMENT '回复人员',

View File

@@ -16,7 +16,7 @@ CREATE TABLE js_app_comment
update_date timestamp NOT NULL,
remarks nvarchar2(500),
create_by_name varchar2(200),
device_info varchar2(1000),
device_info varchar2(4000),
reply_date date,
reply_content nvarchar2(500),
reply_user_code varchar2(64),

View File

@@ -16,7 +16,7 @@ CREATE TABLE js_app_comment
update_date timestamp NOT NULL,
remarks varchar(500),
create_by_name varchar(200),
device_info varchar(1000),
device_info varchar(4000),
reply_date date,
reply_content varchar(500),
reply_user_code varchar(64),

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.0-SNAPSHOT</version>
<version>5.9.2-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -4,18 +4,16 @@
*/
package com.jeesite.modules.app.entity;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* APP意见反馈Entity
* @author ThinkGem
@@ -84,7 +82,7 @@ public class AppComment extends DataEntity<AppComment> {
this.contact = contact;
}
@Size(min=0, max=1000, message="设备信息长度不能超过 1000 个字符")
@Size(min=0, max=4000, message="设备信息长度不能超过 4000 个字符")
public String getDeviceInfo() {
return deviceInfo;
}

View File

@@ -16,7 +16,7 @@ CREATE TABLE ${_prefix}app_comment
update_date timestamp NOT NULL,
remarks vargraphic(500),
create_by_name varchar(200),
device_info varchar(1000),
device_info varchar(4000),
reply_date date,
reply_content vargraphic(500),
reply_user_code varchar(64),

View File

@@ -16,7 +16,7 @@ CREATE TABLE ${_prefix}app_comment
update_date datetime NOT NULL,
remarks varchar(500),
create_by_name varchar(200),
device_info varchar(1000),
device_info varchar(4000),
reply_date date,
reply_content varchar(500),
reply_user_code varchar(64),

View File

@@ -16,7 +16,7 @@ CREATE TABLE [${_prefix}app_comment]
[update_date] datetime NOT NULL,
[remarks] nvarchar(500),
[create_by_name] varchar(200),
[device_info] varchar(1000),
[device_info] varchar(4000),
[reply_date] date,
[reply_content] nvarchar(500),
[reply_user_code] varchar(64),

View File

@@ -17,7 +17,7 @@ CREATE TABLE ${_prefix}app_comment
update_date datetime NOT NULL COMMENT '更新时间',
remarks varchar(500) COMMENT '备注信息',
create_by_name varchar(200) COMMENT '提问人员姓名',
device_info varchar(1000) COMMENT '设备信息',
device_info varchar(4000) COMMENT '设备信息',
reply_date date COMMENT '回复时间',
reply_content varchar(500) COMMENT '回复意见',
reply_user_code varchar(64) COMMENT '回复人员',

View File

@@ -16,7 +16,7 @@ CREATE TABLE ${_prefix}app_comment
update_date timestamp NOT NULL,
remarks nvarchar2(500),
create_by_name varchar2(200),
device_info varchar2(1000),
device_info varchar2(4000),
reply_date date,
reply_content nvarchar2(500),
reply_user_code varchar2(64),

View File

@@ -16,7 +16,7 @@ CREATE TABLE ${_prefix}app_comment
update_date timestamp NOT NULL,
remarks varchar(500),
create_by_name varchar(200),
device_info varchar(1000),
device_info varchar(4000),
reply_date date,
reply_content varchar(500),
reply_user_code varchar(64),

View File

@@ -20,4 +20,6 @@
5.7.1
5.8.0
5.8.1
5.9.0
5.9.0
5.9.1
5.9.2

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.0-SNAPSHOT</version>
<version>5.9.2-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -28,4 +28,6 @@
5.7.1
5.8.0
5.8.1
5.9.0
5.9.0
5.9.1
5.9.2

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.0-SNAPSHOT</version>
<version>5.9.2-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -17,13 +17,8 @@ import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
import com.jeesite.common.utils.SpringUtils;
import com.jeesite.common.web.CookieUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.sys.entity.Log;
import com.jeesite.modules.sys.entity.Role;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.utils.CorpUtils;
import com.jeesite.modules.sys.utils.LogUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import com.jeesite.modules.sys.utils.ValidCodeUtils;
import com.jeesite.modules.sys.entity.*;
import com.jeesite.modules.sys.utils.*;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.IncorrectCredentialsException;
@@ -424,8 +419,8 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
Global.setLang((String)paramMap.get("lang"), request, response);
}
data.put("demoMode", Global.isDemoMode());
data.put("useCorpModel", Global.isUseCorpModel()
&& Global.getConfigToBoolean("user.loginCodeCorpUnique", "false"));
data.put("useCorpModel", Global.isUseCorpModel());
data.put("loginCodeCorpUnique", Global.getConfigToBoolean("user.loginCodeCorpUnique", "false"));
data.put("title", Global.getProperty("productName"));
data.put("company", Global.getProperty("companyName"));
data.put("version", Global.getProperty("productVersion"));
@@ -452,6 +447,7 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
data.put("msgEnabled", Global.getPropertyToBoolean("msg.enabled", "false"));
data.put("sysCode", session.getAttribute("sysCode"));
data.put("roleCode", session.getAttribute("roleCode"));
data.put("postCode", session.getAttribute("postCode"));
data.put("title", Global.getProperty("productName"));
data.put("company", Global.getProperty("companyName"));
data.put("version", Global.getProperty("productVersion"));
@@ -471,6 +467,21 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
}
}
data.put("roleList", roleList);
List<Map<String, Object>> postList = ListUtils.newArrayList();
if (Global.getConfigToBoolean("user.postRolePermi", "false")
&& User.USER_TYPE_EMPLOYEE.equals(user.getUserType())) {
Employee employee = user.getRefObj();
for (EmployeePost ep : EmpUtils.getEmployeePostList(employee.getEmpCode())){
Post post = ep.getPost();
if (post != null) {
Map<String, Object> postMap = MapUtils.newHashMap();
postMap.put("postCode", post.getPostCode());
postMap.put("postName", post.getPostName());
postList.add(postMap);
}
}
}
data.put("postList", postList);
data.put("desktopUrl", desktopUrl != null ? desktopUrl : Global.getConfig("sys.index.desktopUrl"));
return data;
}

View File

@@ -25,7 +25,7 @@ import java.io.IOException;
* @version 2017年11月30日
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(name="state.enabled", havingValue="true", matchIfMissing=true)
@ConditionalOnProperty(name={"state.enabled","state.druid"}, havingValue="true", matchIfMissing=true)
public class DruidStatConfig {
/**
@@ -43,7 +43,7 @@ public class DruidStatConfig {
bean.addUrlPatterns("/*");
return bean;
}
/**
* 注册DruidServlet
*/

View File

@@ -58,7 +58,9 @@ public class UserfilesController extends BaseController {
request.setAttribute("fileUrl", fileUrl); // 文件访问地址
request.setAttribute("fileUri", fileUri); // 文件下载地址fileDown
request.setAttribute("filePath", filePath); // 文件相对路径或文件名
request.setAttribute("fileUrls", request.getParameter("urls")); // 前后照片列表
request.setAttribute("fileUrls", request.getParameter("urls")); // 文件地址列表
request.setAttribute("fileNames", request.getParameter("names")); // 文件名称列表
request.setAttribute("imageFlag", request.getParameter("image")); // 是否图片控件
request.setAttribute(RequestDispatcher.FORWARD_REQUEST_URI, previewUrl);
request.getRequestDispatcher(previewUrl).forward(request, response);
return null;

View File

@@ -24,6 +24,7 @@ import com.jeesite.common.mybatis.annotation.Table;
columns={
@Column(name="role_code", attrName="roleCode", label="角色编码", isPK=true),
@Column(name="role_name", attrName="roleName", label="角色名称"),
@Column(name="status", attrName="status", label="角色状态"),
})
}, orderBy=""
)

View File

@@ -6,6 +6,7 @@ package com.jeesite.modules.sys.service.support;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.sys.dao.EmployeeDao;
import com.jeesite.modules.sys.dao.EmployeeOfficeDao;
@@ -107,6 +108,12 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
public List<EmployeePost> findEmployeePostList(Employee employee){
EmployeePost employeePost = new EmployeePost();
employeePost.setEmpCode(employee.getEmpCode());
if (employee.getDataMap() != null) {
String a = (String)employee.getDataMap().get("loadJoinTableAlias");
if (StringUtils.isNotBlank(a)) {
employeePost.sqlMap().loadJoinTableAlias(a);
}
}
return employeePostDao.findList(employeePost);
}

View File

@@ -9,13 +9,14 @@ import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.service.CrudService;
import com.jeesite.common.utils.PageUtils;
import com.jeesite.modules.sys.dao.PostDao;
import com.jeesite.modules.sys.dao.PostRoleDao;
import com.jeesite.modules.sys.entity.Post;
import com.jeesite.modules.sys.entity.PostRole;
import com.jeesite.modules.sys.entity.Role;
import com.jeesite.modules.sys.entity.*;
import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.service.PostService;
import com.jeesite.modules.sys.utils.CorpUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@@ -31,6 +32,8 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
@Autowired
private PostRoleDao postRoleDao;
@Autowired
private EmpUserService empUserService;
/**
* 查询岗位
@@ -101,12 +104,13 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
postRoleDao.insertBatch(list, null);
}
}
clearCache(post);
}
/**
* 岗位编码生成规则
*/
public void genId(Role entity, String viewCode){
public void genId(Post entity, String viewCode){
if (StringUtils.isNotBlank(viewCode)){
// 如果是租户模式,并且当前租户不是默认租户的时候,增加租户前缀防止编码重复
if (Global.isUseCorpModel() && !CorpUtils.DEFAULT_CORP_CODE.equals(CorpUtils.getCurrentCorpCode())){
@@ -134,6 +138,21 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
public void delete(Post post) {
post.sqlMap().markIdDelete();
super.delete(post);
clearCache(post);
}
/**
* 根据岗位清理缓存
*/
protected void clearCache(Post post){
// 清除该岗位下所有的用户缓存
EmpUser where = new EmpUser();
where.setCodes(new String[]{ post.getPostCode() });
PageUtils.findList(where, null, e -> {
List<EmpUser> userList = empUserService.findUserListByPostCodes((EmpUser)e);
userList.forEach(UserUtils::clearCache);
return !userList.isEmpty();
});
}
}

View File

@@ -5,6 +5,7 @@
package com.jeesite.modules.sys.utils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.collect.SetUtils;
import com.jeesite.common.lang.ObjectUtils;
import com.jeesite.common.lang.StringUtils;
@@ -325,6 +326,19 @@ public class EmpUtils {
});
return list.toArray(new String[list.size()]);
}
/**
* 根据员工编号,获取员工岗位(返回岗位编码和名称)
* @param empCode
* @return
*/
public static List<EmployeePost> getEmployeePostList(String empCode){
Employee employee = new Employee();
employee.setEmpCode(empCode);
employee.setDataMap(MapUtils.newHashMap());
employee.getDataMap().put("loadJoinTableAlias", "p");
return Static.employeeService.findEmployeePostList(employee);
}
/**
* 清除指定用户缓存不包括改用的SESSION缓存

View File

@@ -493,7 +493,7 @@ public class AccountController extends BaseController{
// 一同验证保存的用户名和验证码是否正确(如果只校验验证码,不验证用户名,则会有获取验证码后修改用户名的漏洞)
if (!(loginCode != null && loginCode.equals(user.getLoginCode()))){
return renderResult(Global.FALSE, text("非法操作"));
return renderResult(Global.FALSE, text("请先获取验证码"));
}
// 验证码是否超时

View File

@@ -6,6 +6,7 @@ package com.jeesite.modules.sys.web;
import com.fasterxml.jackson.annotation.JsonView;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.shiro.filter.FormFilter;
@@ -15,8 +16,10 @@ import com.jeesite.common.web.BaseController;
import com.jeesite.common.web.CookieUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.sys.entity.Menu;
import com.jeesite.modules.sys.entity.PostRole;
import com.jeesite.modules.sys.entity.Role;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.service.PostService;
import com.jeesite.modules.sys.utils.PwdUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import io.swagger.annotations.Api;
@@ -26,6 +29,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -48,7 +52,10 @@ import java.util.Map;
@RequestMapping(value = "${adminPath}")
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
public class LoginController extends BaseController{
@Autowired
private PostService postService;
/**
* 登录页面
*/
@@ -187,11 +194,8 @@ public class LoginController extends BaseController{
return null;
}
// 获取当前会话对象,并返回一些数据
// 如果是登录操作,则初始化一些登录参数
Session session = UserUtils.getSession();
model.addAllAttributes(FormFilter.getLoginSuccessData(request, response, user, session));
// 是否是登录操作
boolean isLogin = Global.TRUE.equals(session.getAttribute(BaseAuthorizingRealm.IS_LOGIN_OPER));
if (isLogin){
// 获取后接着清除,防止下次获取仍然认为是登录状态
@@ -224,20 +228,18 @@ public class LoginController extends BaseController{
}
}
// 获取当前会话对象,并返回一些数据
if (!StringUtils.equals(request.getParameter("__be"), Global.YES)) {
model.addAllAttributes(FormFilter.getLoginSuccessData(request, response, user, session));
}
// 获取登录成功后跳转的页面
String successUrl = request.getParameter("__url");
if (StringUtils.isBlank(successUrl)){
successUrl = (String)request.getAttribute("__url");
}
if (StringUtils.contains(successUrl, "://")){
String ctxPath = Global.getCtxPath();
String domain = ServletUtils.getRequestDomain(successUrl);
successUrl = StringUtils.substring(successUrl, domain.length());
if (StringUtils.startsWith(successUrl, ctxPath)) {
successUrl = StringUtils.substringAfter(successUrl, ctxPath);
}
}
if (StringUtils.isBlank(successUrl)){
// 登录后重定向地址验证,如果是非法地址,则指定默认的登录成功地址
if (!ServletUtils.isAllowRedirects(request, successUrl) || StringUtils.isBlank(successUrl)){
successUrl = Global.getProperty("shiro.successUrl");
}
@@ -361,7 +363,7 @@ public class LoginController extends BaseController{
}
/**
* 切换系统菜单(仅超级管理员有权限
* 切换系统菜单(菜单归属子系统
*/
@RequiresPermissions("user")
@RequestMapping(value = "switch/{sysCode}")
@@ -372,6 +374,9 @@ public class LoginController extends BaseController{
}else{
session.removeAttribute("sysCode");
}
// 切换系统时,清除当前岗位和角色状态
session.removeAttribute("postCode");
session.removeAttribute("roleCode");
UserUtils.removeCache(UserUtils.CACHE_AUTH_INFO+"_"+session.getId());
if (ServletUtils.isAjaxRequest(request)) {
return renderResult(Global.TRUE, text("子系统切换成功"));
@@ -380,7 +385,7 @@ public class LoginController extends BaseController{
}
/**
* 切换角色菜单(仅超级管理员有权限
* 切换角色菜单(用户->角色
*/
@RequiresPermissions("user")
@RequestMapping(value = {"switchRole","switchRole/{roleCode}"})
@@ -397,6 +402,39 @@ public class LoginController extends BaseController{
}
return REDIRECT + adminPath + "/index";
}
/**
* 切换岗位菜单(用户->岗位->角色v4.9.2
*/
@RequiresPermissions("user")
@RequestMapping(value = {"switchPost","switchPost/{postCode}"})
public String switchPost(@PathVariable(required=false) String postCode, HttpServletRequest request) {
Session session = UserUtils.getSession();
if (StringUtils.isNotBlank(postCode)){
PostRole where = new PostRole();
where.setPostCode(postCode);
where.sqlMap().loadJoinTableAlias("r");
List<String> roleCodes = ListUtils.newArrayList();
postService.findPostRoleList(where).forEach(e -> {
if (e.getRole() != null && PostRole.STATUS_NORMAL.equals(e.getRole().getStatus())) {
roleCodes.add(e.getRoleCode());
}
});
if (roleCodes.isEmpty()){
roleCodes.add("__none__");
}
session.setAttribute("postCode", postCode);
session.setAttribute("roleCode", StringUtils.joinComma(roleCodes)); // 5.4.0+ 支持多个,逗号隔开
}else{
session.removeAttribute("postCode");
session.removeAttribute("roleCode");
}
UserUtils.removeCache(UserUtils.CACHE_AUTH_INFO+"_"+session.getId());
if (ServletUtils.isAjaxRequest(request)) {
return renderResult(Global.TRUE, text("岗位切换成功"));
}
return REDIRECT + adminPath + "/index";
}
/**
* 切换主题风格

View File

@@ -79,7 +79,7 @@ public class PostController extends BaseController {
List<String> roleCodes = ListUtils.newArrayList();
List<String> roleNames = ListUtils.newArrayList();
postService.findPostRoleList(where).forEach(e -> {
if (e.getRole() != null) {
if (e.getRole() != null && PostRole.STATUS_NORMAL.equals(e.getRole().getStatus())) {
roleCodes.add(e.getRoleCode());
roleNames.add(e.getRole().getRoleName());
}

View File

@@ -110,9 +110,6 @@ public class CorpAdminController extends BaseController {
if (!user.currentUser().isSuperAdmin()){
return renderResult(Global.FALSE, text("越权操作,只有超级管理员才能修改此数据!"));
}
if (User.isSuperAdmin(user.getUserCode())) {
return renderResult(Global.FALSE, text("非法操作,不能够操作此用户!"));
}
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
return renderResult(Global.FALSE, text("非法操作,不能够操作此用户!"));
}

View File

@@ -157,9 +157,6 @@ public class EmpUserController extends BaseController {
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated EmpUser empUser, String op, HttpServletRequest request) {
if (User.isSuperAdmin(empUser.getUserCode())) {
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
}
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
}
@@ -370,9 +367,6 @@ public class EmpUserController extends BaseController {
@RequestMapping(value = "saveAuthDataScope")
@ResponseBody
public String saveAuthDataScope(EmpUser empUser, HttpServletRequest request) {
if (User.isSuperAdmin(empUser.getUserCode())) {
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
}
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
}

View File

@@ -91,9 +91,6 @@ public class SecAdminController extends BaseController {
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated User user) {
if (User.isSuperAdmin(user.getUserCode())) {
return renderResult(Global.FALSE, text("非法操作,不能够操作此用户!"));
}
if (!User.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
return renderResult(Global.FALSE, text("非法操作,不能够操作此用户!"));
}

View File

@@ -152,6 +152,9 @@ user:
# 二级管理员的控制权限类型1拥有的权限 2管理的权限管理功能包括用户管理、组织机构、公司管理等v4.1.5+
adminCtrlPermi: 2
# 是否启用岗位角色,开启后将 用户->岗位->关联角色,纳入菜单和权限管理
postRolePermi: false
# 多租户模式SAAS模式专业版
useCorpModel: false
@@ -343,6 +346,12 @@ gen:
# 系统监控
state:
enabled: true
# 服务器监控
server: true
# 缓存监控
cache: true
# 数据监控
druid: true
#======================================#
#========= Framework settings =========#

View File

@@ -4,6 +4,7 @@
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<logger name="org.springframework.boot.web.embedded" level="INFO" />
<logger name="org.apache.catalina.core.StandardEngine" level="INFO" />
<logger name="net.oschina.j2cache.caffeine.CaffeineProvider" level="ERROR" />
<logger name="ShardingSphere-SQL" level="DEBUG" />
<!-- <logger name="org.apache.ibatis" level="DEBUG" /> -->

View File

@@ -10,8 +10,8 @@
JOIN ${_prefix}sys_employee_post b ON b.post_code = a.post_code
</if>
<if test="userCode != null and userCode != ''">
JOIN ${_prefix}sys_employee_post b2 on b2.post_code = a.post_code
JOIN ${_prefix}sys_user u on u.ref_code = b2.emp_code AND u.user_type = 'employee'
JOIN ${_prefix}sys_employee_post b2 ON b2.post_code = a.post_code
JOIN ${_prefix}sys_user u ON u.ref_code = b2.emp_code AND u.user_type = 'employee'
</if>
<where>
${sqlMap.where.toSql()}

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>http.api.js</name>
<filePath>${frontDir}/common</filePath>
<fileName>http.api.${className}.js</fileName>
<content><![CDATA[
const install = (Vue, vm) => {
vm.$u.api = {
// 请将以下 ${functionName} 代码,复制到 http.api.js 文件中
// ${functionName} 开始
${className}: {
form: (params = {}) => vm.$u.post(config.adminPath+'/${urlPrefix}/form', params),
list: (params = {}) => vm.$u.post(config.adminPath+'/${urlPrefix}/listData', params),
save: (params = {}) => vm.$u.postJson(config.adminPath+'/${urlPrefix}/save', params),
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
disable: (params = {}) => vm.$u.post(config.adminPath+'/${urlPrefix}/disable', params),
enable: (params = {}) => vm.$u.post(config.adminPath+'/${urlPrefix}/enable', params),
<% } %>
delete: (params = {}) => vm.$u.post(config.adminPath+'/${urlPrefix}/delete', params),
},
// ${functionName} 结束
};
}
export default {
install
}
]]>
</content>
</template>

View File

@@ -0,0 +1,282 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>form.vue</name>
<filePath>${frontDir}/pages/${urlPrefix}</filePath>
<fileName>form.vue</fileName>
<content><![CDATA[
<template>
<view class="wrap">
<u-form class="form" :model="model" :rules="rules" ref="uForm" label-position="left">
<%
var userselectExists = false;
var officeselectExists = false;
var companyselectExists = false;
var areaselectExists = false;
for(c in table.columnList){
if(c.isQuery == "1" && !c.isTreeEntityColumn){
if(c.showType == 'userselect'){
userselectExists = true;
}else if(c.showType == 'officeselect'){
officeselectExists = true;
}else if(c.showType == 'companyselect'){
companyselectExists = true;
}else if(c.showType == 'areaselect'){
areaselectExists = true;
}
}
}
%>
<%
for (c in table.columnList){
if (c.isEdit == '1' && c.showType != 'hidden'){
// 如果是树结构的字段,则自动忽略
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')
&& c.attrName != table.treeViewCodeAttrName
&& c.attrName != table.treeViewNameAttrName){
continue;
}
%>
<% if(c.showType == 'input'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" type="text" maxlength="${c.dataLength}"></u-input>
</u-form-item>
<% }else if(c.showType == 'textarea'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180" label-position="top">
<u-input type="textarea" placeholder="请输入${c.columnLabel}" v-model="model.testTextarea" height="100" maxlength="${c.dataLength}" />
</u-form-item>
<% }else if(c.showType == 'select' || c.showType == 'select_multiple'){
var isMultiple = (c.showType == 'select_multiple'); %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-select v-model="model.${c.attrName}" dict-type="${c.optionMap['dictType']}"<% if(isMultiple){ %> multiple="true"<% } %> placeholder="请选择${c.columnLabel}"></js-select>
</u-form-item>
<% }else if(c.showType == 'radio'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-radio v-model="model.${c.attrName}" dict-type="${c.optionMap['dictType']}"></js-radio>
</u-form-item>
<% }else if(c.showType == 'checkbox'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-checkbox v-model="model.${c.attrName}" dict-type="${c.optionMap['dictType']}"></js-checkbox>
</u-form-item>
<% }else if(c.showType == 'date' || c.showType == 'datetime'){
var isTime = (c.showType == 'datetime'); %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" format="yyyy-MM-dd${isTime?' HH:mm':''}" type="text" maxlength="${c.dataLength}"></u-input>
</u-form-item>
<% }else if(c.showType == 'userselect'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-select v-model="model.${c.attrName}" :items="${c.attrName}List" placeholder="请选择${c.columnLabel}" :tree="true"<% if (isNotBlank(c.attrName2)){ %>
:label-value="model.${c.attrName2}" @label-input="model.${c.attrName2} = $event"<% } %>></js-select>
</u-form-item>
<% }else if(c.showType == 'officeselect'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-select v-model="model.${c.attrName}" :items="${c.attrName}List" placeholder="请选择${c.columnLabel}" :tree="true"<% if (isNotBlank(c.attrName2)){ %>
:label-value="model.${c.attrName2}" @label-input="model.${c.attrName2} = $event"<% } %>></js-select>
</u-form-item>
<% }else if(c.showType == 'companyselect'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-select v-model="model.${c.attrName}" :items="${c.attrName}List" placeholder="请选择${c.columnLabel}" :tree="true"<% if (isNotBlank(c.attrName2)){ %>
:label-value="model.${c.attrName2}" @label-input="model.${c.attrName2} = $event"<% } %>></js-select>
</u-form-item>
<% }else if(c.showType == 'areaselect'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<js-select v-model="model.${c.attrName}" :items="${c.attrName}List" placeholder="请选择${c.columnLabel}" :tree="true"<% if (isNotBlank(c.attrName2)){ %>
:label-value="model.${c.attrName2}" @label-input="model.${c.attrName2} = $event"<% } %>></js-select>
</u-form-item>
<% }else{ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" type="text" maxlength="${c.dataLength}"></u-input>
</u-form-item>
<% } %>
<%
}
}
%>
<% if(toBoolean(table.optionMap['isImageUpload'])){ %>
<u-form-item label="上传图片" prop="images" label-position="top">
<js-uploadfile v-model="model.dataMap" :biz-key="model.id" biz-type="${className}_image"></js-uploadfile>
</u-form-item>
</u-form>
<% } %>
<view class="form-footer">
<u-button class="btn" type="primary" @click="submit">提交</u-button>
<!-- <u-button class="btn" type="default" @click="cancel">关闭</u-button> -->
</view>
</view>
</template>
<script>
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*/
export default {
data() {
return {
model: {
id: '',
<%
for (c in table.columnList){
if (c.isEdit == '1' && c.showType != 'hidden'){
// 如果是树结构的字段,则自动忽略
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')
&& c.attrName != table.treeViewCodeAttrName
&& c.attrName != table.treeViewNameAttrName){
continue;
}
%>
<% if(c.showType == 'userselect'){ %>
${c.simpleAttrName}: {
userCode: '',
userName: ''
},
<% }else if(c.showType == 'officeselect'){ %>
${c.simpleAttrName}: {
officeCode: '',
officeName: ''
},
<% }else if(c.showType == 'companyselect'){ %>
${c.simpleAttrName}: {
companyCode: '',
companyName: ''
},
<% }else if(c.showType == 'areaselect'){ %>
${c.simpleAttrName}: {
areaCode: '',
areaName: ''
},
<% }else{ %>
${c.attrName}: '',
<% } %>
<%
}
}
%>
},
rules: {
<%
for (c in table.columnList){
if (c.isEdit == '1' && c.showType != 'hidden'){
// 如果是树结构的字段,则自动忽略
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')
&& c.attrName != table.treeViewCodeAttrName
&& c.attrName != table.treeViewNameAttrName){
continue;
}
%>
<% if(c.isRequired == '1'){ %>
'${c.attrName}': [
{
required: true,
message: '请输入${c.columnLabel}',
trigger: ['change','blur'],
}
],
<% } %>
<%
}
}
%>
},
<%
for (c in table.columnList){
if (c.isEdit == '1' && c.showType != 'hidden'){
// 如果是树结构的字段,则自动忽略
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')
&& c.attrName != table.treeViewCodeAttrName
&& c.attrName != table.treeViewNameAttrName){
continue;
}
%>
<% if(c.showType == 'userselect'){ %>
${c.simpleAttrName}List: [],
<% }else if(c.showType == 'officeselect'){ %>
${c.simpleAttrName}List: [],
<% }else if(c.showType == 'companyselect'){ %>
${c.simpleAttrName}List: [],
<% }else if(c.showType == 'areaselect'){ %>
${c.simpleAttrName}List: [],
<% } %>
<%
}
}
%>
};
},
onLoad(params){
this.$u.api.${className}.form(params).then(res => {
Object.assign(this.model, res.${className});
this.$refs.uForm.setRules(this.rules);
<%
for (c in table.columnList){
if (c.isEdit == '1' && c.showType != 'hidden'){
// 如果是树结构的字段,则自动忽略
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')
&& c.attrName != table.treeViewCodeAttrName
&& c.attrName != table.treeViewNameAttrName){
continue;
}
%>
<% if(c.showType == 'userselect'){ %>
this.$u.api.office.treeData({isLoadUser: true}).then(res => {
this.${c.simpleAttrName}List = res;
});
<% }else if(c.showType == 'officeselect'){ %>
this.$u.api.office.treeData().then(res => {
this.${c.simpleAttrName}List = res;
});
<% }else if(c.showType == 'companyselect'){ %>
this.$u.api.company.treeData().then(res => {
this.${c.simpleAttrName}List = res;
});
<% }else if(c.showType == 'areaselect'){ %>
this.$u.api.area.treeData().then(res => {
this.${c.simpleAttrName}List = res;
});
<% } %>
<%
}
}
%>
});
},
methods: {
submit() {
this.$refs.uForm.validate(valid => {
if (valid) {
// console.log('${className}-save: ' + JSON.stringify(this.model));
this.$u.api.${className}.save(this.model).then(res => {
uni.showModal({
title: '提示',
content: res.message,
showCancel: false,
success: function () {
if (res.result == 'true') {
uni.setStorageSync('refreshList', true);
uni.navigateBack();
}
}
});
});
} else {
this.$u.toast('您填写的信息有误,请根据提示修正。');
}
});
},
cancel() {
uni.navigateBack();
}
}
};
</script>
<style lang="scss">
</style>
<% %>
]]>
</content>
</template>

View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>list.vue</name>
<filePath>${frontDir}/pages/${urlPrefix}</filePath>
<fileName>list.vue</fileName>
<content><![CDATA[
<template>
<view class="wrap">
<view class="search">
<u-search v-model="keywords" @custom="search" @search="search"></u-search>
</view>
<scroll-view class="scroll-list" scroll-y="true" @scrolltolower="loadMore">
<u-cell-group class="list" :border="false">
<u-swipe-action :options="options" v-for="(item, index) in list" :key="item.id" :index="index" @click="optionsClick">
<%
var idParam = '', idParam2 = '';
for(pk in table.pkList){
idParam = idParam + (pk.attrName + '=\'+item.' + pk.attrName);
idParam2 = idParam2 + ('item.' + pk.attrName);
if (pkLP.index != table.pkList.~size) {
idParam = idParam + '&';
idParam2 = idParam2 + ' || ';
}
}
for(c in table.columnList){
if(c.isList == "1"){
// 如果是树结构的字段,则自动忽略
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')
&& c.attrName != table.treeViewCodeAttrName
&& c.attrName != table.treeViewNameAttrName){
continue;
}
%>
<u-cell-item :arrow="true" @click="navTo('form?${idParam})">
<text slot="title">{{item.${c.attrName} || ${idParam2}}}</text>
<text slot="label">创建者:{{item.createBy}} &nbsp;|&nbsp; 时间:{{item.createDate}}</text>
</u-cell-item>
<%
break;
}
}
%>
</u-swipe-action>
</u-cell-group>
<view class="loadmore" @click="loadMore">
<u-loadmore :status="loadStatus"></u-loadmore>
</view>
</scroll-view>
<view class="btn-plus" @click="navTo('form')">
<u-icon name="plus-circle-fill" size="90" color="#3d87ff"></u-icon>
</view>
</view>
</template>
<script>
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*/
export default {
data() {
return {
keywords: '',
query: {
pageNo: 1,
pageSize: 20
},
list: [],
count: 0,
loadStatus: 'loadmore',
options: [
{text: '上传', style: { background: '#414ee0'}},
{text: '删除', style: { background: '#dd524d'}}
]
};
},
onLoad() {
this.loadList();
},
onShow() {
if (uni.getStorageSync('refreshList') === true){
uni.removeStorageSync('refreshList');
this.search('');
}
},
methods: {
loadMore() {
this.loadStatus = "loading";
setTimeout(() => {
this.query.pageNo += 1;
this.loadList();
}, 100);
},
loadList() {
this.$u.api.${className}.list(this.query).then(res => {
if (!res.list || res.list.length == 0){
this.loadStatus = "nomore";
return;
}
this.list = this.list.concat(res.list);
this.count = res.count;
this.query.pageNo = res.pageNo;
this.query.pageSize = res.pageSize;
this.loadStatus = "loadmore";
});
},
optionsClick(rowIndex, btnIndex) {
let self = this, row = self.list[rowIndex];
if(btnIndex == 0) {
this.navTo('formUpload?id='+row.id);
} else if(btnIndex == 1) {
uni.showModal({
title: '提示',
content: '确认要删除该数据吗?',
showCancel: true,
success: function (res2) {
if (res2.confirm) {
self.$u.api.${className}.delete({id: row.id}).then(res => {
self.$u.toast(res.message);
if (res.result == 'true'){
self.list.splice(rowIndex, 1);
}
});
}
}
});
}
},
search(value) {
this.list = [];
this.query.pageNo = 0;
this.query.testInput = value;
this.loadList();
},
navTo(url) {
uni.navigateTo({
url: url
});
}
}
};
</script>
<style lang="scss">
page {
background-color: #f8f8f8;
}
.btn-plus {
position: absolute;
bottom: 50rpx;
right: 50rpx;
z-index: 1;
opacity: 0.6;
}
.btn-plus:hover {
opacity: 1;
}
</style>
<% %>
]]>
</content>
</template>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>pages.json</name>
<filePath>${frontDir}</filePath>
<fileName>pages.${className}.json</fileName>
<content><![CDATA[
{
"pages": [
/* 请将以下 ${functionName} 代码,复制到 pages.json 文件中 */
/* ${functionName} 开始 */
{
"path": "pages/${className}/form",
"style": {
"navigationBarTitleText": "新增编辑"
}
},
{
"path": "pages/${className}/list",
"style": {
"navigationBarTitleText": "${functionName}"
}
},
/* ${functionName} 结束 */
],
}
]]>
</content>
</template>

View File

@@ -16,32 +16,41 @@
</category>
<category value="crud_vue" label="单表/主子表 (增删改查) vue">
<template>category-ref:crud_java</template>
<template>crud/vueApi.xml</template>
<template>crud/vueList.xml</template>
<template>crud/vueForm.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueImport.xml</template>
<template>vue/vueApi.xml</template>
<template>vue/vueList.xml</template>
<template>vue/vueForm.xml</template>
<template>vue/vueIndex.xml</template>
<template>vue/vueImport.xml</template>
<childTable>
<template>category-ref:dao</template>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_only_vue" label="单表/主子表 (增删改查) 仅vue">
<template>crud/vueApi.xml</template>
<template>crud/vueList.xml</template>
<template>crud/vueForm.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueImport.xml</template>
<template>vue/vueApi.xml</template>
<template>vue/vueList.xml</template>
<template>vue/vueForm.xml</template>
<template>vue/vueIndex.xml</template>
<template>vue/vueImport.xml</template>
<childTable>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_only_vue_modal" label="单表/主子表 (增删改查,弹窗表单) 仅vue ">
<template>category-ref:crud_only_vue</template>
<childTable>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_only_vue_modal_route" label="单表/主子表 (增删改查,路由表单) 仅vue ">
<template>crud/vueApi.xml</template>
<template>crud/vueList.xml</template>
<!--<template>crud/vueForm.xml</template>-->
<template>crud/vueFormRoute.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueImport.xml</template>
<template>vue/vueApi.xml</template>
<template>vue/vueList.xml</template>
<template>vue/vueFormRoute.xml</template>
<template>vue/vueIndex.xml</template>
<template>vue/vueImport.xml</template>
<childTable>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_select" label="单表/主子表 (增删改查,含 listselect 选择页面) beetl">
<template>category-ref:crud</template>
@@ -52,9 +61,10 @@
</category>
<category value="crud_select_vue" label="单表/主子表 (增删改查,含 listselect 选择页面) vue">
<template>category-ref:crud_vue</template>
<template>crud/vueSelect.xml</template>
<template>vue/vueSelect.xml</template>
<childTable>
<template>category-ref:dao</template>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_java" label="单表/主子表 (增删改查,只生成 java/mapper 仅后端 ">
@@ -76,13 +86,14 @@
</category>
<category value="crud_cloud_vue" label="单表/主子表 (增删改查 Cloud生成 api/client Vue">
<template>category-ref:crud_cloud_java</template>
<template>crud/vueApi.xml</template>
<template>crud/vueList.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueForm.xml</template>
<template>crud/vueImport.xml</template>
<template>vue/vueApi.xml</template>
<template>vue/vueList.xml</template>
<template>vue/vueIndex.xml</template>
<template>vue/vueForm.xml</template>
<template>vue/vueImport.xml</template>
<childTable>
<template>category-ref:dao_cloud</template>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_cloud_select" label="单表/主子表 (增删改查 Cloud含 listselect 选择页面) beetl">
@@ -94,9 +105,10 @@
</category>
<category value="crud_cloud_select_vue" label="单表/主子表 (增删改查 Cloud含 listselect 选择页面) vue">
<template>category-ref:crud_cloud_vue</template>
<template>crud/vueSelect.xml</template>
<template>vue/vueSelect.xml</template>
<childTable>
<template>category-ref:dao_cloud</template>
<template>vue/vueFormChildList.xml</template>
</childTable>
</category>
<category value="crud_cloud_java" label="单表/主子表 (增删改查 Cloud只生成 java/mapper 仅后端">
@@ -158,6 +170,12 @@
<template>query/dao.xml</template>
</childTable>
</category>
<category value="crud_only_app" label="手机端列表和表单单表App">
<template>app/appApi.xml</template>
<template>app/appList.xml</template>
<template>app/appForm.xml</template>
<template>app/appPages.xml</template>
</category>
</tplCategory>
<!-- 属性类型 -->
<attrType>

View File

@@ -146,7 +146,7 @@ public class ${ClassName}Controller extends BaseController {
* 查询子表数据
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
@RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}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));

View File

@@ -213,7 +213,7 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
// 生成子表列表字段
for(child in table.childList){
%>
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List = ListUtils.newArrayList(); // 子表列表
<%
}
@@ -366,12 +366,12 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
%>
@Valid
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
return ${@StringUtils.uncap(child.className)}List;
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.classNameSimple)}List() {
return ${@StringUtils.uncap(child.classNameSimple)}List;
}
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
public void set${@StringUtils.cap(child.classNameSimple)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List) {
this.${@StringUtils.uncap(child.classNameSimple)}List = ${@StringUtils.uncap(child.classNameSimple)}List;
}
<% } %>

View File

@@ -70,7 +70,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
<% for (child in table.childList){ %>
${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity);
${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL);
entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
<% } %>
}
return entity;
@@ -168,7 +168,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
<% } %>
<% for (child in table.childList) { %>
// 保存 ${ClassName}子表
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.className)}List()){
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.classNameSimple)}List()){
if (!${@StringUtils.cap(child.className)}.STATUS_DELETE.equals(${@StringUtils.uncap(child.className)}.getStatus())){
<%
for(c in child.columnList){

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewForm</name>
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Form.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewForm.html'){} %>]]>
<% include('/templates/modules/gen/view/viewForm.html'){} %>]]>
</content>
</template>

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewIndex</name>
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Index.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewIndex.html'){} %>]]>
<% include('/templates/modules/gen/view/viewIndex.html'){} %>]]>
</content>
</template>

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewList</name>
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}List.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewList.html'){} %>]]>
<% include('/templates/modules/gen/view/viewList.html'){} %>]]>
</content>
</template>

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewSelect</name>
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Select.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewSelect.html'){} %>]]>
<% include('/templates/modules/gen/view/viewSelect.html'){} %>]]>
</content>
</template>

View File

@@ -148,7 +148,7 @@ public class ${ClassName}Controller extends BaseController {
* 查询子表数据
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
@RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}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));

View File

@@ -213,7 +213,7 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
// 生成子表列表字段
for(child in table.childList){
%>
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List = ListUtils.newArrayList(); // 子表列表
<%
}
@@ -366,12 +366,12 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
%>
@Valid
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
return ${@StringUtils.uncap(child.className)}List;
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.classNameSimple)}List() {
return ${@StringUtils.uncap(child.classNameSimple)}List;
}
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
public void set${@StringUtils.cap(child.classNameSimple)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.classNameSimple)}List) {
this.${@StringUtils.uncap(child.classNameSimple)}List = ${@StringUtils.uncap(child.classNameSimple)}List;
}
<% } %>

View File

@@ -76,7 +76,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
<% for (child in table.childList){ %>
${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity);
${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL);
entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
<% } %>
}
return entity;
@@ -175,7 +175,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
<% } %>
<% for (child in table.childList) { %>
// 保存 ${ClassName}子表
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.className)}List()){
for (${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} : ${className}.get${@StringUtils.cap(child.classNameSimple)}List()){
if (!${@StringUtils.cap(child.className)}.STATUS_DELETE.equals(${@StringUtils.uncap(child.className)}.getStatus())){
<%
for(c in child.columnList){

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewForm</name>
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Form.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewForm.html'){} %>]]>
<% include('/templates/modules/gen/view/viewForm.html'){} %>]]>
</content>
</template>

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewIndex</name>
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Index.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewIndex.html'){} %>]]>
<% include('/templates/modules/gen/view/viewIndex.html'){} %>]]>
</content>
</template>

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewList</name>
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}List.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewList.html'){} %>]]>
<% include('/templates/modules/gen/view/viewList.html'){} %>]]>
</content>
</template>

View File

@@ -3,9 +3,9 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewSelect</name>
<filePath>${frontDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/${moduleName}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Select.html</fileName>
<content><![CDATA[
<% include('/templates/modules/gen/include/viewSelect.html'){} %>]]>
<% include('/templates/modules/gen/view/viewSelect.html'){} %>]]>
</content>
</template>

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>package</name>
<filePath>${baseDir}/${moduleCode}/src/main/java/com/jeesite/modules/${moduleCode}</filePath>
<filePath>${baseDir}/${moduleCode}/src/main/java/com/jeesite/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
<fileName></fileName>
<content><![CDATA[

View File

@@ -8,7 +8,7 @@
<content><![CDATA[
# 温馨提示不建议直接修改此文件为了平台升级方便建议将需要修改的参数值复制到application.yml里进行覆盖该参数值。
#${moduleCode}:
#${@StringUtils.camelCase(moduleCode)}:
# enabled: true
]]>

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>static</name>
<filePath>${baseDir}/${moduleCode}/src/main/resources/static/modules/${moduleCode}</filePath>
<filePath>${baseDir}/${moduleCode}/src/main/resources/static/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
<fileName></fileName>
<content><![CDATA[

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>package</name>
<filePath>${baseDir}/${moduleCode}/${moduleCode}-client/src/main/java/com/jeesite/modules/${moduleCode}</filePath>
<filePath>${baseDir}/${moduleCode}/${moduleCode}-client/src/main/java/com/jeesite/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
<fileName></fileName>
<content><![CDATA[

View File

@@ -21,15 +21,15 @@
<artifactId>jeesite-cloud-module-${moduleCode}-web</artifactId>
<packaging>war</packaging>
<name>JeeSite Cloud Module ${moduleName} Web</name>
<name>JeeSite Cloud Module ${@StringUtils.capCamelCase(moduleCode)} Web</name>
<url>http://jeesite.com</url>
<inceptionYear>2013-Now</inceptionYear>
<properties>
<finalName>web</finalName><!-- war包的名称 -->
<start-class>com.jeesite.modules.${@StringUtils.cap(module.moduleCode)}Application</start-class>
<start-class>com.jeesite.modules.${@StringUtils.capCamelCase(moduleCode)}Application</start-class>
<!-- docker setting -->
<docker.run.port>8989:8989</docker.run.port>

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>package</name>
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/java/com/jeesite/modules/${moduleCode}</filePath>
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/java/com/jeesite/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
<fileName></fileName>
<content><![CDATA[

View File

@@ -4,7 +4,7 @@
<template>
<name>start-class</name>
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/java/com/jeesite/modules</filePath>
<fileName>${@StringUtils.cap(module.moduleCode)}Application.java</fileName>
<fileName>${@StringUtils.capCamelCase(moduleCode)}Application.java</fileName>
<content><![CDATA[
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
@@ -12,6 +12,8 @@
*/
package com.jeesite.modules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -27,16 +29,22 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages={"com.jeesite.modules"})
public class ${@StringUtils.cap(module.moduleCode)}Application extends SpringBootServletInitializer {
public class ${@StringUtils.capCamelCase(moduleCode)}Application extends SpringBootServletInitializer {
private static final Logger logger = LoggerFactory.getLogger(${@StringUtils.capCamelCase(moduleCode)}Application.class);
public static void main(String[] args) {
SpringApplication.run(${@StringUtils.cap(module.moduleCode)}Application.class, args);
SpringApplication.run(${@StringUtils.capCamelCase(moduleCode)}Application.class, args);
logger.info(
"\r\n\r\n==============================================================\r\n"
+ "\r\n " + ${@StringUtils.capCamelCase(moduleCode)}Application.class.getName() + " 启动完成。"
+ "\r\n\r\n==============================================================\r\n");
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
this.setRegisterErrorPageFilter(false); // 错误页面有容器来处理而不是SpringBoot
return builder.sources(${@StringUtils.cap(module.moduleCode)}Application.class);
return builder.sources(${@StringUtils.capCamelCase(moduleCode)}Application.class);
}
}]]>

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>static</name>
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/resources/static/modules/${moduleCode}</filePath>
<filePath>${baseDir}/${moduleCode}/${moduleCode}/src/main/resources/static/modules/${@StringUtils.replace(moduleCode, '-', '/')}</filePath>
<fileName></fileName>
<content><![CDATA[

View File

@@ -132,7 +132,7 @@ public class ${ClassName}Controller extends BaseController {
* 查询子表数据
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "${@StringUtils.uncap(child.className)}ListData")
@RequestMapping(value = "${@StringUtils.uncap(child.classNameSimple)}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));

View File

@@ -49,7 +49,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
<% for (child in table.childList){ %>
${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)} = new ${@StringUtils.cap(child.className)}(entity);
${@StringUtils.uncap(child.className)}.setStatus(${@StringUtils.cap(child.className)}.STATUS_NORMAL);
entity.set${@StringUtils.cap(child.className)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
entity.set${@StringUtils.cap(child.classNameSimple)}List(${@StringUtils.uncap(child.className)}Dao.findList(${@StringUtils.uncap(child.className)}));
<% } %>
}
return entity;

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewForm</name>
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}Form.html</fileName>
<content><![CDATA[
<%
@@ -44,8 +44,8 @@
</div>
</div>
<% } %>
<% include('/templates/modules/gen/include/formControl.html'){} %>
<% include('/templates/modules/gen/include/formChildTable.html'){} %>
<% include('/templates/modules/gen/view/formControl.html'){} %>
<% include('/templates/modules/gen/view/formChildTable.html'){} %>
</div>
<div class="box-footer">
<div class="row">
@@ -58,6 +58,6 @@
</div>
</div>
\<% } %>
<% include('/templates/modules/gen/include/formChildTableScript.html'){} %>]]>
<% include('/templates/modules/gen/view/formChildTableScript.html'){} %>]]>
</content>
</template>

View File

@@ -3,7 +3,7 @@
No deletion without permission, or be held responsible to law. -->
<template>
<name>viewList</name>
<filePath>${frontDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<filePath>${baseDir}/src/main/resources/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
<fileName>${className}List.html</fileName>
<content><![CDATA[
\<% layout('/layouts/default.html', {title: '${functionNameSimple}查询', libs: ['dataGrid']}){ %>
@@ -24,7 +24,7 @@
</div>
</div>
<div class="box-body">
<% include('/templates/modules/gen/include/searchForm.html'){} %>
<% include('/templates/modules/gen/view/searchForm.html'){} %>
<table id="dataGrid"></table>
<% if(!table.isTreeEntity){ %>
<div id="dataGridPage"></div>
@@ -33,6 +33,6 @@
</div>
</div>
\<% } %>
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>]]>
<% include('/templates/modules/gen/view/dataGridScript.html'){} %>]]>
</content>
</template>

View File

@@ -4,10 +4,10 @@
%>
<div class="form-unit">\${text('${child.comments}')}</div>
<div class="form-unit-wrap table-form">
<table id="${@StringUtils.uncap(child.className)}DataGrid"></table>
<table id="${@StringUtils.uncap(child.classNameSimple)}DataGrid"></table>
<% if(table.tplCategory != 'query'){ %>
\<% if (hasPermi('${permissionPrefix}:edit')){ %>
<a href="#" id="${@StringUtils.uncap(child.className)}DataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> \${text('增行')}</a>
<a href="#" id="${@StringUtils.uncap(child.classNameSimple)}DataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> \${text('增行')}</a>
\<% } %>
<% } %>
</div>

View File

@@ -6,9 +6,9 @@ var treeselectExists = false;
for(child in table.childList){
%>
\//# // 初始化${child.comments}DataGrid对象
$('#${@StringUtils.uncap(child.className)}DataGrid').dataGrid({
$('#${@StringUtils.uncap(child.classNameSimple)}DataGrid').dataGrid({
data: \"#{toJson(${className}.${@StringUtils.uncap(child.className)}List)}",
data: \"#{toJson(${className}.${@StringUtils.uncap(child.classNameSimple)}List)}",
datatype: 'local', // 设置本地数据
autoGridHeight: function(){return 'auto'}, // 设置自动高度
@@ -164,9 +164,9 @@ if (table.tplCategory != 'query'){
{header:'\${text("操作")}', name:'actions', width:80, align:'center', formatter: function(val, obj, row, act){
var actions = [];
if (val == 'new'){
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗")}\', function(){$(\'#${@StringUtils.uncap(child.className)}DataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗")}\', function(){$(\'#${@StringUtils.uncap(child.classNameSimple)}DataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
}else{
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗")}\', function(){$(\'#${@StringUtils.uncap(child.className)}DataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
actions.push('<a href="#" onclick="js.confirm(\'\${text("你确认要删除这条数据吗")}\', function(){$(\'#${@StringUtils.uncap(child.classNameSimple)}DataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
}
return actions.join('');
}, editoptions: {defaultValue: 'new'}}
@@ -178,12 +178,12 @@ if (table.tplCategory != 'query'){
\//# // 编辑表格参数
editGrid: true, // 是否是编辑表格
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
editGridAddRowBtn: $('#${@StringUtils.uncap(child.className)}DataGridAddRowBtn'), // 子表增行按钮
editGridAddRowBtn: $('#${@StringUtils.uncap(child.classNameSimple)}DataGridAddRowBtn'), // 子表增行按钮
editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上
editGridAddRowInitData: {<% for(pk in child.pkList){ %>${pk.attrName}<% break; }%>: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
\//# // 编辑表格的提交数据参数
editGridInputFormListName: '${@StringUtils.uncap(child.className)}List', // 提交的数据列表名
editGridInputFormListName: '${@StringUtils.uncap(child.classNameSimple)}List', // 提交的数据列表名
editGridInputFormListAttrs: 'status,<% for(c in child.columnList){if(c.attrName!="status"){%>${c.attrName},<% }} %>', // 提交数据列表的属性字段
\//# // 加载成功后执行事件

View File

@@ -38,8 +38,8 @@
</div>
</div>
<% } %>
<% include('/templates/modules/gen/include/formControl.html'){} %>
<% include('/templates/modules/gen/include/formChildTable.html'){} %>
<% include('/templates/modules/gen/view/formControl.html'){} %>
<% include('/templates/modules/gen/view/formChildTable.html'){} %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<div class="row taskComment hide">
<div class="col-xs-12">
@@ -78,7 +78,7 @@
</div>
</div>
\<% } %>
<% include('/templates/modules/gen/include/formChildTableScript.html'){} %>
<% include('/templates/modules/gen/view/formChildTableScript.html'){} %>
<script>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
// 业务实现草稿按钮

View File

@@ -27,7 +27,7 @@
</div>
</div>
<div class="box-body">
<% include('/templates/modules/gen/include/searchForm.html'){} %>
<% include('/templates/modules/gen/view/searchForm.html'){} %>
<table id="dataGrid"></table>
<% if(!table.isTreeEntity){ %>
<div id="dataGridPage"></div>
@@ -36,7 +36,7 @@
</div>
</div>
\<% } %>
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>
<% include('/templates/modules/gen/view/dataGridScript.html'){} %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<script>
$('#btnExport').click(function(){

View File

@@ -2,7 +2,7 @@
<div class="main-content">
<div class="box box-main">
<div class="box-body">
<% include('/templates/modules/gen/include/searchForm.html'){} %>
<% include('/templates/modules/gen/view/searchForm.html'){} %>
<div class="row">
<div class="col-xs-10 pr10">
<table id="dataGrid"></table>
@@ -18,4 +18,4 @@
</div>
</div>
\<% } %>
<% include('/templates/modules/gen/include/dataGridSelectScript.html'){} %>
<% include('/templates/modules/gen/view/dataGridSelectScript.html'){} %>

View File

@@ -72,7 +72,7 @@ for(c in table.columnList){
%>
<% // 生成子表列表字段
for(child in table.childList){ %>
${@StringUtils.uncap(child.className)}List?: any[]; // 子表列表
${@StringUtils.uncap(child.classNameSimple)}List?: any[]; // 子表列表
<% } %>
}

View File

@@ -28,16 +28,8 @@
<% if (table.childList.~size > 0){ %>
<BasicForm @register="registerForm">
<% for (child in table.childList){ %>
<template #${@StringUtils.uncap(child.className)}List>
<BasicTable
@register="register${child.className}Table"
@row-click="handle${child.className}RowClick"
/>
<% if(table.tplCategory != 'query'){ %>
<a-button class="mt-2" @click="handle${child.className}Add" v-auth="'${permissionPrefix}:edit'">
<Icon icon="i-ant-design:plus-circle-outlined" /> {{ t('新增') }}
</a-button>
<% } %>
<template #${@StringUtils.uncap(child.classNameSimple)}List>
<Form${@StringUtils.cap(child.classNameSimple)}List ref="form${@StringUtils.cap(child.classNameSimple)}ListRef" />
</template>
<% } %>
</BasicForm>
@@ -70,42 +62,42 @@
import { router } from '/@/router';
import { Icon } from '/@/components/Icon';
import { BasicForm, FormSchema, useForm } from '/@/components/Form';
<% if (table.childList.~size > 0){ %>
import { BasicTable, useTable } from '/@/components/Table';
<% } %>
import { Basic${modalOrDrawer}, use${modalOrDrawer}Inner } from '/@/components/${modalOrDrawer}';
import { ${ClassName}, ${className}Save, ${className}Form<% if(table.isTreeEntity){ %>, ${className}TreeData<% } %> } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
<%
var userselectExists = false;
var officeselectExists = false;
var companyselectExists = false;
var areaselectExists = false;
for(c in table.columnList){
if(c.isQuery == "1" && !c.isTreeEntityColumn){
if(c.showType == 'userselect'){
userselectExists = true;
}else if(c.showType == 'officeselect'){
officeselectExists = true;
}else if(c.showType == 'companyselect'){
companyselectExists = true;
}else if(c.showType == 'areaselect'){
areaselectExists = true;
<%
var userselectExists = false;
var officeselectExists = false;
var companyselectExists = false;
var areaselectExists = false;
for(c in table.columnList){
if(c.isQuery == "1" && !c.isTreeEntityColumn){
if(c.showType == 'userselect'){
userselectExists = true;
}else if(c.showType == 'officeselect'){
officeselectExists = true;
}else if(c.showType == 'companyselect'){
companyselectExists = true;
}else if(c.showType == 'areaselect'){
areaselectExists = true;
}
}
}
}
%>
<% if(userselectExists || officeselectExists) { %>
%>
<% if(userselectExists || officeselectExists) { %>
import { officeTreeData } from '/@/api/sys/office';
<% } %>
<% if(companyselectExists) { %>
<% } %>
<% if(companyselectExists) { %>
import { companyTreeData } from '/@/api/sys/company';
<% } %>
<% if(areaselectExists) { %>
<% } %>
<% if(areaselectExists) { %>
import { areaTreeData } from '/@/api/sys/area';
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
import { BpmButton } from '/@/components/Bpm';
<% } %>
<% } %>
<% for (child in table.childList){ %>
import Form${@StringUtils.cap(child.classNameSimple)}List from './form${@StringUtils.cap(child.classNameSimple)}List.vue';
<% } %>
const emit = defineEmits(['success', 'register']);
@@ -113,9 +105,12 @@ for(c in table.columnList){
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<${ClassName}>({} as ${ClassName});
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% for (child in table.childList){ %>
const form${@StringUtils.cap(child.classNameSimple)}ListRef = ref<InstanceType<typeof Form${@StringUtils.cap(child.classNameSimple)}List>>();
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
const loadingRef = ref(false);
<% } %>
<% } %>
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
@@ -135,7 +130,7 @@ for(c in table.columnList){
},
colProps: { md: 24, lg: 24 },
},
<% }
<% }
for (c in table.columnList){
if (c.isEdit == '1' && c.showType != 'hidden'){
// 如果是树结构的字段,则自动忽略
@@ -152,7 +147,7 @@ for (c in table.columnList){
isNewLine = true;
}
}
%>
%>
{
label: t('${c.columnLabel}'),
field: '${c.attrName}',
@@ -316,9 +311,8 @@ for (c in table.columnList){
},
<%
}
}
if(toBoolean(table.optionMap['isImageUpload'])){
%>
} %>
<% if(toBoolean(table.optionMap['isImageUpload'])){ %>
{
label: t('图片上传'),
field: 'dataMap',
@@ -333,8 +327,7 @@ for (c in table.columnList){
},
<%
}
if(toBoolean(table.optionMap['isFileUpload'])){
%>
if(toBoolean(table.optionMap['isFileUpload'])){ %>
{
label: t('附件上传'),
field: 'dataMap',
@@ -352,15 +345,14 @@ for (c in table.columnList){
for (child in table.childList){ %>
{
label: t('${child.comments}'),
field: '${@StringUtils.uncap(child.className)}List',
field: '${@StringUtils.uncap(child.classNameSimple)}List',
component: 'Input',
colProps: { md: 24, lg: 24 },
slot: '${@StringUtils.uncap(child.className)}List',
slot: '${@StringUtils.uncap(child.classNameSimple)}List',
},
<%
<%
}
if(false && toBoolean(table.optionMap['isBpmForm'])){
%>
if(false && toBoolean(table.optionMap['isBpmForm'])){ %>
{
label: t('审批意见'),
field: 'bpm.comment',
@@ -403,9 +395,7 @@ for (c in table.columnList){
selectType: 'empUserSelect',
},
},
<%
}
%>
<% } %>
];
<%
var updateSchemas = [];
@@ -444,186 +434,6 @@ for (c in table.columnList){
<% var formColNum = table.optionMap['formColNum']; %>
baseColProps: { md: 24, lg: ${formColNum=="1"?24:formColNum=="3"?8:12} },
});
<% for (child in table.childList){ %>
const [register${child.className}Table, ${@StringUtils.uncap(child.className)}Table] = useTable({
actionColumn: {
width: 60,
actions: (record: Recordable) => [
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
popConfirm: {
title: '是否确认删除',
confirm: handle${child.className}Delete.bind(this, record),
},
auth: '${permissionPrefix}:edit',
},
],
},
rowKey: 'id',
pagination: false,
bordered: true,
size: 'small',
inset: true,
});
async function set${child.className}TableData(_res: Recordable) {
${@StringUtils.uncap(child.className)}Table.setColumns([
<%
for (c in child.columnList){
if (c.isEdit != '1' || c.isPk == '1'){
continue;
}
if(child.parentExists && child.parentTableFkName == c.columnName){
continue;
}
%>
{
title: t('${c.columnLabel}'),
dataIndex: '${c.attrName}',
<% if(c.showType == 'datetime'){ %>
width: 215,
<% }else{ %>
width: 130,
<% } %>
<% if ((isNotBlank(c.optionMap['dictType']) || @StringUtils.inString(c.attrType, 'java.util.Date', 'Integer', 'Long'))){ %>
align: 'center',
<% }else if (@StringUtils.inString(c.attrType, 'Float', 'Double')){ %>
align: 'right',
<% }else{ %>
align: 'left',
<% } %>
<% if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'checkbox' || c.showType == 'radio'){ %>
dictType: '${c.optionMap['dictType']}',
<% } %>
editRow: true,
<% if(c.showType == 'input' || c.showType == 'textarea'){ %>
<% if (c.simpleAttrType == 'Integer' && c.attrName == 'treeSort'){ %>
editComponent: 'InputNumber',
editDefaultValue: '30',
<% }else{ %>
editComponent: '${c.showType == 'input' ? 'Input' : 'InputTextArea'}',
<% } %>
<% if (c.dataLength != '0'){ %>
editComponentProps: {
maxlength: ${c.dataLength},
},
<% } %>
<% }else if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'radio' || c.showType == 'checkbox'){
var isMultiple = (c.showType == 'select_multiple'); %>
editComponent: 'Select',
editComponentProps: {
dictType: '${c.optionMap['dictType']}',
allowClear: true,
<% if(isMultiple){ %>
mode: 'multiple',
<% } %>
},
<% }else if(c.showType == 'date' || c.showType == 'datetime'){
var isTime = (c.showType == 'datetime'); %>
editComponent: 'DatePicker',
editComponentProps: {
format: 'YYYY-MM-DD${isTime?' HH:mm':''}',
showTime: ${isTime?'{ format: \'HH:mm\' \}':'false'},
},
<% }else if(c.showType == 'userselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: officeTreeData,
params: { isLoadUser: true, userIdPrefix: '' },
canSelectParent: false,
allowClear: true,
},
<% }else if(c.showType == 'officeselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: officeTreeData,
canSelectParent: false,
allowClear: true,
},
<% }else if(c.showType == 'companyselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: companyTreeData,
canSelectParent: false,
allowClear: true,
},
<% }else if(c.showType == 'areaselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: areaTreeData,
canSelectParent: false,
allowClear: true,
},
<% }else{ %>
editComponent: 'Input',
<% } %>
editRule: ${c.isRequired == '1'},
},
<%
}
%>
]);
${@StringUtils.uncap(child.className)}Table.setTableData(record.value.${@StringUtils.uncap(child.className)}List || []);
}
function handle${child.className}RowClick(record: Recordable) {
record.onEdit?.(true, false);
}
function handle${child.className}Add() {
${@StringUtils.uncap(child.className)}Table.insertTableDataRecord({
id: new Date().getTime(),
isNewRecord: true,
editable: true,
});
}
function handle${child.className}Delete(record: Recordable) {
${@StringUtils.uncap(child.className)}Table.deleteTableDataRecord(record);
}
async function get${child.className}List() {
let ${@StringUtils.uncap(child.className)}ListValid = true;
let ${@StringUtils.uncap(child.className)}List: Recordable[] = [];
for (const record of ${@StringUtils.uncap(child.className)}Table.getDataSource()) {
if (!(await record.onEdit?.(false, true))) {
${@StringUtils.uncap(child.className)}ListValid = false;
}
${@StringUtils.uncap(child.className)}List.push({
...record,
id: !!record.isNewRecord ? '' : record.id,
});
}
for (const record of ${@StringUtils.uncap(child.className)}Table.getDelDataSource()) {
if (!!record.isNewRecord) continue;
${@StringUtils.uncap(child.className)}List.push({
...record,
status: '1',
});
}
if (!${@StringUtils.uncap(child.className)}ListValid) {
throw {
errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }],
message: t('${child.comments}填写有误,请根据提示修正'),
};
}
return ${@StringUtils.uncap(child.className)}List;
}
<% } %>
const [register${modalOrDrawer}, { set${modalOrDrawer}Props, close${modalOrDrawer} }] = use${modalOrDrawer}Inner(async (data) => {
set${modalOrDrawer}Props({ loading: true });
@@ -639,7 +449,7 @@ for (c in table.columnList){
<% } %>
setFieldsValue(record.value);
<% for (child in table.childList){ %>
set${child.className}TableData(res);
form${@StringUtils.cap(child.classNameSimple)}ListRef.value?.setTableData(record.value);
<% } %>
<% if(updateSchemas.~size > 0){ %>
updateSchema([
@@ -658,7 +468,7 @@ for (c in table.columnList){
formData(true, data); // 将表单数据传递给 BpmButton
} catch (error: any) {
if (error && error.errorFields) {
showMessage(t('common.validateError'));
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
}
@@ -688,7 +498,7 @@ for (c in table.columnList){
%>
};
<% for (child in table.childList){ %>
data.${@StringUtils.uncap(child.className)}List = await get${child.className}List();
await form${@StringUtils.cap(child.classNameSimple)}ListRef.value?.getTableData(data);
<% } %>
<% if(table.isTreeEntity){ %>
data.oldParentCode = record.value.parentCode;

View File

@@ -0,0 +1,250 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>vueFormChildList</name>
<filePath>${frontDir}/src/views/${urlPrefix}</filePath>
<fileName>form${@StringUtils.cap(table.classNameSimple)}List.vue</fileName>
<content><![CDATA[
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author ${functionAuthor}
-->
<template>
<div>
<BasicTable @register="registerTable" @row-click="handleRowClick" />
<% if(table.tplCategory != 'query'){ %>
<a-button class="mt-2" @click="handleRowAdd" v-auth="'${permissionPrefix}:edit'">
<Icon icon="i-ant-design:plus-circle-outlined" /> {{ t('新增') }}
</a-button>
<% } %>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { Icon } from '/@/components/Icon';
import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
import { ${ParentClassName} } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${parentClassName}';
<%
var userselectExists = false;
var officeselectExists = false;
var companyselectExists = false;
var areaselectExists = false;
for(c in table.columnList){
if(c.isQuery == "1" && !c.isTreeEntityColumn){
if(c.showType == 'userselect'){
userselectExists = true;
}else if(c.showType == 'officeselect'){
officeselectExists = true;
}else if(c.showType == 'companyselect'){
companyselectExists = true;
}else if(c.showType == 'areaselect'){
areaselectExists = true;
}
}
}
%>
<% if(userselectExists || officeselectExists) { %>
import { officeTreeData } from '/@/api/sys/office';
<% } %>
<% if(companyselectExists) { %>
import { companyTreeData } from '/@/api/sys/company';
<% } %>
<% if(areaselectExists) { %>
import { areaTreeData } from '/@/api/sys/area';
<% } %>
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
const record = ref<TestData>({} as ${ParentClassName});
const tableColumns: BasicColumn[] = [
<%
for (c in table.columnList){
if (c.isEdit != '1' || c.isPk == '1'){
continue;
}
if(table.parentExists && table.parentTableFkName == c.columnName){
continue;
}
%>
{
title: t('${c.columnLabel}'),
dataIndex: '${c.attrName}',
<% if(c.showType == 'datetime'){ %>
width: 215,
<% }else{ %>
width: 130,
<% } %>
<% if ((isNotBlank(c.optionMap['dictType']) || @StringUtils.inString(c.attrType, 'java.util.Date', 'Integer', 'Long'))){ %>
align: 'center',
<% }else if (@StringUtils.inString(c.attrType, 'Float', 'Double')){ %>
align: 'right',
<% }else{ %>
align: 'left',
<% } %>
<% if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'checkbox' || c.showType == 'radio'){ %>
dictType: '${c.optionMap['dictType']}',
<% } %>
editRow: true,
<% if(c.showType == 'input' || c.showType == 'textarea'){ %>
<% if (c.simpleAttrType == 'Integer' && c.attrName == 'treeSort'){ %>
editComponent: 'InputNumber',
editDefaultValue: '30',
<% }else{ %>
editComponent: '${c.showType == 'input' ? 'Input' : 'InputTextArea'}',
<% } %>
<% if (c.dataLength != '0'){ %>
editComponentProps: {
maxlength: ${c.dataLength},
},
<% } %>
<% }else if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'radio' || c.showType == 'checkbox'){
var isMultiple = (c.showType == 'select_multiple'); %>
editComponent: 'Select',
editComponentProps: {
dictType: '${c.optionMap['dictType']}',
allowClear: true,
<% if(isMultiple){ %>
mode: 'multiple',
<% } %>
},
<% }else if(c.showType == 'date' || c.showType == 'datetime'){
var isTime = (c.showType == 'datetime'); %>
editComponent: 'DatePicker',
editComponentProps: {
format: 'YYYY-MM-DD${isTime?' HH:mm':''}',
showTime: ${isTime?'{ format: \'HH:mm\' \}':'false'},
},
<% }else if(c.showType == 'userselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: officeTreeData,
params: { isLoadUser: true, userIdPrefix: '' },
canSelectParent: false,
allowClear: true,
},
<% }else if(c.showType == 'officeselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: officeTreeData,
canSelectParent: false,
allowClear: true,
},
<% }else if(c.showType == 'companyselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: companyTreeData,
canSelectParent: false,
allowClear: true,
},
<% }else if(c.showType == 'areaselect'){
if (isNotBlank(c.attrName2)){ %>
dataLabel: '${c.attrName2}',
<% } %>
editComponent: 'TreeSelect',
editComponentProps: {
api: areaTreeData,
canSelectParent: false,
allowClear: true,
},
<% }else{ %>
editComponent: 'Input',
<% } %>
editRule: ${c.isRequired == '1'},
},
<% } %>
];
const [registerTable, tableAction] = useTable({
columns: tableColumns,
actionColumn: {
width: 60,
actions: (record: Recordable) => [
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
popConfirm: {
title: '是否确认删除',
confirm: handleRowDelete.bind(this, record),
},
auth: '${permissionPrefix}:edit',
},
],
},
rowKey: 'id',
pagination: false,
bordered: true,
size: 'small',
inset: true,
});
function handleRowClick(data: Recordable) {
data.onEdit?.(true, false);
}
function handleRowAdd() {
tableAction.insertTableDataRecord({
id: 'rid_' + new Date().getTime(),
isNewRecord: true,
editable: true,
});
}
function handleRowDelete(data: Recordable) {
tableAction.deleteTableDataRecord(data);
}
async function getTableData(data: Recordable): Promise<Recordable> {
let valid = true;
let tableList: Recordable[] = [];
for (const record of tableAction.getDataSource()) {
if (!(await record.onEdit?.(false, true))) {
valid = false;
}
tableList.push({
...record,
id: !!record.isNewRecord ? '' : record.id,
});
}
for (const record of tableAction.getDelDataSource()) {
if (!!record.isNewRecord) continue;
tableList.push({
...record,
status: '1',
});
}
if (!valid) {
throw {
errorFields: [{ name: ['${@StringUtils.uncap(table.classNameSimple)}List'] }],
message: t('${table.comments}填写有误,请根据提示修正'),
};
}
data.${@StringUtils.uncap(table.classNameSimple)}List = tableList;
return tableList;
}
async function setTableData(data: Recordable) {
record.value = data as ${ParentClassName};
tableAction.setTableData(data.${@StringUtils.uncap(table.classNameSimple)}List || []);
}
defineExpose({
getTableData,
setTableData,
});
</script>
<% %>
]]>
</content>
</template>

View File

@@ -26,7 +26,7 @@
<% for (child in table.childList){ %>
<template #${@StringUtils.uncap(child.className)}>
<BasicForm @register="register${child.className}Form">
<template #${@StringUtils.uncap(child.className)}List>
<template #${@StringUtils.uncap(child.classNameSimple)}List>
<BasicTable
@register="register${child.className}Table"
@row-click="handle${child.className}RowClick"
@@ -370,10 +370,10 @@ for (c in table.columnList){
const input${child.className}FormSchemas: FormSchema[] = [
{
field: '${@StringUtils.uncap(child.className)}List',
field: '${@StringUtils.uncap(child.classNameSimple)}List',
component: 'Input',
colProps: { md: 24, lg: 24 },
slot: '${@StringUtils.uncap(child.className)}List',
slot: '${@StringUtils.uncap(child.classNameSimple)}List',
},
];
<%
@@ -473,7 +473,7 @@ for (c in table.columnList){
baseColProps: { md: 24, lg: 24 },
});
const [register${child.className}Table, ${@StringUtils.uncap(child.className)}Table] = useTable({
const [register${child.className}Table, ${@StringUtils.uncap(child.classNameSimple)}Table] = useTable({
actionColumn: {
width: 60,
actions: (record: Recordable) => [
@@ -496,7 +496,7 @@ for (c in table.columnList){
});
async function set${child.className}TableData(_res: Recordable) {
${@StringUtils.uncap(child.className)}Table.setColumns([
${@StringUtils.uncap(child.classNameSimple)}Table.setColumns([
<%
for (c in child.columnList){
if (c.isEdit != '1' || c.isPk == '1'){
@@ -604,7 +604,7 @@ for (c in table.columnList){
}
%>
]);
${@StringUtils.uncap(child.className)}Table.setTableData(record.value.${@StringUtils.uncap(child.className)}List || []);
${@StringUtils.uncap(child.classNameSimple)}Table.setTableData(record.value.${@StringUtils.uncap(child.classNameSimple)}List || []);
}
function handle${child.className}RowClick(record: Recordable) {
@@ -612,7 +612,7 @@ for (c in table.columnList){
}
function handle${child.className}Add() {
${@StringUtils.uncap(child.className)}Table.insertTableDataRecord({
${@StringUtils.uncap(child.classNameSimple)}Table.insertTableDataRecord({
id: new Date().getTime(),
isNewRecord: true,
editable: true,
@@ -620,35 +620,35 @@ for (c in table.columnList){
}
function handle${child.className}Delete(record: Recordable) {
${@StringUtils.uncap(child.className)}Table.deleteTableDataRecord(record);
${@StringUtils.uncap(child.classNameSimple)}Table.deleteTableDataRecord(record);
}
async function get${child.className}List() {
let ${@StringUtils.uncap(child.className)}ListValid = true;
let ${@StringUtils.uncap(child.className)}List: Recordable[] = [];
for (const record of ${@StringUtils.uncap(child.className)}Table.getDataSource()) {
let ${@StringUtils.uncap(child.classNameSimple)}ListValid = true;
let ${@StringUtils.uncap(child.classNameSimple)}List: Recordable[] = [];
for (const record of ${@StringUtils.uncap(child.classNameSimple)}Table.getDataSource()) {
if (!(await record.onEdit?.(false, true))) {
${@StringUtils.uncap(child.className)}ListValid = false;
${@StringUtils.uncap(child.classNameSimple)}ListValid = false;
}
${@StringUtils.uncap(child.className)}List.push({
${@StringUtils.uncap(child.classNameSimple)}List.push({
...record,
id: !!record.isNewRecord ? '' : record.id,
});
}
for (const record of ${@StringUtils.uncap(child.className)}Table.getDelDataSource()) {
for (const record of ${@StringUtils.uncap(child.classNameSimple)}Table.getDelDataSource()) {
if (!!record.isNewRecord) continue;
${@StringUtils.uncap(child.className)}List.push({
${@StringUtils.uncap(child.classNameSimple)}List.push({
...record,
status: '1',
});
}
if (!${@StringUtils.uncap(child.className)}ListValid) {
if (!${@StringUtils.uncap(child.classNameSimple)}ListValid) {
throw {
errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }],
errorFields: [{ name: ['${@StringUtils.uncap(child.classNameSimple)}List'] }],
message: t('${child.comments}填写有误,请根据提示修正'),
};
}
return ${@StringUtils.uncap(child.className)}List;
return ${@StringUtils.uncap(child.classNameSimple)}List;
}
<% } %>
@@ -713,7 +713,7 @@ for (c in table.columnList){
formData(true, data); // 将表单数据传递给 BpmButton
} catch (error: any) {
if (error && error.errorFields) {
showMessage(t('common.validateError'));
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
}
@@ -742,7 +742,7 @@ for (c in table.columnList){
%>
};
<% for (child in table.childList){ %>
data.${@StringUtils.uncap(child.className)}List = await get${child.className}List();
data.${@StringUtils.uncap(child.classNameSimple)}List = await get${child.className}List();
<% } %>
<% if(table.isTreeEntity){ %>
data.oldParentCode = record.value.parentCode;

View File

@@ -2,7 +2,7 @@
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>formImport</name>
<name>vueFormImport</name>
<filePath>${frontDir}/src/views/${urlPrefix}</filePath>
<fileName>formImport.vue</fileName>
<content><![CDATA[
@@ -107,7 +107,7 @@
emit('success');
} catch (error: any) {
if (error && error.errorFields) {
showMessage(t('common.validateError'));
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {

View File

@@ -109,64 +109,64 @@ if(table.isTreeEntity){
import { Icon } from '/@/components/Icon';
import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
import { ${className}Delete, ${className}ListData } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
import { ${className}Disable, ${className}Enable } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
<% } %>
<%
var userselectExists = false;
var officeselectExists = false;
var companyselectExists = false;
var areaselectExists = false;
for(c in table.columnList){
if(c.isQuery == "1" && !c.isTreeEntityColumn){
if(c.showType == 'userselect'){
userselectExists = true;
}else if(c.showType == 'officeselect'){
officeselectExists = true;
}else if(c.showType == 'companyselect'){
companyselectExists = true;
}else if(c.showType == 'areaselect'){
areaselectExists = true;
<% } %>
<%
var userselectExists = false;
var officeselectExists = false;
var companyselectExists = false;
var areaselectExists = false;
for(c in table.columnList){
if(c.isQuery == "1" && !c.isTreeEntityColumn){
if(c.showType == 'userselect'){
userselectExists = true;
}else if(c.showType == 'officeselect'){
officeselectExists = true;
}else if(c.showType == 'companyselect'){
companyselectExists = true;
}else if(c.showType == 'areaselect'){
areaselectExists = true;
}
}
}
}
%>
<% if(userselectExists || officeselectExists) { %>
%>
<% if(userselectExists || officeselectExists) { %>
import { officeTreeData } from '/@/api/sys/office';
<% } %>
<% if(companyselectExists) { %>
<% } %>
<% if(companyselectExists) { %>
import { companyTreeData } from '/@/api/sys/company';
<% } %>
<% if(areaselectExists) { %>
<% } %>
<% if(areaselectExists) { %>
import { areaTreeData } from '/@/api/sys/area';
<% } %>
<% if(modalOrDrawer == 'Drawer' && !@StringUtils.contains(table.tplCategory, '_route')){ %>
<% } %>
<% if(modalOrDrawer == 'Drawer' && !@StringUtils.contains(table.tplCategory, '_route')){ %>
import { useDrawer } from '/@/components/Drawer';
<% } %>
<% if(modalOrDrawer == 'Modal' || (toBoolean(table.optionMap['isBpmForm'])
<% } %>
<% if(modalOrDrawer == 'Modal' || (toBoolean(table.optionMap['isBpmForm'])
|| toBoolean(table.optionMap['isImportExport']))){ %>
import { useModal } from '/@/components/Modal';
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
import { BpmRuntimeTrace } from '/@/components/Bpm';
<% } %>
<% } %>
import { FormProps } from '/@/components/Form';
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
import InputForm from './form.vue';
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import FormImport from './formImport.vue';
<% } %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
<% } %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
const props = defineProps({
treeCode: String,
});
<% } %>
<% if(@StringUtils.contains(table.tplCategory, '_route')) { %>
<% } %>
<% if(@StringUtils.contains(table.tplCategory, '_route')) { %>
const emitter = useEmitter();
<% } %>
<% } %>
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
const { showMessage } = useMessage();
@@ -176,9 +176,9 @@ for(c in table.columnList){
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('${functionNameSimple}管理'),
};
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
const loading = ref(false);
<% } %>
<% } %>
const searchForm: FormProps = {
baseColProps: { md: 8, lg: 6 },
@@ -409,9 +409,6 @@ for(c in table.columnList){
],
};
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
const [register${modalOrDrawer}, { open${modalOrDrawer} }] = use${modalOrDrawer}();
<% } %>
const [registerTable, { reload<% if(table.isTreeEntity){ %>, expandAll, collapseAll, expandCollapse<% } %><%
if (table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])
|| toBoolean(table.optionMap['isImportExport'])){ %>, getForm<% } %> }] = useTable({
@@ -430,7 +427,11 @@ for(c in table.columnList){
<% } %>
canResize: true,
});
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
const [register${modalOrDrawer}, { open${modalOrDrawer} }] = use${modalOrDrawer}();
<% } %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
watch(
() => props.treeCode,
@@ -447,15 +448,15 @@ for(c in table.columnList){
reload();
},
);
<% } %>
<% if(table.isTreeEntity){ %>
<% } %>
<% if(table.isTreeEntity){ %>
function fetchSuccess() {
if (props.treeCode) {
nextTick(expandAll);
}
}
<% } %>
<% } %>
function handleForm(record: Recordable) {
<% if(!@StringUtils.contains(table.tplCategory, '_route')) { %>
@@ -467,7 +468,7 @@ for(c in table.columnList){
});
<% } %>
}
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
async function handleExport() {
loading.value = true;
@@ -484,8 +485,8 @@ for(c in table.columnList){
function handleImport() {
importModal(true, {});
}
<% } %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
<% } %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
async function handleDisable(record: Recordable) {
const params = { ${idParam} };
@@ -500,7 +501,7 @@ for(c in table.columnList){
showMessage(res.message);
handleSuccess(record);
}
<% } %>
<% } %>
async function handleDelete(record: Recordable) {
const params = { ${idParam} };

View File

@@ -18,7 +18,7 @@
<i class="fa fa-sign-out"></i> ${text('退出登录')}</a>
</li>
<% var sysCodes = [];
for(var role in user.roleList) {
for(var role in roleList) {
var codes = @StringUtils.splitComma(role.sysCodes);
if (!isEmpty(codes)) {
for (var code in codes) {
@@ -47,12 +47,25 @@
<% }else{ %>
<li class="mt10"></li>
<% } %>
<% if(user.roleList.~size > 0){ %>
<% if(postList.~size > 0){ %>
<li class="divider"></li>
<% var postCode = @ObjectUtils.toStringIgnoreNull(session.postCode, ''); %>
<li class="dropdown-header mb5">${text('选择岗位')}<% if(isNotBlank(postCode)){ %>
<i class="fa fa-close pointer" title="${text('清除设置')}" onclick="location='${ctx}/switchPost'"></i><% } %></li>
<% for(var post in postList){ %>
<li>
<a href="${ctx}/switchPost/${post.postCode}">
<i class="fa fa-${postCode == post.postCode
? 'check-' : ''}circle-o"></i> ${post.postName}
</a>
</li>
<% } %>
<% } else if(roleList.~size > 0){ %>
<li class="divider"></li>
<% var roleCode = @ObjectUtils.toStringIgnoreNull(session.roleCode, ''); %>
<li class="dropdown-header mb5">${text('选择身份')}<% if(isNotBlank(roleCode)){ %>
<i class="fa fa-close pointer" title="${text('清除设置')}" onclick="location='${ctx}/switchRole'"></i><% } %></li>
<% for(var role in user.roleList){ if(role.isShow == '1'){ %>
<% for(var role in roleList){ if(role.isShow == '1'){ %>
<li>
<a href="${ctx}/switchRole/${role.roleCode}">
<i class="fa fa-${roleCode == role.roleCode

View File

@@ -66,14 +66,14 @@
</div>
<div class="form-group has-feedback">
<span class="fa fa-lock form-control-feedback"></span>
<input type="password" autocomplete="off" id="fp_password" name="password"
<input type="password" autocomplete="new-password" id="fp_password" name="password"
class="form-control required" data-msg-required="请填写新密码."
rangelength="3,50" data-msg-rangelength="新密码长度不能小于3并大于50个字符."
placeholder="新密码" />
</div>
<div class="form-group has-feedback">
<span class="fa fa-lock form-control-feedback"></span>
<input type="password" autocomplete="off" id="fp_confirmPassword" name="confirmPassword"
<input type="password" autocomplete="new-password" id="fp_confirmPassword" name="confirmPassword"
class="form-control required" data-msg-required="请填写确认新密码."
rangelength="3,50" data-msg-rangelength="新密码长度不能小于3并大于50个字符."
equalTo="#fp_password" data-msg-equalTo="新密码与确认新密码不同."

View File

@@ -57,14 +57,14 @@
</div>
<div class="form-group has-feedback">
<span class="fa fa-lock form-control-feedback"></span>
<input type="password" autocomplete="off" id="reg_password" name="password"
<input type="password" autocomplete="new-password" id="reg_password" name="password"
class="form-control required" data-msg-required="请填写登录密码."
rangelength="3,50" data-msg-rangelength="登录密码长度不能小于3并大于50个字符."
placeholder="登录密码" />
</div>
<div class="form-group has-feedback">
<span class="fa fa-lock form-control-feedback"></span>
<input type="password" autocomplete="off" id="reg_confirmPassword" name="confirmPassword"
<input type="password" autocomplete="new-password" id="reg_confirmPassword" name="confirmPassword"
class="form-control required" data-msg-required="请再填一次登录密码."
rangelength="3,50" data-msg-rangelength="登录密码长度不能小于3并大于50个字符."
equalTo="#reg_password" data-msg-equalTo="填写的密码与登录密码不同."

View File

@@ -256,7 +256,7 @@ $("#empOfficeGrid").dataGrid({
}
}
},
{header:'${text("操作")}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
{header:'${text("操作")}', name:'actions', width:80, align:"center", sortable:false, fixed:true, formatter: function(val, obj, row, act){
var actions = [];
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#empOfficeGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
return actions.join('');

View File

@@ -132,7 +132,7 @@
<div class="form-group">
<label class="control-label col-sm-3">${text('旧密码')}</label>
<div class="col-sm-8">
<input id="oldPassword" name="oldPassword" type="password" autocomplete="off" value="" maxlength="50" minlength="3" class="form-control required"/>
<input id="oldPassword" name="oldPassword" type="password" autocomplete="new-password" value="" maxlength="50" minlength="3" class="form-control required"/>
</div>
</div>
</div>
@@ -141,7 +141,7 @@
<label class="control-label col-sm-3">${text('新密码')}</label>
<div class="col-sm-8">
<div class="strength strength-loose">
<input id="newPassword" name="newPassword" type="password" autocomplete="off" value="" maxlength="50" minlength="3" class="form-control required"/>
<input id="newPassword" name="newPassword" type="password" autocomplete="new-password" value="" maxlength="50" minlength="3" class="form-control required"/>
</div>
</div>
</div>
@@ -150,7 +150,7 @@
<div class="form-group">
<label class="control-label col-sm-3">${text('确认新密码')}</label>
<div class="col-sm-8">
<input id="confirmNewPassword" name="confirmNewPassword" type="password" autocomplete="off" value="" maxlength="50" minlength="3" class="form-control required" equalTo="#newPassword"/>
<input id="confirmNewPassword" name="confirmNewPassword" type="password" autocomplete="new-password" value="" maxlength="50" minlength="3" class="form-control required" equalTo="#newPassword"/>
</div>
</div>
</div>
@@ -179,7 +179,7 @@
<div class="form-group">
<label class="control-label col-sm-3">${text('登录密码')}</label>
<div class="col-sm-8">
<input id="validPassword" name="validPassword" type="password" autocomplete="off" value="" maxlength="50" minlength="3" class="form-control required"/>
<input id="validPassword" name="validPassword" type="password" autocomplete="new-password" value="" maxlength="50" minlength="3" class="form-control required"/>
</div>
</div>
</div>

View File

@@ -5,7 +5,7 @@
<groupId>com.jeesite</groupId>
<artifactId>jeesite-modules</artifactId>
<version>5.9.0-SNAPSHOT</version>
<version>5.9.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JeeSite Modules</name>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.0-SNAPSHOT</version>
<version>5.9.2-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

Some files were not shown because too many files have changed in this diff Show More