uploadInfoPath.jsp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <%@ page language="java" contentType="text/html; charset=gbk"
  2. pageEncoding="gbk"%>
  3. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  4. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=gbk">
  9. <meta name="renderer" content="ie-stand">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge;">
  11. <meta http-equiv="PRAGMA" content="no-cache">
  12. <meta http-equiv="Cache-Control" content="no-cache">
  13. <meta http-equiv="Expires" content="0">
  14. <%@ include file="/yw/bpm/configuration/common.jsp"%>
  15. <link href="${pageContext.request.contextPath }/yw/bpm/configuration/configuration.css" rel="stylesheet"></link>
  16. <link href="/shares/js/yw/bpm/bootstrap/jquery-validation-1.11.1/demo/css/screen.css" rel="stylesheet"></link>
  17. <script type="text/javascript" src="/shares/js/yw/bpm/bootstrap/jquery-validation-1.11.1/dist/jquery.validate.js"></script>
  18. <script type="text/javascript" src="/shares/js/yw/bpm/bootstrap/jquery-validation-1.11.1/localization/messages_zh.js"></script>
  19. <title>流程配置</title>
  20. <script type="text/javascript">
  21. var contextPath = "${pageContext.request.contextPath }";
  22. $(function(){
  23. $("#footer").css("margin-top", window.screen.height-215);
  24. // 表单验证配置
  25. $("#form2").validate({
  26. });
  27. $("#file").rules("add", {
  28. required: true,
  29. valFileName: true
  30. });
  31. });
  32. function uploadFile(){
  33. var bool = $("#form2").valid();
  34. if(bool == false){
  35. return false;
  36. }
  37. $("#file").attr("readonly","readonly");
  38. $("#form2").submit();
  39. $(document).progressDialog.showDialog("正在上传,请稍后...");
  40. }
  41. function callback(seq){
  42. var fileId = seq;
  43. $.ajax({
  44. url : "bpmFormConfigAction.do?task=upload&time="+new Date(),
  45. async : true,
  46. type : "post",
  47. data : {"fileId":fileId},
  48. dataType : 'json',
  49. success : function(data) {
  50. $(document).progressDialog.hideDialog();
  51. // var result = data.result;
  52. var formId = data.formId;
  53. location='bpmFormConfigAction.do?task=toFormVersion&formId='+formId;
  54. },
  55. error : function(data) {
  56. $(document).progressDialog.hideDialog();
  57. $("#file").removeAttr("readonly");
  58. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  59. }
  60. });
  61. }
  62. String.prototype.endWith = function(param) {
  63. if (param == null || param == "" || this.length == 0
  64. || param.length > this.length) {
  65. return false;
  66. }
  67. if (this.substring(this.length - param.length) == param) {
  68. return true;
  69. } else {
  70. return false;
  71. }
  72. };
  73. jQuery.validator.addMethod("valFileName", function(value, element) {
  74. var file = value;
  75. if (file.endWith('.xsn') || file.endWith('.XSN')){
  76. return true;
  77. } else {
  78. return false;
  79. }
  80. }, "请选择.xsn后缀文件!");
  81. </script>
  82. </head>
  83. <body>
  84. <!-- 底部按钮区域 -->
  85. <div class="navbar navbar-default navbar-fixed-top" id="footer">
  86. <div class="container-fluid text-right well well-sm">
  87. <button type="button" class="btn btn-info btn-sm" onclick="location.reload()">
  88. <span class="glyphicon glyphicon-refresh"></span>&nbsp;刷新</button>
  89. <button type="button" class="btn btn-primary btn-sm" onclick="uploadFile();">
  90. <span class="glyphicon glyphicon-chevron-right"></span>&nbsp;下一步</button>
  91. </div>
  92. </div>
  93. <!-- 底部按钮区域 -->
  94. <form action="bpmUploadFile.do" method="post" role="form" id="form2" enctype="multipart/form-data" target="check_file_frame">
  95. <!-- 隐藏元素 -->
  96. <!-- 隐藏元素 -->
  97. <!-- 配置区域 -->
  98. <div class="container-fluid" style="margin-top: 35px;" id="center">
  99. <div class="row">
  100. <div class="form-group col-md-offset-1">
  101. <label>上传表单模版
  102. <span class="badge badge-success" data-placement="bottom" title="上传后缀名为xsn的表单模版文件.">?</span>
  103. </label>
  104. <input type="file" name="file" id="file">
  105. <p>请上传后缀名为xsn的表单模版文件</p>
  106. <!-- <input type="button" onclick="uploadFile();" value="上传表单"> -->
  107. </div>
  108. </div>
  109. </div>
  110. <iframe name="check_file_frame" style="display:none;"></iframe>
  111. <!-- 配置区域 -->
  112. </form>
  113. </body>
  114. </html>