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

Merge branch 'fix/Query.no_data_infor' into 'develop'

Merge of fix/[数据中心]视图中增加设置项显示的无数据时的文本 to develop

See merge request o2oa/o2oa!474
蔡祥熠 5 лет назад
Родитель
Сommit
4be23fbcf7

+ 11 - 5
o2web/source/x_component_process_Xform/Form.js

@@ -1678,6 +1678,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
     },
 
     processWork: function () {
+        var _self = this;
         if (!this.businessData.work.startTime) {
             this.startDraftProcess();
         } else {
@@ -1717,15 +1718,18 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                     });
                     var s = dlg.setContentSize();
                     if (dlg.content.getStyle("overflow-y") === "auto" && dlg.content.getStyle("overflow-x") !== "auto") {
-                        dlg.node.setStyle("width", dlg.node.getStyle("width").toInt() + 20 + "px");
-                        dlg.content.setStyle("width", dlg.content.getStyle("width").toInt() + 20 + "px");
+                        var paddingRight = (dlg.content.getStyle("padding-right").toInt() || 0 );
+                        if( paddingRight < 20 ){
+                            dlg.node.setStyle("width", dlg.node.getStyle("width").toInt() + 20 + "px");
+                            dlg.content.setStyle("width", dlg.content.getStyle("width").toInt() + 20 + "px");
+                        }
                     }
                     if (!notRecenter) dlg.reCenter();
                 }
 
                 //var node = new Element("div", {"styles": this.css.rollbackAreaNode});
                 var processNode = new Element("div", { "styles": this.app.css.processNode_Area }).inject(this.node);
