scriptImport.jsp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/commons/include/html_doctype.html" %>
  3. <html>
  4. <head>
  5. <title>自定义表导入</title>
  6. <%@include file="/commons/include/form.jsp" %>
  7. <script type="text/javascript">
  8. /*KILLDIALOG*/
  9. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  10. window.name="win";
  11. $(function(){
  12. valid(showResponse);
  13. $("#btnSave").click(function(){
  14. var path = $('#xmlFile').val();
  15. var extNaem = path.substring(path.length-3, path.length);
  16. if(extNaem!='xml'){
  17. $.ligerDialog.warn("请选择 *.xml文件进行导入!");
  18. }else{
  19. $("#importForm").submit();
  20. }
  21. });
  22. });
  23. function showResponse(responseText){
  24. var obj=new com.hotent.form.ResultMessage(responseText);
  25. if(obj.isSuccess()){//成功
  26. $.ligerDialog.success(obj.getMessage(),'提示信息',function(){
  27. //window.returnValue=obj.getMessage();
  28. dialog.get("sucCall")(obj.getMessage());
  29. dialog.close();
  30. });
  31. }else{//失败
  32. $.ligerDialog.err('出错信息',"自定义表导入失败",obj.getMessage());
  33. }
  34. }
  35. function valid(showResponse){
  36. var options={success:showResponse};
  37. __valid=$("#importForm").validate({
  38. rules: {},
  39. messages: {},
  40. submitHandler:function(form){
  41. $(form).ajaxSubmit(options);
  42. },
  43. success: function(label) {}
  44. });
  45. }
  46. </script>
  47. </head>
  48. <body>
  49. <div class="panel">
  50. <div class="panel-top">
  51. <div class="tbar-title">
  52. <span class="tbar-label">自定义表导入</span>
  53. </div>
  54. <div class="panel-toolbar">
  55. <div class="toolBar">
  56. <div class="group"><a class="link save" id="btnSave"><span></span>导入</a></div>
  57. <div class="l-bar-separator"></div>
  58. <div class="group"><a class="link del" onclick="javasrcipt:dialog.close()"><span></span>关闭</a></div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="panel-body">
  63. <div class="panel-search">
  64. <form id="importForm" name="importForm" method="post" target="win" action="importXml.ht" enctype="multipart/form-data">
  65. <div class="row">
  66. <table id="tableid" class="table-detail" cellpadding="0" cellspacing="0" border="0">
  67. <tr>
  68. <th width="22%">选择文件:</th>
  69. <td width="78%"><input type="file" size="40" name="xmlFile" id="xmlFile"/></td>
  70. </tr>
  71. </table>
  72. </div>
  73. </form>
  74. </div>
  75. </div><!-- end of panel-body -->
  76. </div>
  77. </body>
  78. </html>