Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
1369a4ba
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
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,发现更多精彩内容 >>
提交
1369a4ba
编写于
7月 22, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
选择器增加脚本和数据字典
上级
bba71a56
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
367 addition
and
43 deletion
+367
-43
o2web/source/x_component_Selector/Dictionary.js
o2web/source/x_component_Selector/Dictionary.js
+245
-0
o2web/source/x_component_Selector/FormStyle.js
o2web/source/x_component_Selector/FormStyle.js
+1
-2
o2web/source/x_component_Selector/Script.js
o2web/source/x_component_Selector/Script.js
+110
-41
o2web/source/x_component_Selector/lp/en.js
o2web/source/x_component_Selector/lp/en.js
+5
-0
o2web/source/x_component_Selector/lp/zh-cn.js
o2web/source/x_component_Selector/lp/zh-cn.js
+6
-0
未找到文件。
o2web/source/x_component_Selector/Dictionary.js
0 → 100644
浏览文件 @
1369a4ba
MWF
.
xApplication
.
Selector
=
MWF
.
xApplication
.
Selector
||
{};
MWF
.
xDesktop
.
requireApp
(
"
Selector
"
,
"
Person
"
,
null
,
false
);
MWF
.
xApplication
.
Selector
.
Dictionary
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Person
,
options
:
{
"
style
"
:
"
default
"
,
"
count
"
:
0
,
"
title
"
:
MWF
.
xApplication
.
Selector
.
LP
.
selectDictionary
,
"
values
"
:
[],
"
names
"
:
[],
"
appType
"
:
[
"
process
"
,
"
cms
"
],
"
expand
"
:
false
,
"
forceSearchInItem
"
:
true
},
loadSelectItems
:
function
(
addToNext
){
var
json
=
{};
this
.
options
.
appType
.
each
(
function
(
type
)
{
var
container
=
new
Element
(
"
div
"
).
inject
(
this
.
itemAreaNode
);
var
action
;
if
(
type
===
"
process
"
){
action
=
o2
.
Actions
.
load
(
"
x_processplatform_assemble_designer
"
).
ApplicationDictAction
.
listPaging
;
}
else
if
(
type
===
"
cms
"
){
}
var
json
=
{};
var
array
=
[];
action
(
1
,
1000
,
{},
function
(
dictionaryJson
)
{
dictionaryJson
.
data
.
each
(
function
(
dictionary
)
{
var
appName
=
dictionary
.
portalName
||
dictionary
.
applicationName
;
var
appId
=
dictionary
.
portal
||
dictionary
.
application
;
if
(
!
json
[
appId
])
{
json
[
appId
]
=
{
name
:
appName
,
applicationName
:
appName
,
appName
:
appName
,
application
:
appId
,
appId
:
appId
};
json
[
appId
].
dictionaryList
=
[];
}
dictionary
.
appName
=
appName
;
dictionary
.
appId
=
appId
;
dictionary
.
appType
=
type
;
dictionary
.
type
=
"
dictionary
"
;
json
[
appId
].
dictionaryList
.
push
(
dictionary
)
}.
bind
(
this
));
for
(
var
application
in
json
)
{
if
(
json
[
application
].
dictionaryList
&&
json
[
application
].
dictionaryList
.
length
)
{
array
.
push
(
json
[
application
]);
}
}
if
(
this
.
options
.
appType
.
length
===
1
){
array
.
each
(
function
(
data
)
{
var
category
=
this
.
_newItemCategory
(
data
,
this
,
container
);
}.
bind
(
this
))
}
else
{
var
category
=
this
.
_newItemCategory
({
name
:
MWF
.
xApplication
.
Selector
.
LP
.
appType
[
type
],
id
:
type
,
applicationList
:
array
},
this
,
container
);
}
}.
bind
(
this
))
}.
bind
(
this
));
},
_scrollEvent
:
function
(
y
){
return
true
;
},
_getChildrenItemIds
:
function
(
data
){
return
data
.
dictionaryList
||
[];
},
_newItemCategory
:
function
(
data
,
selector
,
item
,
level
){
return
new
MWF
.
xApplication
.
Selector
.
Dictionary
.
ItemCategory
(
data
,
selector
,
item
,
level
)
},
_listItemByKey
:
function
(
callback
,
failure
,
key
){
return
false
;
},
_getItem
:
function
(
callback
,
failure
,
id
,
async
){
this
.
queryAction
.
getTable
(
function
(
json
){
if
(
callback
)
callback
.
apply
(
this
,
[
json
]);
}.
bind
(
this
),
failure
,
((
typeOf
(
id
)
===
"
string
"
)
?
id
:
id
.
id
),
async
);
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
return
new
MWF
.
xApplication
.
Selector
.
Dictionary
.
ItemSelected
(
data
,
selector
,
item
)
},
_listItemByPinyin
:
function
(
callback
,
failure
,
key
){
return
false
;
},
_newItem
:
function
(
data
,
selector
,
container
,
level
){
return
new
MWF
.
xApplication
.
Selector
.
Dictionary
.
Item
(
data
,
selector
,
container
,
level
);
}
});
MWF
.
xApplication
.
Selector
.
Dictionary
.
Item
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Person
.
Item
,
_getShowName
:
function
(){
return
this
.
data
.
name
;
},
_setIcon
:
function
(){
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
../x_component_Selector/$Selector/default/icon/attr.png)
"
);
},
loadSubItem
:
function
(){
return
false
;
},
checkSelectedSingle
:
function
(){
var
selectedItem
=
this
.
selector
.
options
.
values
.
filter
(
function
(
item
,
index
){
if
(
typeOf
(
item
)
===
"
object
"
){
if
(
this
.
data
.
id
&&
item
.
id
){
return
this
.
data
.
id
===
item
.
id
;
}
//return (this.data.id === item.id) || (this.data.name === item.name) ;
}
//if (typeOf(item)==="object") return (this.data.id === item.id) || (this.data.name === item.name) ;
if
(
typeOf
(
item
)
===
"
string
"
)
return
(
this
.
data
.
id
===
item
)
||
(
this
.
data
.
name
===
item
);
return
false
;
}.
bind
(
this
));
if
(
selectedItem
.
length
){
this
.
selectedSingle
();
}
},
checkSelected
:
function
(){
var
selectedItem
=
this
.
selector
.
selectedItems
.
filter
(
function
(
item
,
index
){
if
(
item
.
data
.
id
&&
this
.
data
.
id
){
return
item
.
data
.
id
===
this
.
data
.
id
;
}
//return (item.data.id === this.data.id) || (item.data.name === this.data.name);
}.
bind
(
this
));
if
(
selectedItem
.
length
){
//selectedItem[0].item = this;
selectedItem
[
0
].
addItem
(
this
);
this
.
selectedItem
=
selectedItem
[
0
];
this
.
setSelected
();
}
}
});
MWF
.
xApplication
.
Selector
.
Dictionary
.
ItemSelected
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Person
.
ItemSelected
,
_getShowName
:
function
(){
return
this
.
data
.
name
;
},
_setIcon
:
function
(){
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
../x_component_Selector/$Selector/default/icon/attr.png)
"
);
},
check
:
function
(){
if
(
this
.
selector
.
items
.
length
){
var
items
=
this
.
selector
.
items
.
filter
(
function
(
item
,
index
){
//return (item.data.id === this.data.id) || (item.data.name === this.data.name);
if
(
item
.
data
.
id
&&
this
.
data
.
id
){
return
item
.
data
.
id
===
this
.
data
.
id
;
}
}.
bind
(
this
));
this
.
items
=
items
;
if
(
items
.
length
){
items
.
each
(
function
(
item
){
item
.
selectedItem
=
this
;
item
.
setSelected
();
}.
bind
(
this
));
}
}
}
});
MWF
.
xApplication
.
Selector
.
Dictionary
.
ItemCategory
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Person
.
ItemCategory
,
clickItem
:
function
(
callback
)
{
if
(
this
.
_hasChild
()
)
{
var
firstLoaded
=
!
this
.
loaded
;
this
.
loadSub
(
function
()
{
if
(
firstLoaded
&&
this
.
_hasChild
()
)
{
if
(
!
this
.
selector
.
isFlatCategory
)
{
this
.
children
.
setStyles
({
"
display
"
:
"
block
"
,
"
height
"
:
"
auto
"
});
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_expand
);
this
.
isExpand
=
true
;
}
// this.checkSelectAll();
}
else
{
var
display
=
this
.
children
.
getStyle
(
"
display
"
);
if
(
display
===
"
none
"
)
{
// this.selector.fireEvent("expand", [this] );
this
.
children
.
setStyles
({
"
display
"
:
"
block
"
,
"
height
"
:
"
auto
"
});
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_expand
);
this
.
isExpand
=
true
;
}
else
{
// this.selector.fireEvent("collapse", [this] );
this
.
children
.
setStyles
({
"
display
"
:
"
none
"
,
"
height
"
:
"
0px
"
});
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_collapse
);
this
.
isExpand
=
false
;
}
}
if
(
callback
)
callback
();
}.
bind
(
this
));
}
},
loadSub
:
function
(
callback
)
{
if
(
!
this
.
loaded
)
{
if
(
this
.
data
.
dictionaryList
){
this
.
data
.
dictionaryList
.
each
(
function
(
subItem
,
index
)
{
var
item
=
this
.
selector
.
_newItem
(
subItem
,
this
.
selector
,
this
.
children
,
this
.
level
+
1
,
this
);
this
.
selector
.
items
.
push
(
item
);
if
(
this
.
subItems
)
this
.
subItems
.
push
(
item
);
}.
bind
(
this
));
}
if
(
this
.
data
.
applicationList
)
{
this
.
data
.
applicationList
.
each
(
function
(
subCategory
,
index
)
{
var
category
=
this
.
selector
.
_newItemCategory
(
subCategory
,
this
.
selector
,
this
.
children
,
this
.
level
+
1
,
this
);
this
.
subCategorys
.
push
(
category
);
}.
bind
(
this
));
}
this
.
loaded
=
true
;
if
(
callback
)
callback
();
}
else
{
if
(
callback
)
callback
();
}
},
_getShowName
:
function
(){
return
this
.
data
.
name
;
},
_getTtiteText
:
function
()
{
return
this
.
data
.
name
;
},
createNode
:
function
(){
this
.
node
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
selector
.
css
.
selectorItemCategory_department
}).
inject
(
this
.
container
);
},
_setIcon
:
function
(){
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
../x_component_Selector/$Selector/default/icon/applicationicon.png)
"
);
},
_hasChild
:
function
(){
return
(
this
.
data
.
dictionaryList
&&
this
.
data
.
dictionaryList
.
length
)
||
(
this
.
data
.
applicationList
&&
this
.
data
.
applicationList
.
length
);
},
afterLoad
:
function
(){
if
(
this
.
_hasChild
()
){
this
.
clickItem
();
}
},
check
:
function
(){}
});
o2web/source/x_component_Selector/FormStyle.js
浏览文件 @
1369a4ba
...
...
@@ -34,9 +34,8 @@ MWF.xApplication.Selector.FormStyle = new Class({
},
this
,
this
.
itemAreaNode
);
var
json
=
{};
var
appJs
=
{};
var
array
=
[];
o2
.
Actions
.
load
(
"
x_processplatform_assemble_designer
"
).
ScriptAction
.
listPaging
(
1
,
5
00
,
{},
function
(
scriptJson
){
o2
.
Actions
.
load
(
"
x_processplatform_assemble_designer
"
).
ScriptAction
.
listPaging
(
1
,
10
00
,
{},
function
(
scriptJson
){
scriptJson
.
data
.
each
(
function
(
script
)
{
if
(
!
json
[
script
.
application
])
{
json
[
script
.
application
]
=
{
...
...
o2web/source/x_component_Selector/Script.js
浏览文件 @
1369a4ba
...
...
@@ -8,52 +8,66 @@ MWF.xApplication.Selector.Script = new Class({
"
title
"
:
MWF
.
xApplication
.
Selector
.
LP
.
selectScript
,
"
values
"
:
[],
"
names
"
:
[],
"
appType
"
:
[
"
process
"
,
"
portal
"
],
"
expand
"
:
false
,
"
forceSearchInItem
"
:
true
},
loadSelectItems
:
function
(
addToNext
){
var
json
=
{};
var
appJs
=
{};
o2
.
Actions
.
load
(
"
x_processplatform_assemble_designer
"
).
ScriptAction
.
listNext
(
"
(0)
"
,
500
,
function
(
scriptJson
)
{
o2
.
Actions
.
load
(
"
x_processplatform_assemble_designer
"
).
ApplicationAction
.
list
(
function
(
appJson
)
{
appJson
.
data
.
each
(
function
(
app
)
{
appJs
[
app
.
id
]
=
app
;
});
scriptJson
.
data
.
each
(
function
(
script
)
{
if
(
!
json
[
script
.
application
]
){
json
[
script
.
application
]
=
appJs
[
script
.
application
];
json
[
script
.
application
].
scriptList
=
[];
}
script
.
appName
=
appJs
[
script
.
application
].
name
;
script
.
appId
=
script
.
application
;
json
[
script
.
application
].
scriptList
.
push
(
script
)
}.
bind
(
this
));
for
(
var
application
in
json
){
var
category
=
this
.
_newItemCategory
(
json
[
application
],
this
,
this
.
itemAreaNode
);
json
[
application
].
scriptList
.
each
(
function
(
d
){
var
item
=
this
.
_newItem
(
d
,
this
,
category
.
children
);
this
.
items
.
push
(
item
);
this
.
options
.
appType
.
each
(
function
(
type
)
{
var
container
=
new
Element
(
"
div
"
).
inject
(
this
.
itemAreaNode
);
var
action
;
if
(
type
===
"
process
"
){
action
=
o2
.
Actions
.
load
(
"
x_processplatform_assemble_designer
"
).
ScriptAction
.
listPaging
;
}
else
if
(
type
===
"
portal
"
){
action
=
o2
.
Actions
.
load
(
"
x_portal_assemble_designer
"
).
ScriptAction
.
listPaging
;
}
else
if
(
type
===
"
cms
"
){
}
var
json
=
{};
var
array
=
[];
action
(
1
,
1000
,
{},
function
(
scriptJson
)
{
scriptJson
.
data
.
each
(
function
(
script
)
{
var
appName
=
script
.
portalName
||
script
.
applicationName
;
var
appId
=
script
.
portal
||
script
.
application
;
if
(
!
json
[
appId
])
{
json
[
appId
]
=
{
name
:
appName
,
applicationName
:
appName
,
appName
:
appName
,
application
:
appId
,
appId
:
appId
};
json
[
appId
].
scriptList
=
[];
}
script
.
appName
=
appName
;
script
.
appId
=
appId
;
script
.
appType
=
type
;
script
.
type
=
"
script
"
;
json
[
appId
].
scriptList
.
push
(
script
)
}.
bind
(
this
));
for
(
var
application
in
json
)
{
if
(
json
[
application
].
scriptList
&&
json
[
application
].
scriptList
.
length
)
{
array
.
push
(
json
[
application
]);
}
}
if
(
this
.
options
.
appType
.
length
===
1
){
array
.
each
(
function
(
data
)
{
var
category
=
this
.
_newItemCategory
(
data
,
this
,
container
);
}.
bind
(
this
))
}
else
{
var
category
=
this
.
_newItemCategory
({
name
:
MWF
.
xApplication
.
Selector
.
LP
.
appType
[
type
],
id
:
type
,
applicationList
:
array
},
this
,
container
);
}
}.
bind
(
this
))
}.
bind
(
this
));
// this.processAction.listApplications(function(json){
// json.data.each(function(data){
// if (!data.scriptList){
// this.designerAction.listScript(data.id, function(scriptJson){
// data.scriptList = scriptJson.data;
// }.bind(this), null, false);
// }
// if (data.scriptList && data.scriptList.length){
// var category = this._newItemCategory(data, this, this.itemAreaNode);
// data.scriptList.each(function(d){
// d.applicationName = data.name;
// var item = this._newItem(d, this, category.children);
// this.items.push(item);
// }.bind(this));
// }
// }.bind(this));
// }.bind(this));
},
_scrollEvent
:
function
(
y
){
return
true
;
...
...
@@ -115,8 +129,6 @@ MWF.xApplication.Selector.Script.Item = new Class({
var
selectedItem
=
this
.
selector
.
selectedItems
.
filter
(
function
(
item
,
index
){
if
(
item
.
data
.
id
&&
this
.
data
.
id
){
return
item
.
data
.
id
===
this
.
data
.
id
;
}
else
{
return
item
.
data
.
name
===
this
.
data
.
name
;
}
//return (item.data.id === this.data.id) || (item.data.name === this.data.name);
}.
bind
(
this
));
...
...
@@ -143,8 +155,6 @@ MWF.xApplication.Selector.Script.ItemSelected = new Class({
//return (item.data.id === this.data.id) || (item.data.name === this.data.name);
if
(
item
.
data
.
id
&&
this
.
data
.
id
){
return
item
.
data
.
id
===
this
.
data
.
id
;
}
else
{
return
item
.
data
.
name
===
this
.
data
.
name
;
}
}.
bind
(
this
));
this
.
items
=
items
;
...
...
@@ -160,9 +170,62 @@ MWF.xApplication.Selector.Script.ItemSelected = new Class({
MWF
.
xApplication
.
Selector
.
Script
.
ItemCategory
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Person
.
ItemCategory
,
clickItem
:
function
(
callback
)
{
if
(
this
.
_hasChild
()
)
{
var
firstLoaded
=
!
this
.
loaded
;
this
.
loadSub
(
function
()
{
if
(
firstLoaded
&&
this
.
_hasChild
()
)
{
if
(
!
this
.
selector
.
isFlatCategory
)
{
this
.
children
.
setStyles
({
"
display
"
:
"
block
"
,
"
height
"
:
"
auto
"
});
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_expand
);
this
.
isExpand
=
true
;
}
// this.checkSelectAll();
}
else
{
var
display
=
this
.
children
.
getStyle
(
"
display
"
);
if
(
display
===
"
none
"
)
{
// this.selector.fireEvent("expand", [this] );
this
.
children
.
setStyles
({
"
display
"
:
"
block
"
,
"
height
"
:
"
auto
"
});
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_expand
);
this
.
isExpand
=
true
;
}
else
{
// this.selector.fireEvent("collapse", [this] );
this
.
children
.
setStyles
({
"
display
"
:
"
none
"
,
"
height
"
:
"
0px
"
});
this
.
actionNode
.
setStyles
(
this
.
selector
.
css
.
selectorItemCategoryActionNode_collapse
);
this
.
isExpand
=
false
;
}
}
if
(
callback
)
callback
();
}.
bind
(
this
));
}
},
loadSub
:
function
(
callback
)
{
if
(
!
this
.
loaded
)
{
if
(
this
.
data
.
scriptList
){
this
.
data
.
scriptList
.
each
(
function
(
subItem
,
index
)
{
var
item
=
this
.
selector
.
_newItem
(
subItem
,
this
.
selector
,
this
.
children
,
this
.
level
+
1
,
this
);
this
.
selector
.
items
.
push
(
item
);
if
(
this
.
subItems
)
this
.
subItems
.
push
(
item
);
}.
bind
(
this
));
}
if
(
this
.
data
.
applicationList
)
{
this
.
data
.
applicationList
.
each
(
function
(
subCategory
,
index
)
{
var
category
=
this
.
selector
.
_newItemCategory
(
subCategory
,
this
.
selector
,
this
.
children
,
this
.
level
+
1
,
this
);
this
.
subCategorys
.
push
(
category
);
}.
bind
(
this
));
}
this
.
loaded
=
true
;
if
(
callback
)
callback
();
}
else
{
if
(
callback
)
callback
();
}
},
_getShowName
:
function
(){
return
this
.
data
.
name
;
},
_getTtiteText
:
function
()
{
return
this
.
data
.
name
;
},
createNode
:
function
(){
this
.
node
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
selector
.
css
.
selectorItemCategory_department
...
...
@@ -172,7 +235,13 @@ MWF.xApplication.Selector.Script.ItemCategory = new Class({
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
../x_component_Selector/$Selector/default/icon/applicationicon.png)
"
);
},
_hasChild
:
function
(){
return
(
this
.
data
.
scriptList
&&
this
.
data
.
scriptList
.
length
);
return
(
this
.
data
.
scriptList
&&
this
.
data
.
scriptList
.
length
)
||
(
this
.
data
.
applicationList
&&
this
.
data
.
applicationList
.
length
);
},
afterLoad
:
function
(){
if
(
this
.
_hasChild
()
){
this
.
clickItem
();
}
},
check
:
function
(){}
});
o2web/source/x_component_Selector/lp/en.js
浏览文件 @
1369a4ba
...
...
@@ -29,6 +29,11 @@ MWF.xApplication.Selector.LP = MWF.SelectorLP = {
"
role
"
:
"
Role
"
,
"
group
"
:
"
Group
"
,
"
unit
"
:
"
Unit
"
,
"
appType
"
:
{
"
process
"
:
"
Process
"
,
"
cms
"
:
"
CMS
"
,
"
portal
"
:
"
Portal
"
},
"
cancel
"
:
"
Cancel
"
,
"
back
"
:
"
Back
"
,
...
...
o2web/source/x_component_Selector/lp/zh-cn.js
浏览文件 @
1369a4ba
...
...
@@ -37,6 +37,12 @@ MWF.xApplication.Selector.LP = MWF.SelectorLP = {
"
group
"
:
"
群组
"
,
"
unit
"
:
"
组织
"
,
"
appType
"
:
{
"
process
"
:
"
流程管理
"
,
"
cms
"
:
"
内容管理
"
,
"
portal
"
:
"
门户管理
"
},
"
cancel
"
:
"
取消
"
,
"
back
"
:
"
返回
"
,
"
ok
"
:
"
确定
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录