Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
4ba34256
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,发现更多精彩内容 >>
提交
4ba34256
编写于
1月 04, 2021
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加树组件的各种事件
上级
bb866718
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
199 addition
and
5 deletion
+199
-5
o2web/source/o2_core/o2/widget/Tree.js
o2web/source/o2_core/o2/widget/Tree.js
+14
-2
o2web/source/x_component_portal_PageDesigner/Module/Tree/template.json
...x_component_portal_PageDesigner/Module/Tree/template.json
+32
-0
o2web/source/x_component_process_FormDesigner/Module/Tree/template.json
..._component_process_FormDesigner/Module/Tree/template.json
+32
-0
o2web/source/x_component_process_Xform/$Module.js
o2web/source/x_component_process_Xform/$Module.js
+1
-1
o2web/source/x_component_process_Xform/Tree.js
o2web/source/x_component_process_Xform/Tree.js
+116
-2
o2web/source/x_component_query_ViewDesigner/Property.js
o2web/source/x_component_query_ViewDesigner/Property.js
+4
-0
未找到文件。
o2web/source/o2_core/o2/widget/Tree.js
浏览文件 @
4ba34256
...
...
@@ -16,7 +16,8 @@ o2.widget.Tree = new Class({
"
action
"
:
"
action
"
,
"
icon
"
:
"
icon
"
,
"
style
"
:
""
,
"
sub
"
:
"
sub
"
"
sub
"
:
"
sub
"
,
"
defalut
"
:
"
defalut
"
},
initialize
:
function
(
container
,
options
){
this
.
setOptions
(
options
);
...
...
@@ -155,6 +156,7 @@ o2.widget.Tree = new Class({
obj
[
this
.
jsonMapping
.
text
]
=
options
.
text
;
obj
[
this
.
jsonMapping
.
action
]
=
options
.
action
;
obj
[
this
.
jsonMapping
.
style
]
=
options
.
style
;
obj
[
this
.
jsonMapping
.
defalut
]
=
options
.
defalut
;
obj
[
this
.
jsonMapping
.
icon
]
=
(
options
.
icon
)
?
options
.
icon
:
"
none
"
;
return
obj
;
}
...
...
@@ -169,6 +171,7 @@ o2.widget.Tree.Node = new Class({
"
text
"
:
""
,
"
action
"
:
""
,
"
style
"
:
""
,
"
default
"
:
false
,
"
icon
"
:
"
folder.png
"
},
imgs
:
{
...
...
@@ -225,6 +228,9 @@ o2.widget.Tree.Node = new Class({
},
load
:
function
(){
debugger
;
this
.
tree
.
fireEvent
(
"
beforeLoadTreeNode
"
,
[
this
]);
this
.
nodeTable
=
new
Element
(
"
table
"
,
{
"
border
"
:
"
0
"
,
"
cellpadding
"
:
"
0
"
,
...
...
@@ -245,7 +251,8 @@ o2.widget.Tree.Node = new Class({
this
.
createOperateNode
();
this
.
createIconNode
();
this
.
createTextNode
();
this
.
tree
.
fireEvent
(
"
afterLoadTreeNode
"
,
[
this
]);
},
createLevelNode
:
function
(){
for
(
var
i
=
0
;
i
<
this
.
level
;
i
++
){
...
...
@@ -335,6 +342,9 @@ o2.widget.Tree.Node = new Class({
}.
bind
(
this
));
textDivNode
.
inject
(
this
.
textNode
);
if
(
this
.
options
.
default
){
textDivNode
.
click
();
}
},
clickNode
:
function
(
e
){
this
.
selectNode
(
e
);
...
...
@@ -342,6 +352,7 @@ o2.widget.Tree.Node = new Class({
},
selectNode
:
function
(){
this
.
tree
.
fireEvent
(
"
beforeSelect
"
,
[
this
]);
if
(
this
.
tree
.
currentNode
){
var
textDivNode
=
this
.
tree
.
currentNode
.
textNode
.
getElement
(
"
div
"
);
textDivNode
.
setStyles
(
this
.
tree
.
css
.
textDivNode
);
...
...
@@ -359,6 +370,7 @@ o2.widget.Tree.Node = new Class({
}
}
this
.
tree
.
currentNode
=
this
;
this
.
tree
.
fireEvent
(
"
afterSelect
"
,
[
this
]);
},
doAction
:
function
(
e
){
var
t
=
typeOf
(
this
.
options
.
action
);
...
...
o2web/source/x_component_portal_PageDesigner/Module/Tree/template.json
浏览文件 @
4ba34256
...
...
@@ -32,6 +32,38 @@
"code"
:
""
,
"html"
:
""
},
"beforeLoadTree"
:
{
"code"
:
""
,
"html"
:
""
},
"afterLoadTree"
:
{
"code"
:
""
,
"html"
:
""
},
"beforeLoadTreeNode"
:
{
"code"
:
""
,
"html"
:
""
},
"afterLoadTreeNode"
:
{
"code"
:
""
,
"html"
:
""
},
"expand"
:
{
"code"
:
""
,
"html"
:
""
},
"collapse"
:
{
"code"
:
""
,
"html"
:
""
},
"beforeSelect"
:
{
"code"
:
""
,
"html"
:
""
},
"afterSelect"
:
{
"code"
:
""
,
"html"
:
""
},
"click"
:
{
"code"
:
""
,
"html"
:
""
...
...
o2web/source/x_component_process_FormDesigner/Module/Tree/template.json
浏览文件 @
4ba34256
...
...
@@ -32,6 +32,38 @@
"code"
:
""
,
"html"
:
""
},
"beforeLoadTree"
:
{
"code"
:
""
,
"html"
:
""
},
"afterLoadTree"
:
{
"code"
:
""
,
"html"
:
""
},
"beforeLoadTreeNode"
:
{
"code"
:
""
,
"html"
:
""
},
"afterLoadTreeNode"
:
{
"code"
:
""
,
"html"
:
""
},
"expand"
:
{
"code"
:
""
,
"html"
:
""
},
"collapse"
:
{
"code"
:
""
,
"html"
:
""
},
"beforeSelect"
:
{
"code"
:
""
,
"html"
:
""
},
"afterSelect"
:
{
"code"
:
""
,
"html"
:
""
},
"click"
:
{
"code"
:
""
,
"html"
:
""
...
...
o2web/source/x_component_process_Xform/$Module.js
浏览文件 @
4ba34256
...
...
@@ -33,7 +33,7 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
* @member {Element}
* @example
* //可以在脚本中获取该组件
* var field = this.form.get("
module
Id"); //获取组件对象
* var field = this.form.get("
field
Id"); //获取组件对象
* field.node.setStyle("font-size","12px"); //给节点设置样式
*/
this
.
node
=
$
(
node
);
...
...
o2web/source/x_component_process_Xform/Tree.js
浏览文件 @
4ba34256
MWF
.
xDesktop
.
requireApp
(
"
process.Xform
"
,
"
$Module
"
,
null
,
false
);
MWF
.
xApplication
.
process
.
Xform
.
Tree
=
MWF
.
APPTree
=
new
Class
({
/**树组件数据结构
* @typedef {Object} TreeData
* @example
* [
* {
* "expand": true, //是否默认展开
* "title": "", //鼠标移上叶子节点的文字
* "text": "根节点", //叶子节点的文字
* "action": "", //执行的脚本
* "default": true, //是否默认选中
* "icon": "folder.png", //图标
* "sub": [ //改节点的子节点
* {
* "expand": true,
* "title": "",
* "text": "[none]",
* "action": "",
* "default": false,
* "icon": "folder.png",
* "sub": []
* },
* ...
* ]
* }
* ]
*/
/** @class Tree 树组件。
* @example
* //可以在脚本中获取该组件
* //方法1:
* var datagrid = this.form.get("name"); //获取组件
* //方法2
* var datagrid = this.target; //在组件事件脚本中获取
* @see {@link TreeData|树组件数据结构}
* @extends MWF.xApplication.process.Xform.$Module
* @category FormComponents
* @hideconstructor
*/
MWF
.
xApplication
.
process
.
Xform
.
Tree
=
MWF
.
APPTree
=
new
Class
(
/** @lends MWF.xApplication.process.Xform.Tree# */
{
Extends
:
MWF
.
APP$Module
,
options
:
{
/**
* 异步加载树前执行。this.target指向当前组件。
* @event MWF.xApplication.process.Xform.Tree#beforeLoadTree
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 异步加载树后执行。this.target指向当前组件。
* @event MWF.xApplication.process.Xform.Tree#afterLoadTree
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 加载树的叶子前执行。this.target指向加载的叶子。
* @event MWF.xApplication.process.Xform.Tree#beforeLoadTreeNode
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 加载树的叶子后执行。this.target指向加载的叶子。
* @event MWF.xApplication.process.Xform.Tree#afterLoadTreeNode
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 加载树的叶子后执行。this.target指向加载的叶子。
* @event MWF.xApplication.process.Xform.Tree#expand
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 折叠节点的时候执行。this.target指向被折叠的节点。
* @event MWF.xApplication.process.Xform.Tree#collapse
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 选中节点前执行。此时原来被选中的节点还未取消。this.target指向选中的节点。
* @event MWF.xApplication.process.Xform.Tree#beforeSelect
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 选中节点后执行。this.target指向选中的节点。
* @event MWF.xApplication.process.Xform.Tree#afterSelect
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
"
moduleEvents
"
:
[
"
load
"
,
"
queryLoad
"
,
"
postLoad
"
,
"
beforeLoadTree
"
,
"
afterLoadTree
"
,
"
beforeLoadTreeNode
"
,
"
afterLoadTreeNode
"
,
"
expand
"
,
"
collapse
"
,
"
beforeSelect
"
,
"
afterSelect
"
]
},
_loadUserInterface
:
function
(){
this
.
node
.
empty
();
MWF
.
require
(
"
MWF.widget.Tree
"
,
function
(){
this
.
tree
=
new
MWF
.
widget
.
Tree
(
this
.
node
,
{
"
style
"
:
"
form
"
});
var
options
=
{
"
style
"
:
"
form
"
};
if
(
this
.
json
.
events
&&
typeOf
(
this
.
json
.
events
)
===
"
object
"
){
[
{
"
beforeLoadTree
"
:
"
onQueryLoad
"
},
{
"
afterLoadTree
"
:
"
onPostLoad
"
},
{
"
beforeLoadTreeNode
"
:
"
onBeforeLoadTreeNode
"
},
{
"
afterLoadTreeNode
"
:
"
onAfterLoadTreeNode
"
},
{
"
expand
"
:
"
onPostExpand
"
},
{
"
collapse
"
:
"
onPostCollapse
"
},
{
"
beforeSelect
"
:
"
onBeforeSelect
"
},
{
"
afterSelect
"
:
"
onAfterSelect
"
}
].
each
(
function
(
obj
)
{
var
moduleEvent
=
Object
.
keys
(
obj
)[
0
];
var
treeEvent
=
obj
[
moduleEvent
];
if
(
this
.
json
.
events
[
moduleEvent
]
&&
this
.
json
.
events
[
moduleEvent
].
code
){
options
[
treeEvent
]
=
function
(
target
){
return
this
.
form
.
Macro
.
fire
(
this
.
json
.
events
[
moduleEvent
].
code
,
target
||
this
);
}.
bind
(
this
)
}
}.
bind
(
this
));
}
/**
* @summary 树组件,平台使用该组件实现树的功能,该组件为异步加载
* @member {o2.widget.Tree}
* @example
* //可以在脚本中获取该组件
* var tree = this.form.get("fieldId").tree; //获取组件对象
* var children = tree.children[]; //获取第一层树叶
*/
this
.
tree
=
new
MWF
.
widget
.
Tree
(
this
.
node
,
options
);
this
.
tree
.
form
=
this
.
form
;
this
.
_setTreeWidgetStyles
();
...
...
o2web/source/x_component_query_ViewDesigner/Property.js
浏览文件 @
4ba34256
...
...
@@ -229,6 +229,10 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
"
isTime
"
:
false
,
"
target
"
:
this
.
module
.
designer
.
content
,
"
format
"
:
"
%Y-%m-%d
"
,
"
onClear
"
:
function
()
{
debugger
;
this
.
setValue
(
jsondata
,
node
.
value
,
node
);
}.
bind
(
this
),
"
onComplate
"
:
function
()
{
this
.
setValue
(
jsondata
,
node
.
value
,
node
);
//this.validationMode();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录