sysQuerySqlDefImport.jsp 2.6 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. window.name="win";
  9. /*KILLDIALOG*/
  10. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  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. $.ligerDialog.waitting('正在导入中,请稍候...');
  20. $("#importForm").submit();
  21. }
  22. });
  23. });
  24. function showResponse(responseText){
  25. var obj=new com.hotent.form.ResultMessage(responseText);
  26. if(obj.isSuccess()){//成功
  27. $.ligerDialog.closeWaitting();
  28. var message = obj.getMessage();
  29. if(message){
  30. message =message.replaceAll("###","\'").replaceAll("!!!","<font ").replaceAll("%%%","</font>").replaceAll("&gt;",">").replaceAll("&lt;","<");
  31. }
  32. $.ligerDialog.tipDialog('提示信息',"导入结果如下:",message,null,function(){
  33. dialog.get('sucCall')("/");
  34. dialog.close();
  35. });
  36. }else{//失败
  37. $.ligerDialog.closeWaitting();
  38. $.ligerDialog.err("提示信息","自定义Sql查询导入失败!",obj.getMessage());
  39. }
  40. }
  41. function valid(showResponse){
  42. var options={success:showResponse};
  43. __valid=$("#importForm").validate({
  44. rules: {},
  45. messages: {},
  46. submitHandler:function(form){
  47. $(form).ajaxSubmit(options);
  48. },
  49. success: function(label) {}
  50. });
  51. }
  52. </script>
  53. </head>
  54. <body>
  55. <div class="panel-top">
  56. <div class="tbar-title">
  57. <span class="tbar-label">自定义Sql查询导入</span>
  58. </div>
  59. <div class="panel-toolbar">
  60. <div class="toolBar">
  61. <div class="group"><a class="link save" id="btnSave"><span></span>导入</a></div>
  62. <div class="l-bar-separator"></div>
  63. <div class="group"><a class="link del" onclick="javasrcipt:frameElement.dialog.close()"><span></span>关闭</a></div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="panel-body">
  68. <form id="importForm" name="importForm" method="post" target="win" action="importXml.ht" enctype="multipart/form-data">
  69. <div class="row">
  70. <table id="tableid" class="table-detail" cellpadding="0" cellspacing="0" border="0">
  71. <tr>
  72. <th width="22%">选择文件:</th>
  73. <td width="78%"><input type="file" size="40" name="xmlFile" id="xmlFile"/></td>
  74. </tr>
  75. </table>
  76. </div>
  77. </form>
  78. </div><!-- end of panel-body -->
  79. </body>
  80. </html>