office.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
  3. xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
  4. <head>
  5. <title>Index</title>
  6. <script type="text/javascript" src="../office/jquery.min.js"></script>
  7. <script type="text/javascript" src="../office/pageoffice.js" id="po_js_main"></script>
  8. <script type="text/javascript">
  9. // 获取访问文件URL
  10. $(function(){
  11. var urlTemp = location.href;
  12. var urlStr = urlTemp.substr(0,urlTemp.indexOf("/office"));
  13. $.ajax({
  14. type: "GET",
  15. url: urlStr + "/office/getUrl",
  16. data: {urlSTR:urlStr},
  17. dataType: "json",
  18. success: function(result){
  19. // localStorage.removeItem("pageOfficeFileId");
  20. var urlT = result.data;
  21. $('#clickBut').attr('href',urlT);
  22. document.getElementById("clickBut").click();
  23. }
  24. });
  25. });
  26. // 保存文件ID 供弹出框调用 (实际为关闭页面操作 )
  27. function setLocalFileId(fileIdTemp){
  28. var urlTemp = location.href;
  29. var urlStr = urlTemp.substr(0,urlTemp.indexOf("/office"));
  30. $.ajax({
  31. type: "GET",
  32. url: urlStr + "/office/setTempFileId?FileId="+fileIdTemp,
  33. data: {},
  34. dataType: "json",
  35. success: function(result){
  36. window.close();
  37. }
  38. });
  39. }
  40. // 回退方法 供弹出框调用
  41. function refresh(){
  42. window.close();
  43. }
  44. </script>
  45. </head>
  46. <body>
  47. <a id="clickBut" href=""></a>
  48. </body>
  49. </html>