preview.html 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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_core/o2.min.js"></script>
  9. <script src="../o2_lib/Decimal.js"></script>
  10. <script src="js/base.min.js"></script>
  11. <title>FORM PREVIEW</title>
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  13. <script>
  14. layout.addReady(function(){
  15. (function(layout){
  16. MWF.getJSON("res/config/config.json", function(config){
  17. if (config.proxyCenterEnable){
  18. if (o2.typeOf(config.center)==="array"){
  19. config.center.forEach(function(c){
  20. c.port = window.location.port || 80;
  21. })
  22. }else{
  23. config.port = window.location.port || 80;
  24. }
  25. }
  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.formDataText = JSON.stringify(preview.data);
  42. layout.appForm.app = {"content": document.body, "fireEvent": function(){},"addEvent": function(){}};
  43. layout.appForm.workAction = MWF.Actions.get("x_processplatform_assemble_surface");
  44. MWF.getJSON("res/preview/work.json", function(data){
  45. debugger;
  46. if( preview.form && preview.form.designer && preview.form.designer.application && preview.form.designer.application.id ){
  47. data.work.application = preview.form.designer.application.id;
  48. }
  49. if( preview.form && preview.form.json && preview.form.json.mode && preview.form.json.mode === "Mobile" ){
  50. layout.mobile = true;
  51. }
  52. layout.appForm.businessData = {
  53. "data": data.data,
  54. "taskList": data.taskList,
  55. "work": data.work,
  56. "workCompleted": data.workCompleted,
  57. "control": data.control,
  58. "activity": data.activity,
  59. "task": data.taskList[0],
  60. "workLogList": data.workLogList,
  61. "recordList": data.recordList,
  62. "attachmentList": data.attachmentList,
  63. "status": {
  64. //"readonly": (this.options.readonly) ? true : false
  65. "readonly": this.readonly
  66. }
  67. };
  68. layout.appForm.load();
  69. });
  70. });
  71. // }
  72. };
  73. layout.load();
  74. })();
  75. });
  76. }.bind(this));
  77. })(layout);
  78. });
  79. </script>
  80. </head>
  81. <body style="overflow: auto">
  82. <div id="layout" class="layout" style="overflow: auto">
  83. <div id="layout_top">
  84. </div>
  85. <div id="layout_form">
  86. </div>
  87. </div>
  88. </body>
  89. </html>