aliasScriptImport.jsp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. //window.returnValue="/";
  34. dialog.get('sucCall')("/");
  35. dialog.close();
  36. });
  37. }else{//失败
  38. $.ligerDialog.closeWaitting();
  39. $.ligerDialog.err("提示信息","别名脚本导入失败!",obj.getMessage());
  40. }
  41. }
  42. function valid(showResponse){
  43. var options={success:showResponse};
  44. __valid=$("#importForm").validate({
  45. rules: {},
  46. messages: {},
  47. submitHandler:function(form){
  48. $(form).ajaxSubmit(options);
  49. },
  50. success: function(label) {}
  51. });
  52. }
  53. </script>
  54. </head>
  55. <body>
  56. <div class="panel-top">
  57. <div class="tbar-title">
  58. <span class="tbar-label">别名脚本导入</span>
  59. </div>
  60. <div class="panel-toolbar">
  61. <div class="toolBar">
  62. <div class="group"><a class="link save" id="btnSave"><span></span>导入</a></div>
  63. <div class="l-bar-separator"></div>
  64. <div class="group"><a class="link del" onclick="javasrcipt:frameElement.dialog.close()"><span></span>关闭</a></div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="panel-body">
  69. <form id="importForm" name="importForm" method="post" target="win" action="importXml.ht" enctype="multipart/form-data">
  70. <div class="row">
  71. <table id="tableid" class="table-detail" cellpadding="0" cellspacing="0" border="0">
  72. <tr>
  73. <th width="22%">选择文件:</th>
  74. <td width="78%"><input type="file" size="40" name="xmlFile" id="xmlFile"/></td>
  75. </tr>
  76. </table>
  77. </div>
  78. </form>
  79. </div><!-- end of panel-body -->
  80. </body>
  81. </html>