文件上传增加样例和摘要业务文件的的总文件大小、单个文件大小、文件类型校验

This commit is contained in:
duandongmei
2018-07-06 17:13:46 +08:00
parent 9d0f8072c1
commit 7c6251e859
15 changed files with 1774 additions and 38 deletions

View File

@@ -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> --%>

View File

@@ -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>
@@ -93,4 +94,6 @@
<!-- 文件导入 -->
<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/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>

View File

@@ -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;}

View File

@@ -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()==""){