preview.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  5. <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
  6. <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
  7. <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
  8. <script src="/x_desktop/res/common.js?v=1.1.7"></script>
  9. <script src="../o2_core/o2.js?v=2.0.0"></script>
  10. <script src="../o2_core/compatible.js?v=2.0.0"></script>
  11. <title>FORM PREVIEW</title>
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  13. <script>
  14. layout = window.layout || {};
  15. var href = window.location.href;
  16. if (href.indexOf("debugger")!=-1) layout["debugger"] = true;
  17. var mode = (new URI(href)).get("data").mode;
  18. if (mode){
  19. if (mode=="mobile") layout.mobile = true;
  20. }
  21. layout.session = window.frameElement.ownerDocument.window.layout.session || {};
  22. //layout.desktop = layout;
  23. o2.addReady(function(){
  24. o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
  25. MWF.getJSON("res/config/config.json", function(config){
  26. layout.config = config;
  27. if (layout.config.app_protocol=="auto"){
  28. layout.config.app_protocol = window.location.protocol;
  29. }
  30. MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
  31. MWF.loadLP(MWF.language);
  32. MWF.require("MWF.xDesktop.Layout", function(){
  33. //MWF.require("MWF.xDesktop.Authentication", null, false);
  34. (function(){
  35. layout.load = function(){
  36. // if (this.isAuthentication()){
  37. var preview = window.frameElement.retrieve("preview");
  38. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  39. MWF.xDesktop.requireApp("process.Xform", "Form", function(){
  40. layout.appForm = new MWF.APPForm($("layout"), preview.data);
  41. layout.appForm.app = {"content": document.body, "fireEvent": function(){}};
  42. MWF.getJSON("res/preview/work.json", function(data){
  43. layout.appForm.businessData = {
  44. "data": data.data,
  45. "taskList": data.taskList,
  46. "work": data.work,
  47. "workCompleted": data.workCompleted,
  48. "control": data.control,
  49. "activity": data.activity,
  50. "task": data.taskList[0],
  51. "workLogList": data.workLogList,
  52. "attachmentList": data.attachmentList,
  53. "status": {
  54. //"readonly": (this.options.readonly) ? true : false
  55. "readonly": this.readonly
  56. }
  57. };
  58. layout.appForm.load();
  59. });
  60. });
  61. // }
  62. };
  63. // layout.authentication = new MWF.xDesktop.Authentication({
  64. // "onLogin": layout.load.bind(layout)
  65. // });
  66. // layout.isAuthentication = function(){
  67. // var returnValue = true;
  68. // this.authentication.isAuthenticated(function(json){
  69. // this.user = json.data;
  70. // }.bind(this), function(){
  71. // this.authentication.loadLogin(this.node);
  72. // returnValue = false;
  73. // }.bind(this));
  74. // return returnValue;
  75. // };
  76. // layout.getServiceAddress = function(callback){
  77. // var uri = "http://"+layout.config.center+"/x_program_center/jaxrs/distribute/assemble";
  78. // MWF.restful("get", uri, null, function(json){
  79. // this.serviceAddressList = json.data;
  80. // if (callback) callback();
  81. // }.bind(this));
  82. // };
  83. //
  84. // MWF.getJSON("res/config/config.json", function(config){
  85. // layout.config = config;
  86. //
  87. // layout.getServiceAddress(function(){
  88. // layout.load();
  89. // });
  90. // });
  91. layout.load();
  92. })();
  93. });
  94. }.bind(this));
  95. });
  96. });
  97. </script>
  98. </head>
  99. <body style="overflow: auto">
  100. <div id="layout" style="overflow: auto">
  101. <div id="layout_top">
  102. </div>
  103. <div id="layout_form">
  104. </div>
  105. </div>
  106. </body>
  107. </html>