|
@@ -1,11 +1,11 @@
|
|
|
-<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
-<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
|
|
|
+<%@ page contentType="text/html;charset=UTF-8"%>
|
|
|
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
|
|
|
<html>
|
|
|
<head>
|
|
|
- <title>新建学校</title>
|
|
|
- <meta name="decorator" content="default"/>
|
|
|
- <%@include file="/WEB-INF/views/include/head.jsp" %>
|
|
|
- <script type="text/javascript">
|
|
|
+<title>新建学校</title>
|
|
|
+<meta name="decorator" content="default" />
|
|
|
+<%@include file="/WEB-INF/views/include/head.jsp"%>
|
|
|
+<script type="text/javascript">
|
|
|
$(document).ready(function () {
|
|
|
$("#uploadFile").change(function (e) {
|
|
|
var ob=e.currentTarget.files[0];
|
|
@@ -39,50 +39,88 @@
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ function urlToBlob(url, cb) {
|
|
|
+ const xhr = new XMLHttpRequest();
|
|
|
+ xhr.open('GET', url, true);
|
|
|
+ xhr.responseType = 'blob';
|
|
|
+ xhr.onload = function () {
|
|
|
+ if (xhr.status == 200) {
|
|
|
+ cb(URL.createObjectURL(xhr.response));
|
|
|
+ }
|
|
|
+ };
|
|
|
+ xhr.send();
|
|
|
+ }
|
|
|
+
|
|
|
+ function saveAs(blob, filename) {
|
|
|
+ if (window.navigator.msSaveOrOpenBlob) {
|
|
|
+ navigator.msSaveBlob(blob, filename);
|
|
|
+ } else {
|
|
|
+ console.log('blob', blob);
|
|
|
+ var link = document.createElement('a');
|
|
|
+ var body = document.querySelector('body');
|
|
|
+ link.href = blob;
|
|
|
+ link.download = filename;
|
|
|
+ link.style.display = 'none';
|
|
|
+ body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ body.removeChild(link);
|
|
|
+ window.URL.revokeObjectURL(link.href);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function downloadByCrossUrl(url, filename) {
|
|
|
+ urlToBlob(url, (blob) => {
|
|
|
+ saveAs(blob, filename);
|
|
|
+ });
|
|
|
+ }
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
|
-<form:form id="inputForm" action="${ctx}/admin/exam/subject/split/save" method="post" class="form-horizontal" enctype="multipart/form-data">
|
|
|
- <tags:message content="${message}"/>
|
|
|
- <tags:message content="${errmsg}" type="error" />
|
|
|
- <input type="hidden" id="schoolId" name="schoolId" value="${schoolId}" />
|
|
|
+ <form:form id="inputForm" action="${ctx}/admin/exam/subject/split/save"
|
|
|
+ method="post" class="form-horizontal" enctype="multipart/form-data">
|
|
|
+ <tags:message content="${message}" />
|
|
|
+ <tags:message content="${errmsg}" type="error" />
|
|
|
+ <input type="hidden" id="schoolId" name="schoolId" value="${schoolId}" />
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">名称</label>
|
|
|
- <div class="controls"><input type="text" disabled="disabled"
|
|
|
- id="schoolName" name="schoolName" value="${schoolName}"/>
|
|
|
- </div>
|
|
|
+ <div class="controls">
|
|
|
+ <input type="text" disabled="disabled" id="schoolName"
|
|
|
+ name="schoolName" value="${schoolName}" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">考试</label>
|
|
|
<div class="controls">
|
|
|
- <select class="input-large required" name="examId" id="examId">
|
|
|
- <option value="" selected="selected">请选择考试</option>
|
|
|
- <c:forEach items="${examList}" var="item">
|
|
|
- <option <c:if test="${item.id==examId}">selected</c:if> value="${item.id}">${item.id}-${item.name}</option>
|
|
|
- </c:forEach>
|
|
|
- </select>
|
|
|
+ <select class="input-large required" name="examId" id="examId">
|
|
|
+ <option value="" selected="selected">请选择考试</option>
|
|
|
+ <c:forEach items="${examList}" var="item">
|
|
|
+ <option <c:if test="${item.id==examId}">selected</c:if>
|
|
|
+ value="${item.id}">${item.id}-${item.name}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label">导入拆分表</label>
|
|
|
+ <label class="control-label">导入拆分表</label>
|
|
|
<div class="controls">
|
|
|
- <input id="uploadFile" name="file" type="file" style="width:210px" class="required"
|
|
|
- accept=".xls,.xlsx"
|
|
|
- />
|
|
|
+ <input id="uploadFile" name="file" type="file" style="width: 210px"
|
|
|
+ class="required" accept=".xls,.xlsx" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label"></label>
|
|
|
<div class="controls">
|
|
|
- <a href="${ctx}/admin/exam/subject/split/template">下载模板</a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-actions">
|
|
|
- <input id="btnSubmit" class="btn btn-primary" type="submit"
|
|
|
- value="导入"/>
|
|
|
-
|
|
|
- <a href="${ctx}/admin/sys/school" class="btn">返回</a>
|
|
|
- </div>
|
|
|
-</form:form>
|
|
|
+ <a href="${ctx}/admin/exam/subject/split/template">下载模板</a>
|
|
|
+ <c:if test="${errmsgUrl!=null}">
|
|
|
+ <a href="#" style="margin-left: 50px"
|
|
|
+ onclick="downloadByCrossUrl('${errmsgUrl}','error.txt')">error.txt</a>
|
|
|
+ </c:if>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-actions">
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit"
|
|
|
+ value="导入" /> <a href="${ctx}/admin/sys/school" class="btn">返回</a>
|
|
|
+ </div>
|
|
|
+ </form:form>
|
|
|
</body>
|
|
|
</html>
|