Selaa lähdekoodia

视图自定义样式

unknown 5 vuotta sitten
vanhempi
commit
e0181b750c

+ 0 - 1
o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss

@@ -368,7 +368,6 @@
         "opacity": 1,
         "width": "auto",
         "margin": "3px 3px",
-        "padding" : "5px",
         "background-color": "#FFF",
         "cursor": "pointer"
     },

+ 76 - 26
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_default.json

@@ -1,38 +1,88 @@
 {
-  "name": "传统样式",
-  "table": {
-    "containerStyles" : {
-
-    },
-    "tableStyles": {
-      "background-color": "#FFF",
-      "border": "1px solid #ddd"
-    },
-    "titleTdStyles":{
-      "background-color": "#eee",
-      "color": "#333",
+  "name": "默认样式",
+  "view": {
+    "container" : {
+      "height" : "100%",
+      "overflow" : "auto",
+      "font-size": "14px"
+    },
+    "table": {
+      "margin-bottom": "20px",
+      "width": "100%"
+    },
+    "titleTr":{  //viewTitleTrNode   viewTitleLineNode
+      "line-height": "40px",
+      "height": "40px",
+      "color": "#666666",
+      "background-color": "#EEE"
+    },
+    "titleTd":{ //viewTitleColumnNode  viewTitleCellNode
+      "font-weight": "bold",
+      "padding": "0px 10px",
+      "border-bottom": "1px solid #CCC"
+    },
+    "contentTr" : {
+      "background": "#ffffff"
+    },
+    "contentSelectedTr" : {
+      "background": "#ecf5ff"
+    },
+    "contentTd": {
+      "height": "30px",
+      "line-height": "30px",
+      "padding": "5px 5px",
+      "border-bottom": "1px solid #CCC"
+    },
+    "contentGroupTd": {
+      "padding": "5px 5px",
+      "border-bottom": "1px solid #CCC",
+      "font-weight": "bold",
+      "background-color": "#F6F6F6",
+      "cursor": "pointer"
+    },
+    "groupCollapseNode": {
       "height": "30px",
       "line-height": "30px",
-      "text-align": "right"
+      "padding-left" : "20px",
+      "background-image": "url(/x_component_process_ViewDesigner/$View/default/icon/right.png)",
+      "background-repeat" : "no-repeat",
+      "background-position": "left center",
+      "background-size": "20px 20px"
+    },
+    "groupExpandNode": {
+      "height": "30px",
+      "line-height": "30px",
+      "padding-left" : "20px",
+      "background-image": "url(/x_component_process_ViewDesigner/$View/default/icon/down.png)",
+      "background-repeat" : "no-repeat",
+      "background-position": "left center",
+      "background-size": "20px 20px"
+    },
+    "checkboxNode" : {
+      "background-image": "url(/x_component_query_Query/$Viewer/default/icon/checkbox.png)",
+      "background-repeat" : "no-repeat",
+      "background-position": "center center"
     },
-    "contentTdStyles": {
-      "background-color": "#FFFFFF",
-      "color": "#333"
+    "checkedCheckboxNode" : {
+      "background-image": "url(/x_component_query_Query/$Viewer/default/icon/checkbox_checked.png)",
+      "background-repeat" : "no-repeat",
+      "background-position": "center center"
     },
-    "contentTdOverStyles": {
-      "background-color": "#FFFFFF",
-      "color": "#535861"
+    "radioNode" : {
+      "background-image": "url(/x_component_query_Query/$Viewer/default/icon/radiobox.png)",
+      "background-repeat" : "no-repeat",
+      "background-position": "center center"
     },
-    "contentTdSelectedStyles": {
-      "background-color": "#FFFFFF",
-      "color": "#535861"
+    "checkedRadioNode" : {
+      "background-image": "url(/x_component_query_Query/$Viewer/default/icon/radiobox_checked.png)",
+      "background-repeat" : "no-repeat",
+      "background-position": "center center"
     },
-    "properties": {
+    "tableProperties": {
       "width": "100%",
       "border": "0",
-      "cellpadding": "3",
-      "cellspacing": "2",
-      "align": "center"
+      "cellpadding": "0",
+      "cellspacing": "0"
     }
   },
   "actionbar": {

+ 1 - 1
o2web/source/x_component_query_ViewDesigner/$View/view.html

@@ -686,7 +686,7 @@
 <!--    </div>-->
 
     <div title="样式"  class="MWFTab">
-        <div class="MWFViewStylesArea" name="viewStyles"></div>
+        <div class="MWFViewStylesArea" name="data.viewStyles"></div>
     </div>
 
     <div title="事件"  class="MWFTab">

+ 6 - 1
o2web/source/x_component_query_ViewDesigner/Property.js

@@ -716,7 +716,12 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
         var viewAreas = this.propertyContent.getElements(".MWFViewStylesArea");
         viewAreas.each(function(node){
             var name = node.get("name");
-            var viewStyles = this.data[name] || {};
+
+            var d = this.data;
+            Array.each( name.split("."), function(n){
+                if(d)d = d[n];
+            })
+            var viewStyles = d || {};
             MWF.require("MWF.widget.Maplist", function(){
                 var maps = [];
                 Object.each(viewStyles, function(v, k){

+ 11 - 4
o2web/source/x_component_query_ViewDesigner/View.js

@@ -676,8 +676,8 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
 
                     this.json.data.styleConfig = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType] : null;
 
-                    if (oldTemplateStyles["table"]) this.clearTemplateStyles(oldTemplateStyles["table"]);
-                    if (this.templateStyles["table"]) this.setTemplateStyles(this.templateStyles["table"]);
+                    if (oldTemplateStyles["view"]) this.clearTemplateStyles(oldTemplateStyles["view"]);
+                    if (this.templateStyles["view"]) this.setTemplateStyles(this.templateStyles["view"]);
 
                     this.setAllStyles();
 
@@ -822,10 +822,17 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
             this.loadTemplateStyles( this.stylesList[this.json.data.viewStyleType].file, this.stylesList[this.json.data.viewStyleType].extendFile,
                 function( templateStyles ){
                     this.templateStyles = templateStyles;
+
+                    debugger;
+
+                    if(!this.json.data.viewStyles && this.templateStyles["view"]){
+                        this.json.data.viewStyles = Object.clone(this.templateStyles["view"]);
+                    }
+
                     // this.loadDomModules();
 
-                    if (this.json.data.viewStyleType && this.templateStyles && this.templateStyles["table"]){
-                        this.setTemplateStyles(this.templateStyles["table"]);
+                    if (this.json.data.viewStyleType && this.templateStyles && this.templateStyles["view"]){
+                        this.setTemplateStyles(this.templateStyles["view"]);
                     }
 
                     this.setCustomStyles();