文件上传增加样例和摘要业务文件的的总文件大小、单个文件大小、文件类型校验
This commit is contained in:
@@ -10,6 +10,7 @@ import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.StringUtil;
|
||||
/**
|
||||
* 业务辅助表-业务字典信息表
|
||||
* @author zsl
|
||||
@@ -33,7 +34,6 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
private Date editTime; //edit_time 修改时间 date Y
|
||||
private Integer levelNo; //层级
|
||||
private List<ServiceDictInfo> childrenList = new ArrayList<ServiceDictInfo>();//子列表
|
||||
|
||||
private Date beginDate; // 开始日期
|
||||
private Date endDate; // 结束日期
|
||||
|
||||
@@ -42,14 +42,20 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
|
||||
private String showSequence; //显示序号
|
||||
|
||||
|
||||
private String pNames;//父节点名称
|
||||
/**
|
||||
* 封装参数数据类型,
|
||||
*
|
||||
*/
|
||||
private List<Integer> conditionType;
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
public String getpNames() {
|
||||
return pNames;
|
||||
}
|
||||
public void setpNames(String pNames) {
|
||||
this.pNames = pNames;
|
||||
}
|
||||
public Integer getServiceDictId() {
|
||||
return serviceDictId;
|
||||
}
|
||||
@@ -250,5 +256,23 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
|
||||
|
||||
}
|
||||
//获取所有父节点
|
||||
@JsonIgnore
|
||||
public static String getPNames(List<ServiceDictInfo> list,Integer pid,String pNames) {
|
||||
String pName="";
|
||||
for (ServiceDictInfo serviceDictInfo : list) {
|
||||
if(pid==serviceDictInfo.getServiceDictId()){
|
||||
pid=serviceDictInfo.getParent().getServiceDictId();
|
||||
pName=serviceDictInfo.getItemValue();
|
||||
pNames="/"+pName+pNames;
|
||||
}
|
||||
}
|
||||
if(pid==0){
|
||||
if(!StringUtil.isEmpty(pNames)) pNames=pNames.substring(1);
|
||||
return pNames;
|
||||
}else{
|
||||
return getPNames(list, pid, pNames);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
59
src/main/java/com/nis/exceptions/MultiPartNewException.java
Normal file
59
src/main/java/com/nis/exceptions/MultiPartNewException.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.nis.exceptions;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.web.multipart.MultipartException;
|
||||
|
||||
public class MultiPartNewException extends MultipartException {
|
||||
|
||||
private static final long serialVersionUID = 8922896505285617384L;
|
||||
|
||||
public MultiPartNewException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
public MultiPartNewException(Properties prop,Throwable ex) {
|
||||
super(prop.get("file_upload_error").toString(),ex);
|
||||
}
|
||||
public MultiPartNewException(String msg,Throwable ex) {
|
||||
|
||||
super(msg,ex);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message The detail message.
|
||||
* @param actual The actual request size.
|
||||
* @param permitted The maximum permitted request size.
|
||||
*/
|
||||
public MultiPartNewException(String msg,long actual,long permitted,Properties prop,Throwable ex) {
|
||||
|
||||
super(format(prop.get("total_file_upload_size_error").toString(),
|
||||
Long.valueOf(actual),Long.valueOf(permitted)),ex);
|
||||
}
|
||||
|
||||
/**single file
|
||||
* @param fileName
|
||||
* @param message The detail message.
|
||||
* @param actual The actual request size.
|
||||
* @param permitted The maximum permitted request size.
|
||||
*/
|
||||
public MultiPartNewException(String msg,String fileName,long actual,long permitted,Properties prop,Throwable ex) {
|
||||
|
||||
super(format(prop.get("single_file_upload_size_error").toString(),
|
||||
fileName,Long.valueOf(actual), Long.valueOf(permitted)),ex);
|
||||
}
|
||||
|
||||
/**single file
|
||||
* @param fileName
|
||||
* @param message The detail message.
|
||||
* @param permitted fileType.
|
||||
*/
|
||||
public MultiPartNewException(String msg,String fileName,String fileType,Properties prop,Throwable ex) {
|
||||
|
||||
super(format(prop.get("file_upload_type_error").toString(),
|
||||
fileName, fileType),ex);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
161
src/main/java/com/nis/interceptor/MultipartFileIntercepter.java
Normal file
161
src/main/java/com/nis/interceptor/MultipartFileIntercepter.java
Normal file
@@ -0,0 +1,161 @@
|
||||
package com.nis.interceptor;
|
||||
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.fileupload.FileUpload;
|
||||
import org.apache.commons.fileupload.FileUploadBase;
|
||||
import org.apache.commons.fileupload.FileUploadException;
|
||||
import org.apache.commons.fileupload.UploadContext;
|
||||
import org.apache.commons.fileupload.FileUploadBase.FileSizeLimitExceededException;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.apache.commons.fileupload.servlet.ServletRequestContext;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.multipart.MultipartException;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsFileUploadSupport;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
|
||||
import com.nis.exceptions.MultiPartNewException;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.FileUtils;
|
||||
|
||||
|
||||
public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
Logger logger = Logger.getLogger(MultipartFileIntercepter.class);
|
||||
|
||||
|
||||
protected CommonsFileUploadSupport.MultipartParsingResult parseRequest(HttpServletRequest request)throws MultipartException{
|
||||
String encoding = determineEncoding(request);
|
||||
//是否是样例文件
|
||||
boolean isSampleFileUpload = request.getRequestURI().contains(Constants.SAMPLE_UPLOAD_URL_KEYWORD);
|
||||
FileUpload fileUpload = this.prepareFileUpload(encoding,isSampleFileUpload);
|
||||
long fileUploadTotalSize=0l;
|
||||
Properties languageProp=getMsgProp();
|
||||
try {
|
||||
/*****************预先获取上传文件的总的大小************/
|
||||
FileUpload fileUploadTotal = fileUpload;
|
||||
|
||||
ServletRequestContext ctx = new ServletRequestContext(request);
|
||||
InputStream input=ctx.getInputStream();
|
||||
@SuppressWarnings("deprecation") // still has to be backward compatible
|
||||
int contentLengthInt = ctx.getContentLength();
|
||||
|
||||
fileUploadTotalSize = UploadContext.class.isAssignableFrom(input.getClass())
|
||||
// Inline conditional is OK here CHECKSTYLE:OFF
|
||||
? ((UploadContext) ctx).contentLength()
|
||||
: contentLengthInt;
|
||||
// CHECKSTYLE:ON
|
||||
logger.error("上传文件总大小为"+fileUploadTotalSize);
|
||||
/*****************预先获取上传文件的总的大小************/
|
||||
//验证文件总大小
|
||||
if(fileUploadTotalSize > fileUpload.getSizeMax()){
|
||||
throw new MultiPartNewException("", fileUploadTotalSize, fileUpload.getSizeMax(),languageProp, null);
|
||||
}
|
||||
//设置文件上传SizeMax为总文件的大小,否则无法通过SizeLimit(总的文件大小)校验,就无法进行下面单个文件大小的校验
|
||||
fileUploadTotal.setSizeMax(fileUploadTotalSize);
|
||||
|
||||
List fileItems = ((ServletFileUpload) fileUploadTotal).parseRequest(request);
|
||||
MultipartParsingResult multipartParsingResult=parseFileItems(fileItems, encoding);
|
||||
MultiValueMap<String, MultipartFile> files=multipartParsingResult.getMultipartFiles();
|
||||
//单个文件验证文件格式和文件大小
|
||||
validFileList(files,fileUpload,languageProp,isSampleFileUpload);
|
||||
|
||||
return multipartParsingResult;
|
||||
|
||||
} catch (FileUploadBase.SizeLimitExceededException ex) {
|
||||
throw new MultiPartNewException("",fileUploadTotalSize,fileUpload.getSizeMax(),languageProp,ex);
|
||||
} catch (FileUploadException ex) {
|
||||
throw new MultiPartNewException(languageProp, ex);
|
||||
}catch (IOException ex) {
|
||||
throw new MultiPartNewException(languageProp, ex);
|
||||
}catch (MultiPartNewException ex) {
|
||||
throw ex;
|
||||
}catch (Exception ex) {
|
||||
throw new MultiPartNewException(languageProp, ex);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 校验文件大小、类型
|
||||
* @return
|
||||
* @throws FileSizeLimitExceededException
|
||||
*/
|
||||
protected void validFileList(MultiValueMap<String, MultipartFile> multipartFile,FileUpload fileUpload,Properties prop,boolean isSampleFileUpload) throws FileSizeLimitExceededException{
|
||||
String errorInfo="";
|
||||
|
||||
String fileType="";
|
||||
long fileMaxSize=0l;
|
||||
if(isSampleFileUpload){
|
||||
fileType=Constants.SAMPLE_FILE_TYPE;
|
||||
fileMaxSize=Constants.SAMPLE_SINGLE_FILE_MAX_SIZE;
|
||||
}else{
|
||||
fileType=Constants.DIGEST_FILE_TYPE;
|
||||
fileMaxSize=Constants.DIGEST_SINGLE_FILE_MAX_SIZE;
|
||||
}
|
||||
for (String fileName : multipartFile.keySet()) {
|
||||
MultipartFile file= multipartFile.getFirst(fileName);
|
||||
//文件类型错误
|
||||
if(fileType.indexOf(","+FileUtils.getSuffix(file.getOriginalFilename(), false)+",") == -1){
|
||||
throw new MultiPartNewException(errorInfo,file.getOriginalFilename(),fileType.substring(0,fileType.length()-1).substring(1),prop,null);
|
||||
}
|
||||
if(file.getSize() > fileMaxSize){
|
||||
throw new MultiPartNewException(errorInfo, file.getOriginalFilename(), file.getSize(), fileMaxSize,prop, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 构造FileUpload
|
||||
* @param encoding
|
||||
* @param isSampleFileUpload
|
||||
* @return
|
||||
*/
|
||||
protected FileUpload prepareFileUpload(String encoding,boolean isSampleFileUpload) {
|
||||
FileUpload fileUpload = getFileUpload();
|
||||
FileUpload actualFileUpload = fileUpload;
|
||||
if (encoding != null && !encoding.equals(fileUpload.getHeaderEncoding())) {
|
||||
actualFileUpload = newFileUpload(getFileItemFactory());
|
||||
actualFileUpload.setHeaderEncoding(encoding);
|
||||
if(isSampleFileUpload){
|
||||
actualFileUpload.setSizeMax(Constants.SAMPLE_TOTAL_FILE_MAX_SIZE);
|
||||
}else{
|
||||
actualFileUpload.setSizeMax(Constants.DIGEST_TOTAL_FILE_MAX_SIZE);
|
||||
}
|
||||
}
|
||||
return actualFileUpload;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取国际化配置文件
|
||||
* @return
|
||||
*/
|
||||
public Properties getMsgProp(){
|
||||
Properties msgProp = new Properties();
|
||||
try {
|
||||
String language = LocaleContextHolder.getLocale().getLanguage();
|
||||
if(language.equals("zh_cn")||language.equals("zh")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_zh_CN.properties"));
|
||||
}else if(language.equals("ru")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_ru.properties"));
|
||||
}else{
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_en.properties"));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
msgProp = null;
|
||||
logger.error("未知i18n消息配置文件,请确定文件是否存在!",e);
|
||||
}
|
||||
return msgProp;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -404,4 +404,16 @@ public final class Constants {
|
||||
public static final String HTTP_REDIRECT_RES_HEAD_REGION = Configurations.getStringProperty("http_redirect_res_hdr_region","PXY_CTRL_HTTP_RES_HDR");
|
||||
public static final String HTTP_REDIRECT_REQ_BODY_REGION = Configurations.getStringProperty("http_redirect_req_body_region","PXY_CTRL_HTTP_REQ_BODY");
|
||||
public static final String HTTP_REDIRECT_RES_BODY_REGION = Configurations.getStringProperty("http_redirect_res_body_region","PXY_CTRL_HTTP_RES_BODY");
|
||||
public static final String REDIRECT_RESPONSE_CODE_KEY = Configurations.getStringProperty("redirect_response_code_key","code");
|
||||
public static final String REDIRECT_URL_KEY = Configurations.getStringProperty("redirect_url_key","url");
|
||||
public static final String REDIRECT_CONTENT_KEY = Configurations.getStringProperty("redirect_content_key","content");
|
||||
public static final String REDIRECT_RESPONSE_CODE_STARTWITH = Configurations.getStringProperty("redirect_response_code_startwith","30");
|
||||
|
||||
public static final String SAMPLE_UPLOAD_URL_KEYWORD = Configurations.getStringProperty("sample_upload_url_keyword","av");
|
||||
public static final String SAMPLE_FILE_TYPE = Configurations.getStringProperty("sample_file_type","");
|
||||
public static final long SAMPLE_SINGLE_FILE_MAX_SIZE = Configurations.getLongProperty("sample_single_file_max_size",10485760l);//10M
|
||||
public static final long SAMPLE_TOTAL_FILE_MAX_SIZE = Configurations.getLongProperty("sample_total_file_max_size",52428800l);//50M
|
||||
public static final String DIGEST_FILE_TYPE = Configurations.getStringProperty("digest_file_type","");
|
||||
public static final long DIGEST_SINGLE_FILE_MAX_SIZE = Configurations.getLongProperty("digest_single_file_max_size",10485760l);//10M
|
||||
public static final long DIGEST_TOTAL_FILE_MAX_SIZE = Configurations.getLongProperty("digest_total_file_max_size",52428800l);//50M
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ExportExcel;
|
||||
import com.nis.web.service.ArchiveServcie;
|
||||
import com.nis.web.service.AreaService;
|
||||
@@ -69,6 +70,7 @@ import com.nis.web.service.configuration.ControlPolicyService;
|
||||
import com.nis.web.service.configuration.DdosCfgService;
|
||||
import com.nis.web.service.configuration.DnsIpCfgService;
|
||||
import com.nis.web.service.configuration.DnsResStrategyService;
|
||||
import com.nis.web.service.configuration.DomainService;
|
||||
import com.nis.web.service.configuration.FileTransferCfgService;
|
||||
import com.nis.web.service.configuration.HttpRedirectCfgService;
|
||||
import com.nis.web.service.configuration.IpCfgService;
|
||||
@@ -76,7 +78,6 @@ import com.nis.web.service.configuration.IpMultiplexPoolCfgService;
|
||||
import com.nis.web.service.configuration.MailCfgService;
|
||||
import com.nis.web.service.configuration.NumCfgService;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
import com.nis.web.service.configuration.DomainService;
|
||||
import com.nis.web.service.configuration.WebsiteCfgService;
|
||||
import com.nis.web.service.configuration.XmppCfgService;
|
||||
import com.nis.web.service.specific.SpecificServiceCfgService;
|
||||
@@ -276,20 +277,52 @@ public class BaseController {
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
|
||||
String pNames="";
|
||||
for (ServiceDictInfo serviceDictInfo : fls) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(fls, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
for (ServiceDictInfo serviceDictInfo : xzs) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(xzs, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
for (ServiceDictInfo serviceDictInfo : lables) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(lables, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("lables", lables);
|
||||
}
|
||||
protected void initPageCondition(Model model,BaseCfg cfg){
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
|
||||
String pNames="";
|
||||
for (ServiceDictInfo serviceDictInfo : fls) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(fls, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
for (ServiceDictInfo serviceDictInfo : xzs) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(xzs, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
for (ServiceDictInfo serviceDictInfo : lables) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(lables, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("lables", lables);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
@@ -300,10 +333,26 @@ public class BaseController {
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
|
||||
String pNames="";
|
||||
for (ServiceDictInfo serviceDictInfo : fls) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(fls, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
|
||||
for (ServiceDictInfo serviceDictInfo : xzs) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(xzs, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
|
||||
for (ServiceDictInfo serviceDictInfo : lables) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(lables, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("lables", lables);
|
||||
List<Integer> itTypeList=new ArrayList<Integer>();
|
||||
itTypeList.add(Constants.ITEM_TYPE_AREA);
|
||||
@@ -322,10 +371,26 @@ public class BaseController {
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
|
||||
String pNames="";
|
||||
for (ServiceDictInfo serviceDictInfo : fls) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(fls, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
|
||||
for (ServiceDictInfo serviceDictInfo : xzs) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(xzs, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
|
||||
for (ServiceDictInfo serviceDictInfo : lables) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(lables, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("lables", lables);
|
||||
List<Integer> itTypeList=new ArrayList<Integer>();
|
||||
itTypeList.add(Constants.ITEM_TYPE_AREA);
|
||||
@@ -384,10 +449,26 @@ public class BaseController {
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();//只查询有效的
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();//只查询有效分类字典
|
||||
String pNames="";
|
||||
for (ServiceDictInfo serviceDictInfo : fls) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(fls, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();//只查询有效性质字典
|
||||
for (ServiceDictInfo serviceDictInfo : xzs) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(xzs, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();//只查询有效标签字典
|
||||
for (ServiceDictInfo serviceDictInfo : lables) {
|
||||
pNames="";
|
||||
pNames=serviceDictInfo.getPNames(lables, serviceDictInfo.getParent().getServiceDictId(), pNames);
|
||||
serviceDictInfo.setpNames(pNames);
|
||||
}
|
||||
model.addAttribute("lables", lables);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
@@ -538,12 +619,22 @@ public class BaseController {
|
||||
params.put("searchCfgId", entry.getCfgId());
|
||||
}
|
||||
}
|
||||
public void checkIpCfg(List<IpCfgTemplate> list) throws ServiceException{
|
||||
public void checkIpCfg(int functionId ,List<IpCfgTemplate> list) throws ServiceException{
|
||||
Properties prop=this.getMsgProp();
|
||||
List<SysDataDictionaryItem> ipTypeList = DictUtils.getDictList("IP_TYPE");
|
||||
List<SysDataDictionaryItem> ipPatternList = DictUtils.getDictList("IP_PATTERN");
|
||||
List<SysDataDictionaryItem> portPatternList = DictUtils.getDictList("PORT_PATTERN");
|
||||
List<SysDataDictionaryItem> directionList = DictUtils.getDictList("DIRECTION");
|
||||
List<SysDataDictionaryItem> protocolList = DictUtils.getDictList("PROTOCOL");
|
||||
List<SysDataDictionaryItem> ipsecProrocolList = DictUtils.getDictList("IPSEC_PROTOCOL");
|
||||
List<SysDataDictionaryItem> tunnelProrocolList = DictUtils.getDictList("TUNNEL_PROTOCOL");
|
||||
List<SysDataDictionaryItem> specialFunctionIdList = DictUtils.getDictList("SPECIAL_FUNCTION_ID");
|
||||
String specialItem=null;
|
||||
for(SysDataDictionaryItem sfuncItem:specialFunctionIdList){
|
||||
if(functionId==Integer.parseInt(sfuncItem.getItemCode())){
|
||||
specialItem=sfuncItem.getItemValue();
|
||||
}
|
||||
}
|
||||
StringBuffer msg=new StringBuffer();
|
||||
int line=1;
|
||||
for(IpCfgTemplate value:list){
|
||||
@@ -658,7 +749,44 @@ public class BaseController {
|
||||
//protocol check start
|
||||
Integer protocol= value.getProtocol();
|
||||
if(protocol==null){
|
||||
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("direction"))+";");
|
||||
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("protocol"))+";");
|
||||
}else{
|
||||
if(specialItem!=null&&("ipsec".equals(specialItem)||"tunnel".equals(specialItem))){
|
||||
if("ipsec".equals(specialItem)){
|
||||
boolean has=false;
|
||||
for(SysDataDictionaryItem protocolItem:ipsecProrocolList){
|
||||
if(Integer.parseInt(protocolItem.getItemCode())==protocol.intValue()){
|
||||
has=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol"))+";");
|
||||
}
|
||||
}else if("tunnel".equals(specialItem)){
|
||||
for(SysDataDictionaryItem protocolItem:tunnelProrocolList){
|
||||
if("default".equals(protocolItem.getItemValue())){
|
||||
if(protocol.intValue()!=Integer.parseInt(protocolItem.getItemCode())){
|
||||
errInfo.append(String.format(prop.getProperty("must_be"), prop.getProperty("protocol"),Integer.parseInt(protocolItem.getItemCode()))+";");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
boolean has=false;
|
||||
for(SysDataDictionaryItem protocolItem:protocolList){
|
||||
if(Integer.parseInt(protocolItem.getItemCode())==protocol.intValue()){
|
||||
has=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!has){
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("protocol"))+";");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//protocol check end
|
||||
// requestId check start
|
||||
@@ -858,4 +986,5 @@ public class BaseController {
|
||||
}
|
||||
return msg.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -721,4 +721,18 @@ must_between=must between %s and %s
|
||||
not_number=%s is not a number
|
||||
id_not_exists=the id %s of %s is not valid
|
||||
num_split_by_comma=%s must be numbers split by comma
|
||||
must_be=%s must be %s
|
||||
#=============some validation===========
|
||||
#=============userregions===============
|
||||
userregion1=user region 1
|
||||
userregion2=user region 2
|
||||
userregion3=user region 3
|
||||
userregion4=user region 4
|
||||
userregion5=user region 5
|
||||
#=============userregions===============
|
||||
#=============multipart upload error info=================
|
||||
single_file_upload_size_error=The size of the file %s is %s,allowing the maximum value of a single file to be %s !
|
||||
total_file_upload_size_error=The total size of uploaded files is %s,allowing the total size of uploaded to be %s !
|
||||
file_upload_type_error=%s file type of error,allowing uploaded file type with %s!
|
||||
file_upload_error=File upload failure !
|
||||
#=============multipart upload error info=================
|
||||
@@ -705,4 +705,18 @@ must_between=must between %s and %s
|
||||
not_number=%s is not a number
|
||||
id_not_exists=the id %s of %s is not valid
|
||||
num_split_by_comma=%s must be numbers split by comma
|
||||
must_be=%s must be %s
|
||||
#=============some validation===========
|
||||
#=============userregions===============
|
||||
userregion1=user region 1
|
||||
userregion2=user region 2
|
||||
userregion3=user region 3
|
||||
userregion4=user region 4
|
||||
userregion5=user region 5
|
||||
#=============userregions===============
|
||||
#=============multipart upload error info=================
|
||||
single_file_upload_size_error=The size of the file %s is %s,allowing the maximum value of a single file to be %s !
|
||||
total_file_upload_size_error=The total size of uploaded files is %s,allowing the total size of uploaded to be %s !
|
||||
file_upload_type_error=%s file type of error,allowing uploaded file type with %s!
|
||||
file_upload_error=File upload failure !
|
||||
#=============multipart upload error info=================
|
||||
@@ -605,7 +605,7 @@ action=\u52A8\u4F5C
|
||||
has_prohibit_delete=\u53EA\u6709\u672A\u5BA1\u6838\u7684\u914D\u7F6E\u53EF\u5220\u9664
|
||||
has_prohibit_nopass=\u53EA\u6709\u672A\u5BA1\u6838\u7684\u914D\u7F6E\u53EF\u672A\u901A\u8FC7\u5BA1\u6838
|
||||
has_prohibit_pass=\u53EA\u6709\u672A\u5BA1\u6838\u7684\u914D\u7F6E\u53EF\u4EE5\u5BA1\u6838\u901A\u8FC7
|
||||
multiple_keywords_tip=\u53EF\u540C\u65F6\u8F93\u5165\u591A\u6761\u5173\u952E\u5B57\uFF0C\u8BF7\u4EE5\u82F1\u6587\u9017\u53F7\u6216\u8005\u56DE\u8F66\u952E\u9694\u5F00\u3002
|
||||
multiple_keywords_tip=\u53EF\u540C\u65F6\u8F93\u5165\u591A\u6761\u5173\u952E\u5B57\uFF0C\u8BF7\u4EE5\u56DE\u8F66\u952E\u9694\u5F00\u3002
|
||||
action_drop=\u4E22\u5F03
|
||||
action_reject=\u963B\u65AD
|
||||
action_redirect=\u91CD\u5B9A\u5411
|
||||
@@ -814,4 +814,26 @@ FTP_CONTENT=\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E
|
||||
id_not_exists=id\u4E3A%s\u7684%s\u4E0D\u5B58\u5728
|
||||
id_not_valid=id\u4E3A%s\u7684%s\u65E0\u6548
|
||||
num_split_by_comma=%s\u4E3A\u9017\u53F7\u5206\u9694\u7684\u6570\u5B57
|
||||
no_data=\u65E0\u76F8\u5173\u6570\u636E
|
||||
must_be=%s\u7684\u503C\u5FC5\u987B\u4E3A%s
|
||||
REDIRECT_RESPONSE_CODE=\u91CD\u5B9A\u5411\u5E94\u7B54\u7801
|
||||
permanet_redirect=\u6C38\u4E45\u91CD\u5B9A\u5411
|
||||
temporary_redirect=\u4E34\u65F6\u91CD\u5B9A\u5411
|
||||
prohibition_access=\u7981\u6B62\u8BBF\u95EE
|
||||
not_allowed_method=\u4E0D\u5141\u8BB8\u6B64\u65B9\u6CD5\u8BBF\u95EE
|
||||
law_prohibition_access=\u7531\u4E8E\u6CD5\u5F8B\u539F\u56E0\u4E0D\u53EF\u7528
|
||||
redirect_content=\u91CD\u5B9A\u5411\u5185\u5BB9
|
||||
#=============region_value,config form title=================
|
||||
#=============userregions===============
|
||||
userregion1=\u81EA\u5B9A\u4E49\u57DF1
|
||||
userregion2=\u81EA\u5B9A\u4E49\u57DF2
|
||||
userregion3=\u81EA\u5B9A\u4E49\u57DF3
|
||||
userregion4=\u81EA\u5B9A\u4E49\u57DF4
|
||||
userregion5=\u81EA\u5B9A\u4E49\u57DF5
|
||||
#=============userregions===============
|
||||
#=============multipart upload error info=================
|
||||
single_file_upload_size_error=\u6587\u4EF6%s\u7684\u5927\u5C0F\u4E3A%s\uFF0C\u5141\u8BB8\u5355\u4E2A\u6587\u4EF6\u7684\u6700\u5927\u503C\u4E3A%s\uFF01
|
||||
total_file_upload_size_error=\u4E0A\u4F20\u6587\u4EF6\u7684\u603B\u5927\u5C0F\u6700\u5927\u4E3A%s\uFF0C\u5141\u8BB8\u4E0A\u4F20\u7684\u6587\u4EF6\u603B\u5927\u5C0F\u4E3A%s\uFF01
|
||||
file_upload_type_error=%s\u6587\u4EF6\u7C7B\u578B\u51FA\u9519\uFF0C\u5141\u8BB8\u4E0A\u4F20\u7684\u6587\u4EF6\u7C7B\u578B\u6709%s\uFF01
|
||||
file_upload_error=\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01
|
||||
#=============multipart upload error info=================
|
||||
@@ -304,8 +304,26 @@ userregion_replace_res_key_value=http_res_body
|
||||
userregion_replace_regex_key=regex
|
||||
#IP相关验证正则
|
||||
ip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))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*$
|
||||
ipv6_ip_regexp=^\\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\\s*$
|
||||
#重定向业务自定义域相关参数
|
||||
redirect_response_code_key=code
|
||||
redirect_url_key=url
|
||||
redirect_content_key=content
|
||||
redirect_response_code_startwith=30
|
||||
#样例文件上传的uri关键词
|
||||
sample_upload_url_keyword=/av
|
||||
#样例和摘要文件大小类型设置
|
||||
sample_file_type=,mp4,flv,ivf,mp2v,
|
||||
#10M 10485760
|
||||
sample_single_file_max_size=10485760
|
||||
#12M 12582912
|
||||
sample_total_file_max_size=12582912
|
||||
digest_file_type=,txt,doc,img,
|
||||
#10M10485760
|
||||
digest_single_file_max_size=10485760
|
||||
#12M12582912
|
||||
digest_total_file_max_size=12582912
|
||||
@@ -157,7 +157,6 @@
|
||||
<property name="favorPathExtension" value="true" />
|
||||
</bean>
|
||||
|
||||
|
||||
<mvc:interceptors>
|
||||
<mvc:interceptor>
|
||||
<mvc:mapping path="/nis/**" />
|
||||
@@ -172,29 +171,29 @@
|
||||
</mvc:interceptor>
|
||||
|
||||
<!-- 数据源拦截器,该拦截路径下使用数据源B -->
|
||||
<mvc:interceptor>
|
||||
<!-- <mvc:interceptor>
|
||||
<mvc:mapping path="/service/cfg/**" />
|
||||
<bean class="com.nis.interceptor.DataSourceBInterceptor"></bean>
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptor> -->
|
||||
|
||||
<!-- 数据源拦截器,该拦截路径下使用数据源C -->
|
||||
<mvc:interceptor>
|
||||
<!-- <mvc:interceptor>
|
||||
<mvc:mapping path="/service/log/**" />
|
||||
<bean class="com.nis.interceptor.DataSourceCInterceptor"></bean>
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptor> -->
|
||||
|
||||
|
||||
<!-- 数据源拦截器,该拦截路径下使用数据源D,后期会删除 -->
|
||||
<mvc:interceptor>
|
||||
<!-- <mvc:interceptor>
|
||||
<mvc:mapping path="/service/test/**" />
|
||||
<bean class="com.nis.interceptor.DataSourceDInterceptor"></bean>
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptor> -->
|
||||
|
||||
<!-- 数据源拦截器,该拦截路径下使用数据源E -->
|
||||
<mvc:interceptor>
|
||||
<!-- <mvc:interceptor>
|
||||
<mvc:mapping path="/service/jk/**" />
|
||||
<bean class="com.nis.interceptor.DataSourceEInterceptor"></bean>
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptor> -->
|
||||
|
||||
</mvc:interceptors>
|
||||
|
||||
@@ -245,6 +244,10 @@
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<bean id="multipartResolver"
|
||||
class="com.nis.interceptor.MultipartFileIntercepter" >
|
||||
<property name="defaultEncoding" value="utf-8"></property>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
|
||||
@@ -257,15 +260,6 @@
|
||||
</bean>
|
||||
<!-- 支持Shiro对Controller的方法级AOP安全控制 end -->
|
||||
|
||||
|
||||
<!-- 上传文件拦截,设置最大文件大小10m=10*1024*1024(B)=10485760 bytes -->
|
||||
<bean id="multipartResolver"
|
||||
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<property name="defaultEncoding" value="utf-8"></property>
|
||||
<property name="maxUploadSize" value="10737418240"></property>
|
||||
<!--<property name="maxInMemorySize" value="1000"></property> -->
|
||||
</bean>
|
||||
|
||||
<!-- 配置国际化资源文件路径 -->
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="basename">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<h3 class="form-section"><spring:message code="basic_config"/></h3>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%><h3 class="form-section"><spring:message code="basic_config"/></h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@@ -162,7 +161,95 @@
|
||||
|
||||
</c:forEach>
|
||||
</select> --%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="attribute"/></label>
|
||||
<div class="col-md-6">
|
||||
<div class="input-group">
|
||||
<input id="classifyId" name="classify" class="form-control singleClass" value="" type="hidden">
|
||||
<input id="classifyName" onclick="openSelct(this);" name="classifyName" readonly="readonly" value="" data-msg-required="" placeholder="" class="form-control" style="background-color:transparent" type="text">
|
||||
|
||||
<div class="input-group-btn">
|
||||
<a id="classifyButton" class="btn btn-default dropdown-toggle" href="javascript:void(0);" style=""><i class="fa fa-angle-down"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<select name="classifyTest" multiple="multiple" class="form-control">
|
||||
|
||||
<c:forEach items="${fls}" var="fl">
|
||||
<c:choose>
|
||||
<c:when test="${_cfg.classify==null or _cfg.classify==''}">
|
||||
<option value="${fl.serviceDictId}" data-section="${fl.pNames}">${fl.itemValue}</option>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:if test="${fl.isValid!=0}">
|
||||
<option value="${fl.serviceDictId}"
|
||||
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
|
||||
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
||||
</c:forEach>
|
||||
data-section="${fl.pNames}"
|
||||
>
|
||||
${fl.itemValue}
|
||||
</option>
|
||||
</c:if>
|
||||
<option value="${fl.serviceDictId}"
|
||||
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
|
||||
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
|
||||
data-section="${fl.pNames}"
|
||||
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
|
||||
</c:forEach>
|
||||
>${fl.itemValue}</option>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="label"/></label>
|
||||
<div class="col-md-6">
|
||||
<div class="btn-group bootstrap-select form-control required dropup">
|
||||
<button aria-expanded="true" title="" type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown">
|
||||
<span class="caret"></span></button>
|
||||
</div>
|
||||
<select name="lableTest" multiple="multiple" title=<spring:message code="select"/>>
|
||||
<c:forEach items="${lables}" var="lable">
|
||||
<c:choose>
|
||||
<c:when test="${_cfg.lable==null or _cfg.lable==''}">
|
||||
<option value="${lable.serviceDictId}" data-section="${lable.pNames}">${lable.itemValue}</option>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:if test="${lable.isValid!=0}">
|
||||
<option value="${lable.serviceDictId}"
|
||||
<c:forEach items="${fn:split(_cfg.lable,',')}" var="_lable">
|
||||
<c:if test="${fn:trim(lable.serviceDictId) eq _lable}">selected</c:if>
|
||||
</c:forEach>
|
||||
data-section="${lable.pNames}"
|
||||
>
|
||||
${lable.itemValue}
|
||||
</option>
|
||||
</c:if>
|
||||
<c:forEach items="${fn:split(_cfg.lable,',')}" var="_lable">
|
||||
<option value="${lable.serviceDictId}"
|
||||
<c:if test="${lable.isValid==0}"> readonly</c:if>
|
||||
<c:if test="${fn:trim(lable.serviceDictId) eq _lable}">selected</c:if>
|
||||
data-section="${lable.pNames}"
|
||||
>${lable.itemValue}</option>
|
||||
</c:forEach>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
</c:forEach>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<!-- 文件导入 -->
|
||||
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-fileupload/css/bootstrap-fileupload.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="${pageContext.request.contextPath}/static/global/plugins/jquery-tree-multiselect/jquery.tree-multiselect.min.css" rel="stylesheet" type="text/css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/respond.min.js"></script>
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/excanvas.min.js"></script>
|
||||
@@ -94,3 +95,5 @@
|
||||
<!-- 文件导入 -->
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-fileupload/js/bootstrap-fileupload.js" type="text/javascript"></script>
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-fileupload/js/jquery.cookie.min.js" type="text/javascript"></script>
|
||||
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-tree-multiselect/jquery.tree-multiselect.js" type="text/javascript"></script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
/* jQuery Tree Multiselect v2.5.2 | (c) Patrick Tsai | MIT Licensed */
|
||||
div.tree-multiselect{border-radius:5px;display:table;height:inherit;width:100%}div.tree-multiselect>div.selected,div.tree-multiselect>div.selections{display:inline-block;box-sizing:border-box;overflow:auto;vertical-align:top;width:100%}div.tree-multiselect>div.selections div.item{margin-left:16px}div.tree-multiselect>div.selections div.item label{cursor:pointer;display:inline}div.tree-multiselect>div.selections div.item label.disabled{color:#D8D8D8}div.tree-multiselect>div.selections *[searchhit=false]{display:none}div.tree-multiselect>div.selections.no-border{border-right:none}div.tree-multiselect>div.selected>div.item{background:#EAEAEA;border-radius:2px;padding:2px 5px;overflow:auto}div.tree-multiselect>div.selected.ui-sortable>div.item:hover{cursor:move}div.tree-multiselect div.section>div.section,div.tree-multiselect div.section>div.item{padding-left:20px}div.tree-multiselect div.section.collapsed>div.title span.collapse-section:after{content:"+"}div.tree-multiselect div.section.collapsed:not([searchhit])>.item,div.tree-multiselect div.section.collapsed:not([searchhit])>.section{display:none}div.tree-multiselect div.title,div.tree-multiselect div.item{margin-bottom:2px}div.tree-multiselect div.title{background:#f6f6f6;color:#555;padding:2px}div.tree-multiselect div.title>*{display:inline-block}div.tree-multiselect div.title>span.collapse-section{margin:0 3px;width:8px}div.tree-multiselect div.title>span.collapse-section:after{content:"-"}div.tree-multiselect div.title:hover{cursor:pointer}div.tree-multiselect input[type=checkbox]{display:inline;margin-right:5px}div.tree-multiselect input[type=checkbox]:not([disabled]):hover{cursor:pointer}div.tree-multiselect span.remove-selected,div.tree-multiselect span.description{background:#777;border-radius:2px;color:white;margin-right:5px;padding:0 3px}div.tree-multiselect span.remove-selected:hover{cursor:pointer}div.tree-multiselect span.description:hover{cursor:help}div.tree-multiselect div.temp-description-popup{background:#EAEAEA;border:1px solid #676767;border-radius:3px;padding:5px}div.tree-multiselect span.section-name{float:right;font-style:italic}div.tree-multiselect .auxiliary{display:table;width:100%}div.tree-multiselect .auxiliary input.search{border-width:1px;border-style: solid solid solid solid;border-color: #D8D8D8;display:table-cell;margin:0;padding:5px;width:100%}div.tree-multiselect .auxiliary .select-all-container{display:table-cell;text-align:right}div.tree-multiselect .auxiliary .select-all-container span.select-all,div.tree-multiselect .auxiliary .select-all-container span.unselect-all{margin-right:5px;padding-right:5px}div.tree-multiselect .auxiliary .select-all-container span.select-all:hover,div.tree-multiselect .auxiliary .select-all-container span.unselect-all:hover{cursor:pointer}div.tree-multiselect .auxiliary .select-all-container span.select-all{border-right:2px solid #D8D8D8} .selectionsDiv{max-height: 169.367px; overflow-y: auto; min-height: 103px;}
|
||||
@@ -1,7 +1,14 @@
|
||||
$(function(){
|
||||
/* var tree2 = $("#test-select-2").treeMultiselect({
|
||||
searchable: true
|
||||
});*/
|
||||
var tree2 = $("select[name=lableTest]").treeMultiselect({
|
||||
searchable: true,
|
||||
hideSidePanel:true,
|
||||
startCollapsed:true
|
||||
});
|
||||
var tree1 = $("select[name=classifyTest]").treeMultiselect({
|
||||
searchable: true,
|
||||
hideSidePanel:true,
|
||||
startCollapsed:true
|
||||
});
|
||||
//全选及取消
|
||||
$("#checkAll").change(function(){
|
||||
if($("#checkAll").prop("checked")){
|
||||
@@ -874,6 +881,10 @@ var downLoadXLS=function(){
|
||||
var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/"));
|
||||
window.location =pathName+"/import/template?functionId="+$("#functionId").val()+"&cfgRegionCode="+$("#cfgRegionCode").val();
|
||||
}
|
||||
//下载模板
|
||||
var openSelct=function(obj){
|
||||
$(obj).parent().parent().find(".tree-multiselect").removeClass("hidden");
|
||||
}
|
||||
//导入配置
|
||||
var importCfg=function(){
|
||||
if($("#serviceId").val()==""){
|
||||
|
||||
Reference in New Issue
Block a user