-                this.setProcessNode(processNode, "process", function () {
+                this.setProcessNode(processNode, "process", function ( processor ){
                     this.processDlg = o2.DL.open({
                         "title": this.app.lp.process,
                         "style": this.json.dialogStyle || "user",
@@ -1756,6 +1760,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                             }
                         ],
                         "onPostLoad": function () {
+                            processor.options.mediaNode = this.content;
                             setSize.call(this)
                         }
                     });
@@ -1866,14 +1871,15 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
             if (layout.mobile) {
                 innerNode = new Element("div").inject(processNode);
             }
+
             this.processor = new MWF.xApplication.process.Work.Processor(innerNode || processNode, this.businessData.task, {
                 "style": (layout.mobile) ? "mobile" : (style || "default"),
                 "opinion": op.opinion,
                 "tabletWidth": this.json.tabletWidth || 0,
                 "tabletHeight": this.json.tabletHeight || 0,
                 "onPostLoad": function () {
-                    if (postLoadFun) postLoadFun();
-                }.bind(this),
+                    if (postLoadFun) postLoadFun( this );
+                },
                 "onResize": function () {
                     if (resizeFun) resizeFun();
                 },

+ 6 - 0
o2web/source/x_component_query_Query/$Viewer/default/css.wcss

@@ -471,5 +471,11 @@
     "workAreaLeftNode": {
         "margin-right": "80px",
         "overflow": "hidden"
+    },
+    "noDataTextNode" : {
+        "height" : "50px",
+        "font-size" : "16px",
+        "margin" : "20px auto",
+        "text-align" : "center"
     }
 }

+ 11 - 0
o2web/source/x_component_query_Query/Viewer.js

@@ -368,12 +368,23 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
 
                     this._initPage();
                     if (this.bundleItems.length){
+                        if( this.noDataTextNode )this.noDataTextNode.destroy();
                         this.loadCurrentPageData( function () {
                             this.fireEvent("postLoad"); //用户配置的事件
                         }.bind(this));
                     }else{
                         //this._loadPageNode();
                         this.viewPageAreaNode.empty();
+                        if( this.viewJson.noDataText ){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.viewJson.viewStyles && this.viewJson.viewStyles["noDataTextNode"] ){
+                                noDataTextNodeStyle = this.viewJson.viewStyles["noDataTextNode"];
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.viewJson.noDataText
+                            }).inject( this.contentAreaNode );
+                        }
                         if (this.loadingAreaNode){
                             this.loadingAreaNode.destroy();
                             this.loadingAreaNode = null;

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

@@ -68,6 +68,12 @@
         "line-height": "20px",
         "margin-left": "20px"
     },
+    "noDataTextNode" : {
+        "height" : "50px",
+        "font-size" : "16px",
+        "margin" : "20px auto",
+        "text-align" : "center"
+    },
 
     "refreshNode": {
         "width": "29px",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json

@@ -76,6 +76,12 @@
       "background-repeat" : "no-repeat",
       "background-position": "center center"
     },
+    "noDataTextNode" : {
+      "height" : "50px",
+      "font-size" : "16px",
+      "margin" : "20px auto",
+      "text-align" : "center"
+    },
     "tableProperties": {
       "width": "100%",
       "border": "0",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-simple.json

@@ -76,6 +76,12 @@
       "background-repeat" : "no-repeat",
       "background-position": "center center"
     },
+    "noDataTextNode" : {
+      "height" : "50px",
+      "font-size" : "16px",
+      "margin" : "20px auto",
+      "text-align" : "center"
+    },
     "tableProperties": {
       "width": "100%",
       "border": "0",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_cmcc.json

@@ -76,6 +76,12 @@
       "background-repeat" : "no-repeat",
       "background-position": "center center"
     },
+    "noDataTextNode" : {
+      "height" : "50px",
+      "font-size" : "16px",
+      "margin" : "20px auto",
+      "text-align" : "center"
+    },
     "tableProperties": {
       "width": "100%",
       "border": "0",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_default.json

@@ -76,6 +76,12 @@
       "background-repeat" : "no-repeat",
       "background-position": "center center"
     },
+    "noDataTextNode" : {
+      "height" : "50px",
+      "font-size" : "16px",
+      "margin" : "20px auto",
+      "text-align" : "center"
+    },
     "tableProperties": {
       "width": "100%",
       "border": "0",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_official.json

@@ -76,6 +76,12 @@
       "background-repeat" : "no-repeat",
       "background-position": "center center"
     },
+    "noDataTextNode" : {
+      "height" : "50px",
+      "font-size" : "16px",
+      "margin" : "20px auto",
+      "text-align" : "center"
+    },
     "tableProperties": {
       "width": "100%",
       "border": "0",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_red-simple.json

@@ -76,6 +76,12 @@
       "background-repeat" : "no-repeat",
       "background-position": "center center"
     },
+    "noDataTextNode" : {
+      "height" : "50px",
+      "font-size" : "16px",
+      "margin" : "20px auto",
+      "text-align" : "center"
+    },
     "tableProperties": {
       "width": "100%",
       "border": "0",

+ 6 - 0
o2web/source/x_component_query_ViewDesigner/$View/view.html

@@ -67,6 +67,12 @@
                     <input class="editTableRadio" name="data.select" text{($.data.select==='multi')?'checked':''} type="radio" value="multi"/>多选
                 </td>
             </tr>
+            <tr>
+                <td class="editTableTitle">无数据显示:</td>
+                <td class="editTableValue">
+                    <input type="text" name="data.noDataText" value="text{$.data.noDataText}" class="editTableInput"/>
+                </td>
+            </tr>
             <!--<tr>-->
             <!--<td class="editTableTitle">最大行数:</td>-->
             <!--<td class="editTableValue"><input type="text" name="max" value="text{$.max}" class="editTableInput"/></td>-->

+ 1 - 0
o2web/source/x_component_query_ViewDesigner/$View/view.json

@@ -31,6 +31,7 @@
       "creatorUnitList": [],
       "creatorIdentityList": []
     },
+    "noDataText" : "未找到数据",
     "selectList": [],
     "filterList": [],
     "orderList": [],

+ 26 - 0
o2web/source/x_component_query_ViewDesigner/View.js

@@ -275,6 +275,19 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
                             }.bind(this));
                             this.setContentColumnWidth();
                             this.setContentHeight();
+                        }else if(this.json.data.noDataText){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.json.data.viewStyles ){
+                                if( this.json.data.viewStyles["noDataTextNode"] ){
+                                    noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
+                                }else{
+                                     this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
+                                }
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.json.data.noDataText
+                            }).inject( this.viewContentBodyNode );
                         }
 
                     }else{
@@ -310,6 +323,19 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
                             }.bind(this));
                             this.setContentColumnWidth();
                             this.setContentHeight();
+                        }else if(this.json.data.noDataText){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.json.data.viewStyles ){
+                                if( this.json.data.viewStyles["noDataTextNode"] ){
+                                    noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
+                                }else{
+                                    this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
+                                }
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.json.data.noDataText
+                            }).inject( this.viewContentBodyNode );
                         }
                     }
                 }.bind(this));