synchronizers
This commit is contained in:
@@ -17,7 +17,11 @@
|
||||
|
||||
package org.maxkey.synchronizer;
|
||||
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
|
||||
public interface ISynchronizerService {
|
||||
|
||||
public void sync() throws Exception ;
|
||||
|
||||
public void setSynchronizer(Synchronizers synchronizer);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.naming.directory.SearchControls;
|
||||
import javax.naming.directory.SearchResult;
|
||||
import org.maxkey.constants.ldap.OrganizationalUnit;
|
||||
import org.maxkey.entity.Organizations;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.persistence.ldap.ActiveDirectoryUtils;
|
||||
import org.maxkey.persistence.ldap.LdapUtils;
|
||||
import org.maxkey.persistence.service.OrganizationsService;
|
||||
@@ -119,4 +120,10 @@ public class ActiveDirectoryOrganizationService implements ISynchronizerServic
|
||||
this.organizationsService = organizationsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.maxkey.synchronizer.activedirectory;
|
||||
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -27,6 +28,8 @@ import org.springframework.stereotype.Service;
|
||||
public class ActiveDirectorySynchronizerService implements ISynchronizerService{
|
||||
final static Logger _logger = LoggerFactory.getLogger(ActiveDirectorySynchronizerService.class);
|
||||
|
||||
Synchronizers synchronizer;
|
||||
|
||||
@Autowired
|
||||
ActiveDirectoryUsersService activeDirectoryUsersService;
|
||||
|
||||
@@ -63,6 +66,11 @@ public class ActiveDirectorySynchronizerService implements ISynchronizerServic
|
||||
this.activeDirectoryOrganizationService = activeDirectoryOrganizationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers synchronizer) {
|
||||
this.synchronizer = synchronizer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.naming.directory.Attribute;
|
||||
import javax.naming.directory.SearchControls;
|
||||
import javax.naming.directory.SearchResult;
|
||||
import org.maxkey.constants.ldap.ActiveDirectoryUser;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.ldap.ActiveDirectoryUtils;
|
||||
import org.maxkey.persistence.ldap.LdapUtils;
|
||||
@@ -147,6 +148,12 @@ public class ActiveDirectoryUsersService implements ISynchronizerService{
|
||||
public void setUserInfoService(UserInfoService userInfoService) {
|
||||
this.userInfoService = userInfoService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,9 @@ public class DingdingAccessTokenService {
|
||||
|
||||
String appsecret;
|
||||
|
||||
|
||||
public DingdingAccessTokenService() {
|
||||
|
||||
}
|
||||
public DingdingAccessTokenService(String appkey, String appsecret) {
|
||||
super();
|
||||
this.appkey = appkey;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
package org.maxkey.synchronizer.dingding;
|
||||
|
||||
import org.maxkey.entity.Organizations;
|
||||
import org.maxkey.persistence.ldap.ActiveDirectoryUtils;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.persistence.service.OrganizationsService;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.slf4j.Logger;
|
||||
@@ -104,6 +104,12 @@ public class DingdingOrganizationService implements ISynchronizerService{
|
||||
public void setOrganizationsService(OrganizationsService organizationsService) {
|
||||
this.organizationsService = organizationsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.maxkey.synchronizer.dingding;
|
||||
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -28,6 +29,7 @@ import com.taobao.api.ApiException;
|
||||
@Service
|
||||
public class DingdingSynchronizerService implements ISynchronizerService{
|
||||
final static Logger _logger = LoggerFactory.getLogger(DingdingSynchronizerService.class);
|
||||
Synchronizers synchronizer;
|
||||
|
||||
@Autowired
|
||||
DingdingUsersService dingdingUsersService;
|
||||
@@ -36,7 +38,7 @@ public class DingdingSynchronizerService implements ISynchronizerService{
|
||||
DingdingOrganizationService dingdingOrganizationService;
|
||||
|
||||
|
||||
DingdingAccessTokenService dingdingAccessTokenService;
|
||||
DingdingAccessTokenService dingdingAccessTokenService = new DingdingAccessTokenService();
|
||||
|
||||
public DingdingSynchronizerService() {
|
||||
super();
|
||||
@@ -44,6 +46,8 @@ public class DingdingSynchronizerService implements ISynchronizerService{
|
||||
|
||||
public void sync() throws ApiException {
|
||||
_logger.info("Sync ...");
|
||||
dingdingAccessTokenService.setAppkey(synchronizer.getPrincipal());
|
||||
dingdingAccessTokenService.setAppsecret(synchronizer.getCredentials());
|
||||
|
||||
String access_token=dingdingAccessTokenService.requestToken();
|
||||
|
||||
@@ -78,4 +82,10 @@ public class DingdingSynchronizerService implements ISynchronizerService{
|
||||
this.dingdingAccessTokenService = dingdingAccessTokenService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers synchronizer) {
|
||||
this.synchronizer = synchronizer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.maxkey.synchronizer.dingding;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.service.UserInfoService;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
@@ -124,6 +125,12 @@ public class DingdingUsersService implements ISynchronizerService{
|
||||
return organizationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.naming.directory.SearchControls;
|
||||
import javax.naming.directory.SearchResult;
|
||||
import org.maxkey.constants.ldap.OrganizationalUnit;
|
||||
import org.maxkey.entity.Organizations;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.persistence.ldap.LdapUtils;
|
||||
import org.maxkey.persistence.service.OrganizationsService;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
@@ -122,6 +123,12 @@ public class LdapOrganizationService implements ISynchronizerService{
|
||||
public void setOrganizationsService(OrganizationsService organizationsService) {
|
||||
this.organizationsService = organizationsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.maxkey.synchronizer.ldap;
|
||||
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -27,6 +28,8 @@ import org.springframework.stereotype.Service;
|
||||
public class LdapSynchronizerService implements ISynchronizerService{
|
||||
final static Logger _logger = LoggerFactory.getLogger(LdapSynchronizerService.class);
|
||||
|
||||
Synchronizers synchronizer;
|
||||
|
||||
@Autowired
|
||||
LdapUsersService ldapUsersService;
|
||||
|
||||
@@ -59,5 +62,11 @@ public class LdapSynchronizerService implements ISynchronizerService{
|
||||
this.ldapOrganizationService = ldapOrganizationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers synchronizer) {
|
||||
this.synchronizer = synchronizer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.naming.directory.Attribute;
|
||||
import javax.naming.directory.SearchControls;
|
||||
import javax.naming.directory.SearchResult;
|
||||
import org.maxkey.constants.ldap.InetOrgPerson;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.ldap.LdapUtils;
|
||||
import org.maxkey.persistence.service.UserInfoService;
|
||||
@@ -139,6 +140,12 @@ public class LdapUsersService implements ISynchronizerService{
|
||||
public void setUserInfoService(UserInfoService userInfoService) {
|
||||
this.userInfoService = userInfoService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,9 @@ public class WorkweixinAccessTokenService {
|
||||
public static String TOKEN_URL="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s";
|
||||
|
||||
|
||||
|
||||
public WorkweixinAccessTokenService() {}
|
||||
|
||||
|
||||
public WorkweixinAccessTokenService(String corpid, String corpsecret) {
|
||||
super();
|
||||
this.corpid = corpid;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package org.maxkey.synchronizer.workweixin;
|
||||
|
||||
import org.maxkey.entity.Organizations;
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.persistence.service.OrganizationsService;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.maxkey.synchronizer.workweixin.entity.WorkWeixinDepts;
|
||||
@@ -103,4 +104,10 @@ public class WorkweixinOrganizationService implements ISynchronizerService{
|
||||
this.organizationsService = organizationsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers synchronizer) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
|
||||
package org.maxkey.synchronizer.workweixin;
|
||||
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.taobao.api.ApiException;
|
||||
|
||||
@Service
|
||||
public class WorkweixinSynchronizerService implements ISynchronizerService{
|
||||
final static Logger _logger = LoggerFactory.getLogger(WorkweixinSynchronizerService.class);
|
||||
Synchronizers synchronizer;
|
||||
|
||||
@Autowired
|
||||
WorkweixinUsersService workweixinUsersService;
|
||||
@@ -36,7 +36,7 @@ public class WorkweixinSynchronizerService implements ISynchronizerService{
|
||||
WorkweixinOrganizationService workweixinOrganizationService;
|
||||
|
||||
|
||||
WorkweixinAccessTokenService workweixinAccessTokenService;
|
||||
WorkweixinAccessTokenService workweixinAccessTokenService = new WorkweixinAccessTokenService();
|
||||
|
||||
public WorkweixinSynchronizerService() {
|
||||
super();
|
||||
@@ -44,7 +44,8 @@ public class WorkweixinSynchronizerService implements ISynchronizerService{
|
||||
|
||||
public void sync() throws Exception {
|
||||
_logger.info("Sync ...");
|
||||
|
||||
workweixinAccessTokenService.setCorpid(synchronizer.getPrincipal());
|
||||
workweixinAccessTokenService.setCorpsecret(synchronizer.getCredentials());
|
||||
String access_token=workweixinAccessTokenService.requestToken();
|
||||
|
||||
workweixinOrganizationService.setAccess_token(access_token);
|
||||
@@ -78,4 +79,10 @@ public class WorkweixinSynchronizerService implements ISynchronizerService{
|
||||
this.workweixinAccessTokenService = workweixinAccessTokenService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers synchronizer) {
|
||||
this.synchronizer = synchronizer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.maxkey.synchronizer.workweixin;
|
||||
|
||||
import org.maxkey.entity.Synchronizers;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.service.UserInfoService;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
@@ -111,6 +112,12 @@ public class WorkweixinUsersService implements ISynchronizerService{
|
||||
return organizationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSynchronizer(Synchronizers Synchronizer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
"org.maxkey.web.tag",
|
||||
"org.maxkey.identity.kafka",
|
||||
"org.maxkey.identity.scim.controller",
|
||||
"org.maxkey.identity.rest"
|
||||
"org.maxkey.identity.rest",
|
||||
"org.maxkey.synchronizer"
|
||||
})
|
||||
@MapperScan("org.maxkey.persistence.mapper,")
|
||||
@SpringBootApplication
|
||||
|
||||
@@ -17,10 +17,14 @@
|
||||
|
||||
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.entity.Synchronizers;
|
||||
import org.maxkey.persistence.service.SynchronizersService;
|
||||
import org.maxkey.synchronizer.ISynchronizerService;
|
||||
import org.maxkey.util.StringUtils;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.maxkey.web.message.Message;
|
||||
import org.maxkey.web.message.MessageType;
|
||||
@@ -32,6 +36,7 @@ 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;
|
||||
|
||||
@@ -44,8 +49,15 @@ public class SynchronizersController {
|
||||
@Autowired
|
||||
@Qualifier("synchronizersService")
|
||||
SynchronizersService synchronizerssService;
|
||||
|
||||
|
||||
private static HashMap<String,String> synchronizerMap =new HashMap<String,String>();
|
||||
|
||||
static {
|
||||
synchronizerMap.put("1", "ldapSynchronizerService");
|
||||
synchronizerMap.put("2", "activeDirectorySynchronizerService");
|
||||
synchronizerMap.put("3", "dingdingSynchronizerService");
|
||||
synchronizerMap.put("4", "workweixinSynchronizerService");
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/list"})
|
||||
public ModelAndView groupsList(){
|
||||
@@ -92,5 +104,31 @@ public class SynchronizersController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value={"/sync"})
|
||||
public Message sync(@RequestParam("id") String id) {
|
||||
_logger.debug("-update synchronizers ids :" + id);
|
||||
|
||||
List<String> ids = StringUtils.string2List(id, ",");
|
||||
try {
|
||||
for(String sysId : ids) {
|
||||
Synchronizers synchronizer = synchronizerssService.get(sysId);
|
||||
_logger.debug("synchronizer " + synchronizer);
|
||||
ISynchronizerService synchronizerService = (ISynchronizerService)WebContext.getBean(synchronizerMap.get(sysId));
|
||||
synchronizerService.setSynchronizer(synchronizer);
|
||||
synchronizerService.sync();
|
||||
}
|
||||
}catch(Exception e) {
|
||||
_logger.error("synchronizer Exception " , e);
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
|
||||
}
|
||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ login.password.confirmPassword=\u786e\u8ba4\u65b0\u5bc6\u7801
|
||||
login.password.initial.change.tip=\u9996\u6b21\u767b\u5f55\uff0c\u8bf7\u4fee\u6539\u521d\u59cb\u5316\u5bc6\u7801
|
||||
login.password.changepassword=\u5bc6\u7801\u4fee\u6539
|
||||
login.password.applogin.changepassword=\u5e94\u7528\u767b\u5f55\u5bc6\u7801\u8bbe\u7f6e
|
||||
|
||||
#passwordpolicy
|
||||
login.passwordpolicy=\u5bc6\u7801\u7b56\u7565
|
||||
login.passwordpolicy.minlength=\u6700\u5c0f\u957f\u5ea6
|
||||
login.passwordpolicy.maxlength=\u6700\u5927\u957f\u5ea6
|
||||
@@ -111,13 +111,12 @@ login.passwordpolicy.numerical=\u6570\u5b57\u5e8f\u5217\u7b56\u7565
|
||||
login.passwordpolicy.qwerty=\u952e\u76d8\u7b56\u7565
|
||||
login.passwordpolicy.occurances=\u5b57\u7b26\u91cd\u590d\u6b21\u6570
|
||||
|
||||
|
||||
#social
|
||||
login.social.link=\u7ed1\u5b9a
|
||||
login.social.unlink=\u89e3\u9664
|
||||
login.social.icon=\u56fe\u6807
|
||||
login.social.provider=\u4f9b\u5e94\u5546
|
||||
|
||||
#
|
||||
#userinfo
|
||||
userinfo.id=\u7528\u6237\u7f16\u53f7
|
||||
userinfo.tab.basic=\u57fa\u672c\u4fe1\u606f
|
||||
userinfo.tab.business=\u673a\u6784\u4fe1\u606f
|
||||
@@ -218,7 +217,7 @@ userinfo.authnType.authnType.7=HOTP\u4ee4\u724c
|
||||
userinfo.authnType.authnType.8=RSA\u4ee4\u724c
|
||||
userinfo.authnType.authnType.9=\u6570\u5b57\u8bc1\u4e66
|
||||
userinfo.authnType.authnType.10=USB Key
|
||||
|
||||
#org
|
||||
org.tab.basic=\u57fa\u672c\u4fe1\u606f
|
||||
org.tab.extra=\u6269\u5c55\u4fe1\u606f
|
||||
org.id=\u673a\u6784\u7f16\u53f7
|
||||
@@ -242,7 +241,6 @@ org.address=\u5730\u5740
|
||||
org.postalcode=\u90ae\u7f16
|
||||
org.sortorder=\u6392\u5e8f
|
||||
org.description=\u63cf\u8ff0
|
||||
|
||||
#opt totp
|
||||
login.totp.sharedSecret=\u5171\u4eab\u5bc6\u7801
|
||||
login.totp.period=\u5468\u671f
|
||||
@@ -313,12 +311,10 @@ apps.extendAttr.parameter.type=\u7c7b\u578b
|
||||
apps.extendAttr.parameter.value=\u503c
|
||||
apps.principal=\u51ed\u8bc1
|
||||
apps.credentials=\u79d8\u94a5
|
||||
|
||||
#adapter
|
||||
apps.adapter.name=\u540D\u79F0
|
||||
apps.adapter.adapter=\u9002\u914D\u5668
|
||||
apps.adapter.protocol=\u534F\u8BAE
|
||||
|
||||
#formbased
|
||||
apps.formbased.info=\u8868\u5355\u8ba4\u8bc1
|
||||
apps.formbased.redirectUri=\u8ba4\u8bc1\u5730\u5740
|
||||
@@ -410,7 +406,6 @@ apps.oauth.connect.idTokenEncryptedAlgorithm=idToken\u52a0\u5bc6\u7b97\u6cd5
|
||||
apps.oauth.connect.userInfoEncryptedAlgorithm=\u7528\u6237\u52a0\u5bc6\u7b97\u6cd5
|
||||
apps.oauth.connect.idTokenEncryptionMethod=idToken\u52a0\u5bc6\u65b9\u6cd5
|
||||
apps.oauth.connect.userInfoEncryptionMethod=\u7528\u6237\u52a0\u5bc6\u65b9\u6cd5
|
||||
|
||||
#group
|
||||
group.id=\u7ec4\u7f16\u7801
|
||||
group.name=\u7528\u6237\u7ec4
|
||||
@@ -419,14 +414,13 @@ group.filters=\u8fc7\u6ee4\u5668
|
||||
group.orgidslist=\u673a\u6784\u5217\u8868
|
||||
group.resumeTime=\u52a8\u6001\u65f6\u95f4
|
||||
group.suspendTime=\u6302\u8d77\u65f6\u95f4
|
||||
|
||||
#role
|
||||
role.id=\u89d2\u8272\u7f16\u7801
|
||||
role.name=\u89d2\u8272
|
||||
role.dynamic=\u52a8\u6001\u7ec4
|
||||
role.filters=\u8fc7\u6ee4\u5668
|
||||
role.orgidslist=\u673a\u6784\u5217\u8868
|
||||
|
||||
#resource
|
||||
resource.id=\u8d44\u6e90\u7f16\u7801
|
||||
resource.name=\u8d44\u6e90\u540d\u79f0
|
||||
resource.parentId=\u7236\u7ea7\u7f16\u7801
|
||||
@@ -443,7 +437,6 @@ resource.resourceIcon=\u56fe\u6807
|
||||
resource.resourceUrl=\u8d44\u6e90\u5730\u5740
|
||||
resource.resourceAction=\u52a8\u4f5c
|
||||
resource.resourceStyle=\u6837\u5f0f
|
||||
|
||||
#account
|
||||
account.username=\u7528\u6237\u540d
|
||||
account.displayName=\u7528\u6237\u59d3\u540d
|
||||
@@ -451,7 +444,6 @@ account.appId=\u5e94\u7528\u7f16\u53f7
|
||||
account.appName=\u5e94\u7528\u540d\u79f0
|
||||
account.relatedUsername=\u7528\u6237\u8d26\u53f7
|
||||
account.relatedPassword=\u8d26\u53f7\u5bc6\u7801
|
||||
|
||||
#synchronizers
|
||||
synchronizers.id=\u7F16\u53F7
|
||||
synchronizers.name=\u540C\u6B65\u5668\u540D\u79F0
|
||||
@@ -469,7 +461,7 @@ synchronizers.trustStore=\u8BC1\u4E66\u8DEF\u5F84
|
||||
synchronizers.trustStorePassword=\u8BC1\u4E66\u5BC6\u94A5
|
||||
synchronizers.resumeTime=\u6062\u590D\u65F6\u95F4
|
||||
synchronizers.suspendTime=\u6302\u8D77\u65F6\u95F4
|
||||
|
||||
#button
|
||||
button.text.action=\u8bbf\u95ee
|
||||
button.text.visit=\u8bbf\u95ee
|
||||
button.text.save=\u4fdd\u5b58
|
||||
@@ -489,7 +481,8 @@ button.text.view=\u67e5\u770b
|
||||
button.text.hidden=\u9690\u85cf
|
||||
button.text.import=\u5bfc\u5165
|
||||
button.text.adjunct=\u517c\u4efb\u673a\u6784
|
||||
|
||||
button.text.sync=\u540C\u6B65
|
||||
#loginhistory
|
||||
log.loginhistory.id=\u7f16\u53f7
|
||||
log.loginhistory.sessionId=\u4f1a\u8bdd
|
||||
log.loginhistory.username=\u767b\u5f55\u540d
|
||||
@@ -506,7 +499,7 @@ log.loginhistory.application=\u5e94\u7528
|
||||
log.loginhistory.loginUrl=\u767b\u5f55\u5730\u5740
|
||||
log.loginhistory.code=\u4ee3\u7801
|
||||
log.loginhistory.rpUserInfo=\u7b2c\u4e09\u65b9
|
||||
|
||||
#loginappshistory
|
||||
log.loginappshistory.id=\u7f16\u53f7
|
||||
log.loginappshistory.sessionId=\u4f1a\u8bdd
|
||||
log.loginappshistory.uid=\u7528\u6237\u7f16\u53f7
|
||||
@@ -515,14 +508,14 @@ log.loginappshistory.displayName=\u7528\u6237\u540d
|
||||
log.loginappshistory.appId=\u5e94\u7528\u7f16\u53f7
|
||||
log.loginappshistory.appName=\u5e94\u7528\u540d\u79f0
|
||||
log.loginappshistory.loginTime=\u767b\u5f55\u65f6\u95f4
|
||||
|
||||
#operate
|
||||
log.operate.servicename=\u670d\u52a1
|
||||
log.operate.message=\u6d88\u606f
|
||||
log.operate.content=\u5185\u5bb9
|
||||
log.operate.messageType=\u6d88\u606f\u7c7b\u578b
|
||||
log.operate.operateType=\u64cd\u4f5c\u7c7b\u578b
|
||||
log.operate.username=\u64cd\u4f5c\u4eba
|
||||
|
||||
#message
|
||||
message.action.insert.success=\u65b0\u589e\u64cd\u4f5c\u6210\u529f
|
||||
message.action.insert.error=\u65b0\u589e\u64cd\u4f5c\u5931\u8d25
|
||||
message.action.update.success=\u66f4\u65b0\u64cd\u4f5c\u6210\u529f
|
||||
@@ -531,17 +524,16 @@ message.action.delete.success=\u5220\u9664\u64cd\u4f5c\u6210\u529f
|
||||
message.action.delete.error=\u5220\u9664\u64cd\u4f5c\u5931\u8d25
|
||||
message.action.import.success=\u6279\u91cf\u5bfc\u5165\u6210\u529f
|
||||
message.action.import.error=\u6279\u91cf\u5bfc\u5165\u5931\u8d25
|
||||
|
||||
#import
|
||||
import.title=\u6279\u91cf\u5bfc\u5165\u6570\u636e
|
||||
import.file.select=\u9009\u62e9\u5bfc\u5165\u6587\u4ef6
|
||||
import.template.download=\u4e0b\u8f7d\u6a21\u677f
|
||||
import.update.exist=\u66f4\u65b0\u5b58\u5728\u6570\u636e
|
||||
import.tip=\u63d0\u793a\uff1a\u4ec5\u5141\u8bb8\u5bfc\u5165\u201cxls\u201d\u6216\u8005\u201cxlsx\u201d\u683c\u5f0f\u7684\u6587\u4ef6
|
||||
|
||||
#Notices
|
||||
notices.title=\u6807\u9898
|
||||
notices.content=\u5185\u5BB9
|
||||
|
||||
#navs
|
||||
navs.system=\u7cfb\u7edf
|
||||
navs.home=\u9996\u9875
|
||||
navs.orgs=\u673a\u6784\u7ba1\u7406
|
||||
|
||||
@@ -491,6 +491,7 @@ button.text.view=View
|
||||
button.text.hidden=Hidden
|
||||
button.text.import=Import
|
||||
button.text.adjunct=Adjoint Depts
|
||||
button.text.sync=Sync
|
||||
|
||||
log.loginhistory.id=id
|
||||
log.loginhistory.sessionId=sessionId
|
||||
|
||||
@@ -489,6 +489,7 @@ button.text.view=\u67e5\u770b
|
||||
button.text.hidden=\u9690\u85cf
|
||||
button.text.import=\u5bfc\u5165
|
||||
button.text.adjunct=\u517c\u4efb\u673a\u6784
|
||||
button.text.sync=\u540C\u6B65
|
||||
|
||||
log.loginhistory.id=\u7f16\u53f7
|
||||
log.loginhistory.sessionId=\u4f1a\u8bdd
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
/* jQuery json2form Plugin
|
||||
* version: 1.0 (2011-03-01)
|
||||
*
|
||||
* Copyright (c) 2011, Crystal, shimingxy@163.com
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
* Date: 2011-03-01 rev 1
|
||||
*/
|
||||
;(function ($) {
|
||||
$.json2form = $.json2form||{};
|
||||
$.fn.json2form = function(config ) {
|
||||
var config=$.extend({
|
||||
url :null,
|
||||
elem :this.attr("id"),
|
||||
type :'POST'
|
||||
}, config || {});
|
||||
|
||||
if(config.url){
|
||||
$.ajax({type: config.type,url: config.url,data:$.extend({json2form:config.elem},config.data||{}),dataType: "json",async: false,
|
||||
success: function(data){
|
||||
config.data=data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(!$("#"+config.elem).attr("loadedInit")){//init checkbox radio and select element ,label
|
||||
if(config.data.init){
|
||||
for (var elem in config.data.init){
|
||||
var arrayData=config.data.init[elem];
|
||||
if($("#"+config.elem+" input[name='"+elem+"']")){
|
||||
var elemType=$("#"+config.elem+" input[name='"+elem+"']").attr("type");
|
||||
var elemName=$("#"+config.elem+" input[name='"+elem+"']").attr("name");
|
||||
var initElem=$("#"+config.elem+" input[name='"+elem+"']");
|
||||
switch(elemType){
|
||||
case "checkbox":
|
||||
case "radio":
|
||||
for (var initelem in arrayData){
|
||||
initElem.after('<input type="'+elemType+'" name="'+elemName+'" value="'+arrayData[initelem].value+'" />'+arrayData[initelem].display);
|
||||
}
|
||||
initElem.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($("#"+config.elem+" select[name='"+elem+"']")){
|
||||
for (var initelem in arrayData){
|
||||
$("#"+config.elem+" select[name='"+elem+"']").append("<option value='"+arrayData[initelem].value+"'>"+arrayData[initelem].display+"</option>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(config.data.label){//label
|
||||
$("#"+config.elem+" label").each(function(){
|
||||
var labelFor=$(this).attr("for");
|
||||
if(config.data.label[labelFor]){
|
||||
$(this).html(config.data.label[labelFor]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if(config.data){//input text password hidden button reset submit checkbox radio select textarea
|
||||
$("#"+config.elem+" input,select,textarea").each(function(){
|
||||
var elemType=$(this).attr("type")==undefined?this.type:$(this).attr("type");
|
||||
var elemName=$(this).attr("name");
|
||||
var elemData=config.data[elemName];
|
||||
if(!$("#"+config.elem).attr("loadedInit")&&$(this).attr("loadurl")){
|
||||
switch(elemType){
|
||||
case "checkbox":
|
||||
case "radio":
|
||||
case "select":
|
||||
case "select-one":
|
||||
case "select-multiple":{
|
||||
var _this =this;
|
||||
$.ajax({type: config.type,url: $(this).attr("loadurl"),dataType: "json",async: false,success: function(data){
|
||||
if(elemType=="select"||elemType=="select-one"||elemType=="select-multiple"){
|
||||
$(_this).empty();
|
||||
}
|
||||
for (var elem in data){
|
||||
if(elemType=="select"||elemType=="select-one"||elemType=="select-multiple"){
|
||||
$(_this).append("<option value='"+data[elem].value+"'>"+data[elem].display+"</option>");
|
||||
}else{
|
||||
$(_this).after('<input type="'+elemType+'" name="'+elemName+'" value="'+data[elem].value+'" />'+data[elem].display);
|
||||
}
|
||||
}
|
||||
if(elemType=="checkbox"||elemType=="radio")$(_this).remove();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(elemData){
|
||||
switch(elemType){
|
||||
case undefined:
|
||||
case "text":
|
||||
case "password":
|
||||
case "hidden":
|
||||
case "button":
|
||||
case "reset":
|
||||
case "textarea":
|
||||
case "submit":{
|
||||
if(typeof(elemData)=="string"){
|
||||
$(this).val(elemData.toUpperCase()=="NULL"?"":elemData);
|
||||
}else{
|
||||
$(this).val(elemData+"");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "checkbox":
|
||||
case "radio":{
|
||||
$(this).attr("checked",false);
|
||||
if(elemData.constructor==Array){//checkbox multiple value is Array
|
||||
for (var elem in elemData){
|
||||
if(elemData[elem]==$(this).val()){
|
||||
$(this).attr("checked",true);
|
||||
}
|
||||
}
|
||||
}else{//radio or checkbox is a string single value
|
||||
if(elemData==$(this).val()){
|
||||
$(this).attr("checked",true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "select":
|
||||
case "select-one":
|
||||
case "select-multiple":{
|
||||
$(this).find("option:selected").attr("selected",false);
|
||||
if(elemData.constructor==Array){
|
||||
for (var elem in elemData){
|
||||
$(this).find("option[value='"+elemData[elem]+"']").attr("selected",true);
|
||||
}
|
||||
}else{
|
||||
$(this).find("option[value='"+elemData+"']").attr("selected",true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#"+config.elem).attr("loadedInit","true");//loadedInit is true,next invoke not need init checkbox radio and select element ,label
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -1,149 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Json2form Demo</title>
|
||||
<script src="jquery-1.4.4.min.js" type="text/javascript"></script>
|
||||
<script src="json2form.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
var objdata ={
|
||||
txt:'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
pwd:'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
||||
hd:'<27><><EFBFBD><EFBFBD>',
|
||||
are:'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>json2form',
|
||||
btn:'<27><>ť',
|
||||
rt:'<27><><EFBFBD>ð<EFBFBD>ť',
|
||||
sb:'<27>ύ<EFBFBD><E1BDBB>ť',
|
||||
rad:'<27><>',
|
||||
chk:'chk1',
|
||||
chk:['<27><><EFBFBD><EFBFBD>','<27>й<EFBFBD>'],
|
||||
sl:['<27><><EFBFBD><EFBFBD>','<27>ձ<EFBFBD>'],
|
||||
label:{
|
||||
txt:'<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>ǩ',
|
||||
sl :'<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ǩ'
|
||||
},
|
||||
init:{
|
||||
chk444:[{"value":"comm","display":"һ<><D2BB><EFBFBD><EFBFBD>Դ"},{"value":"system","display":"ϵͳ"},{"value":"page","display":"ҳ<><D2B3>"},{"value":"url","display":"<22><><EFBFBD><EFBFBD>"},{"value":"model","display":"ģ<><C4A3>"},{"value":"data","display":"<22><><EFBFBD><EFBFBD>"}],
|
||||
chk555:[{"value":"comm","display":"һ<><D2BB><EFBFBD><EFBFBD>Դ"},{"value":"system","display":"ϵͳ"},{"value":"page","display":"ҳ<><D2B3>"},{"value":"url","display":"<22><><EFBFBD><EFBFBD>"},{"value":"model","display":"ģ<><C4A3>"},{"value":"data","display":"<22><><EFBFBD><EFBFBD>"}],
|
||||
slinit:[{"value":"comm","display":"һ<><D2BB><EFBFBD><EFBFBD>Դ"},{"value":"system","display":"ϵͳ"},{"value":"page","display":"ҳ<><D2B3>"},{"value":"url","display":"<22><><EFBFBD><EFBFBD>"},{"value":"model","display":"ģ<><C4A3>"},{"value":"data","display":"<22><><EFBFBD><EFBFBD>"}]
|
||||
}
|
||||
};
|
||||
|
||||
$("#json2form").json2form({data:objdata});
|
||||
$("#json2form").json2form({data:objdata});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
table, td {
|
||||
border:1px solid #cccccc;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div align="center">
|
||||
<form id="json2form" name="json2form">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="#FFFFFF"><div align="center"><strong>Aduby json2formDemo</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1. text(<28>ı<EFBFBD><C4B1><EFBFBD>)</td>
|
||||
<td>
|
||||
<label for="txt">1 text(<28>ı<EFBFBD><C4B1><EFBFBD>)</label>
|
||||
<input type="text" id="txt" name="txt" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2. password(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)</td>
|
||||
<td>
|
||||
<input type="password" id="pwd" name="pwd" value="ֵ" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3. hidden(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)</td>
|
||||
<td>
|
||||
<input type="hidden" id="hd" name="hd" value="ֵ"/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4. checkbox(<28><>ѡ<EFBFBD><D1A1>)</td>
|
||||
<td>
|
||||
<input type="checkbox" id="chk1" name="chk" value="<22>й<EFBFBD>" checked="checked" /><EFBFBD>й<EFBFBD><label for="chk1"></label>
|
||||
<input type="checkbox" id="chk2" name="chk" value="<22><><EFBFBD><EFBFBD>" /><EFBFBD><EFBFBD><EFBFBD><EFBFBD><label for="chk2"></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>5. checkbox(<28><>̬<EFBFBD><CCAC>ѡ<EFBFBD><D1A1>)</td>
|
||||
<td>
|
||||
<input type="checkbox" id="chk444" name="chk444" value="<22><>̬<EFBFBD><CCAC>ѡ<EFBFBD><D1A1>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6. radion(<28><>ѡ<EFBFBD><D1A1>ť)</td>
|
||||
<td>
|
||||
<input type="radio" id="rd1" name="rad" value="<22><>" checked="checked" /><EFBFBD><EFBFBD>
|
||||
<input type="radio" id="rd2" name="rad" value="Ů" />Ů
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>7. radion(<28><>̬<EFBFBD><CCAC>ѡ<EFBFBD><D1A1>ť)</td>
|
||||
<td>
|
||||
<input type="radio" id="chk555" name="chk555" value="<22><>̬<EFBFBD><CCAC>ѡ<EFBFBD><D1A1>ť" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8. file(<28>ļ<EFBFBD>)</td>
|
||||
<td>
|
||||
<input type="file" id="fl" name="file" value="<22>Ǻ<EFBFBD>" size="20" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>9. textare(<28>ı<EFBFBD><C4B1><EFBFBD>)</td>
|
||||
<td>
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><br>
|
||||
<textarea id="are" name="are" cols="10" rows="10" ></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>10. select(<28><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>)</td>
|
||||
<td>
|
||||
<09>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><br>
|
||||
<label for="sl"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD></label><br>
|
||||
<select id="sl" name="sl" multiple="multiple" >
|
||||
<option id="op1" value="<22><><EFBFBD><EFBFBD>" selected="selected"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></option>
|
||||
<option id="op2" value="<22>й<EFBFBD>"><EFBFBD>й<EFBFBD></option>
|
||||
<option id="op3" value="<22>ձ<EFBFBD>"><EFBFBD>ձ<EFBFBD></option>
|
||||
<option id="op4" value="<22><><EFBFBD><EFBFBD>"><EFBFBD><EFBFBD><EFBFBD><EFBFBD></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>11. select(<28><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>)</td>
|
||||
<td>
|
||||
<select id="slinit" name="slinit" ><option value="null"><EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD></option> </select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>12. button(<28><>ͨ<EFBFBD><CDA8>ť)</td>
|
||||
<td>
|
||||
<input type="button" id="btn" name="btn" value="<22><>ͨ<EFBFBD><CDA8>ť">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>13. reset(<28><><EFBFBD>ð<EFBFBD>ť)</td>
|
||||
<td>
|
||||
<input type="reset" id="rt" name="rt" value="<22><><EFBFBD>ð<EFBFBD>ť" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>14. submit(<28>ύ<EFBFBD><E1BDBB>ť)</td>
|
||||
<td>
|
||||
<input type="submit" id="sb" name="sb" value="<22>ύ<EFBFBD><E1BDBB>ť" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,168 +0,0 @@
|
||||
/* jQuery json2form Plugin
|
||||
* version: 1.0 (2011-3-01)
|
||||
*
|
||||
* Copyright (c) 2011, Crystal, shimingxy@163.com
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
* Date: 2011-3-01 rev 1
|
||||
*/
|
||||
;(function ($) {
|
||||
$.json2form = $.json2form||{};
|
||||
$.fn.json2form = function(config ) {
|
||||
|
||||
var config=$.extend({
|
||||
url : null,//remote url for ajax data
|
||||
elem : this.attr("id"),//id
|
||||
type : "POST",//remote data method type ,GET or POST default is POST
|
||||
}, config || {});
|
||||
if(config.url){
|
||||
$.ajax({type: config.type,url: config.url,dataType: "json",async: false,
|
||||
success: function(data){
|
||||
config.data=data;
|
||||
}
|
||||
});
|
||||
}
|
||||
alert();
|
||||
if(config.init){
|
||||
//init
|
||||
for (var elem in config.init){
|
||||
if(typeof(elem) != 'function'){
|
||||
var arrayObject=config.init[elem];
|
||||
if($("#"+config.elem+" input[name='"+elem+"']")){
|
||||
var elemtype=$("#"+config.elem+" input[name='"+elem+"']").attr("type");
|
||||
var elemName=$("#"+config.elem+" input[name='"+elem+"']").attr("name");
|
||||
var initElem=$("#"+config.elem+" input[name='"+elem+"']");
|
||||
switch(elemtype){
|
||||
case "checkbox":
|
||||
for (var initelem in arrayObject){
|
||||
initElem.after('<input type="checkbox" name="'+elemName+'" value="'+arrayObject[initelem].value+'" />'+arrayObject[initelem].display);
|
||||
}
|
||||
initElem.remove();
|
||||
break;
|
||||
case "radio":
|
||||
for (var initelem in arrayObject){
|
||||
initElem.after('<input type="radio" name="'+elemName+'" value="'+arrayObject[initelem].value+'" />'+arrayObject[initelem].display);
|
||||
}
|
||||
initElem.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($("#"+config.elem+" select[name='"+elem+"']")){
|
||||
for (var initelem in arrayObject){
|
||||
$("#"+config.elem+" select[name='"+elem+"']").append("<option value='"+arrayObject[initelem].value+"'>"+arrayObject[initelem].display+"</option>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(config.data){
|
||||
//input text password hidden button reset submit checkbox radio
|
||||
$("#"+config.elem+" input").each(function(){
|
||||
|
||||
var elemtype=$(this).attr("type");
|
||||
|
||||
if($(this).attr("action")){
|
||||
var elemName=$(this).attr("name");
|
||||
switch(elemtype){
|
||||
case "checkbox":
|
||||
var checkbox =this;
|
||||
$.ajax({type: "POST",url: $(this).attr("action"),dataType: "json",async: false,success: function(data){
|
||||
for (var elem in data){
|
||||
$(checkbox).after('<input type="checkbox" name="'+elemName+'" value="'+data[elem].value+'" />'+data[elem].display);
|
||||
}
|
||||
$(checkbox).remove();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "radio":
|
||||
var radio =this;
|
||||
$.ajax({type: "POST",url: $(this).attr("action"),dataType: "json",async: false,success: function(data){
|
||||
for (var elem in data){
|
||||
$(radio).after('<input type="radio" name="'+elemName+'" value="'+data[elem].value+'" />'+data[elem].display);
|
||||
}
|
||||
$(radio).remove();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch(elemtype){
|
||||
case "text":
|
||||
case "password":
|
||||
case "hidden":
|
||||
case "button":
|
||||
case "reset":
|
||||
case "submit":{
|
||||
for (var elem in config.data){
|
||||
if(typeof(elem) != 'function'){
|
||||
if(($(this).attr("name"))==elem){
|
||||
$(this).val(config.data[elem]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "checkbox":
|
||||
case "radio":{
|
||||
for (var elem in config.data){
|
||||
if(typeof(elem) != 'function'){
|
||||
if(($(this).attr("name"))==elem&&($(this).val())==$(this).val()){
|
||||
$(this).attr("checked",true);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
//select
|
||||
$("#"+config.elem+" select").each(function(){
|
||||
var select =this;
|
||||
if($(this).attr("action")){
|
||||
$.ajax({type: "POST",url: $(this).attr("action"),dataType: "json",async: false,success: function(data){
|
||||
for (var elem in data){
|
||||
$(select).append("<option value='"+data[elem].value+"'>"+data[elem].display+"</option>");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (var elem in config.data){
|
||||
if(typeof(elem) != 'function'){
|
||||
if(($(this).attr("name"))==elem){
|
||||
$(this).val(config.data[elem]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//textarea
|
||||
$("#"+config.elem+" textarea").each(function(){
|
||||
for (var elem in config.data){
|
||||
if(typeof(elem) != 'function'){
|
||||
if(($(this).attr("name"))==elem){
|
||||
$(this).val(config.data[elem]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(config.label){
|
||||
//label
|
||||
$("#"+config.elem+" label").each(function(){
|
||||
for (var elem in config.label){
|
||||
if(typeof(elem) != 'function'){
|
||||
if(($(this).attr("for"))==elem){
|
||||
$(this).html(config.label[elem]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -224,6 +224,29 @@ $(function(){
|
||||
$(".d-footer").show();
|
||||
};
|
||||
|
||||
//get Selections Rows Data
|
||||
$.dataGridSelRowsData=function(dataGridElement){
|
||||
return $(dataGridElement).bootstrapTable('getSelections');
|
||||
};
|
||||
|
||||
//get Selections Rows Data
|
||||
$.gridSelectedData=function(dataGridElement){
|
||||
return $(dataGridElement).bootstrapTable('getSelections');
|
||||
};
|
||||
|
||||
//get Selections Rows Ids
|
||||
$.gridSelectedIds=function(dataGridElement){
|
||||
var selectIds="";
|
||||
if($(dataGridElement).length>0){//get grid list selected ids
|
||||
var selRows = $(dataGridElement).bootstrapTable('getSelections');
|
||||
for (var i=0;i<selRows.length; i++){
|
||||
selectIds=selectIds+","+selRows[i].id;
|
||||
}
|
||||
selectIds=selectIds.substring(1);
|
||||
}
|
||||
return selectIds;
|
||||
};
|
||||
|
||||
// Fetch all the forms we want to apply custom Bootstrap validation styles to
|
||||
// For actionForm use ajax submit
|
||||
var forms = $(".needs-validation");
|
||||
@@ -305,28 +328,61 @@ $(function(){
|
||||
|
||||
//window open by element is window style
|
||||
$(".window").on("click",function(){
|
||||
//before open action
|
||||
if (typeof(beforeWindow) == "function"){
|
||||
beforeWindow();///before open action
|
||||
beforeWindow();
|
||||
}
|
||||
|
||||
var url=$(this).attr("wurl");
|
||||
|
||||
|
||||
if($(this).attr("ref")){
|
||||
if($("#"+$(this).attr("ref")).val()==""){
|
||||
var refObject = $(this).attr("ref");
|
||||
var refData = "";
|
||||
if(refObject){
|
||||
if(refObject=="datagrid" && $.gridSelectedData("#datagrid").length>0){
|
||||
refData= $.gridSelectedData("#datagrid")[0].id;
|
||||
}else if($("#"+refObject).val()!=""){
|
||||
refData = $("#"+refObject).val();
|
||||
}
|
||||
if( refData == null || refData == ""){
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
url = url + "/"+ refData;
|
||||
}
|
||||
$.window({
|
||||
url : url,//window url
|
||||
title : $(this).attr("wtitle"),//title
|
||||
width : $(this).attr("wwidth"),//width
|
||||
height : $(this).attr("wheight")//height
|
||||
});//open window
|
||||
});
|
||||
|
||||
//click Btn Submit data to server
|
||||
$(".sendBtn").on("click",function(){
|
||||
var url=$(this).attr("wurl");
|
||||
var refObject = $(this).attr("ref");
|
||||
|
||||
if(refObject){
|
||||
if(refObject=="datagrid"){
|
||||
var selectIds= $.gridSelectedIds("#datagrid");
|
||||
if(selectIds == null || selectIds == "") {
|
||||
return;
|
||||
}
|
||||
url = url+"?id="+selectIds;
|
||||
}else if($("#"+refObject).val()!=""){
|
||||
url=url+"/"+$("#"+refObject).val();
|
||||
}else{
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
url=url+"/"+$("#"+$(this).attr("ref")).val();
|
||||
}
|
||||
|
||||
var settings={
|
||||
url : url,//window url
|
||||
title : $(this).attr("wtitle"),//title
|
||||
width : $(this).attr("wwidth"),//width
|
||||
height : $(this).attr("wheight")//height
|
||||
};
|
||||
$.window(settings);//open window
|
||||
$.post(url, {currTime:(new Date()).getTime()}, function(data) {
|
||||
//alert result
|
||||
$.alert({content:data.message,type:$.platform.messages.messageType[data.messageType]});
|
||||
//refresh grid list
|
||||
if($("#datagrid")[0]){
|
||||
$("#datagrid").bootstrapTable("refresh");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//forward to url, by forward style
|
||||
@@ -420,23 +476,12 @@ $(function(){
|
||||
if (typeof(beforeUpdate) == "function"){
|
||||
beforeUpdate(this);
|
||||
}
|
||||
|
||||
var selectId="";
|
||||
if($("#datagrid").length>0){//get grid list selected ids
|
||||
var selRows = $('#datagrid').bootstrapTable('getSelections');
|
||||
for (var i=0;i<selRows.length; i++){
|
||||
selectId=selectId+","+selRows[i].id;
|
||||
break;
|
||||
}
|
||||
selectId=selectId.substring(1);
|
||||
}
|
||||
|
||||
var selectId= $.gridSelectedIds("#datagrid");
|
||||
if(selectId == null || selectId == "") {
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($(this).attr("target")&&$(this).attr("target")=="forward"){
|
||||
$.forward($(this).attr("wurl")+"/"+selectId);
|
||||
}if($(this).attr("target")&&$(this).attr("target")=="_blank"){
|
||||
@@ -454,59 +499,12 @@ $(function(){
|
||||
|
||||
});
|
||||
|
||||
//view button
|
||||
$("#viewBtn").click(function(){
|
||||
if (typeof(viewAction) == "function"){
|
||||
document.location.href=viewAction(this);//自定义跳转
|
||||
}else {
|
||||
if (typeof(beforeView) == "function"){
|
||||
beforeView(this);//自定义跳转
|
||||
}
|
||||
var selectId="";
|
||||
if($("#list2").length>0){//get grid list selected ids
|
||||
selectId=$("#list2").jqGrid("getGridParam", "selrow");
|
||||
if(selectId == null || selectId == ""){
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
var rowData = $("#list2").jqGrid("getRowData", selectId);
|
||||
selectId=rowData.id;
|
||||
}else if($("#list").length>0){//get grid list selected ids
|
||||
selectId=$("#list").jqGrid("getGridParam", "selrow");
|
||||
if(selectId == null || selectId == ""){
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
var rowData = $("#list").jqGrid("getRowData", selectId);
|
||||
selectId=rowData.id;
|
||||
}
|
||||
if($(this).attr("target")&&$(this).attr("target")=="forward"){
|
||||
$.forward($(this).attr("wurl")+"/"+selectId);
|
||||
}else{
|
||||
var settings={
|
||||
url : $(this).attr("wurl")+"/"+selectId,//window url
|
||||
title : $(this).attr("wtitle"),//title
|
||||
width : $(this).attr("wwidth"),//width
|
||||
height : $(this).attr("wheight")//height
|
||||
};
|
||||
$.window(settings);//open window
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//delete and batch delete button
|
||||
$("#deleteBtn").click(function(){
|
||||
if (typeof(beforeDelete) == "function"){
|
||||
beforeDelete(this);//before function
|
||||
}
|
||||
var selectIds="";
|
||||
if($("#datagrid").length>0){//get grid list selected ids
|
||||
var selRows = $('#datagrid').bootstrapTable('getSelections');
|
||||
for (var i=0;i<selRows.length; i++){
|
||||
selectIds=selectIds+","+selRows[i].id;
|
||||
}
|
||||
selectIds=selectIds.substring(1);
|
||||
}
|
||||
var selectIds=$.gridSelectedIds("#datagrid");
|
||||
if(selectIds == null || selectIds == "") {
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
@@ -563,18 +561,6 @@ $(function(){
|
||||
|
||||
});
|
||||
|
||||
//form json url init all ways not used
|
||||
if($("#actionForm")){//actionForm exist
|
||||
if($("#actionForm").attr("loadaction")){//init form
|
||||
$("#actionForm").json2form({url : $("#actionForm").attr("loadaction")});//init #actionForm with loadaction url
|
||||
$("#actionForm").removeAttr('loadaction'); //is need init
|
||||
}
|
||||
};
|
||||
|
||||
$.dataGridSelRowsData=function(dataGridElement){
|
||||
return $(dataGridElement).bootstrapTable('getSelections');
|
||||
};
|
||||
|
||||
var curExpandNode = null;
|
||||
$.tree=function (treeSettings){
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
<script src ="<@base />/static/jquery/jquery.cookie.js" type="text/javascript" ></script>
|
||||
<#-- form -->
|
||||
<script src ="<@base />/static/jquery/jquery.form.js" type="text/javascript" ></script>
|
||||
<script src ="<@base />/static/jquery/json2form/json2form.js" type="text/javascript" ></script>
|
||||
<#-- blockUI -->
|
||||
<script src ="<@base />/static/jquery/jquery.blockUI.js" type="text/javascript" ></script>
|
||||
<#-- serializeObject -->
|
||||
|
||||
@@ -55,6 +55,9 @@
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div id="tool_box_right">
|
||||
<input class="button btn btn-success mr-3 sendBtn" id="syncBtn" type="button" value="<@locale code="button.text.sync"/>"
|
||||
wurl="<@base/>/synchronizers/sync" ref="datagrid"
|
||||
/>
|
||||
<input class="button btn btn-info mr-3 " id="modifyBtn" type="button" value="<@locale code="button.text.edit"/>"
|
||||
wurl="<@base/>/synchronizers/forwardUpdate"
|
||||
wwidth="550"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
return '<@locale code="userinfo.gender.male" />';
|
||||
}
|
||||
};
|
||||
|
||||
function statusFormatter(value, row, index){
|
||||
if(value==1){
|
||||
return '<@locale code="userinfo.status.active" />';
|
||||
@@ -24,8 +25,6 @@
|
||||
return '<@locale code="userinfo.status.inactive" />';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
function onClick (event, treeId, treeNode) {
|
||||
$("#departmentId").val(treeNode.data.id)
|
||||
@@ -34,15 +33,6 @@ function onClick (event, treeId, treeNode) {
|
||||
$("#searchBtn").click();
|
||||
|
||||
}
|
||||
|
||||
//adjunctUserIdRef
|
||||
function beforeWindow( ){
|
||||
var selData = $('#datagrid').bootstrapTable('getSelections');
|
||||
if(selData && selData[0] != null){
|
||||
$("#adjunctUserIdRef").val(selData[0].id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
@@ -158,17 +148,7 @@ $(function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
);//end tree
|
||||
|
||||
$("#changepwdBtn").on("click",function(){
|
||||
if($.dataGridSelRowsData("#datagrid")[0]==null){
|
||||
$.alert({content:$.platform.messages.select.alertText});
|
||||
return;
|
||||
}
|
||||
$("#changepwdBtnHidden").attr("wurl","<@base/>/userinfo/forwardChangePassword/"+$.dataGridSelRowsData("#datagrid")[0].id);
|
||||
$("#changepwdBtnHidden").click();
|
||||
});
|
||||
|
||||
);//end tree
|
||||
|
||||
$("#moreBtn").on("click",function(){
|
||||
var node=$("#tool_box_right_more");
|
||||
@@ -250,13 +230,12 @@ $(function () {
|
||||
<input class="button btn btn-secondary" id="moreBtn" type="button" size="50" value="<@locale code="button.text.expandsearch"/>" expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>">
|
||||
</div>
|
||||
<div id="tool_box_right_more" style="display:none;">
|
||||
<input class="button btn btn-warning mr-3" id="changepwdBtn" type="button" value="<@locale code="login.password.changepassword"/>" />
|
||||
<input class="button btn btn-warning mr-3 window" id="changepwdBtnHidden" type="hidden"
|
||||
<input class="button btn btn-warning mr-3 window" id="changepwdBtn" type="button"
|
||||
value="<@locale code="login.password.changepassword"/>"
|
||||
wurl="<@base/>/userinfo/forwardChangePassword" wwidth="600px" wheight="250px" />
|
||||
wurl="<@base/>/userinfo/forwardChangePassword/" wwidth="600px" wheight="250px" ref="datagrid"/>
|
||||
|
||||
<input class="button btn btn-info mr-3 window" id="userAdjointBtn" type="button"
|
||||
value="<@locale code="button.text.adjunct"/>" ref="adjunctUserIdRef"
|
||||
value="<@locale code="button.text.adjunct"/>" ref="datagrid"
|
||||
wurl="<@base/>/useradjoint/list" wwidth="900px" wheight="600px" />
|
||||
<input id="adjunctUserIdRef" type="hidden" />
|
||||
<input class="button btn btn-success mr-3 window" id="usersImportBtn" type="button"
|
||||
|
||||
Reference in New Issue
Block a user