preview.html 5.9 KB

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