소스 검색

隐藏流程高级属性

(cherry picked from commit 8c3132e20ac92d71337289a2ef3569e6e1b30f71)
huqi 5 년 전
부모
커밋
392775e282
2개의 변경된 파일31개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      o2web/source/x_component_process_ProcessDesigner/Process.js
  2. 21 0
      o2web/source/x_component_process_ProcessDesigner/Property.js

+ 10 - 0
o2web/source/x_component_process_ProcessDesigner/Process.js

@@ -1687,6 +1687,16 @@ MWF.xApplication.process.ProcessDesigner.Process.Panel = new Class({
 			this.objectTabPage = this.propertyListTab.addTab(this.jsonObjectNode, "JSON", false);
 			this.stringTabPage = this.propertyListTab.addTab(this.jsonStringNode, "Text", false);
 
+			var div = new Element("div", {"styles": {
+				"float": "right",
+				"margin-right": "10px"
+			}, "text": MWF.APPPD.LP.showAdvanced}).inject(this.propertyListTab.tabNodeContainer)
+			this.showAdvanced = new Element("input", {
+				"type": "checkbox",
+				"events": {
+					"mousedown": function(e){ e.stopPropagation(); }
+				}
+			}).inject(div, "top");
 
 			// this.propertyListTab.tabNodeContainerArea
 			// showAdvanced

+ 21 - 0
o2web/source/x_component_process_ProcessDesigner/Property.js

@@ -26,14 +26,28 @@ MWF.xApplication.process.ProcessDesigner.Property = new Class({
             if (callback) callback();
         }
     },
+    //隐藏高级属性
+    hideAdvanced: function(){
+	    if (this.process.panel.showAdvanced && !this.process.panel.showAdvanced.checked){
+            var advs = this.propertyContent.querySelectorAll("*[data-o2-advanced=\"yes\"]");
+            if (advs && advs.length){
+                for (var i=0; i<advs.length; i++){
+                    advs[i].hide();
+                }
+            }
+        }
+    },
+
 	show: function(){
         if (!this.process.options.isView){
             if (!this.propertyContent){
                 this.getHtmlString(function(){
+                    debugger;
                     this.propertyContent = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.process.propertyListNode);
                     this.process.panel.propertyTabPage.showTabIm();
                     this.JsonTemplate = new MWF.widget.JsonTemplate(this.data, this.htmlString);
                     this.propertyContent.set("html", this.JsonTemplate.load());
+
                     this.process.panel.data = this.data;
 
                     this.setEditNodeEvent();
@@ -53,6 +67,8 @@ MWF.xApplication.process.ProcessDesigner.Property = new Class({
                     this.loadIconSelect();
                     this.loadContextRoot();
                     this.loadProjection();
+
+                    this.hideAdvanced();
                 }.bind(this));
                 //this.loadDutySelector();
             }else{
@@ -91,6 +107,7 @@ MWF.xApplication.process.ProcessDesigner.Property = new Class({
 				"styles": this.process.css.propertyTabNode
 			}).inject(tmpNode, "before");
 
+			debugger;
 			MWF.require("MWF.widget.Tab", function(){
 				var tab = new MWF.widget.Tab(tabAreaNode, {"style": "moduleList"});
 				tab.load();
@@ -98,6 +115,10 @@ MWF.xApplication.process.ProcessDesigner.Property = new Class({
 				tabNodes.each(function(node){
 					var tabPage = tab.addTab(node, node.get("title"), false);
 					tabPages.push(tabPage);
+					if (node.hasAttribute("data-o2-advanced") && node.dataset["o2Advanced"]=="yes"){
+                        tabPage.tabNode.setAttribute("data-o2-advanced", "yes");
+                        tabPage.tabNode.hide();
+                    }
 				}.bind(this));
 				tabPages[0].showTab();
 			}.bind(this));