Commit 449b5259 by 宋祥

1.调整页面

parent ba480d8d
...@@ -256,8 +256,10 @@ public class HPSqlConstant { ...@@ -256,8 +256,10 @@ public class HPSqlConstant {
// 查询 // 查询
public static final String QUERY = "HPPZ010.query"; public static final String QUERY = "HPPZ010.query";
// 查询 // 查询菜单树
public static final String QUERY_TREE_NODE = "HPPZ010.queryTreeNode"; public static final String QUERY_PAGE_TREE = "HPPZ010.queryPageTree";
// 查询组织树
public static final String QUERY_ORG_TREE = "HPPZ010.queryOrgTree";
// 查询用户数据权限 // 查询用户数据权限
public static final String QUERY_USER_AUTH = "HPPZ010.queryUserAuth"; public static final String QUERY_USER_AUTH = "HPPZ010.queryUserAuth";
} }
......
...@@ -15,7 +15,7 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -15,7 +15,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-03-21 10:15:34 create * @history 2024-03-27 18:22:41 create
*/ */
public class HPPZ010 extends DaoEPBase { public class HPPZ010 extends DaoEPBase {
...@@ -32,8 +32,10 @@ public class HPPZ010 extends DaoEPBase { ...@@ -32,8 +32,10 @@ public class HPPZ010 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_PAGE_ENAME = "pageEname"; /* 页面英文名*/ public static final String FIELD_PAGE_ENAME = "pageEname"; /* 页面英文名*/
public static final String FIELD_PAGE_CNAME = "pageCname"; /* 页面中文名*/ public static final String FIELD_PAGE_CNAME = "pageCname"; /* 页面中文名*/
public static final String FIELD_CUSTOM_AUTH = "customAuth"; /* 自定义权限*/ public static final String FIELD_AUTH_DEP_CODE = "authDepCode"; /* 权限部门编码*/
public static final String FIELD_DEP_AUTH = "depAuth"; /* 部门权限*/ public static final String FIELD_AUTH_DEP_NAME = "authDepName"; /* 权限部门名称*/
public static final String FIELD_AUTH_TYPE = "authType"; /* 权限类型*/
public static final String FIELD_LINKAGE_FLAG = "linkageFlag"; /* 0-不联动,1-联动*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/
...@@ -46,8 +48,10 @@ public class HPPZ010 extends DaoEPBase { ...@@ -46,8 +48,10 @@ public class HPPZ010 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_PAGE_ENAME = "PAGE_ENAME"; /* 页面英文名*/ public static final String COL_PAGE_ENAME = "PAGE_ENAME"; /* 页面英文名*/
public static final String COL_PAGE_CNAME = "PAGE_CNAME"; /* 页面中文名*/ public static final String COL_PAGE_CNAME = "PAGE_CNAME"; /* 页面中文名*/
public static final String COL_CUSTOM_AUTH = "CUSTOM_AUTH"; /* 自定义权限*/ public static final String COL_AUTH_DEP_CODE = "AUTH_DEP_CODE"; /* 权限部门编码*/
public static final String COL_DEP_AUTH = "DEP_AUTH"; /* 部门权限*/ public static final String COL_AUTH_DEP_NAME = "AUTH_DEP_NAME"; /* 权限部门名称*/
public static final String COL_AUTH_TYPE = "AUTH_TYPE"; /* 权限类型*/
public static final String COL_LINKAGE_FLAG = "LINKAGE_FLAG"; /* 0-不联动,1-联动*/
public static final String QUERY = "HPPZ010.query"; public static final String QUERY = "HPPZ010.query";
public static final String COUNT = "HPPZ010.count"; public static final String COUNT = "HPPZ010.count";
...@@ -55,7 +59,7 @@ public class HPPZ010 extends DaoEPBase { ...@@ -55,7 +59,7 @@ public class HPPZ010 extends DaoEPBase {
public static final String UPDATE = "HPPZ010.update"; public static final String UPDATE = "HPPZ010.update";
public static final String DELETE = "HPPZ010.delete"; public static final String DELETE = "HPPZ010.delete";
private Long id; private Long id = new Long(0);
private String companyCode = " "; /* 企业编码*/ private String companyCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/ private String createdBy = " "; /* 创建人*/
...@@ -66,8 +70,10 @@ public class HPPZ010 extends DaoEPBase { ...@@ -66,8 +70,10 @@ public class HPPZ010 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private String pageEname = " "; /* 页面英文名*/ private String pageEname = " "; /* 页面英文名*/
private String pageCname = " "; /* 页面中文名*/ private String pageCname = " "; /* 页面中文名*/
private String customAuth = " "; /* 自定义权限*/ private String authDepCode = " "; /* 权限部门编码*/
private String depAuth = " "; /* 部门权限*/ private String authDepName = " "; /* 权限部门名称*/
private String authType = " "; /* 权限类型*/
private Integer linkageFlag; /* 0-不联动,1-联动*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -120,12 +126,20 @@ public class HPPZ010 extends DaoEPBase { ...@@ -120,12 +126,20 @@ public class HPPZ010 extends DaoEPBase {
eiColumn.setDescName("页面中文名"); eiColumn.setDescName("页面中文名");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CUSTOM_AUTH); eiColumn = new EiColumn(FIELD_AUTH_DEP_CODE);
eiColumn.setDescName("自定义权限"); eiColumn.setDescName("权限部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_AUTH); eiColumn = new EiColumn(FIELD_AUTH_DEP_NAME);
eiColumn.setDescName("部门权限"); eiColumn.setDescName("权限部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUTH_TYPE);
eiColumn.setDescName("权限类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LINKAGE_FLAG);
eiColumn.setDescName("0-不联动,1-联动");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -315,36 +329,68 @@ public class HPPZ010 extends DaoEPBase { ...@@ -315,36 +329,68 @@ public class HPPZ010 extends DaoEPBase {
this.pageCname = pageCname; this.pageCname = pageCname;
} }
/** /**
* get the customAuth - 自定义权限. * get the authDepCode - 权限部门编码.
* @return the customAuth * @return the authDepCode
*/
public String getAuthDepCode() {
return this.authDepCode;
}
/**
* set the authDepCode - 权限部门编码.
*
* @param authDepCode - 权限部门编码
*/
public void setAuthDepCode(String authDepCode) {
this.authDepCode = authDepCode;
}
/**
* get the authDepName - 权限部门名称.
* @return the authDepName
*/
public String getAuthDepName() {
return this.authDepName;
}
/**
* set the authDepName - 权限部门名称.
*
* @param authDepName - 权限部门名称
*/
public void setAuthDepName(String authDepName) {
this.authDepName = authDepName;
}
/**
* get the authType - 权限类型.
* @return the authType
*/ */
public String getCustomAuth() { public String getAuthType() {
return this.customAuth; return this.authType;
} }
/** /**
* set the customAuth - 自定义权限. * set the authType - 权限类型.
* *
* @param customAuth - 自定义权限 * @param authType - 权限类型
*/ */
public void setCustomAuth(String customAuth) { public void setAuthType(String authType) {
this.customAuth = customAuth; this.authType = authType;
} }
/** /**
* get the depAuth - 部门权限. * get the linkageFlag - 0-不联动,1-联动.
* @return the depAuth * @return the linkageFlag
*/ */
public String getDepAuth() { public Integer getLinkageFlag() {
return this.depAuth; return this.linkageFlag;
} }
/** /**
* set the depAuth - 部门权限. * set the linkageFlag - 0-不联动,1-联动.
* *
* @param depAuth - 部门权限 * @param linkageFlag - 0-不联动,1-联动
*/ */
public void setDepAuth(String depAuth) { public void setLinkageFlag(Integer linkageFlag) {
this.depAuth = depAuth; this.linkageFlag = linkageFlag;
} }
/** /**
* get the value from Map. * get the value from Map.
...@@ -365,8 +411,10 @@ public class HPPZ010 extends DaoEPBase { ...@@ -365,8 +411,10 @@ public class HPPZ010 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setPageEname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_ENAME)), pageEname)); setPageEname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_ENAME)), pageEname));
setPageCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_CNAME)), pageCname)); setPageCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_CNAME)), pageCname));
setCustomAuth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CUSTOM_AUTH)), customAuth)); setAuthDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUTH_DEP_CODE)), authDepCode));
setDepAuth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_AUTH)), depAuth)); setAuthDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUTH_DEP_NAME)), authDepName));
setAuthType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUTH_TYPE)), authType));
setLinkageFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LINKAGE_FLAG)), linkageFlag));
} }
/** /**
...@@ -387,8 +435,10 @@ public class HPPZ010 extends DaoEPBase { ...@@ -387,8 +435,10 @@ public class HPPZ010 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_PAGE_ENAME, StringUtils.toString(pageEname, eiMetadata.getMeta(FIELD_PAGE_ENAME))); map.put(FIELD_PAGE_ENAME, StringUtils.toString(pageEname, eiMetadata.getMeta(FIELD_PAGE_ENAME)));
map.put(FIELD_PAGE_CNAME, StringUtils.toString(pageCname, eiMetadata.getMeta(FIELD_PAGE_CNAME))); map.put(FIELD_PAGE_CNAME, StringUtils.toString(pageCname, eiMetadata.getMeta(FIELD_PAGE_CNAME)));
map.put(FIELD_CUSTOM_AUTH, StringUtils.toString(customAuth, eiMetadata.getMeta(FIELD_CUSTOM_AUTH))); map.put(FIELD_AUTH_DEP_CODE, StringUtils.toString(authDepCode, eiMetadata.getMeta(FIELD_AUTH_DEP_CODE)));
map.put(FIELD_DEP_AUTH, StringUtils.toString(depAuth, eiMetadata.getMeta(FIELD_DEP_AUTH))); map.put(FIELD_AUTH_DEP_NAME, StringUtils.toString(authDepName, eiMetadata.getMeta(FIELD_AUTH_DEP_NAME)));
map.put(FIELD_AUTH_TYPE, StringUtils.toString(authType, eiMetadata.getMeta(FIELD_AUTH_TYPE)));
map.put(FIELD_LINKAGE_FLAG, StringUtils.toString(linkageFlag, eiMetadata.getMeta(FIELD_LINKAGE_FLAG)));
return map; return map;
} }
......
...@@ -32,7 +32,10 @@ public class HPPZ010A extends DaoEPBase { ...@@ -32,7 +32,10 @@ public class HPPZ010A extends DaoEPBase {
public static final String FIELD_ORG_CNAME = "orgCname"; /* 组织机构名称*/ public static final String FIELD_ORG_CNAME = "orgCname"; /* 组织机构名称*/
public static final String FIELD_PAGE_ENAME = "pageEname"; /* 页面英文名*/ public static final String FIELD_PAGE_ENAME = "pageEname"; /* 页面英文名*/
public static final String FIELD_PAGE_CNAME = "pageCname"; /* 页面中文名*/ public static final String FIELD_PAGE_CNAME = "pageCname"; /* 页面中文名*/
public static final String FIELD_CUSTOM_AUTH = "customAuth"; /* 自定义权限*/ public static final String FIELD_AUTH_DEP_CODE = "authDepCode"; /* 权限部门编码*/
public static final String FIELD_AUTH_DEP_NAME = "authDepName"; /* 权限部门名称*/
public static final String FIELD_AUTH_TYPE = "authType"; /* 权限类型*/
public static final String FIELD_LINKAGE_FLAG = "linkageFlag"; /* 0-不联动,1-联动*/
private String companyCode = " "; /* 企业编码*/ private String companyCode = " "; /* 企业编码*/
private String userId = " "; /* 用户ID*/ private String userId = " "; /* 用户ID*/
...@@ -44,7 +47,10 @@ public class HPPZ010A extends DaoEPBase { ...@@ -44,7 +47,10 @@ public class HPPZ010A extends DaoEPBase {
private String orgCname = " "; /* 组织机构名称*/ private String orgCname = " "; /* 组织机构名称*/
private String pageEname = " "; /* 页面英文名*/ private String pageEname = " "; /* 页面英文名*/
private String pageCname = " "; /* 页面中文名*/ private String pageCname = " "; /* 页面中文名*/
private String customAuth = " "; /* 自定义权限*/ private String authDepCode = " "; /* 权限部门编码*/
private String authDepName = " "; /* 权限部门名称*/
private String authType = " "; /* 权限类型*/
private Integer linkageFlag; /* 0-不联动,1-联动*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -92,10 +98,21 @@ public class HPPZ010A extends DaoEPBase { ...@@ -92,10 +98,21 @@ public class HPPZ010A extends DaoEPBase {
eiColumn.setDescName("页面中文名"); eiColumn.setDescName("页面中文名");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CUSTOM_AUTH); eiColumn = new EiColumn(FIELD_AUTH_DEP_CODE);
eiColumn.setDescName("自定义权限"); eiColumn.setDescName("权限部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUTH_DEP_NAME);
eiColumn.setDescName("权限部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AUTH_TYPE);
eiColumn.setDescName("权限类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LINKAGE_FLAG);
eiColumn.setDescName("0-不联动,1-联动");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -185,12 +202,36 @@ public class HPPZ010A extends DaoEPBase { ...@@ -185,12 +202,36 @@ public class HPPZ010A extends DaoEPBase {
this.pageCname = pageCname; this.pageCname = pageCname;
} }
public String getCustomAuth() { public String getAuthDepCode() {
return customAuth; return authDepCode;
}
public void setAuthDepCode(String authDepCode) {
this.authDepCode = authDepCode;
}
public String getAuthDepName() {
return authDepName;
}
public void setAuthDepName(String authDepName) {
this.authDepName = authDepName;
}
public String getAuthType() {
return authType;
}
public void setAuthType(String authType) {
this.authType = authType;
}
public Integer getLinkageFlag() {
return linkageFlag;
} }
public void setCustomAuth(String customAuth) { public void setLinkageFlag(Integer linkageFlag) {
this.customAuth = customAuth; this.linkageFlag = linkageFlag;
} }
/** /**
...@@ -211,7 +252,10 @@ public class HPPZ010A extends DaoEPBase { ...@@ -211,7 +252,10 @@ public class HPPZ010A extends DaoEPBase {
setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname)); setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname));
setPageEname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_ENAME)), pageEname)); setPageEname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_ENAME)), pageEname));
setPageCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_CNAME)), pageCname)); setPageCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PAGE_CNAME)), pageCname));
setCustomAuth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CUSTOM_AUTH)), customAuth)); setAuthDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUTH_DEP_CODE)), authDepCode));
setAuthDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUTH_DEP_NAME)), authDepName));
setAuthType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUTH_TYPE)), authType));
setLinkageFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_LINKAGE_FLAG)), linkageFlag));
} }
/** /**
...@@ -231,7 +275,10 @@ public class HPPZ010A extends DaoEPBase { ...@@ -231,7 +275,10 @@ public class HPPZ010A extends DaoEPBase {
map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME))); map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME)));
map.put(FIELD_PAGE_ENAME, StringUtils.toString(pageEname, eiMetadata.getMeta(FIELD_PAGE_ENAME))); map.put(FIELD_PAGE_ENAME, StringUtils.toString(pageEname, eiMetadata.getMeta(FIELD_PAGE_ENAME)));
map.put(FIELD_PAGE_CNAME, StringUtils.toString(pageCname, eiMetadata.getMeta(FIELD_PAGE_CNAME))); map.put(FIELD_PAGE_CNAME, StringUtils.toString(pageCname, eiMetadata.getMeta(FIELD_PAGE_CNAME)));
map.put(FIELD_CUSTOM_AUTH, StringUtils.toString(customAuth, eiMetadata.getMeta(FIELD_CUSTOM_AUTH))); map.put(FIELD_AUTH_DEP_CODE, StringUtils.toString(authDepCode, eiMetadata.getMeta(FIELD_AUTH_DEP_CODE)));
map.put(FIELD_AUTH_DEP_NAME, StringUtils.toString(authDepName, eiMetadata.getMeta(FIELD_AUTH_DEP_NAME)));
map.put(FIELD_AUTH_TYPE, StringUtils.toString(authType, eiMetadata.getMeta(FIELD_AUTH_TYPE)));
map.put(FIELD_LINKAGE_FLAG, StringUtils.toString(linkageFlag, eiMetadata.getMeta(FIELD_LINKAGE_FLAG)));
return map; return map;
} }
......
...@@ -6,7 +6,6 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -6,7 +6,6 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ010; import com.baosight.hpjx.hp.pz.domain.HPPZ010;
import com.baosight.hpjx.hp.pz.domain.HPPZ010A;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
...@@ -73,7 +72,7 @@ public class ServiceHPPZ010 extends ServiceBase { ...@@ -73,7 +72,7 @@ public class ServiceHPPZ010 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo queryTreeNode(EiInfo inInfo) { public EiInfo queryPageTree(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryMap, "node"); String node = MapUtils.getString(queryMap, "node");
...@@ -85,7 +84,28 @@ public class ServiceHPPZ010 extends ServiceBase { ...@@ -85,7 +84,28 @@ public class ServiceHPPZ010 extends ServiceBase {
// 管理员查所有 // 管理员查所有
params.put("isUserAdmin", LoginUserDetails.isUserAdmin(loginName) ? CommonConstant.YesNo.YES params.put("isUserAdmin", LoginUserDetails.isUserAdmin(loginName) ? CommonConstant.YesNo.YES
: CommonConstant.YesNo.NO); : CommonConstant.YesNo.NO);
List results = dao.query(HPSqlConstant.HpPz010.QUERY_TREE_NODE, params); List results = dao.query(HPSqlConstant.HpPz010.QUERY_PAGE_TREE, params);
inInfo.addBlock(node).addRows(results);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 查询树节点
*
* @param inInfo
* @return
*/
public EiInfo queryOrgTree(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryMap, "node");
String parentNode = StringUtils.isEmpty(node) || "$".equals(node) ? "root" : node;
Map params = new HashMap();
params.put("node", parentNode);
List results = dao.query(HPSqlConstant.HpPz010.QUERY_ORG_TREE, params);
inInfo.addBlock(node).addRows(results); inInfo.addBlock(node).addRows(results);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败"); LogUtils.setMsg(inInfo, e, "查询失败");
...@@ -150,7 +170,7 @@ public class ServiceHPPZ010 extends ServiceBase { ...@@ -150,7 +170,7 @@ public class ServiceHPPZ010 extends ServiceBase {
HPPZ010 fPz010 = new HPPZ010(); HPPZ010 fPz010 = new HPPZ010();
fPz010.fromMap(resultRow); fPz010.fromMap(resultRow);
AssertUtils.isEmpty(fPz010.getPageEname(), "请选择菜单"); AssertUtils.isEmpty(fPz010.getPageEname(), "请选择菜单");
AssertUtils.isEmpty(fPz010.getDepAuth(), "请选择部门"); AssertUtils.isEmpty(fPz010.getAuthDepCode(), "请选择部门");
} }
} }
...@@ -164,12 +184,11 @@ public class ServiceHPPZ010 extends ServiceBase { ...@@ -164,12 +184,11 @@ public class ServiceHPPZ010 extends ServiceBase {
HPPZ010 fPz010 = new HPPZ010(); HPPZ010 fPz010 = new HPPZ010();
fPz010.fromMap(resultRow); fPz010.fromMap(resultRow);
// 当前企业是否已经设置过权限 // 当前企业是否已经设置过权限
HPPZ010 dbPz010 = HPPZTools.HpPz010.getByPage(fPz010.getPageEname(), fPz010.getDepAuth()); HPPZ010 dbPz010 = HPPZTools.HpPz010.getByPage(fPz010.getPageEname(), fPz010.getAuthDepCode());
if (dbPz010 == null) { if (dbPz010 == null) {
DaoUtils.insert(HPPZ010.INSERT, fPz010); DaoUtils.insert(HPPZ010.INSERT, fPz010);
} else { } else {
dbPz010.setCustomAuth(fPz010.getCustomAuth()); dbPz010.setAuthType(fPz010.getAuthType());
dbPz010.setDepAuth(fPz010.getDepAuth());
DaoUtils.update(HPPZ010.UPDATE, dbPz010); DaoUtils.update(HPPZ010.UPDATE, dbPz010);
} }
} }
......
...@@ -14,8 +14,10 @@ ...@@ -14,8 +14,10 @@
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
PAGE_ENAME as "pageEname", <!-- 页面英文名 --> PAGE_ENAME as "pageEname", <!-- 页面英文名 -->
PAGE_CNAME as "pageCname", <!-- 页面中文名 --> PAGE_CNAME as "pageCname", <!-- 页面中文名 -->
CUSTOM_AUTH as "customAuth", <!-- 自定义权限 --> AUTH_DEP_CODE as "authDepCode", <!-- 权限部门编码 -->
DEP_AUTH as "depAuth" <!-- 部门权限 --> AUTH_DEP_NAME as "authDepName", <!-- 权限部门名称 -->
AUTH_TYPE as "authType", <!-- 权限类型 -->
LINKAGE_FLAG as "linkageFlag" <!-- 0-不联动,1-联动 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -34,14 +36,20 @@ ...@@ -34,14 +36,20 @@
<isNotEmpty prepend=" AND " property="pageCname"> <isNotEmpty prepend=" AND " property="pageCname">
PAGE_CNAME = #pageCname# PAGE_CNAME = #pageCname#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depAuth"> <isNotEmpty prepend=" AND " property="authDepCode">
DEP_AUTH = #depAuth# AUTH_DEP_CODE = #authDepCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="authDepName">
AUTH_DEP_NAME = #authDepName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="authType">
AUTH_TYPE = #authType#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="depAuths"> <isNotEmpty prepend=" AND " property="authDepCodes">
DEP_AUTH IN <iterate close=")" open="(" conjunction="," property="depAuths">#depAuths[]#</iterate> AUTH_DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -79,7 +87,7 @@ ...@@ -79,7 +87,7 @@
</select> </select>
<!-- 查询树节点 --> <!-- 查询树节点 -->
<select id="queryTreeNode" resultClass="java.util.HashMap"> <select id="queryPageTree" resultClass="java.util.HashMap">
SELECT SELECT
TREE_ENAME AS "parent", TREE_ENAME AS "parent",
NODE_ENAME AS "label", NODE_ENAME AS "label",
...@@ -118,6 +126,24 @@ ...@@ -118,6 +126,24 @@
ORDER BY NODE_SORT_ID ASC ORDER BY NODE_SORT_ID ASC
</select> </select>
<!-- 组织机构子节点树查询 -->
<select id="queryOrgTree" resultClass="java.util.HashMap">
SELECT
ORG_ID as "label",
ORG_CNAME as "text",
ORG_NODE_TYPE as "leaf",
ORG_TYPE as "type",
PARENT_ORG_ID as "parentOrgId"
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND IS_DELETED = '0'
AND COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="node">
PARENT_ORG_ID = #node#
</isNotEmpty>
ORDER BY SORT_INDEX ASC
</select>
<!-- 查询用户数据权限 --> <!-- 查询用户数据权限 -->
<select id="queryUserAuth" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ010A"> <select id="queryUserAuth" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ010A">
SELECT SELECT
...@@ -130,7 +156,7 @@ ...@@ -130,7 +156,7 @@
C.ORG_CNAME AS "orgCname", C.ORG_CNAME AS "orgCname",
D.PAGE_ENAME AS "pageEname", D.PAGE_ENAME AS "pageEname",
D.PAGE_CNAME AS "pageCname", D.PAGE_CNAME AS "pageCname",
D.CUSTOM_AUTH AS "customAuth" D.AUTH_TYPE AS "authType"
FROM ${platSchema}.XS_USER A FROM ${platSchema}.XS_USER A
LEFT JOIN ${platSchema}.TXSOG02 B ON A.USER_ID = B.USER_ID LEFT JOIN ${platSchema}.TXSOG02 B ON A.USER_ID = B.USER_ID
LEFT JOIN ${platSchema}.TXSOG01 C ON B.ORG_ID = C.ORG_ID LEFT JOIN ${platSchema}.TXSOG01 C ON B.ORG_ID = C.ORG_ID
...@@ -164,11 +190,14 @@ ...@@ -164,11 +190,14 @@
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
PAGE_ENAME, <!-- 页面英文名 --> PAGE_ENAME, <!-- 页面英文名 -->
PAGE_CNAME, <!-- 页面中文名 --> PAGE_CNAME, <!-- 页面中文名 -->
CUSTOM_AUTH, <!-- 自定义权限 --> AUTH_DEP_CODE, <!-- 权限部门编码 -->
DEP_AUTH <!-- 部门权限 --> AUTH_DEP_NAME, <!-- 权限部门名称 -->
AUTH_TYPE, <!-- 权限类型 -->
LINKAGE_FLAG <!-- 0-不联动,1-联动 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#pageEname#, #pageCname#, #customAuth#, #depAuth# #pageEname#, #pageCname#, #authDepCode#, #authDepName#, #authType#,
#linkageFlag#
) )
</insert> </insert>
...@@ -177,9 +206,9 @@ ...@@ -177,9 +206,9 @@
</delete> </delete>
<update id="update"> <update id="update">
UPDATE ${hpjxSchema}.T_HPPZ010 UPDATE ${hpjxSchema}.T_HPPZ010
SET CUSTOM_AUTH = #customAuth#, <!-- 权限类型 --> SET AUTH_TYPE = #authType#, <!-- 权限类型 -->
DEP_AUTH = #depAuth#, <!-- 部门权限 --> LINKAGE_FLAG = #linkageFlag#, <!-- 0-不联动,1-联动 -->
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</update> </update>
......
...@@ -558,12 +558,12 @@ public class HPPZTools { ...@@ -558,12 +558,12 @@ public class HPPZTools {
* 查询菜单权限 * 查询菜单权限
* *
* @param pageEname * @param pageEname
* @param depAuth * @param depCode
* @return * @return
*/ */
public static HPPZ010 getByPage(String pageEname, String depAuth) { public static HPPZ010 getByPage(String pageEname, String depCode) {
AssertUtils.isEmpty(pageEname, "页面号不能为空"); AssertUtils.isEmpty(pageEname, "页面号不能为空");
AssertUtils.isEmpty(depAuth, "部门不能为空"); AssertUtils.isEmpty(depCode, "部门不能为空");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StringUtils.isBlank(companyCode)) { if (StringUtils.isBlank(companyCode)) {
return null; return null;
...@@ -571,7 +571,7 @@ public class HPPZTools { ...@@ -571,7 +571,7 @@ public class HPPZTools {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HPPZ010.FIELD_COMPANY_CODE, companyCode); queryMap.put(HPPZ010.FIELD_COMPANY_CODE, companyCode);
queryMap.put(HPPZ010.FIELD_PAGE_ENAME, pageEname); queryMap.put(HPPZ010.FIELD_PAGE_ENAME, pageEname);
queryMap.put(HPPZ010.FIELD_DEP_AUTH, depAuth); queryMap.put(HPPZ010.FIELD_AUTH_DEP_CODE, depCode);
List<HPPZ010> results = DaoBase.getInstance().query(HPPZ010.QUERY, queryMap); List<HPPZ010> results = DaoBase.getInstance().query(HPPZ010.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
...@@ -592,7 +592,7 @@ public class HPPZTools { ...@@ -592,7 +592,7 @@ public class HPPZTools {
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HPPZ010.FIELD_COMPANY_CODE, companyCode); queryMap.put(HPPZ010.FIELD_COMPANY_CODE, companyCode);
queryMap.put(HPPZ010.FIELD_PAGE_ENAME, pageEname); queryMap.put(HPPZ010.FIELD_PAGE_ENAME, pageEname);
queryMap.put("depAuths", depCodes); queryMap.put("authDepCodes", depCodes);
return DaoBase.getInstance().query(HPPZ010.QUERY, queryMap); return DaoBase.getInstance().query(HPPZ010.QUERY, queryMap);
} }
......
...@@ -255,20 +255,20 @@ public class SqlMapDaoLogProxy extends SqlMapDao { ...@@ -255,20 +255,20 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
* @param dbPz010 * @param dbPz010
*/ */
private List<String> buildDepCondition(HPPZ010 dbPz010) { private List<String> buildDepCondition(HPPZ010 dbPz010) {
String customAuth = dbPz010.getCustomAuth(); String authType = dbPz010.getAuthType();
if (StringUtils.isBlank(customAuth) || AuthTypeEnum.NO_AUTH.getCode().equals(customAuth)) { if (StringUtils.isBlank(authType) || AuthTypeEnum.NO_AUTH.getCode().equals(authType)) {
return Arrays.asList(AuthTypeEnum.NO_AUTH.getCode()); return Arrays.asList(AuthTypeEnum.NO_AUTH.getCode());
} }
String depAuth = dbPz010.getDepAuth(); String authDepCode = dbPz010.getAuthDepCode();
// 看全部 // 看全部
if (AuthTypeEnum.ONLY_COMPANY.getCode().equals(customAuth)) { if (AuthTypeEnum.ONLY_COMPANY.getCode().equals(authType)) {
return Arrays.asList(AuthTypeEnum.ALL.getCode()); return Arrays.asList(AuthTypeEnum.ALL.getCode());
} else if (AuthTypeEnum.ONLY_FACTORY.getCode().equals(customAuth)) { } else if (AuthTypeEnum.ONLY_FACTORY.getCode().equals(authType)) {
// 查询当前部门所在的厂及子集 // 查询当前部门所在的厂及子集
Org factoryOrg = HPXSTools.XsOrg.queryFactory(depAuth); Org factoryOrg = HPXSTools.XsOrg.queryFactory(authDepCode);
return HPXSTools.XsOrg.queryChildren(factoryOrg.getOrgId()); return HPXSTools.XsOrg.queryChildren(factoryOrg.getOrgId());
} else if (AuthTypeEnum.ONLY_DEPT.getCode().equals(customAuth)) { } else if (AuthTypeEnum.ONLY_DEPT.getCode().equals(authType)) {
return HPXSTools.XsOrg.queryChildren(depAuth); return HPXSTools.XsOrg.queryChildren(authDepCode);
} else { } else {
return Arrays.asList(AuthTypeEnum.NO_AUTH.getCode()); return Arrays.asList(AuthTypeEnum.NO_AUTH.getCode());
} }
......
...@@ -4,9 +4,20 @@ $(function () { ...@@ -4,9 +4,20 @@ $(function () {
"pageTree": { "pageTree": {
// ROOT: {label: "root", text: "系统菜单", leaf: true} // ROOT: {label: "root", text: "系统菜单", leaf: true}
select: function (e) { select: function (e) {
treeNodeSelect(this.dataItem(e.node)); pageTreeSelect(this.dataItem(e.node));
}, },
selectTreeNode: {} selectTreeNode: {
leaf: false
}
},
"orgTree": {
// ROOT: {label: "root", text: "系统菜单", leaf: true}
select: function (e) {
orgTreeSelect(this.dataItem(e.node));
},
selectTreeNode: {
leaf: false
}
} }
}; };
...@@ -19,13 +30,9 @@ $(function () { ...@@ -19,13 +30,9 @@ $(function () {
*/ */
$(window).load(function () { $(window).load(function () {
// 禁用Input // 禁用Input
disableInput(true); disableInput();
// 全选框绑定事件 // 权限类型绑定事件
allInputEvent(); authTypeInputEvent();
// 子项绑定事件
customAuthInputEvent();
// 部门绑定事件
depAuthInputEvent()
}); });
/** /**
...@@ -33,17 +40,8 @@ $(window).load(function () { ...@@ -33,17 +40,8 @@ $(window).load(function () {
* *
* @returns {*|jQuery|HTMLElement} * @returns {*|jQuery|HTMLElement}
*/ */
let listCustomInput = function () { let listAuthTypeInput = function () {
return $("input:radio[name='result-0-customAuth']"); return $("input:radio[name='result-0-authType']");
}
/**
* Input集合
*
* @returns {*|jQuery|HTMLElement}
*/
let listDepInput = function () {
return $("input:radio[name='result-0-depAuth']");
} }
/** /**
...@@ -52,12 +50,8 @@ let listDepInput = function () { ...@@ -52,12 +50,8 @@ let listDepInput = function () {
* @param bool * @param bool
*/ */
let clearCheckedInput = function () { let clearCheckedInput = function () {
// 全选
// $("input:checkbox[name='result-0-authAll']").prop('checked', 'false');
// 权限子项 // 权限子项
checkedCustomInput(false); checkedAuthTypeInput(false);
// 部门子项
checkedDepInput(false);
} }
/** /**
...@@ -65,53 +59,32 @@ let clearCheckedInput = function () { ...@@ -65,53 +59,32 @@ let clearCheckedInput = function () {
* *
* @param bool * @param bool
*/ */
let checkedCustomInput = function (bool) { let checkedAuthTypeInput = function (bool) {
listCustomInput().prop('checked', bool); listAuthTypeInput().prop('checked', bool);
}
/**
* 选中或取消Input,部门子项
*
* @param bool
*/
let checkedDepInput = function (bool) {
listDepInput().prop('checked', bool);
} }
/** /**
* 禁用或启用Input * 禁用或启用Input
*/ */
let disableInput = function (bool) { let disableInput = function () {
// 全选 let bool = false;
// $("input:checkbox[name='result-0-authAll']").attr('readonly', bool); let orgNode = IPLATUI.EFTree.orgTree.selectTreeNode.label;
let pageNode = IPLATUI.EFTree.pageTree.selectTreeNode.label;
let pageLeaf = IPLATUI.EFTree.pageTree.selectTreeNode.leaf;
if (isBlank(orgNode) || isBlank(pageNode) || pageLeaf) {
bool = true;
}
// 数据权限 // 数据权限
listCustomInput().each(function () { listAuthTypeInput().each(function () {
$(this).attr('readonly', bool);
});
// 部门权限
listDepInput().each(function () {
$(this).attr('readonly', bool); $(this).attr('readonly', bool);
}); });
} }
/** /**
* 全选框绑定事件
*/
let allInputEvent = function () {
$("input:checkbox[name='result-0-authAll']").on("change", function () {
if ($(this).prop('readonly')) {
$(this).attr('checked', false);
return;
}
listDepInput().prop('checked', this.checked);
});
}
/**
* 数据权限绑定事件 * 数据权限绑定事件
*/ */
let customAuthInputEvent = function () { let authTypeInputEvent = function () {
$("input:radio[name='result-0-customAuth']").on("change", function () { $("input:radio[name='result-0-authType']").on("change", function () {
if ($(this).prop('readonly')) { if ($(this).prop('readonly')) {
$(this).prop('checked', ''); $(this).prop('checked', '');
return; return;
...@@ -120,61 +93,38 @@ let customAuthInputEvent = function () { ...@@ -120,61 +93,38 @@ let customAuthInputEvent = function () {
} }
/** /**
* 组织部门绑定事件 * 菜单树节点选中
*
* @param e
*/ */
let depAuthInputEvent = function () { let pageTreeSelect = function (nodeData) {
$("input:radio[name='result-0-depAuth']").on("change", function () { // 设置选择的节点
if ($(this).prop('readonly')) { setSelectPageTreeNode(nodeData);
$(this).prop('checked', ''); // 清空选项
return; clearCheckedInput();
} // 启用Input/禁用Input
// 判断全选框是选中还是不选中 disableInput();
// setAllInput(); // 叶子节点渲染权限
// 加载部门权限 if (!nodeData.leaf) {
showAuthInput(); showAuthInput();
}); }
}
/**
* 设置全选框选中或取消
*/
let setAllInput = function (){
// 判断全选框是选中还是不选中
let allCheckBool = true;
// listCustomInput().each(function () {
// if ($(this).prop('checked') == false) {
// allCheckBool = false;
// }
// })
listDepInput().each(function () {
if ($(this).prop('checked') == false) {
allCheckBool = false;
}
})
// 全选
// $("input:checkbox[name='result-0-authAll']").prop('checked', allCheckBool);
} }
/** /**
* 树节点选中 * 组织树节点选中
* *
* @param e * @param e
*/ */
let treeNodeSelect = function (nodeData) { let orgTreeSelect = function (nodeData) {
// 设置选择的节点 // 设置选择的节点
setSelectTreeNode(nodeData); setSelectOrgTreeNode(nodeData);
// 非叶子节点清空显示 // 非叶子节点清空显示
if (nodeData.leaf) { let pageLeaf = IPLATUI.EFTree.pageTree.selectTreeNode.leaf;
// 禁用Input disableInput(pageLeaf);
disableInput(true); // 清空选项
// 清空选项 clearCheckedInput();
clearCheckedInput(); // 渲染权限
} else { showAuthInput();
// 启用Input
disableInput(false);
// 渲染权限
showAuthInput();
}
} }
/** /**
...@@ -182,27 +132,38 @@ let treeNodeSelect = function (nodeData) { ...@@ -182,27 +132,38 @@ let treeNodeSelect = function (nodeData) {
* *
* @param nodeData * @param nodeData
*/ */
let setSelectTreeNode = function (nodeData) { let setSelectPageTreeNode = function (nodeData) {
IPLATUI.EFTree.pageTree.selectTreeNode.label = nodeData.label; IPLATUI.EFTree.pageTree.selectTreeNode.label = nodeData.label;
IPLATUI.EFTree.pageTree.selectTreeNode.text = nodeData.text; IPLATUI.EFTree.pageTree.selectTreeNode.text = nodeData.text;
IPLATUI.EFTree.pageTree.selectTreeNode.leaf = nodeData.leaf; IPLATUI.EFTree.pageTree.selectTreeNode.leaf = nodeData.leaf;
} }
/** /**
* 设置选择的节点
*
* @param nodeData
*/
let setSelectOrgTreeNode = function (nodeData) {
IPLATUI.EFTree.orgTree.selectTreeNode.label = nodeData.label;
IPLATUI.EFTree.orgTree.selectTreeNode.text = nodeData.text;
IPLATUI.EFTree.orgTree.selectTreeNode.leaf = nodeData.leaf;
}
/**
* 显示权限选择框 * 显示权限选择框
* *
* @param node * @param node
*/ */
let showAuthInput = function () { let showAuthInput = function () {
let depAuth = $("input:radio[name='result-0-depAuth']:checked").val(); let depCode = IPLATUI.EFTree.orgTree.selectTreeNode.label;
let node = IPLATUI.EFTree.pageTree.selectTreeNode.label; let pageEname = IPLATUI.EFTree.pageTree.selectTreeNode.label;
if(isBlank(depAuth) || isBlank(node)){ if (isBlank(depCode) || isBlank(pageEname)) {
return; return;
} }
// 渲染权限 // 渲染权限
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-depAuth", depAuth); inInfo.set("inqu_status-0-pageEname", pageEname);
inInfo.set("inqu_status-0-pageEname", node); inInfo.set("inqu_status-0-authDepCode", depCode);
EiCommunicator.send("HPPZ010", "getByPage", inInfo, { EiCommunicator.send("HPPZ010", "getByPage", inInfo, {
onSuccess: getByPageSuccess, onSuccess: getByPageSuccess,
onFail: function (res) { onFail: function (res) {
...@@ -218,7 +179,7 @@ let showAuthInput = function () { ...@@ -218,7 +179,7 @@ let showAuthInput = function () {
*/ */
let getByPageSuccess = function (res) { let getByPageSuccess = function (res) {
// 清空权限子项 // 清空权限子项
checkedCustomInput(false); checkedAuthTypeInput(false);
if (res.status < 0) { if (res.status < 0) {
message(res.msg); message(res.msg);
return; return;
...@@ -227,19 +188,14 @@ let getByPageSuccess = function (res) { ...@@ -227,19 +188,14 @@ let getByPageSuccess = function (res) {
if (resultRows.length == 0) { if (resultRows.length == 0) {
return; return;
} }
let customAuth = resultRows[0]['customAuth']; let authType = resultRows[0]['authType'];
if(!isBlank(customAuth)){ if (!isBlank(authType)) {
let customAuths = customAuth.split(','); listAuthTypeInput().each(function () {
listCustomInput().each(function () { if ($(this).val() == authType) {
for (let i = 0; i < customAuths.length; i++) { $(this).prop('checked', 'true');
if ($(this).val() == customAuths[i]) {
$(this).prop('checked', 'true');
}
} }
}) })
} }
// 判断全选框是选中还是不选中
// setAllInput();
} }
/** /**
...@@ -247,41 +203,35 @@ let getByPageSuccess = function (res) { ...@@ -247,41 +203,35 @@ let getByPageSuccess = function (res) {
*/ */
let save = function () { let save = function () {
// 检查是否选择的叶子节点 // 检查是否选择的叶子节点
let selectTreeNode = IPLATUI.EFTree.pageTree.selectTreeNode; let pageNode = IPLATUI.EFTree.pageTree.selectTreeNode;
if (selectTreeNode.leaf) { if (isBlank(pageNode.label)) {
message("【" + selectTreeNode.text + "】不是叶子节点,请选择菜单树叶子节点进行授权"); message("请选择菜单");
return;
}
if (pageNode.leaf) {
message("【" + pageNode.text + "】不是叶子节点,请选择菜单树叶子节点进行授权");
return;
}
let orgNode = IPLATUI.EFTree.orgTree.selectTreeNode;
if (isBlank(orgNode.label)) {
message("请选择部门");
return; return;
} }
JSUtils.confirm("确定对勾选中的数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的数据做\"保存\"操作? ", {
ok: saveOk ok: saveOk(pageNode, orgNode)
}); });
} }
/** /**
* 保存确认 * 保存确认
*/ */
let saveOk = function () { let saveOk = function (pageNode, orgNode) {
let selectTreeNode = IPLATUI.EFTree.pageTree.selectTreeNode;
if (isBlank(selectTreeNode)) {
message("请选择菜单");
return;
}
let depAuth = $("input:radio[name='result-0-depAuth']:checked").val();
if (isBlank(depAuth)) {
message("请选择部门");
return;
}
let customAuth = '';
listCustomInput().each(function () {
if ($(this).prop('checked')) {
customAuth += ('' == customAuth ? $(this).val() : ',' + $(this).val());
}
})
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("result-0-pageEname", selectTreeNode.label); inInfo.set("result-0-pageEname", pageNode.label);
inInfo.set("result-0-pageCname", selectTreeNode.text); inInfo.set("result-0-pageCname", pageNode.text);
inInfo.set("result-0-customAuth", customAuth); inInfo.set("result-0-authDepCode", orgNode.label);
inInfo.set("result-0-depAuth", depAuth); inInfo.set("result-0-authDepName", orgNode.text);
inInfo.set("result-0-authType", $("input:radio[name='result-0-authType']:checked").val());
EiCommunicator.send("HPPZ010", "save", inInfo, { EiCommunicator.send("HPPZ010", "save", inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
message(res.msg); message(res.msg);
......
...@@ -20,53 +20,54 @@ ...@@ -20,53 +20,54 @@
<EF:EFPage> <EF:EFPage>
<div class="row" style="margin: 0 -10px;"> <div class="row" style="margin: 0 -10px;">
<div class="col-md-3"> <div class="col-md-4">
<EF:EFRegion title="系统菜单树" id="tree" fitHeight="true"> <EF:EFRegion title="系统菜单树" id="tree" fitHeight="true">
<EF:EFTree bindId="pageTree" ename="node" textField="text" valueField="label" hasChildren="leaf" <EF:EFTree bindId="pageTree" ename="node" textField="text" valueField="label" hasChildren="leaf"
serviceName="HPPZ010" methodName="queryTreeNode"> serviceName="HPPZ010" methodName="queryPageTree">
</EF:EFTree> </EF:EFTree>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
<div class="col-md-9"> <div class="col-md-4">
<EF:EFRegion title="组织机构" id="org"> <EF:EFRegion title="组织机构树" id="tree" fitHeight="true">
<c:forEach items="${requestScope.orgMap}" var="entry"> <EF:EFTree bindId="orgTree" ename="node" textField="text" valueField="label" hasChildren="leaf"
<c:forEach items="${entry.value}" var="item" varStatus="i"> serviceName="HPPZ010" methodName="queryOrgTree">
<c:if test="${item.orgType == 'factory'}"> </EF:EFTree>
<c:if test="${i.index == 0}">
<div class="row">
<div class="col-md-9">
</c:if>
<c:if test="${i.index != 0}">
</div>
</div>
<div class="row">
<div class="col-md-9">
</c:if>
</c:if>
<EF:EFInput cname="${item.orgCname}" blockId="result" ename="depAuth" row="0"
value="${item.orgId}" colWidth="3" type="radio" inline="true"/>
</c:forEach>
</div>
</div>
</c:forEach>
</EF:EFRegion> </EF:EFRegion>
</div>
<div class="col-md-4">
<EF:EFRegion title="数据查看范围" id="result"> <EF:EFRegion title="数据查看范围" id="result">
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-12">
<EF:EFInput cname="不可查看" blockId="result" ename="customAuth" row="0" value="noAuth" colWidth="3" <EF:EFInput cname="父子联动" blockId="result" ename="authType" row="0" value="onlyCompany"
type="radio" inline="true"/> colWidth="3" type="checkBox" inline="true"/>
<EF:EFInput cname="本企业" blockId="result" ename="customAuth" row="0" value="onlyCompany" </div>
</div>
<div class="row">
<div class="col-md-12">
<EF:EFInput cname="本公司" blockId="result" ename="authType" row="0" value="onlyCompany"
colWidth="3" type="radio" inline="true"/> colWidth="3" type="radio" inline="true"/>
<EF:EFInput cname="本厂" blockId="result" ename="customAuth" row="0" value="onlyFactory" </div>
</div>
<div class="row">
<div class="col-md-9">
<EF:EFInput cname="本厂" blockId="result" ename="authType" row="0" value="onlyFactory"
colWidth="3" type="radio" inline="true"/> colWidth="3" type="radio" inline="true"/>
<EF:EFInput cname="本部门" blockId="result" ename="customAuth" row="0" value="onlyDept" </div>
</div>
<div class="row">
<div class="col-md-6">
<EF:EFInput cname="本部门" blockId="result" ename="authType" row="0" value="onlyDept"
colWidth="3" type="radio" inline="true"/> colWidth="3" type="radio" inline="true"/>
</div> </div>
</div> </div>
</EF:EFRegion> <div class="row">
<EF:EFRegion title="提示" hidden="true"> <div class="col-md-6">
<span style="color: red">1:仅叶子节点页面可设置数据权限。</span> <EF:EFInput cname="不可查看" blockId="result" ename="authType" row="0" value="noAuth" colWidth="3"
type="radio" inline="true"/>
</div>
</div>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
</div> </div>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<EF:EFOptions blockId="org_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="org_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="orgCname" cname="组织机构名称" enable="false" width="140" align="center"/> <EF:EFColumn ename="orgCname" cname="组织机构名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="customAuth" cname="数据权限" enable="false" width="140" align="center"> <EF:EFComboColumn ename="authType" cname="数据权限" enable="false" width="140" align="center">
<EF:EFCodeOption codeName="hpjx.hppz.authType"/> <EF:EFCodeOption codeName="hpjx.hppz.authType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
</EF:EFGrid> </EF:EFGrid>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment