preview.html 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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" type="text/css" href="css/v10/root.css" charset="UTF-8" />
  7. <link rel="stylesheet" type="text/css" href="css/v10/style.css" id="oo-css-skin" charset="UTF-8" />
  8. <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
  9. <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
  10. <script src="../o2_core/o2.min.js"></script>
  11. <script src="../o2_lib/Decimal.js"></script>
  12. <script src="js/base.min.js"></script>
  13. <title>FORM PREVIEW</title>
  14. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  15. <script>
  16. layout.addReady(function(){
  17. (function(layout){
  18. MWF.getJSON("res/config/config.json", function(config){
  19. if (config.proxyCenterEnable){
  20. if (o2.typeOf(config.center)==="array"){
  21. config.center.forEach(function(c){
  22. c.port = window.location.port || 80;
  23. })
  24. }else{
  25. config.port = window.location.port || 80;
  26. }
  27. }
  28. layout.config = config;
  29. if (layout.config.app_protocol=="auto"){
  30. layout.config.app_protocol = window.location.protocol;
  31. }
  32. //MWF.defaultPath = "../x_desktop"+MWF.defaultPath;
  33. MWF.loadLP(MWF.language);
  34. MWF.require("MWF.xDesktop.Layout", function(){
  35. //MWF.require("MWF.xDesktop.Authentication", null, false);
  36. (function(){
  37. layout.load = function(){
  38. // if (this.isAuthentication()){
  39. var preview = window.frameElement.retrieve("preview");
  40. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  41. MWF.xDesktop.requireApp("process.Xform", "Form", function(){
  42. layout.appForm = new MWF.APPForm($("layout"), preview.data);
  43. layout.appForm.formDataText = JSON.stringify(preview.data);
  44. layout.appForm.app = {"content": document.body, "fireEvent": function(){},"addEvent": function(){}};
  45. layout.appForm.workAction = MWF.Actions.get("x_processplatform_assemble_surface");
  46. MWF.getJSON("res/preview/work.json", function(data){
  47. debugger;
  48. if( preview.form && preview.form.designer && preview.form.designer.application && preview.form.designer.application.id ){
  49. data.work.application = preview.form.designer.application.id;
  50. }
  51. if( preview.form && preview.form.json && preview.form.json.mode && preview.form.json.mode === "Mobile" ){
  52. layout.mobile = true;
  53. }
  54. layout.appForm.businessData = {
  55. "data": data.data,
  56. "taskList": data.taskList,
  57. "work": data.work,
  58. "workCompleted": data.workCompleted,
  59. "control": data.control,
  60. "activity": data.activity,
  61. "task": data.taskList[0],
  62. "workLogList": data.workLogList,
  63. "recordList": data.recordList,
  64. "attachmentList": data.attachmentList,
  65. "status": {
  66. //"readonly": (this.options.readonly) ? true : false
  67. "readonly": this.readonly
  68. }
  69. };
  70. layout.appForm.load();
  71. });
  72. });
  73. // }
  74. };
  75. layout.load();
  76. })();
  77. });
  78. }.bind(this));
  79. })(layout);
  80. });
  81. </script>
  82. </head>
  83. <body style="overflow: auto">
  84. <div id="layout" class="layout" style="overflow: auto">
  85. <div id="layout_top">
  86. </div>
  87. <div id="layout_form">
  88. </div>
  89. </div>
  90. </body>
  91. </html>