role manage
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package org.maxkey.web.contorller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.dao.service.RolesService;
|
||||
import org.maxkey.domain.RolePermissions;
|
||||
import org.maxkey.util.StringUtils;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.maxkey.web.message.Message;
|
||||
import org.maxkey.web.message.MessageType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value={"/permissions"})
|
||||
public class PermissionsController {
|
||||
final static Logger _logger = LoggerFactory.getLogger(PermissionsController.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("rolesService")
|
||||
RolesService rolesService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value={"/list"})
|
||||
public ModelAndView resourcesList(){
|
||||
return new ModelAndView("permissions/permissionsList");
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/savepermissions"})
|
||||
public Message insert(@ModelAttribute("rolePermissions") RolePermissions rolePermissions) {
|
||||
_logger.debug("-save :" + rolePermissions);
|
||||
//have
|
||||
List<RolePermissions> rolePermissionsedList = rolesService.queryRolePermissions(
|
||||
new RolePermissions(rolePermissions.getAppId(),rolePermissions.getRoleId()));
|
||||
|
||||
HashMap<String,String >permedMap =new HashMap<String,String >();
|
||||
for(RolePermissions rolePerms : rolePermissionsedList) {
|
||||
permedMap.put(rolePerms.getUniqueId(),rolePerms.getId());
|
||||
}
|
||||
//Maybe insert
|
||||
ArrayList<RolePermissions> rolePermissionsList =new ArrayList<RolePermissions>();
|
||||
List<String>resourceIds = StringUtils.string2List(rolePermissions.getResourceId(), ",");
|
||||
HashMap<String,String >newPermsMap =new HashMap<String,String >();
|
||||
for(String resourceId : resourceIds) {
|
||||
|
||||
RolePermissions newRolePermissions=new RolePermissions(
|
||||
rolePermissions.getAppId(),
|
||||
rolePermissions.getRoleId(),
|
||||
resourceId);
|
||||
|
||||
newPermsMap.put(newRolePermissions.getUniqueId(), rolePermissions.getAppId());
|
||||
|
||||
if(!rolePermissions.getAppId().equalsIgnoreCase(resourceId) &&
|
||||
!permedMap.containsKey(newRolePermissions.getUniqueId())) {
|
||||
rolePermissionsList.add(newRolePermissions);
|
||||
}
|
||||
}
|
||||
|
||||
//delete
|
||||
ArrayList<RolePermissions> deleteRolePermissionsList =new ArrayList<RolePermissions>();
|
||||
for(RolePermissions rolePerms : rolePermissionsedList) {
|
||||
if(!newPermsMap.containsKey(rolePerms.getUniqueId())) {
|
||||
deleteRolePermissionsList.add(rolePerms);
|
||||
}
|
||||
}
|
||||
if (!deleteRolePermissionsList.isEmpty()) {
|
||||
rolesService.logisticDeleteRolePermissions(deleteRolePermissionsList);
|
||||
}
|
||||
|
||||
if (!rolePermissionsList.isEmpty() && rolesService.insertRolePermissions(rolePermissionsList)) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/querypermissions"})
|
||||
public List<RolePermissions> querypermissions(@ModelAttribute("rolePermissions") RolePermissions rolePermissions) {
|
||||
_logger.debug("-querypermissions :" + rolePermissions);
|
||||
//have
|
||||
List<RolePermissions> rolePermissionsedList = rolesService.queryRolePermissions(
|
||||
new RolePermissions(rolePermissions.getAppId(),rolePermissions.getRoleId()));
|
||||
return rolePermissionsedList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package org.maxkey.web.contorller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaPageResults;
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.dao.service.ResourcesService;
|
||||
import org.maxkey.domain.Resources;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.maxkey.web.component.TreeNode;
|
||||
import org.maxkey.web.component.TreeNodeList;
|
||||
import org.maxkey.web.message.Message;
|
||||
import org.maxkey.web.message.MessageType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value={"/resources"})
|
||||
public class ResourcesController {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ResourcesController.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("resourcesService")
|
||||
ResourcesService resourcesService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value={"/list"})
|
||||
public ModelAndView resourcesList(){
|
||||
return new ModelAndView("resources/resourcesList");
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/selectResourcesList"})
|
||||
public ModelAndView selectResourcesList(){
|
||||
return new ModelAndView("resources/selectResourcesList");
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = { "/grid" })
|
||||
@ResponseBody
|
||||
public JpaPageResults<Resources> queryDataGrid(@ModelAttribute("resources") Resources resources) {
|
||||
_logger.debug(""+resources);
|
||||
return resourcesService.queryPageResults(resources);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = { "/forwardAdd" })
|
||||
public ModelAndView forwardAdd() {
|
||||
return new ModelAndView("resources/resourceAdd");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/forwardUpdate/{id}" })
|
||||
public ModelAndView forwardUpdate(@PathVariable("id") String id) {
|
||||
ModelAndView modelAndView=new ModelAndView("resources/resourceUpdate");
|
||||
Resources resource=resourcesService.get(id);
|
||||
modelAndView.addObject("model",resource);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/add"})
|
||||
public Message insert(@ModelAttribute("resource") Resources resource) {
|
||||
_logger.debug("-Add :" + resource);
|
||||
|
||||
if (resourcesService.insert(resource)) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param resource
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/query"})
|
||||
public Message query(@ModelAttribute("resource") Resources resource) {
|
||||
_logger.debug("-query :" + resource);
|
||||
if (resourcesService.load(resource)!=null) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param resource
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/update"})
|
||||
public Message update(@ModelAttribute("resource") Resources resource) {
|
||||
_logger.debug("-update resource :" + resource);
|
||||
|
||||
if (resourcesService.update(resource)) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/delete"})
|
||||
public Message delete(@ModelAttribute("resource") Resources resource) {
|
||||
_logger.debug("-delete resource :" + resource);
|
||||
|
||||
if (resourcesService.remove(resource.getId())) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping({"/tree"})
|
||||
public List<HashMap<String, Object>> resourcesTree(
|
||||
@RequestParam(value = "appId", required = false) String appId,
|
||||
@RequestParam(value = "appName", required = false) String appName
|
||||
) {
|
||||
_logger.debug("resourcesTree appId :" + appId + " ,appName " + appName);
|
||||
Resources queryRes = new Resources();
|
||||
queryRes.setAppId(appId);
|
||||
List<Resources> resourcesList = this.resourcesService.query(queryRes);
|
||||
TreeNodeList treeNodeList = new TreeNodeList();
|
||||
|
||||
TreeNode rootNode = new TreeNode(appId, appName);
|
||||
rootNode.setAttr("open", Boolean.valueOf(true));
|
||||
treeNodeList.addTreeNode(rootNode.getAttr());
|
||||
|
||||
for (Resources res : resourcesList) {
|
||||
TreeNode treeNode = new TreeNode(res.getId(), res.getName());
|
||||
treeNode.setAttr("data", res);
|
||||
treeNode.setPId(res.getPid());
|
||||
treeNodeList.addTreeNode(treeNode.getAttr());
|
||||
}
|
||||
|
||||
|
||||
return treeNodeList.getTreeNodeList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package org.maxkey.web.contorller;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaPageResults;
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.dao.service.RolesService;
|
||||
import org.maxkey.domain.Roles;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.maxkey.web.message.Message;
|
||||
import org.maxkey.web.message.MessageType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value={"/roles"})
|
||||
public class RolesController {
|
||||
final static Logger _logger = LoggerFactory.getLogger(RolesController.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("rolesService")
|
||||
RolesService rolesService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value={"/list"})
|
||||
public ModelAndView rolesList(){
|
||||
return new ModelAndView("roles/rolesList");
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/selectRolesList"})
|
||||
public ModelAndView selectRolesList(){
|
||||
return new ModelAndView("roles/selectRolesList");
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = { "/grid" })
|
||||
@ResponseBody
|
||||
public JpaPageResults<Roles> queryDataGrid(@ModelAttribute("roles") Roles roles) {
|
||||
_logger.debug(""+roles);
|
||||
return rolesService.queryPageResults(roles);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = { "/forwardAdd" })
|
||||
public ModelAndView forwardAdd() {
|
||||
return new ModelAndView("roles/roleAdd");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/forwardUpdate/{id}" })
|
||||
public ModelAndView forwardUpdate(@PathVariable("id") String id) {
|
||||
ModelAndView modelAndView=new ModelAndView("roles/roleUpdate");
|
||||
Roles role=rolesService.get(id);
|
||||
modelAndView.addObject("model",role);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/add"})
|
||||
public Message insert(@ModelAttribute("role") Roles role) {
|
||||
_logger.debug("-Add :" + role);
|
||||
|
||||
if (rolesService.insert(role)) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/query"})
|
||||
public Message query(@ModelAttribute("role") Roles role) {
|
||||
_logger.debug("-query :" + role);
|
||||
if (rolesService.load(role)!=null) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/update"})
|
||||
public Message update(@ModelAttribute("role") Roles role) {
|
||||
_logger.debug("-update role :" + role);
|
||||
|
||||
if (rolesService.update(role)) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/delete"})
|
||||
public Message delete(@ModelAttribute("role") Roles role) {
|
||||
_logger.debug("-delete role :" + role);
|
||||
|
||||
if (rolesService.remove(role.getId())) {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||
|
||||
} else {
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -389,6 +389,14 @@ group.name=\u7528\u6237\u7EC4
|
||||
role.id=\u89D2\u8272\u7F16\u7801
|
||||
role.name=\u89D2\u8272
|
||||
|
||||
resource.id=\u8D44\u6E90\u7F16\u7801
|
||||
resource.name=\u8D44\u6E90\u540D\u79F0
|
||||
resource.pid=\u7236\u7EA7\u7F16\u7801
|
||||
resource.pname=\u7236\u7EA7\u540D\u79F0
|
||||
resource.resType=\u8D44\u6E90\u7C7B\u578B
|
||||
resource.resUrl=\u8D44\u6E90\u5730\u5740
|
||||
resource.resAction=\u52A8\u4F5C
|
||||
|
||||
#account
|
||||
account.username=\u7528\u6237\u540D
|
||||
account.displayName=\u7528\u6237\u59D3\u540D
|
||||
@@ -461,7 +469,7 @@ navs.apps=\u5E94\u7528\u7BA1\u7406
|
||||
navs.accounts=\u8D26\u53F7\u7BA1\u7406
|
||||
navs.groups=\u7EC4\u7BA1\u7406
|
||||
navs.groups.member=\u6210\u5458\u7BA1\u7406
|
||||
navs.groups.privileges=\u6743\u9650\u7BA1\u7406
|
||||
navs.groups.privileges=\u8BBF\u95EE\u6743\u9650\u7BA1\u7406
|
||||
navs.conf=\u914D\u7F6E\u7BA1\u7406
|
||||
navs.conf.passwordpolicy=\u5BC6\u7801\u7B56\u7565
|
||||
navs.audit=\u65E5\u5FD7\u5BA1\u8BA1
|
||||
@@ -469,3 +477,5 @@ navs.audit.login=\u767B\u5F55\u65E5\u5FD7
|
||||
navs.audit.loginapps=\u8BBF\u95EE\u65E5\u5FD7
|
||||
navs.audit.operate=\u64CD\u4F5C\u65E5\u5FD7
|
||||
navs.roles=\u89D2\u8272\u7BA1\u7406
|
||||
navs.role.permissions=\u89D2\u8272\u6743\u9650\u7BA1\u7406
|
||||
navs.resources=\u8D44\u6E90\u7BA1\u7406
|
||||
|
||||
@@ -388,6 +388,14 @@ group.name=name
|
||||
role.id=id
|
||||
role.name=name
|
||||
|
||||
resource.id=id
|
||||
resource.name=name
|
||||
resource.pid=pid
|
||||
resource.pname=pname
|
||||
resource.resType=Type
|
||||
resource.resUrl=URL
|
||||
resource.resAction=Action
|
||||
|
||||
#account
|
||||
account.username=username
|
||||
account.displayName=displayName
|
||||
@@ -461,11 +469,13 @@ navs.apps=Apps
|
||||
navs.accounts=Accounts
|
||||
navs.groups=Groups
|
||||
navs.groups.member=Groups Member
|
||||
navs.groups.privileges=Privileges
|
||||
navs.groups.privileges=Access Privileges
|
||||
navs.conf=Conf
|
||||
navs.conf.passwordpolicy=PasswordPolicy
|
||||
navs.audit=Audit
|
||||
navs.audit.login=Login
|
||||
navs.audit.loginapps=LoginApps
|
||||
navs.audit.operate=Operate
|
||||
navs.roles=Roles
|
||||
navs.roles=Roles
|
||||
navs.role.permissions=Permissions
|
||||
navs.resources=Resources
|
||||
@@ -93,24 +93,10 @@
|
||||
<tr>
|
||||
<td width="120px"><@locale code="apps.name"/></td>
|
||||
<td width="360px">
|
||||
<input type="text" name="name" style ="width:150px">
|
||||
<input class="form-control" type="text" name="name" style ="width:150px">
|
||||
</td>
|
||||
<td width="120px"><@locale code="apps.protocol"/></td>
|
||||
<td width="120px"></td>
|
||||
<td width="360px">
|
||||
<select name="protocol" class="select_protocol">
|
||||
<option value="" selected>Select</option>
|
||||
<option value="<%=PROTOCOLS.FORMBASED%>"><%=PROTOCOLS.FORMBASED%></option>
|
||||
<option value="<%=PROTOCOLS.OPEN_ID_CONNECT%>"><%=PROTOCOLS.OPEN_ID_CONNECT%></option>
|
||||
<option value="<%=PROTOCOLS.OAUTH10A%>"><%=PROTOCOLS.OAUTH10A%></option>
|
||||
<option value="<%=PROTOCOLS.OAUTH20%>"><%=PROTOCOLS.OAUTH20%></option>
|
||||
<option value="<%=PROTOCOLS.SAML11%>"><%=PROTOCOLS.SAML11%></option>
|
||||
<option value="<%=PROTOCOLS.SAML20%>"><%=PROTOCOLS.SAML20%></option>
|
||||
<option value="<%=PROTOCOLS.COOKIEBASED%>"><%=PROTOCOLS.COOKIEBASED%></option>
|
||||
<option value="<%=PROTOCOLS.TOKENBASED%>"><%=PROTOCOLS.TOKENBASED%></option>
|
||||
<option value="<%=PROTOCOLS.DESKTOP%>"><%=PROTOCOLS.DESKTOP%></option>
|
||||
<option value="<%=PROTOCOLS.BASIC%>"><%=PROTOCOLS.BASIC%></option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -47,6 +47,14 @@
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('.side-nav-menu').each(function(){
|
||||
var href = $(this).attr('href');
|
||||
if(window.location.href.indexOf(href) > 0){
|
||||
$(this).parents("li").addClass("mm-active");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(".datetimepicker").datetimepicker({format:'Y-m-d H:i',lang:'<@locale/>'.substring(0, 2)});
|
||||
$(".datepicker").datetimepicker({timepicker:false,format:'Y-m-d',lang:'<@locale/>'.substring(0, 2)});
|
||||
|
||||
|
||||
@@ -1,97 +1,114 @@
|
||||
<div dir="rtl">
|
||||
<ul class="metismenu" id="side-nav-menu" >
|
||||
<li>
|
||||
<a class="" href="<@base />/main/">
|
||||
<a class="side-nav-menu" href="<@base />/main/">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.home"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="<@base />/orgs/list/">
|
||||
<a class="side-nav-menu" href="<@base />/orgs/list/">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.orgs"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="<@base />/userinfo/list/">
|
||||
<a class="side-nav-menu" href="<@base />/userinfo/list/">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.users"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="<@base />/apps/list/">
|
||||
<a class="side-nav-menu" href="<@base />/apps/list/">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.apps"/>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="" href="<@base />/app/accounts/list">
|
||||
<a class="side-nav-menu" href="<@base />/app/accounts/list/">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.accounts"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="has-arrow" href="#">
|
||||
<a class="side-nav-menu has-arrow" href="#">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.groups"/>
|
||||
</a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<@base />/groups/list/">
|
||||
<a class="side-nav-menu" href="<@base />/groups/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.groups"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<@base />/groupMember/list">
|
||||
<a class="side-nav-menu" href="<@base />/groupMember/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.groups.member"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<@base />/groupPrivileges/list">
|
||||
<a class="side-nav-menu" href="<@base />/groupPrivileges/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.groups.privileges"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a class="has-arrow" href="#">
|
||||
<a class="side-nav-menu has-arrow" href="#">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.conf"/>
|
||||
</a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<@base />/config/passwordpolicy/forward">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.conf.passwordpolicy"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="side-nav-menu" href="<@base />/roles/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.roles"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="side-nav-menu" href="<@base />/resources/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.resources"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="side-nav-menu" href="<@base />/permissions/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.role.permissions"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="side-nav-menu" href="<@base />/config/passwordpolicy/forward/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.conf.passwordpolicy"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a class="has-arrow" href="#">
|
||||
<a class="side-nav-menu has-arrow" href="#">
|
||||
<span class="fa fa-fw fa-github fa-lg"></span>
|
||||
<@locale code="navs.audit"/>
|
||||
</a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<@base />/logs/loginHistoryList">
|
||||
<a class="side-nav-menu" href="<@base />/logs/loginHistoryList/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.audit.login"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<@base />/logs/loginAppsHistoryList">
|
||||
<a class="side-nav-menu" href="<@base />/logs/loginAppsHistoryList/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.audit.loginapps"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<@base />/logs/list">
|
||||
<a class="side-nav-menu" href="<@base />/logs/list/">
|
||||
<span class="fa fa-fw fa-code-fork"></span>
|
||||
<@locale code="navs.audit.operate"/>
|
||||
</a>
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<script type="text/javascript">
|
||||
|
||||
function onClick (event, treeId, treeNode) {
|
||||
|
||||
$("#pid").val(treeNode.id);
|
||||
$.cookie("select_res_id", treeNode.id, { path: '/' });
|
||||
$.cookie("select_app_id", $("#appId").val(), { path: '/' });
|
||||
$.cookie("select_res_name", treeNode.name,{ path: '/' });
|
||||
$("#searchBtn").click();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#savePermBtn").click(function(){
|
||||
|
||||
var roleId="";
|
||||
if($("#datagrid").length>0){//get grid list selected ids
|
||||
var selRows = $('#datagrid').bootstrapTable('getSelections');
|
||||
for (var i=0;i<selRows.length; i++){
|
||||
roleId=roleId+","+selRows[i].id;
|
||||
break;
|
||||
}
|
||||
roleId=roleId.substring(1);
|
||||
}
|
||||
|
||||
if(roleId == null || roleId == "") {
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
|
||||
var resIds="";
|
||||
var nodes = $.fn.zTree.getZTreeObj("resourcesTree").getCheckedNodes(true);
|
||||
for(var i=0;i<nodes.length;i++){
|
||||
resIds=resIds+","+nodes[i].id;
|
||||
}
|
||||
resIds=resIds.substring(1);
|
||||
|
||||
$.post("<@base/>/permissions/savepermissions",
|
||||
{
|
||||
appId:$("#appId").val(),
|
||||
roleId:roleId,
|
||||
resourceId:resIds,
|
||||
currTime:(new Date()).getTime()
|
||||
},
|
||||
function(data) {
|
||||
if (typeof(afterDelete) == "function"){
|
||||
afterDelete(data);//call back action
|
||||
}
|
||||
//alert delete result
|
||||
$.alert({content:data.message,type:$.platform.messages.messageType[data.messageType]});
|
||||
//refresh grid list
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$('#datagrid').on('click-row.bs.table', function (row, element, field) {
|
||||
if($("#appId").val() == null || $("#appId").val() == "") {
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
|
||||
$.post("<@base/>/permissions/querypermissions",
|
||||
{
|
||||
appId:$("#appId").val(),
|
||||
roleId:element.id,
|
||||
currTime:(new Date()).getTime()
|
||||
},
|
||||
function(data) {
|
||||
if (typeof(afterDelete) == "function"){
|
||||
afterDelete(data);//call back action
|
||||
}
|
||||
var zTree = $.fn.zTree.getZTreeObj("resourcesTree");
|
||||
zTree.checkAllNodes(false);
|
||||
for(var permsData of data){
|
||||
var node = zTree.getNodeByParam("id",permsData.resourceId);
|
||||
zTree.checkNode(node, true, true);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$("#changTreeBtn").click(function(){
|
||||
var treeSettings={
|
||||
element : "resourcesTree",
|
||||
rootId : "1",
|
||||
checkbox : true,
|
||||
onClick : onClick,
|
||||
onDblClick : null,
|
||||
url : "<@base/>/resources/tree/"
|
||||
};
|
||||
|
||||
function singlePath(newNode) {
|
||||
if (newNode === curExpandNode) return;
|
||||
if (curExpandNode && curExpandNode.open==true) {
|
||||
var zTree = $.fn.zTree.getZTreeObj(treeSettings.element);
|
||||
if (newNode.parentTId === curExpandNode.parentTId) {
|
||||
zTree.expandNode(curExpandNode, false);
|
||||
} else {
|
||||
var newParents = [];
|
||||
while (newNode) {
|
||||
newNode = newNode.getParentNode();
|
||||
if (newNode === curExpandNode) {
|
||||
newParents = null;
|
||||
break;
|
||||
} else if (newNode) {
|
||||
newParents.push(newNode);
|
||||
}
|
||||
}
|
||||
if (newParents!=null) {
|
||||
var oldNode = curExpandNode;
|
||||
var oldParents = [];
|
||||
while (oldNode) {
|
||||
oldNode = oldNode.getParentNode();
|
||||
if (oldNode) {
|
||||
oldParents.push(oldNode);
|
||||
}
|
||||
}
|
||||
if (newParents.length>0) {
|
||||
for (var i = Math.min(newParents.length, oldParents.length)-1; i>=0; i--) {
|
||||
if (newParents[i] !== oldParents[i]) {
|
||||
zTree.expandNode(oldParents[i], false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
zTree.expandNode(oldParents[oldParents.length-1], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
curExpandNode = newNode;
|
||||
};
|
||||
|
||||
|
||||
function beforeExpand(treeId, treeNode) {
|
||||
var pNode = curExpandNode ? curExpandNode.getParentNode():null;
|
||||
var treeNodeP = treeNode.parentTId ? treeNode.getParentNode():null;
|
||||
var zTree = $.fn.zTree.getZTreeObj(""+treeSettings.element);
|
||||
for(var i=0, l=!treeNodeP ? 0:treeNodeP.children.length; i<l; i++ ) {
|
||||
if (treeNode !== treeNodeP.children[i]) {
|
||||
zTree.expandNode(treeNodeP.children[i], false);
|
||||
}
|
||||
}
|
||||
while (pNode) {
|
||||
if (pNode === treeNode) {
|
||||
break;
|
||||
}
|
||||
pNode = pNode.getParentNode();
|
||||
}
|
||||
if (!pNode) {
|
||||
singlePath(treeNode);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.zTree.init(
|
||||
$("#"+treeSettings.element), //element
|
||||
{//json object
|
||||
check : {
|
||||
enable : treeSettings.checkbox
|
||||
},
|
||||
async : {
|
||||
enable : true,
|
||||
url : treeSettings.url,
|
||||
autoParam : ["id", "name=n", "level=lv"],
|
||||
otherParam : {
|
||||
"otherParam":"zTreeAsyncTest",
|
||||
id:treeSettings.rootId,
|
||||
"appId":$("#appId").val(),
|
||||
"appName":$("#appName").val(),
|
||||
}
|
||||
},
|
||||
data : {
|
||||
simpleData : {
|
||||
enable : true
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onClick : treeSettings.onClick,
|
||||
onDblClick : treeSettings.onDblClick,
|
||||
beforeAsync : function(treeId, treeNode){
|
||||
$.loading();
|
||||
},
|
||||
onAsyncSuccess : function(event, treeId, treeNode, msg){
|
||||
$.unloading();
|
||||
},
|
||||
//beforeExpand : beforeExpand,
|
||||
onExpand : function onExpand(event, treeId, treeNode) {
|
||||
curExpandNode = treeNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
);//end tree
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app header-default side-nav-dark">
|
||||
<div class="layout">
|
||||
<div class="header navbar">
|
||||
<#include "../layout/top.ftl"/>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 sidebar-nav side-nav" >
|
||||
<#include "../layout/sidenav.ftl"/>
|
||||
</div>
|
||||
<div class="page-container">
|
||||
|
||||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
<div class="breadcrumb-wrapper row">
|
||||
<div class="col-12 col-lg-3 col-md-6">
|
||||
<h4 class="page-title"><@locale code="navs.role.permissions"/></h4>
|
||||
</div>
|
||||
<div class="col-12 col-lg-9 col-md-6">
|
||||
<ol class="breadcrumb float-right">
|
||||
<li><a href="<@base/>/main"><@locale code="navs.home"/></a></li>
|
||||
<li class="active">/ <@locale code="navs.resources"/></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="col-12 grid-margin">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td style="width:80px;"><@locale code="role.name"/>:</td>
|
||||
<td style="width:350px;">
|
||||
<form id="basic_search_form">
|
||||
<input class="form-control" style="width:200px;float: left;" value="" id="name" name="name" type="text" >
|
||||
|
||||
<input class="button btn btn-primary mr-3" id="searchBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
|
||||
|
||||
</form>
|
||||
</td>
|
||||
<td style="width:120px;"><@locale code="apps.name"/>:</td>
|
||||
<td style="width:500px;">
|
||||
<form id="resources_search_form">
|
||||
<input class="form-control appId" id="appId" name="appId" value="" type="hidden" >
|
||||
<input class="form-control" id="pid" name="pid" value="" type="hidden" >
|
||||
<input class="form-control appName" style="width:200px;float: left;" value="" id="appName" name="appName" type="text" >
|
||||
<input class="button btn btn-success mr-3 window" style="float: left;" id="selectBtn" type="button" value="<@locale code="button.text.select"/>"
|
||||
wurl="<@base/>/apps/select"
|
||||
wwidth="700"
|
||||
wheight="500"
|
||||
target="window">
|
||||
<input class="button btn btn-primary mr-3" id="changTreeBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
|
||||
|
||||
</form>
|
||||
</td>
|
||||
<td >
|
||||
<div id="tool_box_right" style="width:100px;">
|
||||
<input class="button btn btn-success mr-3 " id="savePermBtn" type="button" value="<@locale code="button.text.save"/>"/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="advanced_search">
|
||||
<form id="advanced_search_form">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<table class="datatable" width="100%" >
|
||||
<tr>
|
||||
<td valign="top" class="td_1" style="vertical-align: top;width:450px;">
|
||||
<table data-url="<@base/>/roles/grid"
|
||||
id="datagrid"
|
||||
data-toggle="table"
|
||||
data-classes="table table-bordered table-hover table-striped"
|
||||
data-click-to-select="true"
|
||||
data-pagination="true"
|
||||
data-total-field="records"
|
||||
data-page-list="[10, 25, 50, 100]"
|
||||
data-search="false"
|
||||
data-single-select="true"
|
||||
data-locale="zh-CN"
|
||||
data-query-params="dataGridQueryParams"
|
||||
data-query-params-type="pageSize"
|
||||
data-side-pagination="server">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-checkbox="true"></th>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">Id</th>
|
||||
<th data-field="name"><@locale code="role.name"/></th>
|
||||
<th data-field="description"><@locale code="common.text.description"/></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top" class="td_1" style="vertical-align: top;">
|
||||
<div id="resourcesTree" class="ztree"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="content-footer">
|
||||
<#include "../layout/footer.ftl"/>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="preloader">
|
||||
<div class="loader" id="loader-1"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<style type="text/css">
|
||||
.table th, .table td {
|
||||
padding: .2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#appId").val($.cookie("select_app_id"));
|
||||
$("#pid").val($.cookie("select_res_id"));
|
||||
$("#pname").val($.cookie("select_res_name"));
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form id="actionForm" method="post" type="label" autoclose="true" action="<@base/>/resources/add" class="needs-validation" novalidate>
|
||||
<table border="0" cellpadding="0" cellspacing="0" class="table table-bordered" >
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><@locale code="resource.name" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="name" name="name" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="apps.id" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="appId" name="appId" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.pid" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="pid" name="pid" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.pname" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="pname" name="pname" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.resType" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="resType" name="resType" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.resUrl" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="resUrl" name="resUrl" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.resAction" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="resAction" name="resAction" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="common.text.description" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="description" name="description" class="form-control" title="" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap colspan="2" class="center">
|
||||
<input id="_method" type="hidden" name="_method" value="post"/>
|
||||
<input id="status" type="hidden" name="status" value="1"/>
|
||||
<input class="button btn btn-primary mr-3" id="submitBtn" type="submit" value="<@locale code="button.text.save" />">
|
||||
<input class="button btn btn-secondary mr-3" id="closeBtn" type="button" value="<@locale code="button.text.cancel" />">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<style type="text/css">
|
||||
.table th, .table td {
|
||||
padding: .2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="actionForm" method="post" type="label" autoclose="true" action="<@base/>/resources/update" class="needs-validation" novalidate>
|
||||
<table border="0" cellpadding="0" cellspacing="0" class="table table-bordered">
|
||||
<tbody>
|
||||
<tr style="display:none1">
|
||||
<th><@locale code="resource.id" />:</th>
|
||||
<td nowrap>
|
||||
<input id="id" type="text" readonly name="id" class="form-control" value="${model.id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.name" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="name" name="name" class="form-control" title="" value="${model.name}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.pid" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="pid" name="pid" class="form-control" title="" value="${model.pid!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="apps.id" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="appId" name="appId" class="form-control" title="" value="${model.appId!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.pname" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="pname" name="pname" class="form-control" title="" value="${model.pname!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.resType" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="resType" name="resType" class="form-control" title="" value="${model.resType!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.resUrl" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="resUrl" name="resUrl" class="form-control" title="" value="${model.resUrl!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="resource.resAction" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="resAction" name="resAction" class="form-control" title="" value="${model.resAction!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="common.text.description" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="description" name="description" class="form-control" title="" value="${model.description!}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap colspan="2" class="center">
|
||||
<input id="_method" type="hidden" name="_method" value="post"/>
|
||||
<input id="status" type="hidden" name="status" value="1"/>
|
||||
<input class="button btn btn-primary mr-3" id="submitBtn" type="submit" value="<@locale code="button.text.save" />">
|
||||
<input class="button btn btn-secondary mr-3" id="closeBtn" type="button" value="<@locale code="button.text.cancel" />">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,268 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<script type="text/javascript">
|
||||
|
||||
function onClick (event, treeId, treeNode) {
|
||||
|
||||
$("#pid").val(treeNode.id);
|
||||
$.cookie("select_res_id", treeNode.id, { path: '/' });
|
||||
$.cookie("select_app_id", $("#appId").val(), { path: '/' });
|
||||
$.cookie("select_res_name", treeNode.name,{ path: '/' });
|
||||
$("#searchBtn").click();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
$("#changTreeBtn").click(function(){
|
||||
var treeSettings={
|
||||
element : "resourcesTree",
|
||||
rootId : "1",
|
||||
checkbox : null,
|
||||
onClick : onClick,
|
||||
onDblClick : null,
|
||||
url : "<@base/>/resources/tree/"
|
||||
};
|
||||
|
||||
function singlePath(newNode) {
|
||||
if (newNode === curExpandNode) return;
|
||||
if (curExpandNode && curExpandNode.open==true) {
|
||||
var zTree = $.fn.zTree.getZTreeObj(treeSettings.element);
|
||||
if (newNode.parentTId === curExpandNode.parentTId) {
|
||||
zTree.expandNode(curExpandNode, false);
|
||||
} else {
|
||||
var newParents = [];
|
||||
while (newNode) {
|
||||
newNode = newNode.getParentNode();
|
||||
if (newNode === curExpandNode) {
|
||||
newParents = null;
|
||||
break;
|
||||
} else if (newNode) {
|
||||
newParents.push(newNode);
|
||||
}
|
||||
}
|
||||
if (newParents!=null) {
|
||||
var oldNode = curExpandNode;
|
||||
var oldParents = [];
|
||||
while (oldNode) {
|
||||
oldNode = oldNode.getParentNode();
|
||||
if (oldNode) {
|
||||
oldParents.push(oldNode);
|
||||
}
|
||||
}
|
||||
if (newParents.length>0) {
|
||||
for (var i = Math.min(newParents.length, oldParents.length)-1; i>=0; i--) {
|
||||
if (newParents[i] !== oldParents[i]) {
|
||||
zTree.expandNode(oldParents[i], false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
zTree.expandNode(oldParents[oldParents.length-1], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
curExpandNode = newNode;
|
||||
};
|
||||
|
||||
|
||||
function beforeExpand(treeId, treeNode) {
|
||||
var pNode = curExpandNode ? curExpandNode.getParentNode():null;
|
||||
var treeNodeP = treeNode.parentTId ? treeNode.getParentNode():null;
|
||||
var zTree = $.fn.zTree.getZTreeObj(""+treeSettings.element);
|
||||
for(var i=0, l=!treeNodeP ? 0:treeNodeP.children.length; i<l; i++ ) {
|
||||
if (treeNode !== treeNodeP.children[i]) {
|
||||
zTree.expandNode(treeNodeP.children[i], false);
|
||||
}
|
||||
}
|
||||
while (pNode) {
|
||||
if (pNode === treeNode) {
|
||||
break;
|
||||
}
|
||||
pNode = pNode.getParentNode();
|
||||
}
|
||||
if (!pNode) {
|
||||
singlePath(treeNode);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.zTree.init(
|
||||
$("#"+treeSettings.element), //element
|
||||
{//json object
|
||||
check : {
|
||||
enable : treeSettings.checkbox
|
||||
},
|
||||
async : {
|
||||
enable : true,
|
||||
url : treeSettings.url,
|
||||
autoParam : ["id", "name=n", "level=lv"],
|
||||
otherParam : {
|
||||
"otherParam":"zTreeAsyncTest",
|
||||
id:treeSettings.rootId,
|
||||
"appId":$("#appId").val(),
|
||||
"appName":$("#appName").val(),
|
||||
}
|
||||
},
|
||||
data : {
|
||||
simpleData : {
|
||||
enable : true
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onClick : treeSettings.onClick,
|
||||
onDblClick : treeSettings.onDblClick,
|
||||
beforeAsync : function(treeId, treeNode){
|
||||
$.loading();
|
||||
},
|
||||
onAsyncSuccess : function(event, treeId, treeNode, msg){
|
||||
$.unloading();
|
||||
},
|
||||
//beforeExpand : beforeExpand,
|
||||
onExpand : function onExpand(event, treeId, treeNode) {
|
||||
curExpandNode = treeNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
);//end tree
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app header-default side-nav-dark">
|
||||
<div class="layout">
|
||||
<div class="header navbar">
|
||||
<#include "../layout/top.ftl"/>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 sidebar-nav side-nav" >
|
||||
<#include "../layout/sidenav.ftl"/>
|
||||
</div>
|
||||
<div class="page-container">
|
||||
|
||||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
<div class="breadcrumb-wrapper row">
|
||||
<div class="col-12 col-lg-3 col-md-6">
|
||||
<h4 class="page-title"><@locale code="navs.resources"/></h4>
|
||||
</div>
|
||||
<div class="col-12 col-lg-9 col-md-6">
|
||||
<ol class="breadcrumb float-right">
|
||||
<li><a href="<@base/>/main"><@locale code="navs.home"/></a></li>
|
||||
<li class="active">/ <@locale code="navs.resources"/></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="col-12 grid-margin">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td width="120px"><@locale code="apps.name"/>:</td>
|
||||
<td width="450px">
|
||||
<form id="basic_search_form">
|
||||
<input class="form-control appId" id="appId" name="appId" value="" type="hidden" >
|
||||
<input class="form-control" id="pid" name="pid" value="" type="hidden" >
|
||||
<input class="form-control appName" style="width:200px;float: left;" value="" id="appName" name="appName" type="text" >
|
||||
<input class="button btn btn-success mr-3 window" style="float: left;" id="selectBtn" type="button" value="<@locale code="button.text.select"/>"
|
||||
wurl="<@base/>/apps/select"
|
||||
wwidth="700"
|
||||
wheight="500"
|
||||
target="window">
|
||||
<input class="button btn btn-primary mr-3" id="changTreeBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
|
||||
<!--<input class="button btn btn-secondary" id="advancedSearchExpandBtn" type="button" size="50" value="<@locale code="button.text.expandsearch"/>" expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>">
|
||||
-->
|
||||
<input style="display:none" class="button btn btn-primary mr-3" id="searchBtn" type="button"/>
|
||||
</form>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div id="tool_box_right" style="width:350px;">
|
||||
<input class="button btn btn-success mr-3" id="addBtn" type="button" value="<@locale code="button.text.add"/>"
|
||||
wurl="<@base/>/resources/forwardAdd"
|
||||
wwidth="500"
|
||||
wheight="500"
|
||||
target="window"/>
|
||||
|
||||
<input class="button btn btn-info mr-3 " id="modifyBtn" type="button" value="<@locale code="button.text.edit"/>"
|
||||
wurl="<@base/>/resources/forwardUpdate"
|
||||
wwidth="500"
|
||||
wheight="500"
|
||||
target="window"/>
|
||||
|
||||
<input class="button btn btn-danger mr-3 " id="deleteBtn" type="button" value="<@locale code="button.text.delete"/>"
|
||||
wurl="<@base/>/resources/delete" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="advanced_search">
|
||||
<form id="advanced_search_form">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<table class="datatable" width="100%" >
|
||||
<tr>
|
||||
<td valign="top" class="td_1" style="vertical-align: top;width:400px;">
|
||||
<div id="resourcesTree" class="ztree"></div>
|
||||
|
||||
</td>
|
||||
<td valign="top" class="td_1" style="vertical-align: top;">
|
||||
<table data-url="<@base/>/resources/grid"
|
||||
id="datagrid"
|
||||
data-toggle="table"
|
||||
data-classes="table table-bordered table-hover table-striped"
|
||||
data-click-to-select="true"
|
||||
data-pagination="true"
|
||||
data-total-field="records"
|
||||
data-page-list="[10, 25, 50, 100]"
|
||||
data-search="false"
|
||||
data-locale="zh-CN"
|
||||
data-query-params="dataGridQueryParams"
|
||||
data-query-params-type="pageSize"
|
||||
data-side-pagination="server">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-checkbox="true"></th>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">Id</th>
|
||||
<th data-field="name"><@locale code="resource.name"/></th>
|
||||
<th data-field="description"><@locale code="common.text.description"/></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="content-footer">
|
||||
<#include "../layout/footer.ftl"/>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="preloader">
|
||||
<div class="loader" id="loader-1"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<style type="text/css">
|
||||
.table th, .table td {
|
||||
padding: .2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
$("#selectBtn").on("click",function(){
|
||||
var seldata=$.dataGridSelRowsData("#datagrid");
|
||||
console.log(seldata[0].id+" - "+seldata[0].name);
|
||||
$(".groupId", window.parent.document).val(seldata[0].id);
|
||||
$(".groupName", window.parent.document).val(seldata[0].name);
|
||||
$.closeWindow();
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tool_box">
|
||||
<table class="datatable">
|
||||
<tr>
|
||||
<td width="120px"><@locale code="group.name"/>:</td>
|
||||
<td width="374px">
|
||||
<form id="basic_search_form">
|
||||
<input class="form-control" type="text" name="name" style ="width:150px;float: left;">
|
||||
<input class="button btn btn-success mr-3" id="searchBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
|
||||
</form>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div id="tool_box_right" style="width: auto;">
|
||||
<input class="button btn btn-primary mr-3" id="selectBtn" type="button" value="<@locale code="button.text.select"/>" >
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mainwrap" id="main">
|
||||
<table data-url="<@base/>/resources/grid"
|
||||
id="datagrid"
|
||||
data-toggle="table"
|
||||
data-classes="table table-bordered table-hover table-striped"
|
||||
data-click-to-select="true"
|
||||
data-pagination="true"
|
||||
data-total-field="records"
|
||||
data-page-list="[10, 25, 50, 100]"
|
||||
data-search="false"
|
||||
data-locale="zh-CN"
|
||||
data-query-params="dataGridQueryParams"
|
||||
data-query-params-type="pageSize"
|
||||
data-side-pagination="server">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-checkbox="true"></th>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">Id</th>
|
||||
<th data-field="name"><@locale code="group.name"/></th>
|
||||
<th data-field="description"><@locale code="common.text.description"/></th>
|
||||
<th data-field="createdBy"><@locale code="common.text.createdby"/></th>
|
||||
<th data-field="createdDate"><@locale code="common.text.createddate"/></th>
|
||||
<th data-field="modifiedBy"><@locale code="common.text.modifiedby"/></th>
|
||||
<th data-field="modifiedDate"><@locale code="common.text.modifieddate"/></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<style type="text/css">
|
||||
.table th, .table td {
|
||||
padding: .2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="actionForm" method="post" type="label" autoclose="true" action="<@base/>/roles/add" class="needs-validation" novalidate>
|
||||
<table border="0" cellpadding="0" cellspacing="0" class="table table-bordered" >
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><@locale code="role.name" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="name" name="name" class="form-control" title="" value="" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="common.text.description" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="description" name="description" class="form-control" title="" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td nowrap colspan="2" class="center">
|
||||
<input id="_method" type="hidden" name="_method" value="post"/>
|
||||
<input id="status" type="hidden" name="status" value="1"/>
|
||||
<input class="button btn btn-primary mr-3" id="submitBtn" type="submit" value="<@locale code="button.text.save" />">
|
||||
<input class="button btn btn-secondary mr-3" id="closeBtn" type="button" value="<@locale code="button.text.cancel" />">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<style type="text/css">
|
||||
.table th, .table td {
|
||||
padding: .2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="actionForm" method="post" type="label" autoclose="true" action="<@base/>/roles/update" class="needs-validation" novalidate>
|
||||
<table border="0" cellpadding="0" cellspacing="0" class="table table-bordered">
|
||||
<tbody>
|
||||
<tr style="display:none1">
|
||||
<th><@locale code="role.id" />:</th>
|
||||
<td nowrap>
|
||||
<input id="id" type="text" readonly name="id" class="form-control" value="${model.id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="role.name" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="name" name="name" class="form-control" title="" value="${model.name!}" required="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><@locale code="common.text.description" />:</th>
|
||||
<td nowrap>
|
||||
<input type="text" id="description" name="description" class="form-control" title="" value="${model.description!}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap colspan="2" class="center">
|
||||
<input id="_method" type="hidden" name="_method" value="post"/>
|
||||
<input id="status" type="hidden" name="status" value="1"/>
|
||||
<input class="button btn btn-primary mr-3" id="submitBtn" type="submit" value="<@locale code="button.text.save" />">
|
||||
<input class="button btn btn-secondary mr-3" id="closeBtn" type="button" value="<@locale code="button.text.cancel" />">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,124 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="app header-default side-nav-dark">
|
||||
<div class="layout">
|
||||
<div class="header navbar">
|
||||
<#include "../layout/top.ftl"/>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 sidebar-nav side-nav" >
|
||||
<#include "../layout/sidenav.ftl"/>
|
||||
</div>
|
||||
<div class="page-container">
|
||||
|
||||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
<div class="breadcrumb-wrapper row">
|
||||
<div class="col-12 col-lg-3 col-md-6">
|
||||
<h4 class="page-title"><@locale code="navs.roles"/></h4>
|
||||
</div>
|
||||
<div class="col-12 col-lg-9 col-md-6">
|
||||
<ol class="breadcrumb float-right">
|
||||
<li><a href="<@base/>/main"><@locale code="navs.home"/></a></li>
|
||||
<li class="active">/ <@locale code="navs.roles"/></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="col-12 grid-margin">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td width="120px"><@locale code="role.name"/>:</td>
|
||||
<td width="375px">
|
||||
<form id="basic_search_form">
|
||||
<input class="form-control" type="text" name="name" style ="width:150px;float:left;">
|
||||
<input class="button btn btn-primary mr-3" id="searchBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
|
||||
<!--<input class="button btn btn-secondary" id="advancedSearchExpandBtn" type="button" size="50" value="<@locale code="button.text.expandsearch"/>" expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>">
|
||||
-->
|
||||
</form>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div id="tool_box_right">
|
||||
<input class="button btn btn-success mr-3" id="addBtn" type="button" value="<@locale code="button.text.add"/>"
|
||||
wurl="<@base/>/roles/forwardAdd"
|
||||
wwidth="500"
|
||||
wheight="200"
|
||||
target="window">
|
||||
|
||||
<input class="button btn btn-info mr-3 " id="modifyBtn" type="button" value="<@locale code="button.text.edit"/>"
|
||||
wurl="<@base/>/roles/forwardUpdate"
|
||||
wwidth="500"
|
||||
wheight="200"
|
||||
target="window">
|
||||
|
||||
<input class="button btn btn-danger mr-3 " id="deleteBtn" type="button" value="<@locale code="button.text.delete"/>"
|
||||
wurl="<@base/>/roles/delete" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="advanced_search">
|
||||
<form id="advanced_search_form">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<table data-url="<@base/>/roles/grid"
|
||||
id="datagrid"
|
||||
data-toggle="table"
|
||||
data-classes="table table-bordered table-hover table-striped"
|
||||
data-click-to-select="true"
|
||||
data-pagination="true"
|
||||
data-total-field="records"
|
||||
data-page-list="[10, 25, 50, 100]"
|
||||
data-search="false"
|
||||
data-locale="zh-CN"
|
||||
data-query-params="dataGridQueryParams"
|
||||
data-query-params-type="pageSize"
|
||||
data-side-pagination="server">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-checkbox="true"></th>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">Id</th>
|
||||
<th data-field="name"><@locale code="role.name"/></th>
|
||||
<th data-field="description"><@locale code="common.text.description"/></th>
|
||||
<th data-field="createdBy"><@locale code="common.text.createdby"/></th>
|
||||
<th data-field="createdDate"><@locale code="common.text.createddate"/></th>
|
||||
<th data-field="modifiedBy"><@locale code="common.text.modifiedby"/></th>
|
||||
<th data-field="modifiedDate"><@locale code="common.text.modifieddate"/></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<footer class="content-footer">
|
||||
<#include "../layout/footer.ftl"/>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="preloader">
|
||||
<div class="loader" id="loader-1"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<#include "../layout/header.ftl"/>
|
||||
<#include "../layout/common.cssjs.ftl"/>
|
||||
<style type="text/css">
|
||||
.table th, .table td {
|
||||
padding: .2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
$("#selectBtn").on("click",function(){
|
||||
var seldata=$.dataGridSelRowsData("#datagrid");
|
||||
console.log(seldata[0].id+" - "+seldata[0].name);
|
||||
$(".roleId", window.parent.document).val(seldata[0].id);
|
||||
$(".roleName", window.parent.document).val(seldata[0].name);
|
||||
$.closeWindow();
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tool_box">
|
||||
<table class="datatable">
|
||||
<tr>
|
||||
<td width="120px"><@locale code="role.name"/>:</td>
|
||||
<td width="374px">
|
||||
<form id="basic_search_form">
|
||||
<input class="form-control" type="text" name="name" style ="width:150px;float: left;">
|
||||
<input class="button btn btn-success mr-3" id="searchBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
|
||||
</form>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div id="tool_box_right" style="width: auto;">
|
||||
<input class="button btn btn-primary mr-3" id="selectBtn" type="button" value="<@locale code="button.text.select"/>" >
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mainwrap" id="main">
|
||||
<table data-url="<@base/>/roles/grid"
|
||||
id="datagrid"
|
||||
data-toggle="table"
|
||||
data-classes="table table-bordered table-hover table-striped"
|
||||
data-click-to-select="true"
|
||||
data-pagination="true"
|
||||
data-total-field="records"
|
||||
data-page-list="[10, 25, 50, 100]"
|
||||
data-search="false"
|
||||
data-locale="zh-CN"
|
||||
data-query-params="dataGridQueryParams"
|
||||
data-query-params-type="pageSize"
|
||||
data-side-pagination="server">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-checkbox="true"></th>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">Id</th>
|
||||
<th data-field="name"><@locale code="role.name"/></th>
|
||||
<th data-field="description"><@locale code="common.text.description"/></th>
|
||||
<th data-field="createdBy"><@locale code="common.text.createdby"/></th>
|
||||
<th data-field="createdDate"><@locale code="common.text.createddate"/></th>
|
||||
<th data-field="modifiedBy"><@locale code="common.text.modifiedby"/></th>
|
||||
<th data-field="modifiedDate"><@locale code="common.text.modifieddate"/></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user