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

修复群组有选项当显示无待选项字样的问题

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

+ 84 - 0
o2web/source/x_component_Org/PersonExplorer.js

@@ -137,6 +137,9 @@ MWF.xApplication.Org.PersonExplorer.PersonContent = new Class({
         this.identityContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
         this.identityPage = this.propertyTab.addTab(this.identityContentNode, this.explorer.app.lp.personIdentityText);
 
+        this.roleContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
+        this.rolePage = this.propertyTab.addTab(this.roleContentNode, this.explorer.app.lp.personRoleText);
+
         // this.managerContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
         // this.managerPage = this.propertyTab.addTab(this.managerContentNode, this.explorer.app.lp.controllerListText);
     },
@@ -144,6 +147,7 @@ MWF.xApplication.Org.PersonExplorer.PersonContent = new Class({
         this._listBaseInfor();
         this._listAttribute();
         this._listIdentity();
+        this._listRole();
         this.loadListCount();
 
         //
@@ -421,6 +425,86 @@ MWF.xApplication.Org.PersonExplorer.PersonContent = new Class({
                 }.bind(this), null, this.data.id);
             }.bind(this));
         }
+    },
+    _listRole: function(){
+        var _self = this;
+        this.roleList = new MWF.xApplication.Org.List(this.roleContentNode, this, {
+            "action": false,
+            "canEdit": false,
+            "saveAction": "saveIdentity",
+            "data": {
+                "person": this.data.id,
+                "name": "",
+                "attributeList": []
+            },
+            "attr": ["name", {
+                "get": function(){ return ""; },
+                "events": {
+                    "init": function(){
+                        var contentNode = this.td;
+                        new MWF.widget.O2Unit(this.data.woUnit, contentNode, {"style": "xform"});
+                    }
+                }
+            }, {
+                "get": function(){ return this.distinguishedName; },
+                "set": function(value){ this.distinguishedName = value; }
+            }, {
+                "get": function(){ return ""; },
+                "events": {
+                    "init": function(){
+                        var contentNode = this.td;
+                        if (this.data.woUnitDutyList){
+                            this.data.woUnitDutyList.each(function(duty){
+                                new MWF.widget.O2Duty(duty, contentNode, {"style": "xform"});
+                            }.bind(this));
+                        }
+                    }
+                }
+            }, {
+                "getHtml": function(){
+                    if (this.major){
+                        return "<div style='width:24px; height:24px; background:url(../x_component_Org/$Explorer/"+
+                            _self.explorer.app.options.style+"/icon/mainid.png) center center no-repeat'></div>";
+                    }else{
+                        return "<div title='"+_self.explorer.app.lp.setIdentityMain+"' style='width:24px; height:24px; cursor: pointer; background:url(../x_component_Org/$Explorer/"+
+                            _self.explorer.app.options.style+"/icon/select.png) center center no-repeat'></div>";
+                    }
+                },
+                "events": {
+                    "click": function(){
+                        if (!this.data.major){
+                            if (_self.data.control.allowEdit){_self.setMainIdentity(this.data, this.td, this.item);}
+                        }
+                    }
+                }
+            },{
+                "getHtml": function(){
+                    if (_self.data.control.allowEdit){
+                        return "<div style='width:24px; height:24px; cursor: pointer; background:url(../x_component_Org/$Explorer/"+
+                            _self.explorer.app.options.style+"/icon/edit.png) center center no-repeat'></div>";
+                    }
+                    return "";
+                },
+                "events": {
+                    "click": function(){
+                        debugger;
+                        if (_self.data.control.allowEdit){_self.editIdentity(this.data, this.td, this.item);}
+                    }
+                }
+            }]
+        });
+        this.identityList.load([
+            {"style": "width: 12%", "text": this.explorer.app.lp.IdentityName},
+            {"style": "width: 12%", "text": this.explorer.app.lp.IdentityInUnit},
+            {"style": "width: 44%", "text": this.explorer.app.lp.personUnique},
+            {"style": "width: 20%", "text": this.explorer.app.lp.IdentityDuty},
+            {"style": "width: 10%", "text": this.explorer.app.lp.IdentityMain},
+            {"style": "width: 30px", "text": ""}
+        ]);
+
+        this.data.woIdentityList.each(function(item){
+            this.identityList.push(item);
+        }.bind(this));
     }
 });
 MWF.xApplication.Org.PersonExplorer.PersonContent.TitleInfor = new Class({

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

@@ -220,6 +220,7 @@ MWF.xApplication.Org.LP = {
     "personAttributeText": "个人属性",
     "personIdentityText": "个人身份",
     "controllerListText": "管理者",
+    "personRoleText" : "个人角色",
 
     "IdentityName": "身份名称",
     "IdentityInUnit": "所在组织",

+ 1 - 1
o2web/source/x_component_Selector/Person.js

@@ -1362,7 +1362,7 @@ MWF.xApplication.Selector.Person = new Class({
         }
     },
     afterLoadSelectItem : function(){
-        if( this.subItems.length === 0 && this.subCategorys.length === 0  ){
+        if( this.subItems.length === 0 && this.subCategorys.length === 0 && this.items.length === 0 ){
            this.noSelectableItemTextDiv = new Element("div", {
                text : MWF.SelectorLP.noSelectableItemText,
                styles : this.css.noSelectableItemText