提交 a5b1bfd2 编写于 作者: U unknown

允许人员选择器人员选项进行平铺

上级 a6239adf
......@@ -9,7 +9,8 @@ MWF.xApplication.Selector.Group = new Class({
"roles": [],
"values": [],
"names": [],
"include" : []
"include" : [],
"selectType" : "group"
},
checkLoadSelectItems: function(){
if( this.options.include && this.options.include.length ){
......
......@@ -16,7 +16,8 @@ MWF.xApplication.Selector.Identity = new Class({
"exclude" : [], //排除的可选项
"resultType" : "", //可以设置成个人,那么结果返回个人
"expandSubEnable" : true, //是否允许展开下一层,
"selectAllEnable" : true //分类是否允许全选下一层
"selectAllEnable" : true, //分类是否允许全选下一层
"selectType" : "identity"
},
loadSelectItems: function(addToNext){
debugger;
......
......@@ -16,7 +16,8 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
"resultType" : "", //可以设置成个人,那么结果返回个人
"expandSubEnable": true,
"selectAllEnable" : true, //分类是否允许全选下一层
"exclude" : []
"exclude" : [],
"selectType" : "identity"
},
loadSelectItems: function(addToNext){
......
......@@ -17,7 +17,8 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
"expandSubEnable": true,
"selectAllEnable" : true, //分类是否允许全选下一层
"exclude" : [],
"dutyUnitLevelBy" : "duty" //组织层级是按身份所在群组还是职务
"dutyUnitLevelBy" : "duty", //组织层级是按身份所在群组还是职务,
"selectType" : "identity"
},
loadSelectItems: function(addToNext){
//根据组织分类展现职务
......
......@@ -33,9 +33,11 @@ MWF.xApplication.Selector.Person = new Class({
"injectToBody" : false, //当传入HTML URL的时候是否插入到document.body, false的时候插入到this.container
"selectSingleItem" : false, //当只有一个候选项的时候,是否默认选中
"flatCategory" : false, //扁平化展现分类
"flatCategory" : false, //扁平化展现分类,
"selectType" : "person",
"itemHeight" : 29,
"identityItemWidth" : 0, //选项宽度,如果不为0,设置为float:left,
"showEmptyText" : true
},
......@@ -444,6 +446,9 @@ MWF.xApplication.Selector.Person = new Class({
this.cancelActionNode.addEvent("click", function(){this.fireEvent("cancel"); this.close();}.bind(this));
},
loadContent: function( contentNode, isHTML ){
this.fireEvent("queryLoadContent",[this]);
if( contentNode )this.contentNode = contentNode;
if( this.options.contentUrl || isHTML ){
if (this.options.count.toInt()!==1) this.loadSelectedNodeHTML();
......@@ -1765,8 +1770,12 @@ MWF.xApplication.Selector.Person.Item = new Class({
this.levelNode = new Element("div", {
"styles": this.selector.css.selectorItemLevelNode
}).inject(this.node);
var indent = this.selector.options.level1Indent + (this.level-1)*this.selector.options.indent;
this.levelNode.setStyle("width", ""+indent+"px");
if( this.selector.options.selectType !== "identity" || this.selector.options.identityItemWidth === 0 ) {
var indent = this.selector.options.level1Indent + (this.level - 1) * this.selector.options.indent;
this.levelNode.setStyle("width", "" + indent + "px");
}
this.iconNode = new Element("div", {
"styles": this.selector.css.selectorItemIconNode
......@@ -1789,6 +1798,13 @@ MWF.xApplication.Selector.Person.Item = new Class({
var m = this.textNode.getStyle("margin-left").toFloat()+indent;
this.textNode.setStyle("margin-left", ""+m+"px");
if( this.selector.options.identityItemWidth && this.selector.options.selectType === "identity"){
this.node.setStyles({
"float" : "left",
"min-width" : this.selector.options.identityItemWidth + "px"
})
}
if(this.postLoad)this.postLoad();
this.loadSubItem();
......@@ -2324,8 +2340,13 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
this.levelNode = new Element("div", {
"styles": this.selector.css.selectorItemLevelNode
}).inject(this.node);
var indent = this.selector.options.level1Indent + (this.level-1)*this.selector.options.indent;
this.levelNode.setStyle("width", ""+indent+"px");
if(this.selector.options.selectType !== "identity" || this.selector.options.identityItemWidth === 0 ){
var indent = this.selector.options.level1Indent + (this.level - 1) * this.selector.options.indent;
this.levelNode.setStyle("width", "" + indent + "px");
}else{
this.node.setStyle("clear","both");
}
this.iconNode = new Element("div", {
"styles": this.selector.css.selectorItemCategoryIconNode || this.selector.css.selectorItemIconNode
......@@ -2379,7 +2400,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
var m = this.textNode.getStyle("margin-left").toFloat()+indent;
this.textNode.setStyle("margin-left", ""+m+"px");
this.children = new Element("div", {
this.children = new Element("div.children", {
"styles": this.selector.css.selectorItemCategoryChildrenNode
}).inject(this.node, "after");
if (!this.selector.options.expand) this.children.setStyle("display", "none");
......@@ -2396,6 +2417,14 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
this.children.setStyle("height", ""+this.childrenHeight+"px");
}
if(this.selector.options.identityItemWidth && this.selector.options.selectType === "identity"){
var indent = this.level === 0 ? this.selector.options.level1Indent : this.selector.options.indent;
this.children.setStyles({
"padding-left": "" + indent + "px",
"overflow" : "hidden"
});
}
if ( !this._hasChild()){
this.actionNode.setStyle("background", "transparent");
this.textNode.setStyle("color", "#777");
......
......@@ -8,7 +8,8 @@ MWF.xApplication.Selector.Role = new Class({
"groups": [],
"roles": [],
"values": [],
"names": []
"names": [],
"selectType" : "role"
},
_listItemByKey: function(callback, failure, key){
......
......@@ -13,7 +13,8 @@ MWF.xApplication.Selector.Unit = new Class({
"expand": true,
"exclude" : [],
"expandSubEnable" : true, //是否允许展开下一层
"selectAllEnable" : true //分类是否允许全选下一层
"selectAllEnable" : true, //分类是否允许全选下一层
"selectType" : "unit"
},
loadSelectItems: function(addToNext){
......
......@@ -12,6 +12,7 @@ MWF.xApplication.Selector.UnitWithType = new Class({
"zIndex": 1000,
"expand": true,
"exclude" : [],
"selectType" : "unit",
"expandSubEnable" : true, //是否允许展开下一层
"selectAllEnable" : true //分类是否允许全选下一层
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册