cmspreview.html 4.0 KB
Newer Older
NoSubject's avatar
NoSubject 已提交
1
<!DOCTYPE html>
R
roo00 已提交
2
<html lang="zh-CN">
NoSubject's avatar
NoSubject 已提交
3 4
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
NoSubject's avatar
NoSubject 已提交
5 6 7
    <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
    <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
    <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
R
roo00 已提交
8
    <script src="../o2_core/o2.min.js"></script>
NoSubject's avatar
NoSubject 已提交
9
    <script src="../o2_lib/Decimal.js"></script>
10
    <script src="js/base.min.js"></script>
NoSubject's avatar
NoSubject 已提交
11 12 13 14 15

    <title>FORM PREVIEW</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <script>
16 17
        layout.addReady(function(){
            (function(layout){
R
roo00 已提交
18 19 20 21 22
                MWF.getJSON("res/config/config.json", function(config){
                    layout.config = config;
                    if (layout.config.app_protocol=="auto"){
                        layout.config.app_protocol = window.location.protocol;
                    }
23
                    //MWF.defaultPath = "../x_desktop"+MWF.defaultPath;
R
roo00 已提交
24 25 26 27 28 29 30 31
                    MWF.loadLP(MWF.language);
                    MWF.require("MWF.xDesktop.Layout", function(){
                        //MWF.require("MWF.xDesktop.Authentication", null, false);
                        (function(){
                            layout.load = function(){
                                //        if (this.isAuthentication()){
                                var preview = window.frameElement.retrieve("preview");
                                layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
NoSubject's avatar
NoSubject 已提交
32

R
roo00 已提交
33 34
                                MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
                                    layout.appForm = new MWF.CMSForm($("layout"), preview.data);
35
                                    layout.appForm.formDataText = JSON.stringify(preview.data);
R
roo00 已提交
36 37 38
                                    layout.appForm.app = {
                                        "options" : {
                                            "name" : "CMSDocument"
NoSubject's avatar
NoSubject 已提交
39
                                        },
R
roo00 已提交
40
                                        "content": document.body,
41 42
                                        "addEvent" : function(){},
                                        "fireEvent": function(){}
NoSubject's avatar
NoSubject 已提交
43
                                    };
44
                                    layout.appForm.documentAction = MWF.Actions.get("x_cms_assemble_control");
R
roo00 已提交
45
                                    MWF.getJSON("res/preview/cmsdoc.json", function(data){
U
unknown 已提交
46 47 48
                                        if( preview.form && preview.form.designer && preview.form.designer.application && preview.form.designer.application.id ){
                                            data.document.appId = preview.form.designer.application.id;
                                        }
R
roo00 已提交
49 50 51 52
                                        layout.appForm.businessData = {
                                            "data": data.data,
                                            "document": data.document,
                                            "attachmentList": data.attachmentList,
53
                                            "control": data.control,
R
roo00 已提交
54 55
                                            "status": {
                                                //"readonly": (this.options.readonly) ? true : false
56 57
                                                "readonly": false
                                            }
R
roo00 已提交
58 59 60
                                        };
                                        layout.appForm.load();
                                    });
NoSubject's avatar
NoSubject 已提交
61
                                });
R
roo00 已提交
62 63
                                //        }
                            };
NoSubject's avatar
NoSubject 已提交
64

65
                            layout.load();
R
roo00 已提交
66
                        })();
NoSubject's avatar
NoSubject 已提交
67

R
roo00 已提交
68 69
                    });
                }.bind(this));
70
            })(layout);
NoSubject's avatar
NoSubject 已提交
71 72 73 74
        });
    </script>
</head>
<body style="overflow: auto">
75
<div id="layout" style="overflow: auto">
NoSubject's avatar
NoSubject 已提交
76 77 78 79 80 81 82
    <div id="layout_top">

    </div>
    <div id="layout_form">
    </div>
</div>
</body>
R
roo00 已提交
83
</html>