Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
9bbdc0fb
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9bbdc0fb
编写于
8月 21, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加人员选择嵌套全选的功能
上级
79599b52
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
147 addition
and
65 deletion
+147
-65
o2web/source/x_component_Selector/Group.js
o2web/source/x_component_Selector/Group.js
+2
-2
o2web/source/x_component_Selector/Identity.js
o2web/source/x_component_Selector/Identity.js
+39
-2
o2web/source/x_component_Selector/IdentityWidthDuty.js
o2web/source/x_component_Selector/IdentityWidthDuty.js
+2
-2
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js
...e/x_component_Selector/IdentityWidthDutyCategoryByUnit.js
+2
-2
o2web/source/x_component_Selector/Person.js
o2web/source/x_component_Selector/Person.js
+52
-28
o2web/source/x_component_Selector/Role.js
o2web/source/x_component_Selector/Role.js
+2
-2
o2web/source/x_component_Selector/Unit.js
o2web/source/x_component_Selector/Unit.js
+46
-25
o2web/source/x_component_Selector/UnitWithType.js
o2web/source/x_component_Selector/UnitWithType.js
+2
-2
未找到文件。
o2web/source/x_component_Selector/Group.js
浏览文件 @
9bbdc0fb
...
@@ -55,8 +55,8 @@ MWF.xApplication.Selector.Group = new Class({
...
@@ -55,8 +55,8 @@ MWF.xApplication.Selector.Group = new Class({
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
Group
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
Group
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
if
(
this
.
options
.
groups
.
length
||
this
.
options
.
roles
.
length
)
key
=
this
.
getLikeKey
(
key
);
if
(
this
.
options
.
groups
.
length
||
this
.
options
.
roles
.
length
)
key
=
this
.
getLikeKey
(
key
);
...
...
o2web/source/x_component_Selector/Identity.js
浏览文件 @
9bbdc0fb
...
@@ -207,8 +207,8 @@ MWF.xApplication.Selector.Identity = new Class({
...
@@ -207,8 +207,8 @@ MWF.xApplication.Selector.Identity = new Class({
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
Identity
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
Identity
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
this
.
_listItem
(
"
pinyin
"
,
callback
,
failure
,
key
);
this
.
_listItem
(
"
pinyin
"
,
callback
,
failure
,
key
);
...
@@ -457,6 +457,43 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
...
@@ -457,6 +457,43 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
var
style
=
this
.
selector
.
options
.
style
;
var
style
=
this
.
selector
.
options
.
style
;
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
../x_component_Selector/$Selector/
"
+
style
+
"
/icon/companyicon.png)
"
);
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
../x_component_Selector/$Selector/
"
+
style
+
"
/icon/companyicon.png)
"
);
},
},
_beforeSelectAll
:
function
(
_selectAllFun
){
if
(
this
.
selector
.
options
.
ignorePerson
){
_selectAllFun
();
return
;
}
//批量获取个人
var
object
=
{};
if
(
this
.
selector
.
options
.
resultType
===
"
person
"
){
this
.
subItems
.
each
(
function
(
item
){
var
isPerson
=
false
;
if
(
item
.
data
&&
item
.
data
.
distinguishedName
){
var
dn
=
item
.
data
.
distinguishedName
;
if
(
dn
.
substr
(
dn
.
length
-
1
,
1
).
toLowerCase
()
===
"
p
"
)
isPerson
=
true
;
}
if
(
!
isPerson
&&
!
item
.
data
.
woPerson
&&
item
.
data
.
person
){
object
[
item
.
data
.
person
]
=
item
;
}
}.
bind
(
this
))
}
else
{
this
.
subItems
.
each
(
function
(
item
)
{
if
(
!
item
.
data
.
woPerson
&&
item
.
data
.
person
){
object
[
item
.
data
.
person
]
=
item
;
}
}.
bind
(
this
))
}
var
keys
=
Object
.
keys
(
object
);
if
(
keys
.
length
>
0
){
o2
.
Actions
.
load
(
"
x_organization_assemble_express
"
).
PersonAction
.
listObject
({
"
identityList
"
:
keys
},
function
(
json
)
{
json
.
data
.
each
(
function
(
p
){
if
(
object
[
p
.
id
])
object
[
p
.
id
].
data
.
woPerson
=
p
;
}.
bind
(
this
));
_selectAllFun
();
})
}
else
{
_selectAllFun
();
}
},
clickItem
:
function
(
callback
){
clickItem
:
function
(
callback
){
if
(
this
.
_hasChild
()){
if
(
this
.
_hasChild
()){
var
firstLoaded
=
!
this
.
loaded
;
var
firstLoaded
=
!
this
.
loaded
;
...
...
o2web/source/x_component_Selector/IdentityWidthDuty.js
浏览文件 @
9bbdc0fb
...
@@ -122,8 +122,8 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
...
@@ -122,8 +122,8 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
IdentityWidthDuty
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
IdentityWidthDuty
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
if
(
this
.
options
.
units
.
length
)
key
=
{
"
key
"
:
key
,
"
unitList
"
:
this
.
options
.
units
};
if
(
this
.
options
.
units
.
length
)
key
=
{
"
key
"
:
key
,
"
unitList
"
:
this
.
options
.
units
};
...
...
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js
浏览文件 @
9bbdc0fb
...
@@ -321,8 +321,8 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
...
@@ -321,8 +321,8 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
// if (callback) callback.apply(this, [json]);
// if (callback) callback.apply(this, [json]);
//}.bind(this), failure, ((typeOf(id)==="string") ? id : id.distinguishedName), async);
//}.bind(this), failure, ((typeOf(id)==="string") ? id : id.distinguishedName), async);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
IdentityWidthDutyCategoryByUnit
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
IdentityWidthDutyCategoryByUnit
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
if
(
this
.
options
.
units
.
length
)
key
=
{
"
key
"
:
key
,
"
unitList
"
:
this
.
options
.
units
};
if
(
this
.
options
.
units
.
length
)
key
=
{
"
key
"
:
key
,
"
unitList
"
:
this
.
options
.
units
};
...
...
o2web/source/x_component_Selector/Person.js
浏览文件 @
9bbdc0fb
...
@@ -1332,8 +1332,8 @@ MWF.xApplication.Selector.Person = new Class({
...
@@ -1332,8 +1332,8 @@ MWF.xApplication.Selector.Person = new Class({
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
Person
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
Person
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
this
.
orgAction
.
listPersonByPinyin
(
function
(
json
){
this
.
orgAction
.
listPersonByPinyin
(
function
(
json
){
...
@@ -1862,7 +1862,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
...
@@ -1862,7 +1862,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
this
.
selector
.
fireEvent
(
"
unselectItem
"
,[
this
]);
this
.
selector
.
fireEvent
(
"
unselectItem
"
,[
this
]);
if
(
checkValid
)
this
.
selector
.
fireEvent
(
"
valid
"
,
[
this
.
selector
,
this
]);
if
(
checkValid
)
this
.
selector
.
fireEvent
(
"
valid
"
,
[
this
.
selector
,
this
]);
},
},
selected
:
function
(
checkValid
,
callback
){
selected
:
function
(
checkValid
,
callback
,
selectedNode
){
var
count
=
this
.
selector
.
options
.
maxCount
||
this
.
selector
.
options
.
count
;
var
count
=
this
.
selector
.
options
.
maxCount
||
this
.
selector
.
options
.
count
;
count
=
count
.
toInt
();
count
=
count
.
toInt
();
if
(
!
count
)
count
=
0
;
if
(
!
count
)
count
=
0
;
...
@@ -1882,7 +1882,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
...
@@ -1882,7 +1882,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemActionNode_single_selected
);
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemActionNode_single_selected
);
}
}
}
}
this
.
selectedItem
=
this
.
selector
.
_newItemSelected
(
this
.
data
,
this
.
selector
,
this
);
this
.
selectedItem
=
this
.
selector
.
_newItemSelected
(
this
.
data
,
this
.
selector
,
this
,
selectedNode
);
this
.
selectedItem
.
check
();
this
.
selectedItem
.
check
();
this
.
selector
.
selectedItems
.
push
(
this
.
selectedItem
);
this
.
selector
.
selectedItems
.
push
(
this
.
selectedItem
);
...
@@ -1980,10 +1980,10 @@ MWF.xApplication.Selector.Person.Item = new Class({
...
@@ -1980,10 +1980,10 @@ MWF.xApplication.Selector.Person.Item = new Class({
MWF
.
xApplication
.
Selector
.
Person
.
ItemSelected
=
new
Class
({
MWF
.
xApplication
.
Selector
.
Person
.
ItemSelected
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Person
.
Item
,
Extends
:
MWF
.
xApplication
.
Selector
.
Person
.
Item
,
initialize
:
function
(
data
,
selector
,
item
){
initialize
:
function
(
data
,
selector
,
item
,
selectedNode
){
this
.
data
=
data
;
this
.
data
=
data
;
this
.
selector
=
selector
;
this
.
selector
=
selector
;
this
.
container
=
this
.
selector
.
selectedNode
;
this
.
container
=
selectedNode
||
this
.
selector
.
selectedNode
;
this
.
isSelected
=
false
;
this
.
isSelected
=
false
;
this
.
clazz
=
"
ItemSelected
"
;
this
.
clazz
=
"
ItemSelected
"
;
this
.
items
=
[];
this
.
items
=
[];
...
@@ -2086,7 +2086,14 @@ MWF.xApplication.Selector.Person.ItemSelected = new Class({
...
@@ -2086,7 +2086,14 @@ MWF.xApplication.Selector.Person.ItemSelected = new Class({
}
}
},
},
destroy
:
function
(){
destroy
:
function
(){
if
(
this
.
node
)
this
.
node
.
destroy
();
if
(
this
.
node
){
// var parent = this.node.getParent(".categorySelectedNode");
// if( parent && !this.node.getPrevious() && !this.node.getNext() ){ //parent.getChildren().length <= 1
// parent.destroy();
// }else{
this
.
node
.
destroy
();
// }
}
delete
this
;
delete
this
;
}
}
});
});
...
@@ -2242,7 +2249,12 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
...
@@ -2242,7 +2249,12 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
this
.
selector
.
fireEvent
(
"
unselectCatgory
"
,[
this
]);
this
.
selector
.
fireEvent
(
"
unselectCatgory
"
,[
this
]);
}
else
{
}
else
{
// this.selectAll(ev);
// this.selectAll(ev);
this
.
selector
.
options
.
selectAllRange
===
"
all
"
?
this
.
selectAllNested
(
ev
,
true
)
:
this
.
selectAll
(
ev
,
true
);
if
(
this
.
selector
.
options
.
selectAllRange
===
"
all
"
){
var
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
this
.
selector
.
selectedNode
);
this
.
selectAllNested
(
ev
,
true
,
node
);
}
else
{
this
.
selectAll
(
ev
,
true
)
}
this
.
selector
.
fireEvent
(
"
selectCatgory
"
,[
this
]);
this
.
selector
.
fireEvent
(
"
selectCatgory
"
,[
this
]);
}
}
ev
.
stopPropagation
();
ev
.
stopPropagation
();
...
@@ -2339,21 +2351,24 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
...
@@ -2339,21 +2351,24 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
})
})
}
}
},
},
selectAllNested
:
function
(
ev
,
checkValid
){
selectAllNested
:
function
(
ev
,
checkValid
,
selectedNode
){
debugger
;
debugger
;
this
.
selectAll
(
ev
,
checkValid
);
var
node
;
if
(
selectedNode
)
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
selectedNode
);
this
.
selectAll
(
ev
,
checkValid
,
node
);
if
(
this
.
subCategorys
&&
this
.
subCategorys
.
length
){
if
(
this
.
subCategorys
&&
this
.
subCategorys
.
length
){
this
.
subCategorys
.
each
(
function
(
category
){
this
.
subCategorys
.
each
(
function
(
category
){
category
.
selectAllNested
(
ev
,
checkValid
)
if
(
selectedNode
)
var
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
selectedNode
);
category
.
selectAllNested
(
ev
,
checkValid
,
node
)
})
})
}
}
},
},
selectAll
:
function
(
ev
,
checkValid
){
selectAll
:
function
(
ev
,
checkValid
,
selectedNode
){
if
(
this
.
loaded
||
this
.
selector
.
isFlatCategory
){
if
(
this
.
loaded
||
this
.
selector
.
isFlatCategory
){
this
.
_selectAll
(
ev
,
checkValid
);
this
.
_selectAll
(
ev
,
checkValid
,
selectedNode
);
}
else
{
}
else
{
this
.
clickItem
(
function
(){
this
.
clickItem
(
function
(){
this
.
_selectAll
(
ev
,
checkValid
);
this
.
_selectAll
(
ev
,
checkValid
,
selectedNode
);
//this.children.setStyles({
//this.children.setStyles({
// "display": "none",
// "display": "none",
// "height": "0px"
// "height": "0px"
...
@@ -2362,7 +2377,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
...
@@ -2362,7 +2377,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
}.
bind
(
this
));
}.
bind
(
this
));
}
}
},
},
_selectAll
:
function
(
ev
,
checkValid
){
_selectAll
:
function
(
ev
,
checkValid
,
selectedNode
){
if
(
this
.
selector
.
options
.
selectAllRange
===
"
direct
"
&&
(
!
this
.
subItems
||
!
this
.
subItems
.
length
)
)
return
;
if
(
this
.
selector
.
options
.
selectAllRange
===
"
direct
"
&&
(
!
this
.
subItems
||
!
this
.
subItems
.
length
)
)
return
;
var
count
=
this
.
selector
.
options
.
maxCount
||
this
.
selector
.
options
.
count
;
var
count
=
this
.
selector
.
options
.
maxCount
||
this
.
selector
.
options
.
count
;
if
(
!
count
)
count
=
0
;
if
(
!
count
)
count
=
0
;
...
@@ -2372,13 +2387,15 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
...
@@ -2372,13 +2387,15 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
}.
bind
(
this
));
}.
bind
(
this
));
if
((
count
.
toInt
()
===
0
)
||
(
this
.
selector
.
selectedItems
.
length
+
(
this
.
subItems
.
length
-
selectedSubItemCount
))
<=
count
){
if
((
count
.
toInt
()
===
0
)
||
(
this
.
selector
.
selectedItems
.
length
+
(
this
.
subItems
.
length
-
selectedSubItemCount
))
<=
count
){
var
checkedCount
=
0
;
var
checkedCount
=
0
;
var
doSelectAll
=
function
()
{
this
.
subItems
.
each
(
function
(
item
){
this
.
subItems
.
each
(
function
(
item
){
if
(
!
item
.
isSelected
&&
!
item
.
disabled
)
item
.
selected
(
false
,
function
()
{
if
(
!
item
.
isSelected
&&
!
item
.
disabled
)
item
.
selected
(
false
,
function
()
{
checkedCount
++
;
checkedCount
++
;
if
(
this
.
subItems
.
length
===
checkedCount
){
if
(
this
.
subItems
.
length
===
checkedCount
){
if
(
checkValid
)
this
.
selector
.
fireEvent
(
"
valid
"
,
[
this
.
selector
,
this
]);
if
(
checkValid
)
this
.
selector
.
fireEvent
(
"
valid
"
,
[
this
.
selector
,
this
]);
}
}
}.
bind
(
this
)
);
}.
bind
(
this
),
selectedNode
);
}.
bind
(
this
));
}.
bind
(
this
));
if
(
this
.
selectAllNode
){
if
(
this
.
selectAllNode
){
...
@@ -2388,8 +2405,15 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
...
@@ -2388,8 +2405,15 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
this
.
selectAllNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_selectAll_selected
);
this
.
selectAllNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_selectAll_selected
);
}
}
}
}
this
.
isSelectedAll
=
true
;
this
.
isSelectedAll
=
true
;
}.
bind
(
this
);
if
(
this
.
_beforeSelectAll
){
this
.
_beforeSelectAll
(
doSelectAll
);
}
else
{
doSelectAll
();
}
}
else
{
}
else
{
MWF
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
"
最多可选择
"
+
count
+
"
个选项
"
,
this
.
node
);
MWF
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
"
最多可选择
"
+
count
+
"
个选项
"
,
this
.
node
);
}
}
...
...
o2web/source/x_component_Selector/Role.js
浏览文件 @
9bbdc0fb
...
@@ -22,8 +22,8 @@ MWF.xApplication.Selector.Role = new Class({
...
@@ -22,8 +22,8 @@ MWF.xApplication.Selector.Role = new Class({
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
Role
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
Role
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
if
(
this
.
options
.
units
.
length
||
this
.
options
.
roles
.
length
)
key
=
this
.
getLikeKey
(
key
);
if
(
this
.
options
.
units
.
length
||
this
.
options
.
roles
.
length
)
key
=
this
.
getLikeKey
(
key
);
...
...
o2web/source/x_component_Selector/Unit.js
浏览文件 @
9bbdc0fb
...
@@ -173,8 +173,8 @@ MWF.xApplication.Selector.Unit = new Class({
...
@@ -173,8 +173,8 @@ MWF.xApplication.Selector.Unit = new Class({
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
Unit
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
Unit
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
if
(
this
.
options
.
units
.
length
){
if
(
this
.
options
.
units
.
length
){
...
@@ -336,7 +336,12 @@ MWF.xApplication.Selector.Unit.Item = new Class({
...
@@ -336,7 +336,12 @@ MWF.xApplication.Selector.Unit.Item = new Class({
this
.
selector
.
fireEvent
(
"
unselectCatgory
"
,[
this
])
this
.
selector
.
fireEvent
(
"
unselectCatgory
"
,[
this
])
}
else
{
}
else
{
// this.selectAll(ev);
// this.selectAll(ev);
this
.
selector
.
options
.
selectAllRange
===
"
all
"
?
this
.
selectAllNested
(
ev
,
true
)
:
this
.
selectAll
(
ev
,
true
);
if
(
this
.
selector
.
options
.
selectAllRange
===
"
all
"
){
var
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
this
.
selector
.
selectedNode
);
this
.
selectAllNested
(
ev
,
true
,
node
)
}
else
{
this
.
selectAll
(
ev
,
true
)
}
this
.
selector
.
fireEvent
(
"
selectCatgory
"
,[
this
])
this
.
selector
.
fireEvent
(
"
selectCatgory
"
,[
this
])
}
}
ev
.
stopPropagation
();
ev
.
stopPropagation
();
...
@@ -392,39 +397,47 @@ MWF.xApplication.Selector.Unit.Item = new Class({
...
@@ -392,39 +397,47 @@ MWF.xApplication.Selector.Unit.Item = new Class({
})
})
}
}
},
},
selectAllNested
:
function
(
ev
,
checkValid
){
selectAllNested
:
function
(
ev
,
checkValid
,
selectedNode
){
this
.
selectAll
(
ev
,
checkValid
);
var
node
;
if
(
selectedNode
)
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
selectedNode
);
this
.
selectAll
(
ev
,
checkValid
,
node
);
if
(
this
.
subCategorys
&&
this
.
subCategorys
.
length
){
if
(
this
.
subCategorys
&&
this
.
subCategorys
.
length
){
this
.
subCategorys
.
each
(
function
(
category
){
this
.
subCategorys
.
each
(
function
(
category
){
if
(
category
.
selectAllNested
)
category
.
selectAllNested
,
checkValid
()
if
(
selectedNode
)
var
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
selectedNode
);
if
(
category
.
selectAllNested
)
category
.
selectAllNested
(
ev
,
checkValid
,
node
)
})
})
}
}
if
(
this
.
subItems
&&
this
.
subItems
.
length
){
if
(
this
.
subItems
&&
this
.
subItems
.
length
){
this
.
subItems
.
each
(
function
(
item
){
this
.
subItems
.
each
(
function
(
item
){
if
(
item
.
selectAllNested
)
item
.
selectAllNested
(
ev
,
checkValid
)
if
(
selectedNode
)
var
node
=
new
Element
(
"
div.categorySelectedNode
"
).
inject
(
selectedNode
);
if
(
item
.
selectAllNested
)
item
.
selectAllNested
(
ev
,
checkValid
,
node
)
})
})
}
}
},
},
selectAll
:
function
(
ev
,
checkValid
){
selectAll
:
function
(
ev
,
checkValid
,
selectedNode
){
if
(
this
.
loaded
||
this
.
selector
.
isFlatCategory
){
if
(
this
.
loaded
||
this
.
selector
.
isFlatCategory
){
this
.
_selectAll
(
ev
,
checkValid
)
this
.
_selectAll
(
ev
,
checkValid
,
selectedNode
)
}
else
{
}
else
{
this
.
loadSubItems
(
function
(){
this
.
loadSubItems
(
function
(){
this
.
_selectAll
(
ev
,
checkValid
)
this
.
_selectAll
(
ev
,
checkValid
,
selectedNode
)
}.
bind
(
this
));
}.
bind
(
this
));
this
.
levelNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemLevelNode_expand
);
this
.
levelNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemLevelNode_expand
);
this
.
isExpand
=
true
;
this
.
isExpand
=
true
;
}
}
},
},
_selectAll
:
function
(
ev
,
checkValid
){
_selectAll
:
function
(
ev
,
checkValid
,
selectedNode
){
if
(
!
this
.
subItems
||
!
this
.
subItems
.
length
)
return
;
if
(
!
this
.
subItems
||
!
this
.
subItems
.
length
)
return
;
var
count
=
this
.
selector
.
options
.
maxCount
||
this
.
selector
.
options
.
count
;
var
count
=
this
.
selector
.
options
.
maxCount
||
this
.
selector
.
options
.
count
;
if
(
!
count
)
count
=
0
;
if
(
!
count
)
count
=
0
;
var
selectedSubItemCount
=
0
;
var
selectedSubItemCount
=
0
;
this
.
subItems
.
each
(
function
(
item
){
this
.
subItems
.
each
(
function
(
item
){
if
(
item
.
isSelected
)
selectedSubItemCount
++
if
(
item
.
isSelected
)
selectedSubItemCount
++
}.
bind
(
this
));
}.
bind
(
this
));
if
((
count
.
toInt
()
===
0
)
||
(
this
.
selector
.
selectedItems
.
length
+
(
this
.
subItems
.
length
-
selectedSubItemCount
))
<=
count
){
if
((
count
.
toInt
()
===
0
)
||
(
this
.
selector
.
selectedItems
.
length
+
(
this
.
subItems
.
length
-
selectedSubItemCount
))
<=
count
){
var
doSelectAll
=
function
()
{
var
checkedCount
=
0
;
var
checkedCount
=
0
;
this
.
subItems
.
each
(
function
(
item
){
this
.
subItems
.
each
(
function
(
item
){
if
(
!
item
.
isSelected
&&
!
item
.
disabled
)
item
.
selected
(
false
,
function
()
{
if
(
!
item
.
isSelected
&&
!
item
.
disabled
)
item
.
selected
(
false
,
function
()
{
...
@@ -432,7 +445,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({
...
@@ -432,7 +445,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({
if
(
this
.
subItems
.
length
===
checkedCount
){
if
(
this
.
subItems
.
length
===
checkedCount
){
if
(
checkValid
)
this
.
selector
.
fireEvent
(
"
valid
"
,
[
this
.
selector
,
this
]);
if
(
checkValid
)
this
.
selector
.
fireEvent
(
"
valid
"
,
[
this
.
selector
,
this
]);
}
}
}.
bind
(
this
)
);
}.
bind
(
this
),
selectedNode
);
}.
bind
(
this
));
}.
bind
(
this
));
if
(
this
.
selectAllNode
){
if
(
this
.
selectAllNode
){
...
@@ -444,6 +457,14 @@ MWF.xApplication.Selector.Unit.Item = new Class({
...
@@ -444,6 +457,14 @@ MWF.xApplication.Selector.Unit.Item = new Class({
}
}
this
.
isSelectedAll
=
true
;
this
.
isSelectedAll
=
true
;
}.
bind
(
this
);
if
(
this
.
_beforeSelectAll
){
this
.
_beforeSelectAll
(
doSelectAll
);
}
else
{
doSelectAll
();
}
}
else
{
}
else
{
MWF
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
"
最多可选择
"
+
count
+
"
个选项
"
,
this
.
node
);
MWF
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
"
最多可选择
"
+
count
+
"
个选项
"
,
this
.
node
);
}
}
...
...
o2web/source/x_component_Selector/UnitWithType.js
浏览文件 @
9bbdc0fb
...
@@ -87,8 +87,8 @@ MWF.xApplication.Selector.UnitWithType = new Class({
...
@@ -87,8 +87,8 @@ MWF.xApplication.Selector.UnitWithType = new Class({
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
distinguishedName
),
async
);
},
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
_newItemSelected
:
function
(
data
,
selector
,
item
,
selectedNode
){
return
new
MWF
.
xApplication
.
Selector
.
UnitWithType
.
ItemSelected
(
data
,
selector
,
item
)
return
new
MWF
.
xApplication
.
Selector
.
UnitWithType
.
ItemSelected
(
data
,
selector
,
item
,
selectedNode
)
},
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
key
=
{
"
key
"
:
key
};
key
=
{
"
key
"
:
key
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录