Просмотр исходного кода

增加表单事件提示,删除门户部件的事件

unknown 5 лет назад
Родитель
Сommit
98a3dd9add

+ 1 - 0
o2web/source/x_component_cms_FormDesigner/Module/Form/form.html

@@ -52,6 +52,7 @@
 
 	</div>
 	<div title="事件"  class="MWFTab">
+        <div style="padding: 5px;">注:当以子表单嵌入时,下列事件不会被执行</div>
 		<div class="MWFEventsArea" name="events"></div>
 	</div>
 	<!--<div title="HTML"  class="MWFTab">-->

+ 86 - 76
o2web/source/x_component_portal_WidgetDesigner/Main.js

@@ -1,16 +1,16 @@
 MWF.APPWD = MWF.xApplication.portal.WidgetDesigner;
 MWF.APPWD.options = {
-	"multitask": true,
-	"executable": false
+    "multitask": true,
+    "executable": false
 };
 
-MWF.xDesktop.requireApp("portal.PageDesigner", "lp."+MWF.language, null, false);
+MWF.xDesktop.requireApp("portal.PageDesigner", "lp." + MWF.language, null, false);
 MWF.xDesktop.requireApp("portal.PageDesigner", "", null, false);
 MWF.xApplication.portal.WidgetDesigner.Main = new Class({
-	Extends: MWF.xApplication.portal.PageDesigner.Main,
-	Implements: [Options, Events],
-	options: {
-		"style": "default",
+    Extends: MWF.xApplication.portal.PageDesigner.Main,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
         "template": "page.json",
         "templateId": "",
         "name": "portal.WidgetDesigner",
@@ -21,75 +21,85 @@ MWF.xApplication.portal.WidgetDesigner.Main = new Class({
         "actions": null,
         "category": null,
         "processData": null
-	},
-        //loadPage: function(){
-        //        this.getPageData(function(){
-        //                this.pcPage = new MWF.PCWidget(this, this.designNode);
-        //                this.pcPage.load(this.pageData);
-        //
-        //                this.page = this.pcPage;
-        //        }.bind(this));
-        //},
-        getPageTemplate : function(templateId, callback){
-                this.actions.getWidgetTemplate(templateId, function(page){
-                        if(callback)callback(page);
-                }.bind(this))
-        },
-        getPage : function(id, callback){
-                this.actions.getWidget(id, function(page){
-                        if(callback)callback(page);
-                }.bind(this))
-        },
-        setCategorySelect: function(categorySelect){
-                if (categorySelect){
-                        new Element("option", {"value": "$newCategory","text": this.lp.newCategory}).inject(categorySelect);
-                        this.actions.listWidgetTemplateCategory(function(json){
-                                json.data.each(function(category){
-                                        new Element("option", {"value": category.name,"text": category.name}).inject(categorySelect);
-                                }.bind(this));
-                        }.bind(this));
-                }
-        },
-        _savePage : function(pcData, mobileData, fieldList, success, failure ){
-                this.actions.saveWidget(pcData, mobileData, fieldList, function(responseJSON){
-                        success(responseJSON)
-                }.bind(this), function(xhr, text, error){
-                        failure(xhr, text, error)
-                }.bind(this));
-        },
-        addPageTemplate : function(pcData, mobileData, data, success, failure){
-                this.actions.addWidgetTemplate( pcData, mobileData, data, function(json){
-                        if(success)success(json);
-                }.bind(this), function(xhr, text, error){
-                        if(failure)failure(xhr, text, error);
-                }.bind(this))
-        },
-        loadNewPageData: function(callback){
-                var url = "../x_component_portal_PageDesigner/Module/Page/template/"+this.options.template;
-                MWF.getJSON(url, {
-                        "onSuccess": function(obj){
-                                this.pageData = obj.pcData;
-                                this.pageData.id="";
-                                this.pageData.isNewPage = true;
-                                this.pageData.json.name = MWF.APPWD.LP.newPage;
+    },
+    //loadPage: function(){
+    //        this.getPageData(function(){
+    //                this.pcPage = new MWF.PCWidget(this, this.designNode);
+    //                this.pcPage.load(this.pageData);
+    //
+    //                this.page = this.pcPage;
+    //        }.bind(this));
+    //},
+    getPageTemplate: function (templateId, callback) {
+        this.actions.getWidgetTemplate(templateId, function (page) {
+            if (callback) callback(page);
+        }.bind(this))
+    },
+    getPage: function (id, callback) {
+        this.actions.getWidget(id, function (page) {
+            if (callback) callback(page);
+        }.bind(this))
+    },
+    loadPage: function () {
+        this.getPageData(function () {
+            this.pcPage = new MWF.PCPage(this, this.designNode, {
+                "propertyPath": "../x_component_portal_WidgetDesigner/Module/Page/page.html"
+            });
+            this.pcPage.load(this.pageData);
 
-                                this.pageMobileData = obj.mobileData;
-                                this.pageMobileData.id="";
-                                this.pageMobileData.isNewPage = true;
-                                if (callback) callback();
-                        }.bind(this),
-                        "onerror": function(text){
-                                this.notice(text, "error");
-                        }.bind(this),
-                        "onRequestFailure": function(xhr){
-                                this.notice(xhr.responseText, "error");
-                        }.bind(this)
-                });
-        },
-        previewPage: function(){
-                this.savePage();
-                //this.page.preview();
-                var url = "../x_desktop/portal.html?id="+this.application.id+"&widget="+this.page.json.id;
-                window.open(o2.filterUrl(url));
+            this.page = this.pcPage;
+        }.bind(this));
+    },
+    setCategorySelect: function (categorySelect) {
+        if (categorySelect) {
+            new Element("option", {"value": "$newCategory", "text": this.lp.newCategory}).inject(categorySelect);
+            this.actions.listWidgetTemplateCategory(function (json) {
+                json.data.each(function (category) {
+                    new Element("option", {"value": category.name, "text": category.name}).inject(categorySelect);
+                }.bind(this));
+            }.bind(this));
         }
+    },
+    _savePage: function (pcData, mobileData, fieldList, success, failure) {
+        this.actions.saveWidget(pcData, mobileData, fieldList, function (responseJSON) {
+            success(responseJSON)
+        }.bind(this), function (xhr, text, error) {
+            failure(xhr, text, error)
+        }.bind(this));
+    },
+    addPageTemplate: function (pcData, mobileData, data, success, failure) {
+        this.actions.addWidgetTemplate(pcData, mobileData, data, function (json) {
+            if (success) success(json);
+        }.bind(this), function (xhr, text, error) {
+            if (failure) failure(xhr, text, error);
+        }.bind(this))
+    },
+    loadNewPageData: function (callback) {
+        var url = "../x_component_portal_PageDesigner/Module/Page/template/" + this.options.template;
+        MWF.getJSON(url, {
+            "onSuccess": function (obj) {
+                this.pageData = obj.pcData;
+                this.pageData.id = "";
+                this.pageData.isNewPage = true;
+                this.pageData.json.name = MWF.APPWD.LP.newPage;
+
+                this.pageMobileData = obj.mobileData;
+                this.pageMobileData.id = "";
+                this.pageMobileData.isNewPage = true;
+                if (callback) callback();
+            }.bind(this),
+            "onerror": function (text) {
+                this.notice(text, "error");
+            }.bind(this),
+            "onRequestFailure": function (xhr) {
+                this.notice(xhr.responseText, "error");
+            }.bind(this)
+        });
+    },
+    previewPage: function () {
+        this.savePage();
+        //this.page.preview();
+        var url = "../x_desktop/portal.html?id=" + this.application.id + "&widget=" + this.page.json.id;
+        window.open(o2.filterUrl(url));
+    }
 });

+ 49 - 0
o2web/source/x_component_portal_WidgetDesigner/Module/Page/page.html

@@ -0,0 +1,49 @@
+<div style="background-color: #FFF; overflow: hidden">
+	<div title="基本" class="MWFTab">
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableTitle">标识:</td>
+                <td class="editTableValue">text{$.id}</td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">名称:</td>
+                <td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">描述:</td>
+                <td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
+            </tr>
+            <!--<tr>-->
+                <!--<td class="editTableTitle">标题字段</td>-->
+                <!--<td class="editTableValue">-->
+                    <!--<select class="" name="titleField"></select>-->
+                <!--</td>-->
+            <!--</tr>-->
+            <tr>
+                <td class="editTableTitle">样式:</td>
+                <td class="editTableValue">
+                    <select class="MWFFormStyle" name="formStyleType"></select>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">图标:</td>
+                <td class="editTableValue"><div class="MWFIcon" name="formIcon"></div></td>
+            </tr>
+        </table>
+		
+		<!--<div class="MWFArraylist" name="cssLinks" title="CSS引用"></div>-->
+		<!--<div class="MWFArraylist" name="scriptSrc" title="JS引用"></div>-->
+		
+		<div class="MWFMaplist" name="styles" title="样式"></div>
+		<div class="MWFMaplist" name="properties" title="属性"></div>
+        <div class="MWFCssArea" name="css" title="CSS"></div>
+        <div class="MWFScriptArea" name="jsheader" title="JS Header"></div>
+
+	</div>
+	<div title="HTML"  class="MWFTab">
+		<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
+	</div>
+	<div title="JSON"  class="MWFTab">
+		<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
+	</div>
+</div>

+ 1 - 0
o2web/source/x_component_process_FormDesigner/Module/Form/form.html

@@ -207,6 +207,7 @@
         <div class="MWFActionArea" name="tools"></div>
     </div>
 	<div title="事件"  class="MWFTab">
+        <div style="padding: 5px;">注:当以子表单嵌入时,下列事件不会被执行</div>
 		<div class="MWFEventsArea" name="events"></div>
 	</div>
     <div title="HTML"  class="MWFTab">