preview.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.0.6"></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. debugger;
  40. (function(){
  41. layout.load = function(){
  42. // if (this.isAuthentication()){
  43. var preview = window.frameElement.retrieve("preview");
  44. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  45. MWF.xDesktop.requireApp("process.Xform", "Form", function(){
  46. layout.appForm = new MWF.APPForm($("layout"), preview.data);
  47. layout.appForm.app = {"content": document.body, "fireEvent": function(){}};
  48. MWF.getJSON("res/preview/work.json", function(data){
  49. layout.appForm.businessData = {
  50. "data": data.data,
  51. "taskList": data.taskList,
  52. "work": data.work,
  53. "workCompleted": data.workCompleted,
  54. "control": data.control,
  55. "activity": data.activity,
  56. "task": data.taskList[0],
  57. "workLogList": data.workLogList,
  58. "attachmentList": data.attachmentList,
  59. "status": {
  60. //"readonly": (this.options.readonly) ? true : false
  61. "readonly": this.readonly
  62. }
  63. };
  64. layout.appForm.load();
  65. });
  66. });
  67. // }
  68. };
  69. // layout.authentication = new MWF.xDesktop.Authentication({
  70. // "onLogin": layout.load.bind(layout)
  71. // });
  72. // layout.isAuthentication = function(){
  73. // var returnValue = true;
  74. // this.authentication.isAuthenticated(function(json){
  75. // this.user = json.data;
  76. // }.bind(this), function(){
  77. // this.authentication.loadLogin(this.node);
  78. // returnValue = false;
  79. // }.bind(this));
  80. // return returnValue;
  81. // };
  82. // layout.getServiceAddress = function(callback){
  83. // var uri = "http://"+layout.config.center+"/x_program_center/jaxrs/distribute/assemble";
  84. // MWF.restful("get", uri, null, function(json){
  85. // this.serviceAddressList = json.data;
  86. // if (callback) callback();
  87. // }.bind(this));
  88. // };
  89. //
  90. // MWF.getJSON("res/config/config.json", function(config){
  91. // layout.config = config;
  92. //
  93. // layout.getServiceAddress(function(){
  94. // layout.load();
  95. // });
  96. // });
  97. layout.load();
  98. })();
  99. });
  100. }.bind(this));
  101. });
  102. });
  103. </script>
  104. </head>
  105. <body style="overflow: auto">
  106. <div id="layout" style="overflow: auto">
  107. <div id="layout_top">
  108. </div>
  109. <div id="layout_form">
  110. </div>
  111. </div>
  112. </body>
  113. </html>