preview.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="/x_desktop/res/css/style.css" charset="UTF-8" />
  5. <link rel="stylesheet" href="/x_desktop/res/css/mBoxNotice.css" charset="UTF-8" />
  6. <link rel="stylesheet" href="/x_desktop/res/css/mBoxTooltip.css" charset="UTF-8" />
  7. <script src="/x_desktop/res/common.js?v=0.3.25"></script>
  8. <!--<script src="/x_desktop/res/framework/mootools/mootools-core-1.4.5-full-nocompat.js"></script>-->
  9. <!--<script src="/x_desktop/res/framework/mootools/mootools-more-1.4.0.1-all_2.js"></script>-->
  10. <script src="res/framework/mootools/mootools-1.6.0.min.js"></script>
  11. <script src="res/framework/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.desktop = layout;
  23. COMMON.DOM.addReady(function(){
  24. COMMON.AjaxModule.load("/x_desktop/res/framework/mootools/plugin/mBox.Notice.js", null, false);
  25. COMMON.AjaxModule.load("/x_desktop/res/framework/mootools/plugin/mBox.Tooltip.js", null, false);
  26. COMMON.setContentPath("/x_desktop");
  27. COMMON.AjaxModule.load("mwf", function(){
  28. MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
  29. MWF.loadLP("zh-cn");
  30. MWF.require("MWF.xDesktop.Layout", function(){
  31. //MWF.require("MWF.xDesktop.Authentication", null, false);
  32. (function(){
  33. layout.load = function(){
  34. // if (this.isAuthentication()){
  35. var preview = window.frameElement.retrieve("preview");
  36. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  37. MWF.xDesktop.requireApp("process.Xform", "Form", function(){
  38. layout.appForm = new MWF.APPForm($("layout"), preview.data);
  39. layout.appForm.app = {"content": document.body};
  40. MWF.getJSON("res/preview/work.json", function(data){
  41. layout.appForm.businessData = {
  42. "data": data.data,
  43. "taskList": data.taskList,
  44. "work": data.work,
  45. "workCompleted": data.workCompleted,
  46. "control": data.control,
  47. "activity": data.activity,
  48. "task": data.taskList[0],
  49. "workLogList": data.workLogList,
  50. "attachmentList": data.attachmentList,
  51. "status": {
  52. //"readonly": (this.options.readonly) ? true : false
  53. "readonly": this.readonly
  54. }
  55. };
  56. layout.appForm.load();
  57. });
  58. });
  59. // }
  60. };
  61. // layout.authentication = new MWF.xDesktop.Authentication({
  62. // "onLogin": layout.load.bind(layout)
  63. // });
  64. // layout.isAuthentication = function(){
  65. // var returnValue = true;
  66. // this.authentication.isAuthenticated(function(json){
  67. // this.user = json.data;
  68. // }.bind(this), function(){
  69. // this.authentication.loadLogin(this.node);
  70. // returnValue = false;
  71. // }.bind(this));
  72. // return returnValue;
  73. // };
  74. // layout.getServiceAddress = function(callback){
  75. // var uri = "http://"+layout.config.center+"/x_program_center/jaxrs/distribute/assemble";
  76. // MWF.restful("get", uri, null, function(json){
  77. // this.serviceAddressList = json.data;
  78. // if (callback) callback();
  79. // }.bind(this));
  80. // };
  81. //
  82. // MWF.getJSON("res/config/config.json", function(config){
  83. // layout.config = config;
  84. //
  85. // layout.getServiceAddress(function(){
  86. // layout.load();
  87. // });
  88. // });
  89. layout.load();
  90. })();
  91. });
  92. });
  93. });
  94. </script>
  95. </head>
  96. <body style="overflow: auto">
  97. <div id="layout" style="overflow: auto">
  98. <div id="layout_top">
  99. </div>
  100. <div id="layout_form">
  101. </div>
  102. </div>
  103. </body>
  104. </html>