Former-commit-id: 478face000e2bf0a244e553dccd518bc6e01c7a5
master
wangbing 5 years ago
parent a6a3c08482
commit 6d8fca6f98

@ -147,7 +147,9 @@ public class ${table.getCName()}ManagerImpl implements ${table.getCName()}Manage
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}
@ -206,7 +208,9 @@ public class ${table.getCName()}ManagerImpl implements ${table.getCName()}Manage
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -64,6 +64,8 @@ public class User extends BaseEntity {
@ColumnDescription("")
private String deptName;
private String roleNames;
public String getUserName() {
return this.userName;
}
@ -127,4 +129,12 @@ public class User extends BaseEntity {
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getRoleNames() {
return this.roleNames;
}
public void setRoleNames(String roleNames) {
this.roleNames = roleNames;
}
}

@ -80,8 +80,8 @@ public class DeptManagerImpl implements DeptManager {
entity.setId(id);
if (StringUtil.isEmpty(entity.getSupCode()) || StringUtil.isEmpty(entity.getSupName())) {
String deptCode = entity.getDeptCode();
while (deptCode.contains("_")) {
deptCode = deptCode.substring(0, deptCode.lastIndexOf("_"));
while (deptCode.length() > 0) {
deptCode = deptCode.substring(0, deptCode.length() - 1);
DeptFindRequest deptFindRequest = new DeptFindRequest();
deptFindRequest.setDeptCode(deptCode);
DeptFindResponse deptFindResponse = this.find(deptFindRequest, token);
@ -89,6 +89,7 @@ public class DeptManagerImpl implements DeptManager {
Dept supDept = deptFindResponse.getResult().get(0);
entity.setSupCode(supDept.getDeptCode());
entity.setSupName(supDept.getDeptName());
break;
}
}
}
@ -169,7 +170,9 @@ public class DeptManagerImpl implements DeptManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}
@ -208,7 +211,6 @@ public class DeptManagerImpl implements DeptManager {
return response;
}
@Override
public DeptTreeResponse tree(DeptTreeRequest request, Token token) {
DeptTreeResponse response = new DeptTreeResponse();
@ -221,8 +223,8 @@ public class DeptManagerImpl implements DeptManager {
DeptFindRequest deptFindRequest = new DeptFindRequest();
deptFindRequest.setPageSize(0);
deptFindRequest.setValid(true);
deptFindRequest.setSortType(SortType.ASC);
deptFindRequest.setSortKey("DEPT_CODE");
deptFindRequest.setSortType(SortType.ASC);
DeptFindResponse deptFindResponse = this.find(deptFindRequest, token);
if (deptFindResponse.hasError()) {
@ -233,8 +235,6 @@ public class DeptManagerImpl implements DeptManager {
List<DeptTree> data = new ArrayList<>();
Map<String, DeptTree> allMap = new HashMap<>();
List<Dept> result = deptFindResponse.getResult();
// 获取最顶级资源
int level = 1;
while (result.size() > 0) {
Iterator<Dept> iterator = result.iterator();
while (iterator.hasNext()) {
@ -250,25 +250,22 @@ public class DeptManagerImpl implements DeptManager {
tree.setValue(next.getDeptCode());
tree.setLabel(next.getDeptName());
if (next.getDeptCode() != null && next.getDeptCode().split("_").length == level) {
allMap.put(tree.getValue(), tree);
iterator.remove();
//尝试获取上级资源
String code = next.getDeptCode();
DeptTree Ptree = null;
while (code.contains("_")) {
code = code.substring(0, code.lastIndexOf("_"));
Ptree = allMap.get(code);
if (Ptree != null) break;
}
if (Ptree != null) {
Ptree.addChild(tree);
} else {
data.add(tree);
}
allMap.put(tree.getValue(), tree);
iterator.remove();
//尝试获取上级资源
String code = next.getDeptCode();
DeptTree Ptree = null;
while (code.length() > 0) {
code = code.substring(0, code.length() - 1);
Ptree = allMap.get(code);
if (Ptree != null) break;
}
if (Ptree != null) {
Ptree.addChild(tree);
} else {
data.add(tree);
}
}
level++;
}
response.setResult(data);

@ -134,7 +134,9 @@ public class DictItemManagerImpl implements DictItemManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -143,7 +143,9 @@ public class DictManagerImpl implements DictManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -107,7 +107,9 @@ public class FileManagerImpl implements FileManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -144,7 +144,9 @@ public class ResManagerImpl implements ResManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}
@ -195,8 +197,8 @@ public class ResManagerImpl implements ResManager {
ResFindRequest resourceFindRequest = new ResFindRequest();
resourceFindRequest.setPageSize(0);
resourceFindRequest.setValid(true);
resourceFindRequest.setSortKey("RES_CODE");
resourceFindRequest.setSortType(SortType.ASC);
resourceFindRequest.setSortKey("CODE");
ResFindResponse resourceFindResponse = this.find(resourceFindRequest, token);
if (resourceFindResponse.hasError()) {
@ -207,8 +209,6 @@ public class ResManagerImpl implements ResManager {
List<ResTree> data = new ArrayList<>();
Map<String, ResTree> allMap = new HashMap<>();
List<Res> result = resourceFindResponse.getResult();
// 获取最顶级资源
int level = 1;
while (result.size() > 0) {
Iterator<Res> iterator = result.iterator();
while (iterator.hasNext()) {
@ -223,25 +223,22 @@ public class ResManagerImpl implements ResManager {
tree.setRowVersion(next.getRowVersion());
tree.setLabel(next.getResName());
if (next.getResCode() != null && next.getResCode().split("_").length == level) {
allMap.put(tree.getResCode(), tree);
iterator.remove();
//尝试获取上级资源
String code = next.getResCode();
ResTree Ptree = null;
while (code.contains("_")) {
code = code.substring(0, code.lastIndexOf("_"));
Ptree = allMap.get(code);
if (Ptree != null) break;
}
if (Ptree != null) {
Ptree.addChild(tree);
} else {
data.add(tree);
}
allMap.put(tree.getResCode(), tree);
iterator.remove();
//尝试获取上级资源
String code = next.getResCode();
ResTree Ptree = null;
while (code.length() > 0) {
code = code.substring(0, code.length() - 1);
Ptree = allMap.get(code);
if (Ptree != null) break;
}
if (Ptree != null) {
Ptree.addChild(tree);
} else {
data.add(tree);
}
}
level++;
}
response.setResult(data);

@ -134,7 +134,9 @@ public class RoleManagerImpl implements RoleManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -137,7 +137,9 @@ public class RoleResManagerImpl implements RoleResManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -146,7 +146,9 @@ public class TokensManagerImpl implements ${basePackage}.module.system.mgr.Token
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -1,4 +1,4 @@
package xyz.wbsite.module.system.mgr;
package ${basePackage}.module.system.mgr;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -7,26 +7,30 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import xyz.wbsite.frame.base.ErrorType;
import xyz.wbsite.frame.base.Token;
import xyz.wbsite.frame.utils.IDgenerator;
import xyz.wbsite.frame.utils.MapperUtil;
import xyz.wbsite.frame.utils.Message;
import xyz.wbsite.frame.utils.ValidationUtil;
import xyz.wbsite.module.system.ent.User;
import xyz.wbsite.module.system.mpr.UserMapper;
import xyz.wbsite.module.system.req.UserCreateRequest;
import xyz.wbsite.module.system.req.UserDeleteRequest;
import xyz.wbsite.module.system.req.UserFindRequest;
import xyz.wbsite.module.system.req.UserGetRequest;
import xyz.wbsite.module.system.req.UserRoleCreateRequest;
import xyz.wbsite.module.system.req.UserUpdateRequest;
import xyz.wbsite.module.system.rsp.UserCreateResponse;
import xyz.wbsite.module.system.rsp.UserDeleteResponse;
import xyz.wbsite.module.system.rsp.UserFindResponse;
import xyz.wbsite.module.system.rsp.UserGetResponse;
import xyz.wbsite.module.system.rsp.UserRoleCreateResponse;
import xyz.wbsite.module.system.rsp.UserUpdateResponse;
import ${basePackage}.frame.base.ErrorType;
import ${basePackage}.frame.base.Token;
import ${basePackage}.frame.utils.IDgenerator;
import ${basePackage}.frame.utils.MD5Util;
import ${basePackage}.frame.utils.MapperUtil;
import ${basePackage}.frame.utils.Message;
import ${basePackage}.frame.utils.ValidationUtil;
import ${basePackage}.module.system.ent.Dept;
import ${basePackage}.module.system.ent.User;
import ${basePackage}.module.system.mpr.UserMapper;
import ${basePackage}.module.system.req.DeptFindRequest;
import ${basePackage}.module.system.req.UserCreateRequest;
import ${basePackage}.module.system.req.UserDeleteRequest;
import ${basePackage}.module.system.req.UserFindRequest;
import ${basePackage}.module.system.req.UserGetRequest;
import ${basePackage}.module.system.req.UserRoleCreateRequest;
import ${basePackage}.module.system.req.UserUpdateRequest;
import ${basePackage}.module.system.rsp.DeptFindResponse;
import ${basePackage}.module.system.rsp.UserCreateResponse;
import ${basePackage}.module.system.rsp.UserDeleteResponse;
import ${basePackage}.module.system.rsp.UserFindResponse;
import ${basePackage}.module.system.rsp.UserGetResponse;
import ${basePackage}.module.system.rsp.UserRoleCreateResponse;
import ${basePackage}.module.system.rsp.UserUpdateResponse;
/**
* USER -
@ -42,6 +46,8 @@ public class UserManagerImpl implements UserManager {
@Autowired
private UserMapper userMapper;
@Autowired
private DeptManager deptManager;
@Autowired
private UserRoleManager userRoleManager;
/**
@ -62,6 +68,25 @@ public class UserManagerImpl implements UserManager {
long id = IDgenerator.nextId();
User entity = MapperUtil.map(request, User.class);
entity.setId(id);
entity.setUserPwd(MD5Util.generatePwd(entity.getUserPwd()));
{
DeptFindRequest deptFindRequest = new DeptFindRequest();
deptFindRequest.setDeptCode(request.getDeptCode());
deptFindRequest.setPageSize(1);
DeptFindResponse deptFindResponse = deptManager.find(deptFindRequest, token);
if (deptFindResponse.hasError()) {
response.addErrors(deptFindResponse.getErrors());
return response;
}
if (deptFindResponse.getResult().size() == 0) {
response.addError(ErrorType.BUSINESS_ERROR, "[" + request.getDeptCode() + "]机构代码不存在");
return response;
}
Dept dept = deptFindResponse.getResult().get(0);
entity.setDeptId(dept.getId());
entity.setDeptName(dept.getDeptName());
}
long result = userMapper.insert(entity, token);
if (1L != result) {
@ -154,7 +179,9 @@ public class UserManagerImpl implements UserManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -134,7 +134,9 @@ public class UserRoleManagerImpl implements UserRoleManager {
return response;
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}

@ -20,6 +20,7 @@
<result column="DEPT_ID" jdbcType="BIGINT" property="deptId"/>
<result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode"/>
<result column="DEPT_NAME" jdbcType="VARCHAR" property="deptName"/>
<result column="ROLE_NAMES" jdbcType="VARCHAR" property="roleNames"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
@ -30,31 +31,42 @@
<select id="find" resultMap="user">
SELECT
<include refid="entityColumnList"/>
t1.*,t2.ROLE_NAMES
FROM
<include refid="table"/>
WHERE
`IS_DELETED` = 0
`sys_user` t1,
(
SELECT
t2.user_id, GROUP_CONCAT(t3.NAME) ROLE_NAMES
FROM
`sys_user_role` t2,
`sys_role` t3
WHERE
t2.ROLE_ID = t3.ID
AND t2.`IS_DELETED` = 0
AND t3.`IS_DELETED` = 0
GROUP BY t2.USER_ID
) t2
WHERE t1.`IS_DELETED` = 0 and t1.ID = t2.user_id
<if test="request.userName != null and request.userName != ''">
AND `USER_NAME` = ${r"#"}{request.userName}
AND t1.`USER_NAME` = ${r"#"}{request.userName}
</if>
<if test="request.userCode != null and request.userCode != ''">
AND `USER_CODE` = ${r"#"}{request.userCode}
AND t1.`USER_CODE` = ${r"#"}{request.userCode}
</if>
<if test="request.userAlias != null and request.userAlias != ''">
AND `USER_ALIAS` = ${r"#"}{request.userAlias}
AND t1.`USER_ALIAS` = ${r"#"}{request.userAlias}
</if>
<if test="request.userStatus != null and request.userStatus != ''">
AND `USER_STATUS` = ${r"#"}{request.userStatus}
AND t1.`USER_STATUS` = ${r"#"}{request.userStatus}
</if>
<if test="request.deptId != null and request.deptId != 0">
AND `DEPT_ID` = ${r"#"}{request.deptId}
AND t1.`DEPT_ID` = ${r"#"}{request.deptId}
</if>
<if test="request.deptCode != null and request.deptCode != ''">
AND `DEPT_CODE` = ${r"#"}{request.deptCode}
AND t1.`DEPT_CODE` = ${r"#"}{request.deptCode}
</if>
<if test="request.deptName != null and request.deptName != ''">
AND `DEPT_NAME` = ${r"#"}{request.deptName}
AND t1.`DEPT_NAME` = ${r"#"}{request.deptName}
</if>
</select>
@ -136,10 +148,7 @@
UPDATE
<include refid="table"/>
SET
`USER_NAME` = ${r"#"}{request.userName,jdbcType=VARCHAR},
`USER_CODE` = ${r"#"}{request.userCode,jdbcType=VARCHAR},
`USER_ALIAS` = ${r"#"}{request.userAlias,jdbcType=VARCHAR},
`USER_PWD` = ${r"#"}{request.userPwd,jdbcType=VARCHAR},
`USER_STATUS` = ${r"#"}{request.userStatus,jdbcType=VARCHAR},
`DEPT_ID` = ${r"#"}{request.deptId,jdbcType=BIGINT},
`DEPT_CODE` = ${r"#"}{request.deptCode,jdbcType=VARCHAR},

@ -22,33 +22,12 @@ public class UserUpdateRequest extends BaseUpdateRequest {
@NotNull(message = "[id]主键不能为NULL")
private Long id;
/**
*
*/
@NotEmpty(message = "[userName]用户账户不能为空")
@Length(min = 0, max = 100, message = "[userName]用户账户长度不合法(0-100)")
private String userName;
/**
*
*/
@NotEmpty(message = "[userCode]用户代码不能为空")
@Length(min = 0, max = 50, message = "[userCode]用户代码长度不合法(0-50)")
private String userCode;
/**
*
*/
@Length(min = 0, max = 50, message = "[userAlias]用户别名长度不合法(0-50)")
private String userAlias;
/**
*
*/
@NotEmpty(message = "[userPwd]用户密码不能为空")
@Length(min = 0, max = 50, message = "[userPwd]用户密码长度不合法(0-50)")
private String userPwd;
/**
*
*/
@ -81,22 +60,6 @@ public class UserUpdateRequest extends BaseUpdateRequest {
this.id = id;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserCode() {
return this.userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserAlias() {
return this.userAlias;
}
@ -105,14 +68,6 @@ public class UserUpdateRequest extends BaseUpdateRequest {
this.userAlias = userAlias;
}
public String getUserPwd() {
return this.userPwd;
}
public void setUserPwd(String userPwd) {
this.userPwd = userPwd;
}
public String getUserStatus() {
return this.userStatus;
}

@ -389,6 +389,14 @@
});
}
},
beforeDialogClose:function (done) {
this.$confirm('确认关闭?')
.then(function () {
done();
}).catch(function () {
});
}
},
created: function () {
},

@ -165,7 +165,7 @@
</el-pagination>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class="form" :model="form" :inline="true" :rules="formRules" ref="form" label-position="right" label-width="90px">
<#list fields as item>
<#if !item.isSystem>

@ -201,7 +201,7 @@
</el-tabs>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="部门代码" prop="deptCode">
@ -301,7 +301,7 @@
this.form.title = "部门新增";
this.form.dialog = true;
this.form.id = "";
this.form.deptCode = pItem.value + "_";
this.form.deptCode = pItem.value;
this.form.deptName = "";
this.form.deptAlias = "";
this.form.valid = true;

@ -128,7 +128,7 @@
</el-pagination>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="字典名称" prop="dictName" required>

@ -130,7 +130,7 @@
</el-pagination>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="字典键" prop="key">

@ -119,7 +119,7 @@
</el-pagination>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="文件名称" prop="name">

@ -196,7 +196,7 @@
</el-tabs>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="资源代码" prop="resCode">
@ -305,7 +305,7 @@
this.form.title = "资源新增";
this.form.dialog = true;
this.form.id = "";
this.form.resCode = pItem.resCode + "_";
this.form.resCode = pItem.resCode;
this.form.resName = "";
this.form.resType = "";
this.form.resValue = "";

@ -114,7 +114,7 @@
</el-pagination>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="角色代码" prop="code">

@ -87,13 +87,17 @@
</el-table-column>
<el-table-column
align="center"
prop="userPwd"
label="用户密码">
prop="roleNames"
label="用户角色">
</el-table-column>
<el-table-column
align="center"
prop="userStatus"
label="用户状态">
<template slot-scope="scope">
<el-tag size="mini" type="success" v-if="scope.row.userStatus=='正常'">{{scope.row.userStatus}}</el-tag>
<el-tag size="mini" type="danger" v-if="!scope.row.userStatus=='正常'">{{scope.row.userStatus}}</el-tag>
</template>
</el-table-column>
<el-table-column
align="center"
@ -137,19 +141,16 @@
</el-pagination>
</el-card>
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
<el-dialog class="form-dialog" :title="form.title" :before-close="beforeDialogClose" :visible.sync="form.dialog">
<el-form class=form" :model="form" :inline="true" :rules="formRules" ref="form"
label-position="right" label-width="90px">
<el-form-item label="用户账户" prop="userName">
<el-input v-model="form.userName" clearable size="small" placeholder="请输入用户账户"></el-input>
</el-form-item>
<el-form-item label="用户代码" prop="userCode">
<el-input v-model="form.userCode" clearable size="small" placeholder="请输入用户代码"></el-input>
<el-input v-model="form.userName" readonly size="small" placeholder="请输入用户账户"></el-input>
</el-form-item>
<el-form-item label="用户别名" prop="userAlias">
<el-input v-model="form.userAlias" clearable size="small" autocomplete="off" placeholder="请输入用户别名"></el-input>
</el-form-item>
<el-form-item label="用户密码" prop="userPwd">
<el-form-item label="用户密码" prop="userPwd" v-if="!form.id">
<el-input v-model="form.userPwd" clearable size="small" autocomplete="off" placeholder="请输入用户密码"></el-input>
</el-form-item>
<el-form-item label="所属部门" prop="deptCode">
@ -213,7 +214,6 @@
{min: 1, max: 50, message: '用户别名长度在 1 到 50 个字符', trigger: 'blur'}
],
userPwd: [
{required: true, message: '用户密码不能为空', trigger: 'blur'},
{ pattern:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/, message: '密码至少包含 数字和英文长度6-20'}
],
userStatus: [

@ -96,10 +96,7 @@ public class UserTest {
//更新数据
UserUpdateRequest request = new UserUpdateRequest();
request.setId(createResponse.getId());
request.setUserName("test");
request.setUserCode("");
request.setUserAlias("test");
request.setUserPwd("123456");
request.setUserStatus("code");
request.setDeptCode("A01");

Loading…
Cancel
Save

Powered by TurnKey Linux.