Ver Fonte

Merge branch 'feature/Org.sort_identity' into 'wrdp'

Merge of feature/Org.sort_identity 组织增加了按拼音排序 to wrdp

See merge request o2oa/o2oa!2163
蔡祥熠 há 5 anos atrás
pai
commit
f546fd41cc

+ 16 - 0
o2web/source/x_component_Org/$List/default/css.wcss

@@ -105,4 +105,20 @@
         "text-align": "left",
         "color": "#333333"
     },
+    "sortActionNode": {
+        "background": "url(../x_component_Org/$List/default/icon/order.png) 3px center no-repeat",
+        "float": "right",
+        "cursor": "pointer",
+        "margin-top": "0px",
+        "margin-left": "5px",
+        "padding": "3px 5px",
+        "padding-left": "22px",
+        "font-size": "12px",
+        "font-weight": "normal",
+        "border": "1px solid #666",
+        "background-color": "#FFF",
+        "line-height": "normal",
+        "color":"#333",
+        "border-radius":"3px"
+    }
 }

BIN
o2web/source/x_component_Org/$List/default/icon/order.png


+ 1 - 0
o2web/source/x_component_Org/List.js

@@ -73,6 +73,7 @@ MWF.xApplication.Org.List = new Class({
             this.deleteAction.addEvent("click", function(e){
                 this.deleteItem(e);
             }.bind(this));
+            this.fireEvent("postLoadAction")
         }
     },
     addItem: function(){

+ 28 - 1
o2web/source/x_component_Org/UnitExplorer.js

@@ -785,7 +785,14 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({
                     var count = this.identityCountNode.get("text").toInt()-delCount;
                     this.identityCountNode.set("text", count);
                 }
-            }.bind(this)
+            }.bind(this),
+            "onPostLoadAction": function () {
+                debugger;
+                this.sortAction = new Element("div", {"styles": this.css.sortActionNode, "text": _self.explorer.app.lp.sortByPinYin}).inject(this.actionNode);
+                this.sortAction.addEvent("click", function (e) {
+                    _self.sortByPinYin(e)
+                })
+            }
         });
         this.identityMemberList.addItem = this.addPersonMember.bind(this);
         this.identityMemberList.load([
@@ -801,6 +808,26 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({
             var item = this.identityMemberList.push(id);
         }.bind(this));
     },
+    sortByPinYin : function(e){
+        var _self = this;
+        this.explorer.app.confirm("infor", e, this.explorer.app.lp.sortByPinYin, {"html": this.explorer.app.lp.sortByPinYinConfirmContent}, 300, 180, function(){
+            debugger;
+            var list = _self.data.woSubDirectIdentityList;
+            list.sort( function(a, b){
+               return a.name.localeCompare(b.name);
+            });
+            for( var i=0; i<list.length; i++ ){
+                _self.explorer.actions.orderIdentity(list[i].id, "(0)", function(){}, null, false);
+            }
+            _self.identityMemberList.clear();
+            list.each(function(id){
+                var item = _self.identityMemberList.push(id);
+            }.bind(this));
+            this.close();
+        }, function(){
+            this.close();
+        });
+    },
     startOrder: function(item, td, e){
         var tr = td.getParent("tr");
         var table = tr.getParent("table");

+ 2 - 0
o2web/source/x_component_Org/lp/zh-cn.js

@@ -22,6 +22,8 @@ MWF.xApplication.Org.LP = {
     "process" : "流程",
     "yes": "是",
     "no": "否",
+    "sortByPinYin" : "按拼音排序",
+    "sortByPinYinConfirmContent" : "该操作将使本组织内身份按照拼音排序,确定操作?",
 
     "search": "搜索",
     "searchText": "请输入关键字",