cmspreview.html 4.8 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("cms.Xform", "Form", function(){
  42. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  43. layout.appForm.formDataText = JSON.stringify(preview.data);
  44. layout.appForm.app = {
  45. "options" : {
  46. "name" : "CMSDocument"
  47. },
  48. "content": document.body,
  49. "addEvent" : function(){},
  50. "fireEvent": function(){}
  51. };
  52. layout.appForm.documentAction = MWF.Actions.get("x_cms_assemble_control");
  53. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  54. if( preview.form && preview.form.designer && preview.form.designer.application && preview.form.designer.application.id ){
  55. data.document.appId = preview.form.designer.application.id;
  56. }
  57. if( preview.form && preview.form.json && preview.form.json.mode && preview.form.json.mode === "Mobile" ){
  58. layout.mobile = true;
  59. }
  60. layout.appForm.businessData = {
  61. "data": data.data,
  62. "document": data.document,
  63. "attachmentList": data.attachmentList,
  64. "control": data.control,
  65. "status": {
  66. //"readonly": (this.options.readonly) ? true : false
  67. "readonly": false
  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>