preview.html 5.6 KB

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